logoalt Hacker News

testaccount28today at 4:02 PM4 repliesview on HN

how can i pick a real number at random though?

i tried Math.random(), but that gave a rational number. i'm very lucky i guess?


Replies

andrewflnrtoday at 4:33 PM

You can't actually pick real numbers at random. You especially can't do it on a computer, since all numbers representable in a finite number of digits or bits are rational.

tantalortoday at 4:11 PM

Pick a digit, repeat, don't stop.

show 3 replies
mgtoday at 4:06 PM

How did you test the output of Math.random() for transcendence?

When you apply the same test to the output of Math.PI, does it pass?

show 1 reply
kridsdale1today at 5:24 PM

Use an analog computer. Sample a voltage. Congrats.

show 3 replies