frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

France's homegrown open source online office suite

https://github.com/suitenumerique
216•nar001•2h ago•115 comments

Start all of your commands with a comma (2009)

https://rhodesmill.org/brandon/2009/commands-with-comma/
377•theblazehen•2d ago•134 comments

British drivers over 70 to face eye tests every three years

https://www.bbc.com/news/articles/c205nxy0p31o
6•bookofjoe•8m ago•1 comments

Hoot: Scheme on WebAssembly

https://www.spritely.institute/hoot/
65•AlexeyBrin•3h ago•12 comments

Reinforcement Learning from Human Feedback

https://arxiv.org/abs/2504.12501
41•onurkanbkrc•3h ago•2 comments

OpenCiv3: Open-source, cross-platform reimagining of Civilization III

https://openciv3.org/
749•klaussilveira•18h ago•234 comments

The Waymo World Model

https://waymo.com/blog/2026/02/the-waymo-world-model-a-new-frontier-for-autonomous-driving-simula...
1004•xnx•23h ago•570 comments

Coding agents have replaced every framework I used

https://blog.alaindichiappari.dev/p/software-engineering-is-back
109•alainrk•2h ago•125 comments

Show HN: One-click AI employee with its own cloud desktop

https://cloudbot-ai.com
9•fainir•1h ago•4 comments

First Proof

https://arxiv.org/abs/2602.05192
12•samasblack•38m ago•6 comments

Stories from 25 Years of Software Development

https://susam.net/twenty-five-years-of-computing.html
8•vinhnx•1h ago•1 comments

Vocal Guide – belt sing without killing yourself

https://jesperordrup.github.io/vocal-guide/
134•jesperordrup•8h ago•55 comments

Unseen Footage of Atari Battlezone Arcade Cabinet Production

https://arcadeblogger.com/2026/02/02/unseen-footage-of-atari-battlezone-cabinet-production/
91•videotopia•4d ago•21 comments

Ga68, a GNU Algol 68 Compiler

https://fosdem.org/2026/schedule/event/PEXRTN-ga68-intro/
30•matt_d•4d ago•6 comments

Making geo joins faster with H3 indexes

https://floedb.ai/blog/how-we-made-geo-joins-400-faster-with-h3-indexes
148•matheusalmeida•2d ago•40 comments

Show HN: Look Ma, No Linux: Shell, App Installer, Vi, Cc on ESP32-S3 / BreezyBox

https://github.com/valdanylchuk/breezydemo
254•isitcontent•18h ago•27 comments

Monty: A minimal, secure Python interpreter written in Rust for use by AI

https://github.com/pydantic/monty
267•dmpetrov•18h ago•142 comments

A Fresh Look at IBM 3270 Information Display System

https://www.rs-online.com/designspark/a-fresh-look-at-ibm-3270-information-display-system
7•rbanffy•3d ago•0 comments

Show HN: Kappal – CLI to Run Docker Compose YML on Kubernetes for Local Dev

https://github.com/sandys/kappal
10•sandGorgon•2d ago•2 comments

Hackers (1995) Animated Experience

https://hackers-1995.vercel.app/
531•todsacerdoti•1d ago•258 comments

Sheldon Brown's Bicycle Technical Info

https://www.sheldonbrown.com/
409•ostacke•1d ago•105 comments

Show HN: I spent 4 years building a UI design tool with only the features I use

https://vecti.com
353•vecti•20h ago•159 comments

Show HN: If you lose your memory, how to regain access to your computer?

https://eljojo.github.io/rememory/
322•eljojo•21h ago•198 comments

What Is Ruliology?

https://writings.stephenwolfram.com/2026/01/what-is-ruliology/
55•helloplanets•4d ago•54 comments

An Update on Heroku

https://www.heroku.com/blog/an-update-on-heroku/
450•lstoll•1d ago•296 comments

Microsoft open-sources LiteBox, a security-focused library OS

https://github.com/microsoft/litebox
365•aktau•1d ago•190 comments

Cross-Region MSK Replication: K2K vs. MirrorMaker2

https://medium.com/lensesio/cross-region-msk-replication-a-comprehensive-performance-comparison-o...
6•andmarios•4d ago•1 comments

How to effectively write quality code with AI

https://heidenstedt.org/posts/2026/how-to-effectively-write-quality-code-with-ai/
293•i5heu•21h ago•246 comments

Dark Alley Mathematics

https://blog.szczepan.org/blog/three-points/
103•quibono•5d ago•30 comments

Female Asian Elephant Calf Born at the Smithsonian National Zoo

https://www.si.edu/newsdesk/releases/female-asian-elephant-calf-born-smithsonians-national-zoo-an...
53•gmays•13h ago•22 comments
Open in hackernews

A two-person method to simulate die rolls (2023)

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

Comments

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

IanCal•2mo ago
I think it depends on the roll. For two players against each other it’s a bit more fun, but dm/player feels imbalanced, even when it’s character based. Th player winning might feel more fun beating another character with wits but that doesn’t work as well imo for luck, strength, or against something inanimate. It also moves success into a personal skill of the player vs the dm. I don’t agree that it’s necessarily fair.

Perhaps it’s just the feeling of “I took a risk and it didn’t work” vs “I chose badly and was outsmarted by the dm” seem different to me in an important way.

You could reframe this all easily as well for “I’m thinking of a number between 1 and 100, guess it within Y distance to succeed”. That’s mathematically equivalent I think, if you allow it rolling around.

xg15•2mo 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•2mo 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•2mo 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•2mo 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.
IAmBroom•2mo ago
That assumes "rigging" is the only non-random component. There's also unintentional bias; when asked to name a random number between 1-100, multiples of ten are underrepresented due to our bias.
jstanley•2mo ago
It solves the rigging problem, it doesn't necessarily make claims as to whether that is the only problem that exists.
JKCalhoun•2mo 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?

IanCal•2mo ago
Yes.
zeroonetwothree•2mo 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•2mo 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•2mo 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•2mo 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.
echoangle•2mo ago
Can you calculate the digits in your head without help?
pama•2mo ago
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.]
AlotOfReading•2mo ago
Passes dieharder and PractRand, so it's pretty dang good.
pama•2mo ago
Yeah I like the simplicity and power of it. You might want to tackle the math and write it up.
gowld•2mo ago
You need to go mod 10^(-n) to avoid the bias in the first digits.

I'd prefer that one person choose a non-square integer, and the other choose (very large) n.

amelius•2mo 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.
ddtaylor•2mo ago
Add a CTR!
fweimer•2mo 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•2mo 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•2mo 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•2mo 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.
gowld•2mo ago
I think you need 0-5 to avoid bias. (If you are good at generating random 0-9, then you are biasing 0-4 over 5-6, in the mod-6 regime, and I can preserve that bias by preferring to choose small or large numbers depending on whether I want a small or large result)
jojobas•2mo ago
You must be somewhat right, however only 4 gets biased up:

In [18]: n = 10000000

In [19]: tally = [0,0,0,0,0,0]

In [20]: for i in range(n): ...: tally[(random.randint(0,9)+ random.randint(0,9))%6]+=1 ...:

In [21]: tally Out[21]: [1600008, 1600460, 1699599, 1799697, 1699604, 1600632]

andy99•2mo ago
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.

brokencode•2mo ago
There actually are techniques to win (and presumably lose) rock paper scissors more frequently than random due to psychological factors that make player choices somewhat predictable.
IAmBroom•2mo ago
Which emphasizes the innate problem in using biased inputs (human choice) to generate unbiased outputs.

It is virtually impossible.

evantbyrne•2mo ago
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•2mo ago
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

daiwt•2mo ago
That will make HHH always 6 and TTT always 1
nrhrjrjrjtntbt•2mo ago
HHH becomes H

Then depending on the next 2 throws

HH -> keep going

HT -> 6

TH -> 5

TT -> 4

For TTT similar with K,1,2,3

evantbyrne•2mo ago
Ah yeah of course, there is a zero case as well. I was thinking you just restart as to not bias the result. That's an interesting alternative though
yason•2mo ago
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•2mo ago
> Assuming both parties can come up with unbiased random numbers ranging from

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

morshu9001•2mo ago
This explanation with angles makes this seem more complicated than it is. Two adversaries think of two numbers 0-11. Both say one aloud, add the other person's number to the one that wasn't said, then subtract 12 if it's higher.

As a bonus, the other person doesn't know what you "rolled" unless you tell them, which was important for the game I was making.

luckys•2mo ago
An alternative, because the use of dice is to effectively decide an outcome: for example, Knight (Player1) fights Troll. Have both players agree on a short set of possible outcomes. For this example:

1-Knight defeats Troll 2-Troll defeats Knight 3-Troll is wounded but escapes 4-Knight is wounded but escapes 5-Another character or party comes into scene

Then Player2 decides which outcomes are assigned to which numbers (1-5), keeping them a secret and Player1 picks a number not knowing the outcome it stands for.

It's quicker and within reach of us, mere mortals.

euroderf•2mo ago
This looks srsly overengineered. There's an easier way.

Each player chooses simultaneously an integer from [1, N]. (Like, draw a chit and reveal them simultaneously.) Sum the draws. For a sum of N+1 or more, subtract N.

1313ed01•2mo ago
I saw some gamebook for two players many years ago that had a small 5x5 table printed on each page. When players needed a random number 1-5 they simultaneously revealed a hand showing 1-5 fingers and used the table on the current page to cross-reference to get a number .

Of course it would work fine without the table, just using simple maths, but I think having unique tables on each page to scramble the result removes some of the ability of players to try to mind-game each other.

It would not work as well for ranges other than 1-5.

cheeseomlit•2mo ago
Probably beside the point because I imagine the author just wanted to show a neat math-based solution, but in this situation with no dice available I've just used playing cards. If you want to simulate a 6-sided dice roll you grab cards 1-6 and shuffle, nice and simple
gowld•2mo ago
This appears to be equivalent to playing rock-paper-scissors to generate a random bit stream.
kstenerud•2mo ago
> Assuming both parties can come up with unbiased random numbers

When you're in competition, this cannot be assumed. You'll each bias the numbers you come up with towards your preferred outcome. Even with A + B mod N, you can still bias the results when you know what your opponent is trying for.

A fairer approach would be to make a long series of randomized values. Your opponent secretly chooses a starting offset, and you pick an offset to add.

So for 1d6:

    2 5 1 3 6 4
    4 3 5 2 1 6
    5 6 3 4 2 1
    1 4 3 2 5 6
    3 1 2 6 4 5
You don't need a ton of rows. Each possible roll value must appear once in each row.

Your opponent places a marker on one of those numbers and keeps that information hidden.

- Let's say they choose the "1" at row=2, col=5.

Now you pick a number from 1 to 6.

- Let's say you choose 5.

Now they reveal where the marker is set (row=2, col=5).

Now you advance from the marker by 5 (wrapping around in the row if necessary).

- so from row=2, col=5, you advance by 5 like so: 6, (wrap) 4, 3, 5, 2 (ending at row=2, col=4).

You "rolled" a 2.