Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "determinism"
-
Hmm. So have you ever argued in a job interview? Like really standing your ground? In a technical interview?
Today I had a live coding session with a company I'm interested in. The developer was giving me tasks to evolve the feature on and on.
Everything was TDD. Splendid!
However at one point I had to test if the outcome of the method call is random. What I did is basically:
```
Provider<String> provider = new SomeProvider("aaa", "bbb", "ccc", "ddd", "eee", "fff")
for(int i=0; i<100; i++) {
String str = provider.get();
map.put(str, incrementCount(str));
}
Set<Integer> occurences = new HashSet(map.values());
occurences.removeIf(o -> o.equals(occurences.get(0)));
assertFalse(occurences.empty());
```
and I called it good enough, since I cannot verify true randomness.
But the dev argued that this is not enough and I must verify whether the output is truly random or not, and the output (considering the provider only has a finite set of values to return) occurences are almost equal (i.e. the deviation from median is the median itself).
I argued this is not possible and it beats the core principle of randomness -- non-determinism. Since if you can reliably test whether the sequence is truly random you must have an algorithm which determines what value can or cannot be next in the sequence. Which means determinism. And that the (P)RNG is then flawed. The best you can do is to test whether randomness is "good enough" for your use case.
We were arguing and he eventually said "alright, let's call it a good enough solution, since we're short on time".
I wonder whether this will have adverse effect my evaluation . So have you ever argued with your interviewer? Did it turn out to the better or to the worse?
But more importantly, was I right? :D21 -
!dev
This boring story with stupid ending started on Monday with me going out to buy some food and cook something delicious, day like always until my mind went nuts.
I work from home and cook my meals by myself cause I love cooking.
To buy ingredients I go shopping couple times a week always making the same steps, doing this for over a year now and by this time everything was automatic so I could think about work problems and solutions.
I start usually by getting up from my desk around noon, not many people doing shopping at that time and I can proceed quick.
Algorithm is like this: go to kitchen and look at the fridge, go out, wait for traffic lights, take tram, ride two stops, wait for the traffic lights again, go to supermarket, do shopping and finally go back the same way. Boooring.
When I get out from tram that day l looked at traffic lights to go green, as always and that’s the place where everything started to go bad.
So I was waiting there doing nothing and then stupid idea got me.
I figured out I can stop looking at light to make this day different and look ahead.
Then simply start walking when people from other side start walking.
It worked smoothly on those lights and I was happy I can do things differently from now on. I proceed with this idea on the way back and motherfuckers started walking on red. Twice !!!!
Almost died.
Since then three times some car was driving on green near me in those places and people started walking on red.
It got me worried about world determinism instantly. I might increased some entropy to much and some world developer changed some line of code while I was shopping and from that time death is passing by me.
Now it got me to the point where the more I follow this way the more I am worried about my life. Started thinking about ordering ingredients online.
So if you read this you know that I know your plan and I will be changing supermarkets and paths to it randomly starting from next week.
Or not I hope nobody hacked my mind and only thing that read and write to it is my consciousness.
I feel relief now.2 -
So I came across this meme and it got me thinking.
We say that if our universe is truly infinite, we are bound to find a place that is the exact replica of our local cosmic neighborhood eventually if we keep looking.
But procedurally generated worlds like minecraft have that determinism to their world structure(with an initial seed to calculate everything) where you can predict how the local neighborhood would look like at any distance, no matter how far.
So would it be correct to say that it's not guarenteed that in a game like minecraft where the world is generated procedurally with a deterministic algorithm, will be such that you can find the exact same local neighborhood from one seed in any other seed?18 -
The iteration order of some hashmap or some such keeps changing when I add or remove log lines. For a given source code the order is static, but I can't bisect errors by logging because when I add a probe arbitrary symptoms vanish or previously correct probes start printing bullshit.3
-
floating point numbers are workarounds for infinite problems people didn’t find solution yet
if you eat a cake there is no cake, same if you grab a piece of cake, there is no 3/4 cake left there is something else yet to simplify the meaning of the world so we can communicate cause we’re all dumb fucks who can’t remember more than 20000 words we named different things as same things but in less amount, floating point numbers were a biggest step towards modern world we even don’t remember it
we use infinity everyday yet we don’t know infinite, we only partially know concept of null
you say piece of cake but piece is not measurement - piece is infinite subjective amount of something
everything that is subjective is infinite, like you say a sentence it have infinite number of meanings, you publish a photo or draw a paining there are infinite number of interpretations
you can say there is no cake but isn’t it ? you just said cake so your mind want to materialize something you already know and since you know the cake word there is a cake cause it’s infinite once created
if you think really hard and try to get that feeling, the taste of your last delicious cake you can almost feel it on your tongue cause you’re connected to every cake taste you ate
someone created cake and once people know what cake is it’s infinite in that collection, but what if no one created cake or everyone that remember how cake looks like died, everything what’s cake made of extinct ? does it exist or is it null ? that’s determinism and entropy problem we don’t understand, we don’t understand past and future cause we don’t understand infinity and null, we just replaced it with time
there is no time and you can have a couple of minutes break are best explanations of how null and infinite works in a concept of time
so if you want to change the world, find another thing that explains infinity and null and you will push our civilization forward, you don’t need to know any physics or math, you just need to observe the world and spot patterns10