| ▲ | testaccount28 14 hours ago |
| 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? |
|
| ▲ | andrewflnr 14 hours ago | parent | next [-] |
| 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. |
| |
| ▲ | teraflop 5 hours ago | parent [-] | | Careful -- that statement is half true. It's true that no matter what symbolic representation format you choose (binary or otherwise) it will never be able to encode all irrational numbers, because there are uncountably many of them. But it's certainly false that computers can only represent rational numbers. Sure, there are certain conventional formats that can only represent rational numbers (e.g. IEEE-754 floating point) but it's easy to come up with other formats that can represent irrationals as well. For instance, the Unicode string "√5" is representable as 4 UTF-8 bytes and unambiguously denotes a particular irrational. | | |
| ▲ | andrewflnr 4 hours ago | parent | next [-] | | I was careful. :) > representable in a finite number of digits or bits Implying a digit-based representation. | | |
| ▲ | jamster02 43 minutes ago | parent [-] | | > the Unicode string "√5" is representable as 4 UTF-8 bytes As the other person pointed out, this is representing an irrational number unambiguously in a finite number of bits (8 bits in a byte). I fail to see how your original statement was careful :) > representable in a finite number of digits or bits |
| |
| ▲ | cozzyd 5 hours ago | parent | prev [-] | | Or use pieee-754 which is the same as iee-754 but everything is mimtipled by pi. | | |
|
|
|
| ▲ | tantalor 14 hours ago | parent | prev | next [-] |
| Pick a digit, repeat, don't stop. |
| |
| ▲ | markusde 13 hours ago | parent | next [-] | | Exactly right. You can pick and use real numbers, as long as they are only queried to finite precision. There are lots of super cool algorithms for doing this! | | |
| ▲ | jibal 8 hours ago | parent [-] | | That's just saying that you can pick and use rational numbers (which are a subset of the reals.) | | |
| ▲ | skulk 5 hours ago | parent [-] | | Not really. You can simulate a probability of 1/x by expanding 1/x in binary and flipping a coin repeatedly, once for each digit, until the coin matches the digit (assign heads and tails to 0 and 1 consistently). If the match happened on 1, then it's a positive result, otherwise negative. This only requires arbitrary but finite precision but the probability is exactly equal to 1/x which isn't rational. | | |
| ▲ | jibal 2 hours ago | parent [-] | | No, it isn't ... an infinite expansion isn't possible. |
|
|
| |
| ▲ | jibal 9 hours ago | parent | prev | next [-] | | At no point will your number be transcendental (or even irrational). | | |
| ▲ | tantalor 7 hours ago | parent [-] | | That's why you can't stop. | | |
| ▲ | jibal 2 hours ago | parent [-] | | That's irrelevant. It's like saying that you can count to infinity if you never stop counting ... but no, every number in the count is finite. |
|
| |
| ▲ | techas 9 hours ago | parent | prev [-] | | And don’t die. |
|
|
| ▲ | mg 14 hours ago | parent | prev | next [-] |
| 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? |
| |
| ▲ | BeetleB 14 hours ago | parent [-] | | All floating point numbers are rational. | | |
| ▲ | zeroonetwothree 6 hours ago | parent | next [-] | | All numbers that actually exist in our finite visible universe are rational. | | |
| ▲ | 4 hours ago | parent | next [-] | | [deleted] | |
| ▲ | tsimionescu 3 hours ago | parent | prev [-] | | Not really. In all of our physical theories, curved paths are actual curves. So, (assuming circular orbits for a second) the ratio between the length of the Earth's orbit around the Sun and the distance between the Earth and the Sun is Pi - so, either the length of the path or the straight line distance must be an irrational number. While the actual orbit is elliptical instead of circular, the relation still holds. Of course, we can only measure any quantity up to a finite precision. But the fact that we chose to express the measurement outcome as 3.14159 +- 0.00001 instead of expressing it as Pi +- 0.00001 is an arbitrary choice. If the theory predicts that some path has length equal exactly to 2.54, we are in the same situation - we can't confirm with infinite precision that the measurement is exactly 2.54, we'll still get something like 2.54 +- 0.00001, so it could very well be some irrational number in actual reality. |
| |
| ▲ | jmgao 13 hours ago | parent | prev [-] | | Well, except for inf, -inf, and nan. | | |
| ▲ | Someone 13 hours ago | parent [-] | | and, depending on how you define the rationals, -0. https://en.wikipedia.org/wiki/Integer: “An integer is the number zero (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...)” According to that definition, -0 isn’t an integer. Combining that with https://en.wikipedia.org/wiki/Rational_number: “a rational number is a number that can be expressed as the quotient or fraction p/q of two integers, a numerator p and a non-zero denominator q” means there’s no way to write -0 as the quotient or fraction p/q of two integers, a numerator p and a non-zero denominator q. |
|
|
|
|
| ▲ | kridsdale1 13 hours ago | parent | prev [-] |
| Use an analog computer. Sample a voltage. Congrats. |
| |
| ▲ | why-o-why 13 hours ago | parent | next [-] | | Sample it with what? An infinite precision ADC? This is how old temperature-noise based TRNGs can be attacked (modern ones use a different technique, usually a ring-oscillater with whitening... although i have heard noise-based is coming back but i've been out of the loop for a while) | | |
| ▲ | rcxdude 5 hours ago | parent [-] | | Well, sampling is technically an analog operation that is separate from the conversion operation that makes the result digital. But then analog circuits don't ever actually hold a single real number, in practice there is always noise and that in practice limits the precision to less than what can be fairly easily achieved digitally. |
| |
| ▲ | 10 hours ago | parent | prev | next [-] | | [deleted] | |
| ▲ | jibal 8 hours ago | parent | prev [-] | | Use an analog computer how, to do what? An analog computer can do analog operations on analog signals, but you can't get an irrational number out of it ... this can be viewed as a sort of monad. |
|