Hack Forums
[Python] Humans Suck at Entropy (Man vs Machine) - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Python] Humans Suck at Entropy (Man vs Machine) (/showthread.php?tid=3825892)



Humans Suck at Entropy (Man vs Machine) - ImportUsername - Oct 25, 2013

People are bad at entropy (randomness). This code asks the user to try to input 1's and 0's as randomly as possible. The computer will make an educated guess on what you will enter next, based on numbers you've already input. You are predictable.

Anyway, the math behind this is not my own, I translated the code from BASIC from http://www.loper-os.org/bad-at-entropy/manmach.html

Here is the code:
http://pastebin.com/Rfk4YuNm for 2.x
OR
Spoiler (Click to View)

Later going to make a PyGame version of this similar to the site's version, so the user doesn't need to hit enter between numbers.👍

EDIT: clarity


* - glob - Oct 25, 2013

That code looks extremely messy ._.
I like the concept though. Although it's simple, and there is a 50% chance of success.


* - ImportUsername - Oct 25, 2013

I didn't fully understand the code when writing it, just trying to translate it to work, so it won't look the best it could :/ (Just imagine trying to translate a story from russian to english for example)

I don't get what you mean about a 50% chance of success. It's not guessing randomly on what you will type next. It's actually using the numbers you've already entered to make an educated guess at what you will type next. Pretty much always gets above 50%, if not 60 or 70%. If I had wanted something to just guess randomly I could have done it in under 10 lines of code. This is different


* - glob - Oct 25, 2013

(Oct 25, 2013 05:36 PM)ImportUsername Wrote:  I didn't fully understand the code when writing it, just trying to translate it to work, so it won't look the best it could :/ (Just imagine trying to translate a story from russian to english for example)

I don't get what you mean about a 50% chance of success. It's not guessing randomly on what you will type next. It's actually using the numbers you've already entered to make an educated guess at what you will type next. Pretty much always gets above 50%, if not 60 or 70%. If I had wanted something to just guess randomly I could have done it in under 10 lines of code. This is different

I didn't really explain that well. Yes there is math involved and the percentage would be higher, but I guess the point I was trying to make is that once you get past all that there are only two options that it could guess, therefore making it a somewhat educated 50%

EDIT: Yeah I have no idea where I was going with that. Ignore me.


* - ImportUsername - Oct 25, 2013

The point being made with the program though is that YOU are not random. It would be 50% if you were but you aren't. People are bad at that. Try it out, if not with this program then go to the website for 1 minute. Type in what seems like a random series of zeroes and ones, and you may be surprised just how often it guesses it - http://www.loper-os.org/bad-at-entropy/manmach.html


* - glob - Oct 25, 2013

(Oct 25, 2013 05:56 PM)ImportUsername Wrote:  The point being made with the program though is that YOU are not random. It would be 50% if you were but you aren't. People are bad at that. Try it out, if not with this program then go to the website for 1 minute. Type in what seems like a random series of zeroes and ones, and you may be surprised just how often it guesses it - http://www.loper-os.org/bad-at-entropy/manmach.html

With two options it's very hard to be random without subliminally falling into a pattern yes, but that is in part due to the extreme limitation of only having two options. Just saying that it's relatively simple to guess after a bit of pattern analysis.


* - Wudizit90 - Oct 25, 2013

I agree this is not a good measure of a humans ability to be random.


* - BeerMonger - Oct 26, 2013

I'm aware of the fact that it is based on math, but still looks pretty 50/50 to me. (60-34 score so far ^^)


* - ImportUsername - Oct 26, 2013

(Oct 26, 2013 04:22 AM)BeerMonger Wrote:  I'm aware of the fact that it is based on math, but still looks pretty 50/50 to me. (60-34 score so far ^^)

It doesn't get 100%, it just can't be THAT accurate, but it normally sits around 66%. It will do better if you do it as quick as possible without thinking about it, because then you really set into a pattern. And 60-34 isn't that close to 50-50😝


* - BeerMonger - Oct 27, 2013

Well.. since you have only 2 options to choose from its a bit hard to be unexpected..
You only have 4 options, a sequence of following 0s/1s or 1 followed by 0 and vice versa..
but yeah its nice any how P:


* - ImportUsername - Oct 27, 2013

(Oct 27, 2013 01:16 AM)BeerMonger Wrote:  Well.. since you have only 2 options to choose from its a bit hard to be unexpected..
You only have 4 options, a sequence of following 0s/1s or 1 followed by 0 and vice versa..
but yeah its nice any how P:

The point of the the little game is to show that we're bad at being 'unexpected'. If we could be perfectly random, then even with only 2 options the computer in this game would only guess about 50%


* - Misingnoglic - Oct 31, 2013

Can someone explain to me what is actually happening here code wise?