Posts for OmnipotentEntity

Experienced Forum User, Published Author, Player (36)
Joined: 9/11/2004
Posts: 2624
I'm having difficulty finding a satisfactory answer to a question I came up with, and I'm wondering if you guys would be of help. So we've all heard about the 12 ball problem (right?), where you have 12 balls, one is the odd ball, it might be heavier or lighter, and your job is to find the odd ball and tell me if it's heavier or lighter, and you only have a balance scale that can indicate if the two arms are balanced or if they're not which tray is heavier. There's a reasonably good information theory way to analyze this result. There are 24 possible states, so the total entropy is log_2(24) = 4.585 or so bits. Because the balance gives three possibilities, the best possible method would be to maximize the entropy gain at each step, which you can roughly do by arranging the balls to give you 1/3, 1/3, 1/3 probability (or as close as possible) with each weighing. This gives a lower bound of log_3(24) weighings = 2.893. So best case scenario you would be able determine the unique case out of 24 with only 3 weighings, and in fact, you can achieve this. What I'm trying to find is an analogous version of the problem where there are 2 odd balls out of 18. The odd balls can be any weight, they do not have to be the same. They can be the same or different. So there are 7 total distinguishable cases: both heavier same magnitude, both heavier different, (same with lighter), and then one heavier one lighter x3 (H bigger, L bigger, same). However, if you're selecting from these 7 cases to simulate, because order matters in case where the balls are not identical, there are 12 total ways to choose these two balls. So the total possible beginning states is 12 * 18C2 = 10.842 bits of entropy. The best we can do is the same 1/3, 1/3, 1/3, but now hidden state matters a lot. In theory this should be possible in 7 weighings because log_3(12 * 18C2) = 6.841 or so It should be noted that log_3(12 * 19C2) = 6.942 or so, which means that it might be possible to do 19 balls in 7 weighings as well, but I went with 18 because something similar happens in the one ball case between 12 and 13, it has to do with not being able to get perfect 1/3, 1/3, 1/3 probabilities. So I went with 18 because of that and because it has a nice factorization for this problem. Is 7 weighings actually achievable in this problem? If so, what would be the strategy? And then for me: what's the best way to keep (non-redundant) track of the probabilities of the various hidden states? I tried just keeping them in a matrix, but a lot of the possibilities seem to overlap, and I was constantly finding myself double counting things.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Experienced Forum User, Published Author, Player (36)
Joined: 9/11/2004
Posts: 2624
I'm looking into some PPL (probabilistic programming language) stuff, and as part of that I'm trying to come up with approximations of the results of various functions applied to distributions. For instance, let's say I want to apply the sigmoid function 1/(1+e-x) to a normally distributed random variable. We can solve for the cdf of this distribution by feeding the inverse of the sigmoid through the cdf of a normal distribution. From this we wind up with a reasonably complicated distribution on (0, 1). I'd like to estimate this distribution with a beta distribution, but I have no idea how to go about it. Although I have an expression of the pdf of the resulting distribution, I cannot even calculate the expectation value of it. Outside of SVI or Monte Carlo methods is there a way to calculate this?
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Experienced Forum User, Published Author, Player (36)
Joined: 9/11/2004
Posts: 2624
The most popular and mature bignum library has this documentation about their integer division algorithms: https://gmplib.org/manual/Division-Algorithms.html
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Experienced Forum User, Published Author, Player (36)
Joined: 9/11/2004
Posts: 2624
For future reference, in EE that operation (the reciprocal of sums of reciprocals) has a shorthand notation in somewhat common use: A || B It has all of the properties that you would expect of an infix operator over the complex plane: it's commutative, associative, and follows the distributive property. A || B = B || A (A || B) || C = A || (B || C) C (A || B) = AC || AB It's also not just a coincidence that all of these problems have the form of sums of reciprocals.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Experienced Forum User, Published Author, Player (36)
Joined: 9/11/2004
Posts: 2624
Dang! Hats off to you! Thanks for the translation.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Experienced Forum User, Published Author, Player (36)
Joined: 9/11/2004
Posts: 2624
The name of the run is "Door timer carry over NG+RTA" The first three text boxes are: "After peeking into the door timer save data... a new game start!" "Cut the OP after NEW GAME by looking at the OP in advance." "First, setup configuration. Open configure and set as follows Active, 6, 1, Cursor position remember During this operation, the remaining count of DOORTIMER will be 0f" I stopped after this, because I'm very bad at Japanese, and it was taking a long while to look up kanji.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Experienced Forum User, Published Author, Player (36)
Joined: 9/11/2004
Posts: 2624
Nickolas wrote:
OmnipotentEntity wrote:
(In actual reality, the force you feel due to acceleration is parallel to the direction of acceleration, whereas the force due to a massive body is radial to the body, so you will experience tidal forces which can be detected (if the body is under you, then your feet experience slightly lower acceleration than your head, so you are stretched by this imbalance of forces, and the force on your left arm is down and to the right, whereas the force on your right arm is down and to the left, squeezing you slightly left to right.) However, if you were to construct an infinitely large flat massive surface then gravity and acceleration would be indistinguishable, even in principal.)
If I'm not mistaken, Lorentz contraction means there's an acceleration gradient along the length of an accelerating object. (See this blurb on Rindler Observers.) That is, both gravitational and non-gravitational acceleration result in tidal forces, making them indistinguishable in this regard.
It seems like that would work in reverse though. The Lorentz contraction squeezes you, while the tidal forces in GR stretch you.
Warp wrote:
I must admit that rather than clarifying, this discussion only made me more confused about whether my original assertion is "correct" or not.
According to pwn3r, It seems to depend on convention used. But at the end of the day, the accelerometer is measuring an EM restorative force, because it cannot in principal measure a gravitational one.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Experienced Forum User, Published Author, Player (36)
Joined: 9/11/2004
Posts: 2624
It is not. You seem have a fundamental misunderstanding about the relationship between gravity and acceleration as it pertains to general relativity. The actual idea is that gravity and acceleration are indistinguishable within the context of general relativity (in general), Einstein called this idea the "principal of equivalence." (In actual reality, the force you feel due to acceleration is parallel to the direction of acceleration, whereas the force due to a massive body is radial to the body, so you will experience tidal forces which can be detected (if the body is under you, then your feet experience slightly lower acceleration than your head, so you are stretched by this imbalance of forces, and the force on your left arm is down and to the right, whereas the force on your right arm is down and to the left, squeezing you slightly left to right.) However, if you were to construct an infinitely large flat massive surface then gravity and acceleration would be indistinguishable, even in principal.) If the accelerometer says zero acceleration then you are in free fall and accelerating towards the nearest massive body at whatever amount the force divided by your mass says you should, because it is exerting a force on you that isn't being checked in any way. That being said, in your example, the accelerometer is actually accelerating as it rotates with the surface of the Earth, but it is not accelerating in the motion that it will read, which is in the direction due to the force of gravity. Accelerometer is a bit of a misnomer, because what is actually being measured is the force experienced by the thin silicon capacitive MEMS This force can be from gravity, or it can be from the base of the chip acting upon the MEMS to accelerate it when their relative velocities are different.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Experienced Forum User, Published Author, Player (36)
Joined: 9/11/2004
Posts: 2624
I'll assume the second, release enough energy such that the gravitational binding energy is overcome. This amount of energy is 2.487 x 10^32 J, which corresponds to 2.767 x 10^15 kg of antimatter. The earth has a mass of 5.972 x 10^24 kg, so if only roughly 1 particle in 2 billion in Earth is replaced by an antiparticle the resulting explosion would be enough to overcome the gravitational binding energy and destroy the planet forever.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Experienced Forum User, Published Author, Player (36)
Joined: 9/11/2004
Posts: 2624
I think you're misunderstanding his point Warp. The explosion is caused by rapid heating of the air in your scenario. In p4wn3r's scenario it's that and the sublimation of ice, both contribute to the effect. Considering that at boiling temperature the expansion of ice into steam is roughly a factor of 1000, it's entirely plausible that it has a noticeable effect. Remember that in your scenario the "airburst" is simply due to non-chemical heating and expansion of the air after being compressed by the meteor. This might result in a factor of at most 100x? (Though over a potentially larger volume of air to begin with.)
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Experienced Forum User, Published Author, Player (36)
Joined: 9/11/2004
Posts: 2624
You are correct that it does not hold for all cases. But it does hold for this case. So let's talk about it. When does sqrt(wz) = sqrt(w)sqrt(z) and when does it not. Complex numbers are of the form r e with r and θ real, and where the arg(z) = θ is periodic on 2π. (ie, e = ei(θ + 2kπ) with Integer k). And where θ itself is in (-π, π]. This last part seems as if it doesn't matter, because it's periodic on 2π, but we use it by convention that this is the "true" value of θ because it gives us a single, unambiguous representation. This means that for any complex number z (except 0), that sqrt(z) has two distinct possible values. sqrt(z) = sqrt(r e) = sqrt(r) sqrt(e) = sqrt(r) sqrt(ei(θ + 2kπ)) = sqrt(r) ei(θ/2 + kπ) Because the exponent of a general complex number is periodic on 2π, but this complex number is periodic on π, there are two different values that this number is oscillating between, depending on which representation is chosen. But we demand that the sqrt have only a single value. We want these things to be functions. So we've defined sqrt(z) to be the value of z with the smaller magnitude theta. The one that has a value on (-π/2, π/2]. This is called the principal sqrt. So when does sqrt(wz) = sqrt(w)sqrt(z)? When the arg(sqrt(wz)) = arg(sqrt(w)sqrt(z)). arg(sqrt(wz)) = arg(sqrt(w)sqrt(z)) arg(sqrt(rw ew rz ez)) = arg(sqrt(rw ew) sqrt(rz ez)) arg(sqrt(rw rz) sqrt(ei(θw + θz))) = arg(sqrt(rw) sqrt(ew) sqrt(rz) sqrt(ez)) arg(sqrt(ei(θw + θz))) = arg(sqrt(ew) sqrt(ez)) arg(ei(θw + θz)/2) = arg(sqrt(ew/2) sqrt(ez/2)) (θw + θz + 2πk)/2 = θw/2 + θz/2 In this last line (θw + θz + 2πk)/2 represents the arg of the combined sqrt. This value is constrained to (-π/2, π/2] because it's the direct output of the sqrt operation. The k may be -1, 0, or 1 depending on if θw + θz is on the range (-π, π] (so k = 0), or if the addition moved the total off of the canonical range and it is strayed into (-3π, -π] (so k = 1), or (π, 3π] (so k = -1). However, θw/2 + θz/2 does not require fixup, it is composed of addition of two values on the range (-π/2, π/2] so it has a range (-π, π]. So ultimately, if arg(w) + arg(z) = arg(wz) then sqrt(wz) = sqrt(w)sqrt(z). Otherwise, the value found of the will not be the principal sqrt. It will be the the value of the second branch and differ from the principal by a factor of e = -1.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Experienced Forum User, Published Author, Player (36)
Joined: 9/11/2004
Posts: 2624
sin(pi) is a zero. Just like harem anime protagonists. SHOTS FIRED.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Experienced Forum User, Published Author, Player (36)
Joined: 9/11/2004
Posts: 2624
Yes, but getting rid of the nested radical will introduce one of two things that you might find less pretty. sqrt(4 - 2 sqrt(2)) = sqrt(sqrt(2) (2 sqrt(2) - 2)) = 2^(1/4) sqrt(2 sqrt(2) - 2) Let's consider just the number sqrt(2): sqrt(2) = sqrt(-(-2)) = sqrt(1 + i - i + 1) = sqrt((1 + i)(1 - i)) = sqrt(1 + i) sqrt(1 - i) So: 2^(1/4) sqrt(2 sqrt(2) - 2) = 2^(1/4) sqrt(2 sqrt(1 + i) sqrt(1 - i) - 2) = 2^(1/4) sqrt(-1 - i + 2 sqrt(1 + i) sqrt(1 - i) - 1 + i)) = 2^(1/4) sqrt(sqrt(-1 - i)^2 + 2 sqrt(-1 - i) sqrt(-1 + i) + sqrt(- 1 + i)^2)) = 2^(1/4) sqrt((sqrt(-1 - i) + sqrt(-1 + i))^2) = 2^(1/4) (sqrt(-1 - i) + sqrt(-1 + i)) And we've successfully removed the nested radical and we cannot simplify this further with radicals alone. However, we can simplify this farther if we introduce trig functions. sqrt(-1 - i) = (-1 - i)^1/2 = (sqrt(2) e^(-i 3pi/4))^1/2 = 2^(1/4) e^(-i 3pi/8) Similarly, sqrt(-1 + i) = 2^(1/4) e^(i 3pi/8) So: 2^(1/4) (sqrt(-1 - i) + sqrt(-1 + i)) = sqrt(2) (e^(-i 3pi/8) + e^(i 3pi/8)) = 2 sqrt(2) cos(3pi/8) = 2 sqrt(2) sin(pi/8)
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Experienced Forum User, Published Author, Player (36)
Joined: 9/11/2004
Posts: 2624
Svimmer wrote:
28:10 - This fight is still glorious. It wasn't explicitly discussed before (unless I missed it) but I'm assuming getting maxed-out skills would have required a huge amount of farming, if it's even possible. So this surely inherits my "yes" from before with all the loud bangs and occasional whistles. That easter egg is still weird...
AFAIK it's impossible to max out everything, the game limits the amount of experience you can get in a single level, and even if it didn't enemies do not respawn. In fact, each enemy has a name, and at the end of the game, you are treated to a list of every single person you killed.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Experienced Forum User, Published Author, Player (36)
Joined: 9/11/2004
Posts: 2624
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Experienced Forum User, Published Author, Player (36)
Joined: 9/11/2004
Posts: 2624
A direct computer search yielded several solutions for the dark mirror problem using 7 heroes with 2 charges. One such solution is: a -> b, a -> c, a -> d, e -> a, f -> a, b -> c, d -> b, b -> e, c -> d, c -> f, d -> g, f -> e, e -> g, g -> f This solution does not decompose into independent loops well. Notably, node a has three outgoing edges, and node g only has one. A search with the stipulation that out going edges were limited only to two failed to quickly find solutions. I'll have to leave it running longer to determine if any solutions are more symmetric.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Experienced Forum User, Published Author, Player (36)
Joined: 9/11/2004
Posts: 2624
Here's my full calculation: rendered version. EDIT: I figured out my mistake. I didn't substitute correctly and I dropped a critical factor of 1/2 in equation 14. now my result agrees with yours.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Experienced Forum User, Published Author, Player (36)
Joined: 9/11/2004
Posts: 2624
That involves a hell of a lot of calculation, unless I am quite mistaken. You eventually get down to the following cubic: 6z^3 - 6z^2 - 3z + 1 = 0 With the other two variables being equal to: (-z + 1 +- sqrt(-3z^2 + 2z + 3))/2 And when you find the only real root of the cubic you have: z = 1/6 (2 + cbrt(44 + 6 sqrt(26)) + cbrt(44 - 6 sqrt(26))) And the exact solution for x^4 + y^4 + z^4 is extremely long, but it's approximately 3.793.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Experienced Forum User, Published Author, Player (36)
Joined: 9/11/2004
Posts: 2624
Ferret Warlord wrote:
And here I was, after reading pwner's post, trying to use the tangent and secant functions for g and f and ended up with an even more convoluted integral. Thanks for the help, guys. Just FYI, The question that inspired this was, What two functions will trace an object moving along a hyperbolic path at a constant rate, much like how the trig functions trace a steady circle?
Oh neat! So it does! Did you need a method of calculating this using a computer? Or was this just idle curiosity?
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Experienced Forum User, Published Author, Player (36)
Joined: 9/11/2004
Posts: 2624
p4wn3r wrote:
sqrt(cosh 2u)du = dx So, if you could integrate sqrt(cosh 2u), you could invert this equation and write the answer. The problem is that the function is not elementary, so you'd need to use special functions.
This particular function actually has a pretty nice representation in special functions. integral(sqrt(cosh(2u) du) = integral(sqrt(1 - 2 sin2(iu)) du) = -i E(iu | 2) + C, where E is the Elliptic E function. So if we represent E(x | 2) as E2(x) then (where E2-1 is the inverse): u = -i E2-1(i(x + C)) So f(x) = cosh(-i E2-1(i(x + C))) and g(x) = sinh(-i E2-1(i(x + C))) If f(0) = 1 then (because arccosh(1) = 2k pi i where k element of Z) 2k pi i = -i E2-1(iC) -2k pi = E2-1(iC) C = -i E2(-2k pi) g(0) = sinh(-i E2-1(iC)) 0 = E2-1(-i E2(-2k pi)) E2(x) is non-zero for x != 0, so k = 0. So C = 0. So now we have an explicit, albeit difficult to use expression for f and g, namely: f(x) = cosh(-i E2-1(ix)) g(x) = sinh(-i E2-1(ix)) Plotted:
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Experienced Forum User, Published Author, Player (36)
Joined: 9/11/2004
Posts: 2624
The reason why the limit goes to sqrt(2)/2 is because the derivative equation requires that f'(x) = cos(u) and g'(x) = sin(u) for some u. This restriction also requires that f(x) = cosh(v) and g(x) = sinh(v) for some v. Because both derivatives cannot be zero, the functions must be either increasing or decreasing. Because of the first constraint, the functions need to approach each other asymptotically, so the derivatives have to also approach each other. The only point where sin(u) = cos(u) is at +- sqrt(2)/2. I don't believe that this differential equation has an elementary solution, but we can guess at what they might be related to. Because f(x) and g(x) are related to cosh(v) and sinh(v) and because they are asymptotically linear, this means that v must be a logarithmic-like function of x (in the limit, but not near 0). Because f'(x) and g'(x) are related to cos(u) and sin(u) and because they are asymptotically constant, this means that v must also be an asymptotically constant function of x that approaches pi/4.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Experienced Forum User, Published Author, Player (36)
Joined: 9/11/2004
Posts: 2624
y = 1 is also a solution.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Experienced Forum User, Published Author, Player (36)
Joined: 9/11/2004
Posts: 2624
From there it follows pretty easily that there exists real numbers that cannot be described in a finite amount of information. And that these numbers are the vast majority of all numbers.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Experienced Forum User, Published Author, Player (36)
Joined: 9/11/2004
Posts: 2624
Warp wrote:
OmnipotentEntity wrote:
Were you looking for a uniform distribution on the number of face up cards? You didn't specify.
Well, I did talk about "an evenly-distributed random number between 0 and 52"
Ah, so you did. I apologize for missing that. Well, you can generate a random number between 1 and 64 using two distinguishable d8. Then if the number is between 1 and 52 flip that many cards over and shuffle normally. (If not regenerate the random number.) (EDIT: This seems to be equivalent to what Masterjun wrote.)
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Experienced Forum User, Published Author, Player (36)
Joined: 9/11/2004
Posts: 2624
Warp wrote:
OmnipotentEntity wrote:
Wouldn't just shuffling the standard way, but flip one half of the deck each time, work?
Then you would get half of the cards face up, not a random amount of them.
Mathematically, yes. However practically, there is some variation between the deck halves, and the deck halves may not actually be halves. So you'll get a normal distribution of face up and face down cards, where each card has a 50/50 chance of being face up (but just because each probability is 50/50 doesn't mean you'll get exactly 26 face up cards.) Were you looking for a uniform distribution on the number of face up cards? You didn't specify.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.