Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

50% of miscommunication #9

Open
Vanuan opened this issue Jul 28, 2017 · 5 comments
Open

50% of miscommunication #9

Vanuan opened this issue Jul 28, 2017 · 5 comments

Comments

@Vanuan
Copy link

Vanuan commented Jul 28, 2017

At the slide with configurable level of miscommunication, when you change it to 50% "all cheat" eventually wins if you give it more time.

@rafales
Copy link

rafales commented Jul 29, 2017

It was the opposite for me (copycat won).

@qgustavor
Copy link

I ran it some times and almost everyone won. Seems that instead of "At 50%, nobody wins ever." the correct is "At 50%, anyone can win."

@Vanuan
Copy link
Author

Vanuan commented Jul 30, 2017

Yeah, that seems more likely. It says at 50% chance "every move is a coin flip". But then it says "nobody wins ever". That's what confused me.

@jkoelling
Copy link

jkoelling commented Aug 1, 2017

I agree with you @qgustavor and @Vanuan.

More generally however, Nicky's caveat "The results turn out something like this […]" is important here. Different outcomes are possible for each setting with more than 0% miscommunication. However, there are more and less likely outcomes, and Nicky probably wrote down only the most likely outcomes to keep it simple.

It would be interesting to simulate lots of tournaments and look at the distribution of winners for each setting. Maybe Nicky actually did this to come up with the description. And just maybe, if you run a lot of tournaments for 50%, there's no clear winner in the end. In which case both "nobody wins ever" and "anyone can win" are somewhat true. :)

@ryao
Copy link

ryao commented Nov 6, 2018

It could be that the browsers’ PRNGs have an issue. See the article at random.org for an explanation:

https://www.random.org/randomness/

I have this issue on mobile safari, but the PRNG used there is supposed to be well regarded:

https://lwn.net/Articles/666407/

I am not sure if we have a case where the PRNG algorithm fails to be perfectly random or where the simulation results are real. I don’t have time to do enough runs to see if it is randomly choosing the winner, but a couple of runs both converged on always cheat for me.

If anyone is interested in investigating this, it would be interesting to see what would happen if someone modified the code to try a more rigorous source of PRNG. One idea would be to implement a cryptographic strength PRNG such as the yarrow algorithm:

https://en.m.wikipedia.org/wiki/Yarrow_algorithm

Implementation of yarrow in a web browser is hard, so here is an easier to implement PRNG that I designed off the top of my head with inspiration from cryptographic PRNGs:

RAND(0) = SHA256(DATE()+SYSRAND())
RAND(n) = SHA256(RAND(n-1)+SYSRAND())

Here + is concatenation (either string or binary). Make DATE() the most precise number you can get, such as the number of seconds since the UNIX epoch. Also, only use the upper/lower 64-bits maximum per output. Which does not matter, but only pick one.

Do not use this algorithm in something actually requiring cryptographic strength PRNG. I expect it to beat conventional PRNGs in the quality of its randomness due to the use of a pseudorandomly salted cryptographic hash function. However, I really don’t know how good it really is as far as actual cryptography is concerned (although that did not stop me from trying to devise something decent). If you want to pick a better initial seed for the PRNG, you could use the uniquely identifying information highlighted by panopticlick along with the date to help form the initial seed.

https://panopticlick.eff.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants