Live data from Hacker News

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

github.com

201–210 of 243 posts

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

#201
Video games, especially competitive ones, do this to limit the effect of randomness on the outcome of the game, while still keeping the sequence of random events unpredictable enough to "feel" random and preventing simple exploits.

DoTA2 uses a simple distribution based on the number of "rolls" since the last successful one - P(N) = P0 * N, where P0 is the base probability and N is the number of rolls since the last successful one[1].

It keeps both "hot" and "cold" streaks from being too much of an issue, although that doesn't stop players from cursing the RNG gods when they lose.

[1] http://dota2.gamepedia.com/Random_distribution

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

#202
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…

Time for an Annoying Nerdy Rant!

Randomness is what makes a game more realistic but true randomness will not make it more likable. True randomness dictates that in half of your games, your players will have a harder time achieving anything.

It is not uniformity of results that the players are looking for, it is uniformity of successes weighted by the importance of the rolls. Failing a perception check in an empty room is less important than failing a dodge roll in the final fight on your last health point.

Many games suggest that the gamemaster cheats on some crucial rolls. More games propose an alternate system that biases rolls based on points systems. Some others even replace totally the dices with a points system.

I really prefer those. A very simple biased rolls system I often use (Dk2) is that GM can emphasize the action of dangerous NPCs by adding special D6 dices to a D20 roll (they are special as they only give +3 or +6 on 3 and 6 and +0 on other results). Once used, these dices are added to a pool that the players can use for their actions.

Anyway, my favorite system is Amber Diceless RPG. It trades randomness for secrets. Every player is a bit of a backstabing asshole who does not show all their skills on any action. If someone has 30 in strength, they may just announce 10 if they think it is enough for the action.

The winner in a fight is the one with the bigger score. Add bonus if they use some kind of trick or ambushes (recommended). It is surprisingly interesting for such a simple system.

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

#203
On a related note, a colleague once worked at a place where they did this for on-call: Everyone has an on-call score. Every week, the person on-call had their score set to zero, and everyone else incremented by one. You could plan out the next couple of months this way, and it provided an elegant way for new hires to take their place - they start at zero, and were generally familiar enough by the time their number came around.

There were some housekeeping rules to work around the organicness of human life - if someone went on holiday they kept their score, for example - but overall it seemed to work.

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

#204

> I made a chatbot that rolled dice, and it was constantly criticized for being "broken" because four 3's would come up in a row. > These accusations would come up even though they (all being computer science majors) know it's possible (although unlikely) for these events to happen. They just don't trust the black box. This reminds me of a talk [1] given at Game Developer's Conference (GDC) about the game Civilizatio…

When your battleship is destroyed by a peasant with a pitchfork, there's not a lot of perceived fairness...

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

#205
post #6

Earlier quoted context omitted.

I googled "RNG" because I wanted to know what it meant, but was presented with an interactive widget that generated numbers.

In the case you weren't joking: RNG stands for Random number generator. It is an abbreviation commonly used in video games.

Also in cryptography, in things like CSPRNG (cryptographically secure pseudo-RNG)

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

#206
This shows up a lot (predictably) in actual games, e.g. Hearthstone sells you digital cards, and the randomization specifically guarantees that the time between rare cards is capped [1].

Having unusually bad luck (e.g. opening 100 packs and not getting a single legendary card, when the average would be every ~20 packs) feels bad and probably loses Blizzard a customer, so the solution is to cut off the downside tail of the distribution.

[1] https://www.reddit.com/r/hearthstone/comments/3z7jyh/pity_ti...

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

#207
post #53

Earlier quoted context omitted.

Well, a little micro mechanical device offsetting the internal balance could work, though the balance change would have to be pretty large to bump the probability of any one face up significantly.

maybe have a dense liquid in a die, and have something "float" internally. Like a ball bearing in Gak slime or mercury.

This was the first place my thoughts went to. But a passive device like this seems like it would oppose the gambler's fallacy: after you roll, the weight distribution of the die shifts to be as energetically favorable as possible for that number. Now the die is weighted to roll another of that same number!

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

#208
post #126
post #100

Earlier quoted context omitted.

A simpler way that's guaranteed to not repeat a song till the entire set has been played is: Assuming you have N songs, pick a prime P such that N is not divisible by P. Then pick a random index I (0 Another method is to pick a random key K and sort the entries of the playlist based on HMAC(SONG, K) (where SONG is the name or other identifier of the song). This has a number of interesting properties. For starters the…

The prime method would mean that you would never hear some combinations of songs (for example, those who are an even number apart).

That's not true, at least for the even number apart example.

The prime method will sample songs p apart from each other, and it's easy to find examples of N and p where p is even, for example N=5 p=2. More generally, this method works for any n that is co-prime with N, so N=5 n=4 works as well.

There are lots of shufflings where subsequent songs are not separated by a constant amount, so your main point is true. There are many combinations of songs that you would never hear no matter which prime you picked.

To quantify just how many takes a little bit of work.

There are N! total shufflings possible. We know that there are N-1 or less numbers that are co-prime with N (you get N-1 when N is prime, less otherwise). For each number that is co-prime, we have N possible shufflings, each starting from a different point. This gives at most N(N-1) shufflings from the prime method (really the co-prime method).

As a percentage of total shufflings, we know the upper bound from the co-prime method is N(N-1) / N! == 1/(N-2)!. This very quickly goes to 0. For the first few N,

    N  % of shuffles
     2 100.00000%
     3 100.00000%
     4  50.00000%
     5  16.66667%
     6   4.16667%
     7   0.83333%
     8   0.13889%
     9   0.01984%
    10   0.00248%
    11   0.00028%
    12   0.00003%
    13   0.00000%
So for any reasonable number of songs, we know that _most_ shufflings will not be found by the prime shuffling method.

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

#209
How exactly does the roll() method work? Can't seem to parse the meaning of `runningSum` and `mark`.

  roll() {
    const sum = this.state.reduce((p, c) => p + c, 0)
    const r = Math.random() * sum
    let runningSum = 0
    let result = -1
    for (let i = 0; i  size of die
    return (result + 1)
  }

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

#210

Earlier quoted context omitted.

Also called "quasirandom" numbers, as I learned it from wikipedia years ago. ("Quasirandom" and "quasirandom numbers" today redirect to "low-discrepancy sequence".)

There is many names for it. The problem with "quasirandom" is that is sounds a lot like "pseudorandom". For the special case of points in a plane looking for "Poisson disk sampling" also brings many great resources.

[deleted]
Post reply on HN