News for hackers. Stuff that matters.
Re:Predicting one of 2 characters you will randomly press by sctb on Friday July 15, 2016 @10:37AM (#12101252)
Re:Predicting one of 2 characters you will randomly press by throwaway2016a on Friday July 15, 2016 @10:11AM (#12101037)
For me it is pretty consistently 50% +/- 5 even after a minute. It doesn't seem to work well if you repeat the same key a lot (i.e don't flip to often).
Re:Predicting one of 2 characters you will randomly press by overlordalex on Friday July 15, 2016 @10:19AM (#12101100)
This is actually due to a psychological thing where humans don't find long strings of repeated letters/digits "random" and hence will flip more frequently than you'd expect from a machine.

I also recall there being a problem in the use of 5-grams which lead to a sequence in which it guessed 0%, but I'm struggling to find it now.

Re:Predicting one of 2 characters you will randomly press by js8 on Friday July 15, 2016 @10:29AM (#12101180)
If you would find the sequence I describe in my other comment, I think you would almost get that result, because you would (except at the beginning of the sequence) always pick the k-gram that has been seen one time less.
Re:Predicting one of 2 characters you will randomly press by widforss on Friday July 15, 2016 @10:16AM (#12101074)
This is definetly not working. I'm certain that one can write a program like this, but I'm consistenly getting 50 % even though I use different strategies every time.
Re:Predicting one of 2 characters you will randomly press by oneeyedpigeon on Friday July 15, 2016 @10:13AM (#12101050)
I got 52% after a good lot of keypresses (not sure exactly how many). I chose to not look at the screen at all during that time - I think that probably helps.
Re:Predicting one of 2 characters you will randomly press by Forge36 on Friday July 15, 2016 @10:26AM (#12101146)
Mine started at 25% and worked it's way up to 54%. Which also involved me holding down keys for a few seconds. I'm not sure if it works or if Hacker New's user base is skewed towards people who are slightly better at being random. (or if that's cause by self reporting, would someone whose best was 80% want to come forward?)

Edit: Interesting tidbit: I pre-seeded at 100% by holding down F and it trended down to ~68% before I decided I shouldn't spend too much time on this. Maybe we didn't use it long enough?

Re:Predicting one of 2 characters you will randomly press by udkl on Friday July 15, 2016 @05:37PM (#12104007)
Anything < 50% is a fail for this program.

There is an inherent 50% probability of each character occurring next. i.e if you were to guess randomly, you would be right 50% of the time given enough trials.

Re:Predicting one of 2 characters you will randomly press by LoSboccacc on Friday July 15, 2016 @10:38AM (#12101258)
got it down to 50% but then started learning or I started focusing, it went as up as 56% before I got bored
Re:Predicting one of 2 characters you will randomly press by andrezsanchez on Friday July 15, 2016 @10:46AM (#12101330)
I did something like this a long time ago in a little competition for beating others' rock paper scissors programs, except I used the other players' moves relative to my own (e.g. my program could catch on to the other player choosing the move that would beat my last move) as well as their current pattern of winning or losing.
Re:Predicting one of 2 characters you will randomly press by vorotato on Friday July 15, 2016 @10:20AM (#12101105)
It works if you're trying to be random, however if you're trying to react and respond to its patterns you can win.
Re:Predicting one of 2 characters you will randomly press by rohanprabhu on Friday July 15, 2016 @10:31AM (#12101190)
So, I tried a simple python one-liner:

[os.urandom(1)[0] < 128 for x in xrange(0, 100)]

and typed 'd' for True and 'f' for False in the array, bringing the accuracy of the predictor down to 53%. Theoretically, I'm guessing doing it for large enough numbers should make it exactly 50%.

Re:Predicting one of 2 characters you will randomly press by mikeash on Friday July 15, 2016 @10:34AM (#12101217)
If it doesn't come down to 50% for sufficiently large numbers, you've found a break in your OS's urandom and someone is about to be famous!
Re:Predicting one of 2 characters you will randomly press by dzdt on Friday July 15, 2016 @09:59AM (#12100963)
Doesn't work from my smartphone. Sounds like a fun challenge though, would like to try.
Re:Predicting one of 2 characters you will randomly press by pi-rat on Friday July 15, 2016 @10:38AM (#12101261)
Seems like it's written using ES6 syntax, which many browsers can't handle yet. Safari stopped at a lambda ( () => ) here.
Re:Predicting one of 2 characters you will randomly press by amake on Friday July 15, 2016 @10:09AM (#12101025)
I'm on OS X with Firefox 47.0.1 and it doesn't work for me either :(
Re:Predicting one of 2 characters you will randomly press by justinsaccount on Friday July 15, 2016 @10:15AM (#12101065)
I'm on OS X with Firefox 47.0.1 and it works fine. It doesn't display anything until the 6th keypress.
Re:Predicting one of 2 characters you will randomly press by mikeash on Friday July 15, 2016 @10:36AM (#12101242)
Doesn't work in Safari for me, but it does work in Chrome (after pressing keys six times).
Re:Predicting one of 2 characters you will randomly press by justinsaccount on Friday July 15, 2016 @10:42AM (#12101296)
Yeah, it uses this style function definition (ES6?) in a few places:

  document.addEventListener("DOMContentLoaded", () => {
Safari doesn't support that.
Re:Predicting one of 2 characters you will randomly press by js8 on Friday July 15, 2016 @10:19AM (#12101097)
Is there, for a given k, an easy to remember sequence (easy to remember algorithm with little state) that has all the k-grams with the same frequency?

For k=1: 01 repeating

For k=2: 0011 repeating

For k=3: 00010111 repeating

Re:Predicting one of 2 characters you will randomly press by justinpombrio on Friday July 15, 2016 @10:30AM (#12101188)
They're called De Bruijn sequences[1], and there's an algorithm for constructing them. I'm not sure how easy it is to run in your head, though.

[1] https://en.wikipedia.org/wiki/De_Bruijn_sequence#Algorithm

Re:Predicting one of 2 characters you will randomly press by WillKirkby on Friday July 15, 2016 @10:40AM (#12101285)
probably relevant: https://en.wikipedia.org/wiki/De_Bruijn_sequence

edit: dangit, beaten to the punch.

Re:Predicting one of 2 characters you will randomly press by tokenizerrr on Friday July 15, 2016 @10:35AM (#12101227)
Very cool. Am getting ~50% accuracy so I'm glad to see my free will is still intact!
Re:Predicting one of 2 characters you will randomly press by andrewclunn on Friday July 15, 2016 @10:37AM (#12101245)
40%? Lame.