Live data from Hacker News

Show HN: A Set of Dice That Follows the Gambler's Fallacy

github.com

101–110 of 243 posts

Re: Show HN: A Set of Dice That Follows the Gambler's Fallacy

#101
post #64

Eh, I thought this was something more mathematical, like non-transitive dice ( https://en.wikipedia.org/wiki/Nontransitive_dice ). Apparently it's... a weighted random number generator? in node.js?

Yep it's nothing fancy. But I've yet to have seen it done before.

Re: Show HN: A Set of Dice That Follows the Gambler's Fallacy

#103

A great application for this is in randomizing playlists. My friends, who are also CS grads and should know better, have often complained that their MP3 players, CD carousels, etc play the same music too often claiming that the random is broken, when a song repeating in a short period of time or other songs never playing is what you would expect from a truly random selection. Using this algorithm, you'd be sure to he…

back when I used Winamp as my daily player, I was getting annoyed that its "shuffle" kept playing the same songs. and it would play the same songs in a row. so I would hear the songs C,A,F play. then the next day again the sequence would be C,A,F. over time, I would start hearing the melody of the next song before it even started playing.

when I finally noticed this and realized that could only mean it's not actually random, I researched it, and found out that once you hit shuffle/random on Winamp, it shuffled the songs once and kept the sequence forever.

and then as it turned out, Winamp actually had a setting to select a truly random song each time. all I needed to cure my madness was a checkbox!

Re: Show HN: A Set of Dice That Follows the Gambler's Fallacy

#105
post #4

Interesting, and at first I was excited about the possibilities in something like D&D, where a series of bad rolls can have you feeling down. "I'm due for a critical hit any swing now..." Players would love that! Make my hero feel more heroic! The inevitable comeback! But then I thought about the inverse case -- you are doing really well, and now you are due for a failure. Or series of failures. That would feel awful…

In some competitive games like Dota and LoL, the random distribution for critical hits is weighted so that it ramps up over time, resetting after a successful crit. (http://dota2.gamepedia.com/Random_distribution) This both reduces the chance of two high rolls coming up twice in a row as well as long periods of low rolls.

It doesn't have the "you are doing really well, and now you are due for a failure" since "not a critical" isn't really that negative of an outcome.

For something like D&D, the same kind of "better-than-random" distribution just comes from adding dice. 4d6 is much more consistent than 1d21+3.

Re: Show HN: A Set of Dice That Follows the Gambler's Fallacy

#106
post #57
post #38

Now I really want physical loaded dice which follow the gambler's fallacy! Is it too crazy of an idea?

You could just use a deck of cards with numbers on them. That's the simplest way to do "Gambler's Fallacy Dice" IRL. For example, there's a popular Catan expansion pack that replaces the dice with a deck of cards with numbers on them for just this reason, because in Catan each roll of 2D6 represents different regions of the map paying out so if a number never comes up it never pays out.

The thing about rolling 2D6, is the distribution isn't even.

I'm not sure that factors into the game (have played but its been a while). Cards seem like a more controlled way to distribute the results with some randomness.

only one way to get a 12 (6+6) but 7 much more likely.. (6+1, 5+2, 4+3, 3+4, 2+5, 1+6)

as someone who played a bit of online backgammon back in the day, We always suspected the random dice rolls behaved differently in the game than playing in real life...

Re: Show HN: A Set of Dice That Follows the Gambler's Fallacy

#107
post #67

There's a probability model called the Pólya urn where you imagine an urns containing numbered balls (colored balls in a typical example, but to draw the comparison with dice we can say they're numbered 1-6), and every time you draw a ball of a certain color, you put back more balls according to some rule. A few probability distributions can be expressed in terms of a Pólya urn, see https://en.wikipedia.org/wiki/P%C3…

Thank you! Sometimes the hardest thing is knowing what to google!

I do a lot of furious googling thinking: "Oh man this has to be a thing but what could it be and how would someone describe it?... awe forget it."

Then months later by accident while looking at a completely different topic: "OMG there it is, the thing!"

Re: Show HN: A Set of Dice That Follows the Gambler's Fallacy

#108
I'm not a programmer but I've thought about this a lot. It'd be interesting to know if my simple solution here has something wrong with it.

My idea is based on time - if we assign each song to a 1/1000th of a second, we play the song that matches the 1000th of a second when the next song is called.

In this case, I'm referring to the 1/1000th of a second of current time of day. Depending on the song´s position in the second that I change tracks, is what song gets played.

A bit more randomness (if this is needed) could come if we use Pi - for example, we can run through a series in Pi which adds to the ID of the song. Differing track lengths then do the job of ensuring that we always wind up on a different song in the loop.

The above seems to my layman's eye to be a simpler solution, at least.

Re: Show HN: A Set of Dice That Follows the Gambler's Fallacy

#109

A great application for this is in randomizing playlists. My friends, who are also CS grads and should know better, have often complained that their MP3 players, CD carousels, etc play the same music too often claiming that the random is broken, when a song repeating in a short period of time or other songs never playing is what you would expect from a truly random selection. Using this algorithm, you'd be sure to he…

Good implementations actually don't make a random choice, but do a random sort and then play the whole list, then random sort again, then play again the whole list, etc. The only possible problem here is when the last song in one playthrough is the same as the first song in the next playthrough. But even that can be overcome by re-random-sorting the follow-up.

Re: Show HN: A Set of Dice That Follows the Gambler's Fallacy

#110
post #67

There's a probability model called the Pólya urn where you imagine an urns containing numbered balls (colored balls in a typical example, but to draw the comparison with dice we can say they're numbered 1-6), and every time you draw a ball of a certain color, you put back more balls according to some rule. A few probability distributions can be expressed in terms of a Pólya urn, see https://en.wikipedia.org/wiki/P%C3…

Thank you! Sometimes the hardest thing is knowing what to google!

https://en.wikipedia.org/wiki/True_name
Post reply on HN