David Cary
Reputation
1,100
Top tag
Next privilege 2,000 Rep.
 Aug18 comment Simulate repeated rolls of a 7-sided die with a 6-sided die @Daenyth: Huh? I see 35 non-X possibilities, 5 of them result in a 7, which gives the correct desired probability of 5/35 = 1/7 chance of resulting in a 7. Aug18 comment Simulate repeated rolls of a 7-sided die with a 6-sided die @cHao: Yes, sometimes we want exactly one fair 1d7 value, and you're right that it's impossible to do that with only 1 roll of a 1d6 dice -- we need at least 2, sometimes more, and andre shows an excellent algorithm for that case. However, if we want several hundred independent and fair 1d7 values, it is (theoretically) possible to derive those values from (on average) log(7)/log(6) =~ 1.09 rolls of a fair 1d6 die per desired 1d7 value. However, the algorithm to do that is complex and more difficult to prove that it gives fair, independent 1d7 values. May2 comment Platonic solids and charged particles @LeeMosher: Min-Energy Configurations of Electrons On A Sphere says that N = 16 electrons has 2 local minima, but only one of them is the unique global minimum. Apr28 comment A function such that $f(f(n)) = -n$? @JackAidley: You are technically correct, but many people (apparently including corsiKa) still call the leftmost bit in signed 32-bit integers in practically all modern computers "the sign bit", even though it acts differently than the "real" sign bit in early Cray mainframes. Aug13 comment Which is better, odd/even Hamming codes or extended Hamming code? @JyrkiLahtonen: I'm looking at one protocol with about 32 data bits per packet, and another protocol with about 4096 data bits per packet. Aug13 comment Which is better, odd/even Hamming codes or extended Hamming code? @JyrkiLahtonen: (a) I suspect that every kind of Flash memory has the same vulnerability as DRAM -- cosmic rays, draining stored charge in a small region of the chip. Hopefully I can arrange things so that any single stored codeword has its bits spread far enough apart that any single cosmic ray, although damaging dozens of physically nearby bits, will only damage one bit per codeword. So I hope that the Hamming codes used in DRAM ECC memory will work just as well for flash memory. Aug13 comment Which is better, odd/even Hamming codes or extended Hamming code? @JyrkiLahtonen: Yes, I see that "the extended Hamming code" offers more robust protection than "the odd ECC word" alone. However, it is not obvious to me whether "the extended Hamming code" is more or less robust than "the odd+even Hamming code" ("the odd ECC word" and "the even ECC word"). If you could say a few words about why the extended Hamming code is more (or less) robust than "the odd+even Hamming code", I would be happy to accept that as an answer. Apr26 comment Probability of the sum of n numbers giving the same last d digits Practical application: When the transmitter adds d check digits or b bits of checksum to a message, what is the probability that the receiver will (incorrectly) fail to detect any errors in a random message? Mar2 comment Find points along a Bézier curve that are equal distance from one another @Kenpachi: The Babylonian method gives you a bunch of "t" values. The x,y coordinates on the curve at any t is given by plugging that t value into the Bezier function B(t). For example, if we want the x coordinate at t=0.1 of a typical cubic Bezier curve with control points P0, P1, P2, P3, we calculate B_x(0.1) = (1-0.1)^3*P0_x + 3*(1-0.1)^2*(0.1)*P1_x + 3*(1-0.1)*(0.1)^2*P2_x + (0.1)^3*P3_x. Feb13 comment How do I find a Bezier curve that goes through a series of points? The design guys are not the problem. The problem is that nearly every 3D CAD package stores curves in its own proprietary binary 3D file format. They are happy to "export" their designs to some other format, but apparently their only choices are (a) some other proprietary binary file format, or (b) a STL made of thousands of tiny flat triangle facets. Jan21 comment Conventional ordering of faces of regular polyhedron? You may be interested in "What is the best way to pixelize a sphere?" by Max Tegmark -- see Wikipedia: quadrilateralized spherical cube and Wikipedia: geodesic grid. Aug21 comment Can prefix code always achieve optimal data compression? @MJD: I think what he's asking is: Does there exist a character code that gives better compression than any prefix code? A proof that, among all possible prefix codes, Huffman is optimal, doesn't resolve this question one way or the other. Jul19 comment Is this valid parametric equation to create control points for a helix in 3D space? @ChuckFernández: I think that was a simple typo; fixed now. Dec19 comment Boggle letter probability +1 Good points. If your first approximation tells you to put 'A' on 6 faces, I suspect you don't want to paint all six faces of one die with the letter 'A'. That would make it impossible to form words with more than one 'a' in them, such as "attack". Dec10 comment Terminology, mapping a tree to a tree This reminds me a little bit of some implementations of the rope data structure, where each non-leaf node stores pointers to the left-part and the right-part of the string it represents, and also stores the weight of the "string" it represents (the total of the weight of the left-part and the right-part), and several different ropes can share some of their leaves and (in some cases) a few of their non-leaf nodes. Dec10 comment Terminology, mapping a tree to a tree This reminds me a little bit of a Huffman tree -- the "frequency value" of each non-leaf node in that tree is the sum of the "frequency value" of both of its immediate children, and it is also equal to the sum of all the "frequency values" of every leaf directly or indirectly descended from that non-leaf node. Jun12 comment RSA: is it easy to find the public key from the secret key? Even if you don't know p or q, if you have the private key (n,d), the public key (n, e) is usually (n, 65537). Even when e is not 65537, e is almost always a small number (compared to d), so it almost always takes a short amount of time to find e by brute force testing all possible values. Jun12 comment RSA: is it easy to find the public key from the secret key? +1 Yes, exactly. Typically the primes p and q are stored in the secret private key file. The public key (n,e) is trivial to calculate from that: n = pq, and e is usually fixed at 65537. Apr6 comment What constants do I need to create this specific logarithmic spiral? Sounds fascinating. Please post a link to the first visualization you post online, even if the first version doesn't look pretty to you. Sep27 comment Distributions of point charges @Rahul : Thank you. fixed.