4 developers picking a random restaurant (Problem)
1–9 of 9 posts
Re: 4 developers picking a random restaurant (Problem)
#2Re: 4 developers picking a random restaurant (Problem)
#3Re: 4 developers picking a random restaurant (Problem)
#4Ex.
- Next article title posted on NYT
- Donald Trumps next tweet
- Sum of tomorrow's lottery numbers, mod 20
Re: 4 developers picking a random restaurant (Problem)
#5Seems like you can just pre-announce any information source you do not control and then take hash mod 20 once the content is made available. Ex. - Next article title posted on NYT - Donald Trumps next tweet - Sum of tomorrow's lottery numbers, mod 20
Re: 4 developers picking a random restaurant (Problem)
#6This doesn't work very well, because the distribution would be very uneven.
There is a high chance (93.75%) that at least one of the developers get an even number, so if you multiply them you will get an even result. Moreover, if some of the developer get a multiple of 4 or two of them get a multiple of 2, then the result is a multiple of 4, so the restaurants with a number that is a multiple of 4 have a much higher probability (but I'm too lazy to do the calculation now).
There is something similar with the restaurant that have an index that is a multiple of 5 (and I'm still lazy). So the restaurant with the number 20 (or 0) has the highest probability of been selected.
As a though experiment, just imagine that you have 20 restaurants and 100 developers. It' almost sure that one of them will get a multiple of 4 and another a multiple of 5, and the multiplication will be a multiple of 20.
The problem is that in the multiplication modulo 20, the numbers 2 (and 4) and 5 are special. If you add the four random numbers instead of multiplying them, the problem is automatically solved.
Re: 4 developers picking a random restaurant (Problem)
#7Re: 4 developers picking a random restaurant (Problem)
#8My first own-content post on HN. Would love some feedback.
Github: How do you prove that the first commit was done with the web UI? And how do you prove that there wasn't a force push replacing that commit?
Re: 4 developers picking a random restaurant (Problem)
#9Seems like you can just pre-announce any information source you do not control and then take hash mod 20 once the content is made available. Ex. - Next article title posted on NYT - Donald Trumps next tweet - Sum of tomorrow's lottery numbers, mod 20
But that means waiting for the third party right?