GithubHelp home page GithubHelp logo

50% of miscommunication about trust HOT 5 OPEN

ncase avatar ncase commented on July 23, 2024 1
50% of miscommunication

from trust.

Comments (5)

qgustavor avatar qgustavor commented on July 23, 2024 2

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."

from trust.

jkoelling avatar jkoelling commented on July 23, 2024 2

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. :)

from trust.

Vanuan avatar Vanuan commented on July 23, 2024 1

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.

from trust.

rafales avatar rafales commented on July 23, 2024

It was the opposite for me (copycat won).

from trust.

ryao avatar ryao commented on July 23, 2024

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/

from trust.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.