frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

A two-person method to simulate die rolls

https://blog.42yeah.is/algorithm/2023/08/05/two-person-die.html
36•Fraterkes•2d ago

Comments

AnotherGoodName•1h ago
A + B mod n seems much easier than this.
BoiledCabbage•1h ago
Yup
tomsmeding•1h ago
The method proposed is just A - B mod n. The two are entirely equivalent.
AnotherGoodName•1h ago
A few extra steps to essentially manually do the mod part tbh. Would take their 20 line program to a 1 liner.
IanCal•1h ago
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•1h ago
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.

xg15•1h ago
> 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•1h ago
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.

torginus•1h ago
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.

jstanley•20m ago
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.
JKCalhoun•4m ago
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?

zeroonetwothree•1h ago
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.

AlotOfReading•55m ago
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.

crdrost•10m ago
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•1m ago
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.
amelius•47m ago
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.
fweimer•32m ago
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•21m ago
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•16m ago
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.
jojobas•12m ago
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.

I failed to recreate the 1996 Space Jam Website with Claude

https://j0nah.com/i-failed-to-recreate-the-1996-space-jam-website-with-claude/
229•thecr0w•6h ago•193 comments

The C++ standard for the F-35 Fighter Jet [video]

https://www.youtube.com/watch?v=Gv4sDL9Ljww
151•AareyBaba•5h ago•144 comments

Evidence from the One Laptop per Child Program in Rural Peru

https://www.nber.org/papers/w34495
53•danso•3h ago•20 comments

Mechanical power generation using Earth's ambient radiation

https://www.science.org/doi/10.1126/sciadv.adw6833
11•defrost•1h ago•4 comments

Google Titans architecture, helping AI have long-term memory

https://research.google/blog/titans-miras-helping-ai-have-long-term-memory/
345•Alifatisk•11h ago•110 comments

Dollar-stores overcharge cash-strapped customers while promising low prices

https://www.theguardian.com/us-news/2025/dec/03/customers-pay-more-rising-dollar-store-costs
185•bookofjoe•8h ago•265 comments

An Interactive Guide to the Fourier Transform

https://betterexplained.com/articles/an-interactive-guide-to-the-fourier-transform/
116•pykello•5d ago•14 comments

A two-person method to simulate die rolls

https://blog.42yeah.is/algorithm/2023/08/05/two-person-die.html
36•Fraterkes•2d ago•20 comments

XKeyscore

https://en.wikipedia.org/wiki/XKeyscore
77•belter•2h ago•58 comments

Build a DIY magnetometer with a couple of seasoning bottles

https://spectrum.ieee.org/listen-to-protons-diy-magnetometer
54•nullbyte808•1w ago•13 comments

Bag of words, have mercy on us

https://www.experimental-history.com/p/bag-of-words-have-mercy-on-us
6•ntnbr•59m ago•1 comments

The Anatomy of a macOS App

https://eclecticlight.co/2025/12/04/the-anatomy-of-a-macos-app/
168•elashri•10h ago•41 comments

The state of Schleswig-Holstein is consistently relying on open source

https://www.heise.de/en/news/Goodbye-Microsoft-Schleswig-Holstein-relies-on-Open-Source-and-saves...
495•doener•10h ago•234 comments

Scala 3 slowed us down?

https://kmaliszewski9.github.io/scala/2025/12/07/scala3-slowdown.html
154•kmaliszewski•8h ago•88 comments

Proxmox delivers its software-defined datacenter contender and VMware escape

https://www.theregister.com/2025/12/05/proxmox_datacenter_manager_1_stable/
29•Bender•2h ago•1 comments

Java Hello World, LLVM Edition

https://www.javaadvent.com/2025/12/java-hello-world-llvm-edition.html
159•ingve•11h ago•54 comments

Nested Learning: A new ML paradigm for continual learning

https://research.google/blog/introducing-nested-learning-a-new-ml-paradigm-for-continual-learning/
56•themgt•8h ago•2 comments

Estimates are difficult for developers and product owners

https://thorsell.io/2025/12/07/estimates.html
128•todsacerdoti•4h ago•151 comments

Minimum Viable Arduino Project: Aeropress Timer

https://netninja.com/2025/12/01/minimum-viable-arduino-project-aeropress-timer/
3•surprisetalk•5d ago•0 comments

Syncthing-Android have had a change of owner/maintainer

https://github.com/researchxxl/syncthing-android/issues/16
102•embedding-shape•3h ago•23 comments

iced 0.14 has been released (Rust GUI library)

https://github.com/iced-rs/iced/releases/tag/0.14.0
40•airstrike•2h ago•21 comments

Semantic Compression (2014)

https://caseymuratori.com/blog_0015
47•tosh•6h ago•5 comments

Over fifty new hallucinations in ICLR 2026 submissions

https://gptzero.me/news/iclr-2026/
434•puttycat•10h ago•338 comments

Z2 – Lithographically fabricated IC in a garage fab

https://sam.zeloof.xyz/second-ic/
328•embedding-shape•20h ago•73 comments

Context Plumbing (Interconnected)

https://interconnected.org/home/2025/11/28/plumbing
5•gmays•5d ago•0 comments

Building a Toast Component

https://emilkowal.ski/ui/building-a-toast-component
78•FragrantRiver•4d ago•28 comments

The programmers who live in Flatland

https://blog.redplanetlabs.com/2025/11/24/the-programmers-who-live-in-flatland/
69•winkywooster•1w ago•86 comments

The past was not that cute

https://juliawise.net/the-past-was-not-that-cute/
389•mhb•1d ago•477 comments

Screenshots from developers: 2002 vs. 2015 (2015)

https://anders.unix.se/2015/12/10/screenshots-from-developers--2002-vs.-2015/
435•turrini•1d ago•216 comments

How the Disappearance of Flight 19 Fueled the Legend of the Bermuda Triangle

https://www.smithsonianmag.com/history/how-the-disappearance-of-flight-19-a-navy-squadron-lost-in...
45•pseudolus•11h ago•12 comments