News for hackers. Stuff that matters.
Re:How Inmates Play Tabletop RPGs in Prisons Where Dice Are ... by pesfandiar on Wednesday February 28, 2018 @02:35PM (#16486011)
Well, they can't ban 1-bit random number generators (e.g. coins) and with a bit of time, you can simulate any of dice used in RPGs.
Re:How Inmates Play Tabletop RPGs in Prisons Where Dice Are ... by kibwen on Wednesday February 28, 2018 @03:01PM (#16486251)
"With a thunderous roar, the colossal red dragon envelops the party in a cruel wave of fire! You each take 24d10 damage, but while I'm sitting here flipping this coin six hundred times please do let me know if you make your reflex save for half..."
Re:How Inmates Play Tabletop RPGs in Prisons Where Dice Are ... by setr on Wednesday February 28, 2018 @03:06PM (#16486306)
If you converted the rules to be powers of 2, each coin representing a binary digit, it shouldn't be too bad

24d10 becomes 0-240, so change it to 0-256 and you've got 8 flips (8d2?)

Distribution won't be correct but hey, 8 flips

Re:How Inmates Play Tabletop RPGs in Prisons Where Dice Are ... by kzrdude on Wednesday February 28, 2018 @03:18PM (#16486416)
I didn't know the central limit theorem when I played D&D, but it's interesting how massively different those two distributions are -- 24d10 versus a uniform 24-240 distribution.

24d10 is 24 independently rolled d10's, that means we convolute the uniform distribution with itself 24 times and the result will be nearly indistinguishable from a scaled bell curve.

Edit: Click the “Graph” button here to visualize: http://anydice.com/program/4ddf

Re:How Inmates Play Tabletop RPGs in Prisons Where Dice Are ... by Y_Y on Wednesday February 28, 2018 @03:57PM (#16486835)
I'd like to just add a shoutout for the word "convolve" as the verb referring to this particular action of convolution.
Re:How Inmates Play Tabletop RPGs in Prisons Where Dice Are ... by kzrdude on Wednesday February 28, 2018 @04:26PM (#16487141)
Ah that's nice. I took the relevant course in Swedish, where we use the German loan word "Faltung" (turns to faltning in Swedish) for this operation.
Re:How Inmates Play Tabletop RPGs in Prisons Where Dice Are ... by ajross on Wednesday February 28, 2018 @03:18PM (#16486414)
Four flips can get you 16 outcomes of course, rerolling values out of bounds means you need 4*16/10 = 6.4 amortized flips to generate a d10, or ~154 total to get 24d10.

For large dice counts like that, it's probably better to just use a manual table for a bell curve based on ~8-10 flips. No human player is going to care about result fidelity beyond a thousand possible results anyway.

Re:How Inmates Play Tabletop RPGs in Prisons Where Dice Are ... by ajross on Wednesday February 28, 2018 @05:20PM (#16487671)
Actually I'm realizing a much more efficient (but still simple enough to be practical) way to generate d10 results is to do them in pairs. Do seven flips to generate a binary number to be interpreted as a "percentile" result in the range 00-99, rerolling on 100-127, then treat the two digits independently.

That gets you to 4.48 amortized flips per d10.

Re:How Inmates Play Tabletop RPGs in Prisons Where Dice Are ... by nybble41 on Friday March 02, 2018 @05:49PM (#16506483)
Why stop there? If you switch to triples (10 flips, reroll on 1000-1023) then you can get an amortized cost of about 3.4 flips per d10. That's very close to the ideal outcome of log2(10) ~= 3.32 flips.

Above 3d10 the rate of re-rolls increases; 20 flips for 6d10 gives a worse amortized cost than two sets of three.

Re:How Inmates Play Tabletop RPGs in Prisons Where Dice Are ... by zaroth on Wednesday February 28, 2018 @06:06PM (#16488100)
Now if you just had a bit more time on your hands to work on this problem...
Re:How Inmates Play Tabletop RPGs in Prisons Where Dice Are ... by LolWolf on Wednesday February 28, 2018 @03:12PM (#16486356)
Well, you can re-flip on >240, with an expected number of flips to receive a number in the range being around 1/(1-15/256) ~ 1.062, so pretty close to just one 8-coin-flip (with some low probability of having to re-flip, which vanishes exponentially as the number of re-flips).

This has the guaranteed correct distribution ('correct' being 'uniform'), too!

EDIT: I guess, to be more clear about the algorithm: flip 8 coins and convert this result to binary. If the result is greater than 240, flip the eight coins again. The number of total 8-coin-flips that need to be done on average is something like 1.062, and the likelihood that you need to perform n 8-coin-flips to receive a result ≤ 240 vanishes exponentially as (15/256)^(-n).

Re:How Inmates Play Tabletop RPGs in Prisons Where Dice Are ... by yoklov on Wednesday February 28, 2018 @03:24PM (#16486462)
24d10 has a normal-ish distribution. The scheme you suggest will produce a uniform distribution.
Re:How Inmates Play Tabletop RPGs in Prisons Where Dice Are ... by LolWolf on Wednesday February 28, 2018 @03:30PM (#16486541)
Oh, interesting, did not know that! I guess I only now just realized that 24d10 is 10 dice with 24 values (I just read the GGP and thought, oh 240 uniform is easy to make)... there's probably some nice way to emulate that with 1-bit RNGs in expected finite (ideally small!) time.

EDIT: I screwed up again, 24d10 is 24 dice with 10 values. Oops. Point is still roughly the same!

Re:How Inmates Play Tabletop RPGs in Prisons Where Dice Are ... by tzs on Wednesday February 28, 2018 @05:34PM (#16487814)
At most 8 flips. In many cases you'll be able to use less if you flip the most significant bits of your 8 bit number first. E.g., if you have 45 HP and the first flip is 1, you can probably stop flipping at that point.
Re:How Inmates Play Tabletop RPGs in Prisons Where Dice Are ... by slaymaker1907 on Thursday March 01, 2018 @01:17AM (#16490073)
24d10 would be miserable, even with dice. I takes approximately 4 coin flips to approximate a d10 (need to ignore values [10,15] and add one. This works out to ~100 rolls.

For the more common case of a d20, you could do 5 coin flips, but doing 6 instead gives you much more wiggle room. In that case, you only have to ignore values [60,63] so you only have a 1/16 chance of needing to redo the coin flips. It would be tedious but doable (particularly if you had some system where you could prepare rolls while waiting for your turn).

d4 = 2 flips guaranteed, definitely not bad. d6 = 3 flips expected. d8 = 3 flips guaranteed. d10 = 4 flips. d12 = 4 flips.

For something more typical but still nasty, a Fireball with 8d6 would take ~24 coin flips. Also, if I were a prison DM in this situation, I would probably take the time to homebrew the system so it only uses power of 2 rolls, i.e. d2, d4, d8, d16, and maybe d32. I would probably do d16 instead of d20 since d32 would be rolling 5 rolls quite often and a d16 is closer to a d20.

Overall, the difficulty would not be the coin flips but doing the math to keep track of everything.

Even if they restrict you from doing that, another option would be to do some sort of manual pseudo-rng. That option would probably be faster if you have access to a scientific calculator.

Re:How Inmates Play Tabletop RPGs in Prisons Where Dice Are ... by v_lisivka on Thursday March 01, 2018 @05:17AM (#16490905)
You can flip 600 coins once instead.
Re:How Inmates Play Tabletop RPGs in Prisons Where Dice Are ... by cableshaft on Wednesday February 28, 2018 @04:09PM (#16486950)
Slips of paper, write 1-20 (or whatever the die faces are) on them, shuffle them up, have people pick one. There's your randomness.

You could even insure an even distribution and have like 1-6 in there 4 or 5 times (if it's a d6), and don't return the slips back to the pile until the pile is depleted.

Or you can do what I've done for testing pen and paper game designs where a die wasn't handy, and do the above and write the series of results down in a list on a separate paper, and then refer to the next number in the list when you're playing.

I even did it where I put the numbers into several 4 by 4 square grids, and would simulate different games by picking the next number by from the grid but going from different directions (left, right, up, down, etc).

Re:How Inmates Play Tabletop RPGs in Prisons Where Dice Are ... by Thrwr11 on Wednesday February 28, 2018 @04:27PM (#16487154)
You have to put the slips of paper back if you want to simulate dice.
Re:How Inmates Play Tabletop RPGs in Prisons Where Dice Are ... by cableshaft on Wednesday February 28, 2018 @05:28PM (#16487744)
Yes, I didn't mention it but that's what you'd do in the first one. There are people that prefer dice get rolled more predictably (an even amount of 1s, 2s, 3s, etc), so you can just have a few sets of repeats and don't have them return the slips if you wanted that.

Some people get really mad with true randomness and think the system is rigged. Something I've learned when designing video games. Settlers of Catan have Dice Cards they sell for people who hate that "the 4 alwaaaaays gets rolled and my 8 didn't get rolled once, that's bullshit!"

Re:How Inmates Play Tabletop RPGs in Prisons Where Dice Are ... by bb88 on Thursday March 01, 2018 @02:13AM (#16490245)
Re:How Inmates Play Tabletop RPGs in Prisons Where Dice Are ... by jlgaddis on Wednesday February 28, 2018 @02:56PM (#16486210)
Yes, coins -- all forms of currency, actually -- are banned.
Re:How Inmates Play Tabletop RPGs in Prisons Where Dice Are ... by slaymaker1907 on Thursday March 01, 2018 @01:24AM (#16490089)
Do some sort of simple pseudo-RNG then (DM seeds it obviously). Icky math, but you could probably just generate a bunch of rolls as part of your prep work.
Re:How Inmates Play Tabletop RPGs in Prisons Where Dice Are ... by dalore on Wednesday February 28, 2018 @03:05PM (#16486290)
Ok a leaf? Or a piece of toilet paper.
Re:How Inmates Play Tabletop RPGs in Prisons Where Dice Are ... by logfromblammo on Wednesday February 28, 2018 @04:26PM (#16487140)
Scrabble tile, letter up vs. letter down. Bonus in that the flips may be done all at once and ordered alphabetically.
Re:How Inmates Play Tabletop RPGs in Prisons Where Dice Are ... by fencepost on Wednesday February 28, 2018 @09:00PM (#16489087)
Even better, if you can come up with 5 flippable distinctive items you can simply set each as a bit and shake and flip them at once.

d4=2 bits+1, d6=3 bits rerolling 0/7, d8=3 bits+1, d10=4 bits rerolling 0/11-15, d12 similar, d20=5 bits rerolling 0/21-31. I suspect that most gamers could pick that up pretty quickly with just a bit of practice.