Remix.run Logo
A two-person method to simulate die rolls (2023)(blog.42yeah.is)
50 points by Fraterkes 2 days ago | 27 comments
yason 32 minutes ago | parent | next [-]

You could draw long/short straws to generate bits but since the challenge limited the tools to mortal bodies any other guessing game would do.

One could put his hands behind his back with one hand palm open and the other hand in a fist. The other one then guesses which hand is open and him being right or wrong generates either a 1 or 0. Repeat N times for an N-bit binary number. Both players can influence their choice equally and also equally make assumptions about the other player's intentions when making their own choice.

nrhrjrjrjtntbt 4 minutes ago | parent | prev | next [-]

> Assuming both parties can come up with unbiased random numbers ranging from

Oh shame I though you were going to solve that problem.

xg15 3 hours ago | parent | prev | next [-]

> We can prove that in an ideal situation, the die roll will be fair. Assuming both parties can come up with unbiased random numbers ranging from [0;12)...

Doesn't that assumption remove the entire problem though? I thought the whole reason for the method was that people can't easily think of an unbiased random number.

Or put differently, if that's your starting point, what's stopping you from simply doing (A mod 6) + 1?

AnotherGoodName 3 hours ago | parent | next [-]

I think the game theory inherit here makes it ok for this purpose. You get an advantage being random. You're likely still not going to generate random numbers but at least there's good motivation to be random and that part just becomes part of the game imho (guess what number the opponent calls to maximize your roll).

Of course as others note this is a convoluted mod n process.

JKCalhoun 2 hours ago | parent | prev | next [-]

Does seem like each person could just secretly write down any number, they are revealed, added and mod 6'd.

Is all this angular difference stuff a fancy way of saying mod 6?

jstanley 2 hours ago | parent | prev | next [-]

Because you can rig the answer if it's just one person. But if two of you use the method from the post, and both commit to your answers before revealing them, then neither of you can rig it.

torginus 3 hours ago | parent | prev [-]

Yeah, the only valuable idea here is the angle-one, which is like a modulo, making the approach a primitive LCG, which is a way of generating pseudorandom numbers from seeds.

I'd say the only unbiased and non crappy method here is to feed the 2 participants' numbers into some sorth of hash function.

andy99 an hour ago | parent | prev | next [-]

You could just play rock paper scissors three times and use the results as bits for d6? Maybe dropping 111 and alternating who is 1?

Edit, I realize you’d have to drop 111 and 000 to get 6, not sure what I had in mind in the original, either way it balances. It’s also nice because I don’t think you can intentionally lose rock paper scissors.

fweimer 2 hours ago | parent | prev | next [-]

Usually, commitment schemes are used for this: https://en.wikipedia.org/wiki/Commitment_scheme

(However, if the stakes are high enough, the party that learns the outcome first can choose to exit the protocol if they are unsatisfied with the result.)

petermcneeley 2 hours ago | parent | next [-]

I think mine from 2017 is a commitment scheme. Certainly is not unique or novel.

https://darkcephas.blogspot.com/2017/07/fair-random-number-g...

jstanley 2 hours ago | parent | prev [-]

If you're worried about someone exiting the protocol, you can use a smart contract to lock their funds so that if they simply exit then they lose all their money.

IanCal 3 hours ago | parent | prev | next [-]

This starts by assuming humans are bad at coming up with unbiased numbers but then requires them to do so. I don’t get how this could work with biased inputs.

jdpage 3 hours ago | parent [-]

Bear in mind, the terminal goal doesn't actually require unbiased numbers; the way most TTRPGs work is that you're trying to roll over or under a target number to get a weighted, unpredictable outcome. The idea is that while players (usually) want any given action to succeed, they some of their actions to fail in order to preserve narrative interest, while having their character be better at some things than others.

As such, while randomness is best, the given method is quite sufficient for having fun, and both players can agree that it's fair: they each have equal influence over the result.

evantbyrne 35 minutes ago | parent | prev | next [-]

If you have a coin: Heads and tails represent bits. Flip a coin three times and add up the result to emulate a six-sided dice roll. e.g., heads, heads, tails = 3. If you get 7, then try again.

nrhrjrjrjtntbt a minute ago | parent [-]

If you get all heads or all tails then use the last toss as part of your next set of 3.

E.g. HHHHT -> HHT -> 6

amelius 2 hours ago | parent | prev | next [-]

After a while both people will get tired or bored and start generating the same number over and over again. At which point the method breaks down.

AnotherGoodName 3 hours ago | parent | prev | next [-]

A + B mod n seems much easier than this.

tomsmeding 3 hours ago | parent | next [-]

The method proposed is just A - B mod n. The two are entirely equivalent.

AnotherGoodName 3 hours ago | parent [-]

A few extra steps to essentially manually do the mod part tbh. Would take their 20 line program to a 1 liner.

BoiledCabbage 3 hours ago | parent | prev [-]

Yup

zeroonetwothree 3 hours ago | parent | prev | next [-]

It would be more interesting to look at how much this reduces bias based on numbers humans actually tend to generate.

BTW a "classic" method of generating random numbers is to look at the second hand of a watch mod n.

jojobas 2 hours ago | parent | prev | next [-]

Sounds like a bit more complicated odds-and-evens. Rather than mess with pi and circles, you could just cast 0-9 fingers and get mod 6 + 1.

AlotOfReading 2 hours ago | parent | prev [-]

Another procedure based on a similar problem I worked on with a friend: you both pick positive integers a and b, then add them together to create c. Either sqrt(c) or sqrt(c+1) is irrational and the fractional digits provide your random numbers. If you need a new sequence, you take some digits from the current expansion and sqrt() them again.

Might not be unbiased, but good luck proving it.

pama an hour ago | parent | next [-]

Even without a formal proof you could test it empirically if you generate a large number of samples and run regular tests for pseudorandom number generators. [Edit: a quick test on a million samples and relatively simple RNG tests suggests that this is indeed good enough; maybe worth working out a proof if this hasn't been done already. Edit2: I guess the main problem you'd hit in practice with short sequences of digits would be to avoid accidental recurrences with too short a period, but it should be possible to make it statistically unlikely in practice with enough compute/digits.]

crdrost 2 hours ago | parent | prev | next [-]

I'm not entirely sure what algebraic property you would prove with this, but you probably could prove something about it. The issue is that they have repeating continued fraction representations, and large numbers in the continued fraction correspond to very good rational approximations, and so you'd find that a bunch of these chosen at random have pretty good rational approximations, which assuming the denominator is co-prime to 10, probably means that it explores the space of digits too uniformly? Something like that.

AlotOfReading 2 hours ago | parent [-]

The approach I was thinking of is that you'd prove normality or the lack thereof, a notoriously open problem for virtually all irrational roots. Continued fractions might be fruitful, but I suspect you'd eventually run one of the many other open problems in that space instead.

echoangle an hour ago | parent | prev [-]

Can you calculate the digits in your head without help?