The cursed d65536
aleph.se
aleph.se
[1] http://www.techfreakz.org/2600faq.html#redbox
[2] https://hackaday.com/2004/09/05/radioshack-phone-dialer-red-...
You could build a red box, pink box, blue box, and others by modifying a standard tone dialer. The easiest thing to do was to add a fourth column of keys, which supposedly gave you the ability to use the ABCD digits required for military networks. I never tried that, though.
For those of you who missed out on that era, a tone dialer was a little palm-sized box that had a small Touch Tone keypad on one side, and a speaker on the other. If you had a rotary phone, after dialing, you could hold it up to the mouthpiece and use many of the fancy features that came with the invention of Touch Tone, like using FŌN cards, or listening to your messages on your answering machine.
If the D65538 is fair, it is usable: you just discard the two unwanted values when they show up and roll again. Those faces could be labelled as "roll again".
If you have a uniform source of random numbers from 1 to N, you can get a uniform distribution from 1 to M < N simply by discarding values obtained above M. Those values are just "rain that fell elsewhere".
(The usual definition of that space via “cylinder sets” may seem contrived, but it’s usually introduced first because it’s “elementary” in that it does not require developing the machinery of limits of [not in] probability spaces. Those can be made to work, though, and then you can say that the space of infinite strings is the limit of the spaces of length-n strings for n → ∞ and obtain the same thing. In fact, the cylinder-set definition is essentially the limit definition with the notion of limit inlined.)
If you're working with real numbers, then your step counter is a natural number, you repeat for[2] infinitely many steps, and the probability of failure is exactly zero.
If, on the hand, you're working with surreal numbers - which you would have to be for "infinitely small (but non-zero)" to make sense - then your step counter is a ordinal number[1], not a natural, and you repeat for[2] non-well-foundedly many steps (one for each ordinal), after which the probability of failure is again exactly zero. (Otherwise it would be the reciprocal of some surreal number, that is less than some ordinal, and for any ordinal, you can show that you tried a well-founded number of times that is nonetheless strictly greater than it.[0])
The more existent problem is that you can't put any useful upper bound on how many rerolls you'll need, which is terrible for constant-time algorithms, and particularly for cryptography.
0: And you actually only need two to the power of the number of tries to be greater, since the failure probability of one sample is at most 1/2, so the probability after K tries is at most 1/2^K.
1: ie, a positive whole surreal number, rather than a positive whole real number
2: Technically, you repeat for up to but not including that many, since you're guaranteed to terminate by then.
> 1: ie, a positive whole surreal number, rather than a positive whole real number
Actually, ordinals have some additional contraints besides just "positive" and "whole" (eg ω−1 is not a ordinal), that just reduce to "positive whole" in the case of reals, although that doesn't change the actual point any.
The issue, as far as I understand it, is that LuaJIT only handles traces of two shapes: linear code; or linear loop prologue followed by linear loop body. The conditions of any branches (that could not be determined statically) are evaluated and checked against their tracing-time values, but a failed check (“guard”) throws you out of the compiled trace and back into the interpreter. This includes normal termination of a loop and misspeculated types as well as explicit conditionals.
Of course, handling only these two patterns of control flow is too limiting, so if a guard fails too often the trace compiler can start a new trace from that exit and tie its other end to the original one if it comes back. Aside from handling things like polymorphic functions which get called for more than one combination of types and predictable branches in loops that still get taken occasionally (but too rarely for unrolling), this also turns out to handle nested loops (as explained somewhere in the docs): the inner loop get traced first as a loop, then the outer loop body gets traced as a linear block that ties the end of the inner one back to its beginning, going around from the middle of the outer loop to its end, then from the beginning of its next iteration to the middle.
The catch is that register allocation or optimizations can’t see across trace boundaries, so those side traces get second-class treatment (in particular, only the inner loop gets subjected to loop-invariant code hoisting and strength reduction, as the outer ones are not viewed as loops). Additionally, the part that decides what to trace and how (is it a loop, is it hot, should it be unrolled, etc.) is an opaque pile of heuristics which is generally well tuned, but gets more confused and slower to converge as the nesting level increases.
Turns out having your innermost loop be rejection sampling which usually terminates quickly (under the unrolling threshold) but with a varying number of iterations, in a raytracer that’s already bound to have two or three levels of nested loops, plays merry hell on all of this. Occasionally LuaJIT couldn’t eliminate the GC in the now-“outer” loop and ran 5x slower, occasionally it just fell back to the interpreter and ran 20–100x slower, but generally I think that counts as a failure when the motivation is to avoid libm because it’s slow.
(For similar reasons, the small-vector library used there is almost entirely sad repetitive code along the lines of
c.x = f(a.x, b.x)
if one component then return c end
c.y = f(a.y, b.y)
if two components then return c end
...
because that does not count against the thresholds when you have dozens of these operations per actual iteration.)even better, you can round the top and bottom. Either by semi spheres or pointy like a pencil tip. Then chances of "roll again" hitting would be really low!
Although hex D16s would probably be better.
D20s with 0-F plus two extras could be pretty awesome in a cyberpunk tabletop game. The other two could be "IOError" that makes the matrix glitch in a bad way, and superposition, that makes it glitch in a way you can use.
This should have tipped you off. If you have six triangular faces around every vertex, you have a flat Euclidean plane, not a sphere with positive curvature.
For another example of this: https://m.youtube.com/watch?v=jfSTwqmrQDc
What if the triangles are all congruent but not equilateral? Can that even happen? That’s a fun one, so I won’t spoil it.
I think that’s the only way to do this, but maybe there are more. Could we get a hyperbolic plane this way? Normally you squeeze extra triangles around each vertex to do that so I doubt it but maybe.
Is there, like, 99designs for physics questions? I'd happily pay $99 for the answer, then post it here like I worked it out myself.
1in diameter, however, gives 0.175mmx0.175mm per face, or about the width of a hair by the width of a hair.
If you really want to do it in one throw, you don't really need to color them all differently, though. Just read them in a specified way, i.e. always from left to right and top to bottom. (You don't even have to always read them the same way as long as how you read them is completely independent from what their faces show.)
https://www.amazon.com/Lanema-Polyhedral-Dungeons-Dragons-Si...
With hex dice you can generate 16 bits with four rolls, four bits each time.
Obviously you're more likely to already have a D6 somewhere, but then you're even more likely to own a coin, and 16 coin tosses is also an effective way to generate a 16-bit number.
I'm not sure this is still true. At least not here in Sweden. Everyone I know owns multiple board games which come with at least one D6 and in recent years I've had discussions with friends and family about us paying everything electronically nowadays. There has even been talk about the risk to our society of no one having cash anymore.
In fact, some weeks ago I needed a coin to show my kids when they asked about this physical money they'd heard of and I couldn't find one.
[0]https://www.popularmechanics.com/space/a27259/how-many-parti...
https://www.wired.com/2016/05/mathematical-challenge-of-desi...
My mathematical intuition is that the probability of stopping on a face depends on the extent that nearby faces slow a rotation, which depends on the angle of attack across each face. Without symmetry, this will vary by face.
Well, 2^16 = 65536, so it's a 16-bit number. To get a random 32-bit number you'd need to roll more than once....
https://healpix.sourceforge.io/
You can't make a d65536 with it but you can make a 74^2 * 12 = d65712.
GP_III(27, 166), GP_III(38, 159), GP_III(41, 157), GP_III(102, 107)
each have 4 triangles and 65532 hexagons. Most small regions of them would look roughly like the XKCD.