Posts for HHS

1 2
14 15
HHS
Experienced Forum User, Published Author, Active player (286)
Joined: 10/8/2006
Posts: 356
Ah, should have thought of that! My idea was to apply the condition ¬(0 < a + wb < 1/k) repeatedly to get an ever increasing lower bound on w given an initial lower bound. By taking the limit of the resulting sequence, a new condition ¬(0 < a + wb < 1/(k - 1)) is constructed which is then applied in the same way, and so on, until we get to the point where the sequence diverges.
HHS
Experienced Forum User, Published Author, Active player (286)
Joined: 10/8/2006
Posts: 356
Had to think about this for a while. Obviously, inf A can't be negative, by definition. Suppose inf A equals some positive number c. For any solution w, it is clear that -w is also a solution, so assume that w is positive. Let q = ceil(1/c). Then for any a ∈ ℤ, b ∈ ℕ, a + bw > 0 implies a + bw ≥ 1/q, in other words w > -a/b implies w ≥ (1 - qa)/qb. Suppose we have that w > -a/b implies w ≥ (1 - ka)/kb for some k ∈ ℕ. If k = 1, then w is equal to (n - a)/b for some n ∈ ℕ. Otherwise, taking a = -(kn - 1)/(k - 1) - ukn and b = vkn, w > (kn - 1)/v(k - 1)kn + u/v implies w ≥ (kn+1 - 1)/v(k - 1)kn+1 + u/v for any n, u, v ∈ ℕ. By induction, this means that w > -a/b implies that either w equals some ((1 - (k - 1)a)kn - 1)/(k - 1)knb, or w ≥ (1 - (k - 1)a)/(k - 1)b. Since this is true for k = q, by further induction w must be rational, which is a contradiction.
HHS
Experienced Forum User, Published Author, Active player (286)
Joined: 10/8/2006
Posts: 356
x2 having a square root in R is a red herring and does not factor into the solution. zx2y = z(x2y) = (zx2)y = z(x2 + y) = (x2 + z)y = x2 + z + zy = x2 + y + zy. Therefore, y = z.
HHS
Experienced Forum User, Published Author, Active player (286)
Joined: 10/8/2006
Posts: 356
If it hangs, you will not see the value that gets printed, since the window does not update until the script blocks. This is the problem:
while movie.mode() ~= "finished" do
table.insert(dummyarray, joypad.get(1))
  end
You forgot to call emu.frameadvance().
HHS
Experienced Forum User, Published Author, Active player (286)
Joined: 10/8/2006
Posts: 356
Proof: The left side contains terms with only Aij's, terms with only wkBij's, and mixed terms. The terms with only wkBij's have an overall factor of wnk = 1. The mixed terms cancel out, as they get a factor of wmk with m not a multiple of n.
HHS
Experienced Forum User, Published Author, Active player (286)
Joined: 10/8/2006
Posts: 356
In a recent youtube video, the uploader presents a problem where you have 1000 drinks, 100 of which are poisoned, and a machine that can analyze a sample and tell if there's poison in it or not. The question is, what is the most efficient way (in terms of the number of measurements) to determine which drinks are poisoned? He then goes on to present "the solution", which consists of dividing the drinks into groups of 4 and measuring each group. Then, he reasons, because there is a 0,6561 chance of any of these groups of 4 being okay, we are left with 86 groups, in other words 344 drinks, to analyze one by one. We therefore need to make 594 measurements. He then proudly shows some graphs and mentions the word "optimal" a lot. What is the actual optimal solution, though? For the average case, I estimate that by measuring groups of 7, then groups of 3, then doing them one by one, you'll make roughly 560 measurements. If we want to minimize the worst case, the best I could come up with was doing groups of 3, and then doing them one by one, for 631 measurements in total. (Special case: if you end up with 100 positives in the first step, you'll at most need to make 200 additional measurements.) How close can we get to the theoretical minimum of 469?
HHS
Experienced Forum User, Published Author, Active player (286)
Joined: 10/8/2006
Posts: 356
After thinking about it, I just realized that my previous answer is wrong, it has diamonds in it. Got to think about it some more...
HHS
Experienced Forum User, Published Author, Active player (286)
Joined: 10/8/2006
Posts: 356
The answer to Patashu's brother's puzzle is (X+1)(X+2)/2. Proof: (1) If there exists a hero who can not be countered by another hero whom he can not also counter, the villain wins. (2) The villain can always reduce the number of heroes who can counter any chosen hero by at least 1, by copying someone who can counter another hero who can counter that hero, who according to (1) must exist. (3) Therefore, with X rounds remaining, each hero must be able to be countered by X other heroes, none of which can be countered by that hero or by any common hero. (4) That means each hero must be part of X transitive cycles of 3 or more heroes each. (5) No two heroes can be part of more than one cycle of 3 heroes, otherwise one of them can be countered by multiple heroes who have a hero in common who can counter them, which contradicts (3). (6) Starting from a minimal solution for X rounds of size (X+1)(X+2)/2, we can therefore construct a solution for X+1 rounds by introducing X+2 additional heroes and linking each existing hero with an unique pair, with the lower numbered hero being able to counter the higher numbered hero. No solution can be constructed with fewer than X+2 additional heroes. Example for X=3:
  ABCDEFGHIJ
A  x x  x
B   xx  x
C x   x  x
D     xxx
E x    x x
F  xx     x
G        xxx
H x       xx
I  xx      x
J    xxx
HHS
Experienced Forum User, Published Author, Active player (286)
Joined: 10/8/2006
Posts: 356
Beware, two of the a, b, and c's will be complex. They should in fact be the other two roots of the cubic equation.
HHS
Experienced Forum User, Published Author, Active player (286)
Joined: 10/8/2006
Posts: 356
I love those answers! Assuming he doesn't rectify the problem however, the answer is 264. That would be every 12/143 hour, except for the times where the hands are at the same position, which is every 12/11 hour.
HHS
Experienced Forum User, Published Author, Active player (286)
Joined: 10/8/2006
Posts: 356
That's right, in the digging game there is 1/8 chance each of getting 1 rupee, 5 rupees, 20 rupees or a magic refill. After 25 holes there is also 1/8 chance of a heart piece. In the chest game that has the heart piece, there is 1/8 chance of getting it, doesn't matter if it is the first or second box.
HHS
Experienced Forum User, Published Author, Active player (286)
Joined: 10/8/2006
Posts: 356
Ah, I see what's going on. As long as the spell finishes after you've gone through the door, the orb event will take priority over the room event.
HHS
Experienced Forum User, Published Author, Active player (286)
Joined: 10/8/2006
Posts: 356
Does this work on English too? I can't get it to work for some reason. I'd like to see an emulator movie.
HHS
Experienced Forum User, Published Author, Active player (286)
Joined: 10/8/2006
Posts: 356
7E0FA0 is unrelated, but 7E0FA1 is indeed involved in random number generation, which is quite simple:
lda SLHV
lda OPHCT
adc FrameCounter
adc Random
sta Random
In other words, the current horizontal pixel counter is added to the frame counter along with the whatever the carry flag is set to, and the previous random value is added, again along with the carry from the last addition. Because the horizontal pixel counter is used, the results can be hard to predict and you'll just have to experiment to get the value you need. The RNG is used for a lot of things: - the chest games - bee movement - archer game - Sand Crab walk length and direction - where fireball Zoras surface - how far Zora King throws Octoroks - where Lanmolas surface - rat/grasshopper movement direction - Rope movement direction - Keese turning direction - Popo walk length and direction - where Toppo appears - green soldier walk length - green soldier turning - spear soldier walk length and direction - witch stirring speed - bottle man animation - medallion tablet debris position - whether or not to uncover powerups behind grass, bushes and rocks on the overworld - what type of random powerup to find - Hokkubokku initial direction - green soldier initial direction - luck after tossing rupees into pond - enemy drops - whether or not to uncover a trap on the overworld - digging game - about a zillion other things
HHS
Experienced Forum User, Published Author, Active player (286)
Joined: 10/8/2006
Posts: 356
Erm… what the hell is a PAL 3DS? I thought the 3DS was a handheld...
HHS
Experienced Forum User, Published Author, Active player (286)
Joined: 10/8/2006
Posts: 356
Can you construct an algorithm that, given a set A, an integer N, and a set B of subsets of A with cardinality less than or equal to N, produces a set C of subsets of A of cardinality less than or equal to N, such that each element in B is a subset of an element in C, and C has the lowest possible cardinality?
HHS
Experienced Forum User, Published Author, Active player (286)
Joined: 10/8/2006
Posts: 356
Another detail to note: - When not inside either rising floor section, the background Y scroll position equals the foreground Y position multiplied by 3/16, and the X scroll position is 0. - When in Knuckles' section, the background scroll position equals the foreground scroll position minus ($1E0, $3580). - When in Sonic's section, the background scroll position equals the foreground scroll position minus ($8F0, $3200). - After passing Sonic's section, the background Y scroll position equals the foreground Y position minus $500, then multiplied by 3/16, and the X scroll position is 0. The parallaxing part of the background is $200 pixels high. and is always loaded from X position 0.
HHS
Experienced Forum User, Published Author, Active player (286)
Joined: 10/8/2006
Posts: 356
Here is how the rising floor in MGZ2 works: Collision with the background is initially disabled. When the player's Y coordinate is between $80 and $180, you enter and leave Knuckles' rising floor section through X coordinate $3800, making the floor solid as long as the player is not above Y coordinate $100 and to the right of X coordinate $3C00. Similarly, when the player's Y coordinate is between $800 and $900, you enter and leave Sonic's rising floor section through X coordinate $34C0. When the player's Y coordinate is less than $800 and the X coordinate is greater than or equal to $3900, the floor is deactivated, and gets reactivated again when the Y coordinate is greater than $800 and the X coordinate is greater than or equal to $3A40. Sonic's section starts rising when the player is below and to the right of position $36D0, $A80, by 6/16 pixels per frame for a total of $1D0 pixels. After reaching X position $3D50, it will rise at 1 pixel per frame. Knuckles' section starts rising when the player is below and to the right of position $38A0, $400, also by 6/16 pixels per frame, for a total of $220 pixels. When the player is to the right of and above position $3C80, $200, it too will start rising at 1 pixel per frame. So this basically means you have to make sure you go up above Y position $80 while you are to the left of X position $3800 to have the floor remain nonsolid. You can track which section you are in with the word at $FFEED2. 0 means that you are not in either floor section. 4 means that you are in Knuckles' section, and 8 means you are in Sonic's section. Edit: $FFEED4 tracks the amount of pixels that the floor has risen. If you're coming from the right you can deactivate the floor by entering the bonus stage.
HHS
Experienced Forum User, Published Author, Active player (286)
Joined: 10/8/2006
Posts: 356
Here is a small and most likely useless glitch I just found. If you throw a boomerang and then immediately use the hookshot, you'll overwrite the boomerang's original direction with the hookshot's slot index, which both use the variable 7E039D. With this you can make the boomerang go off screen instead of bouncing back as it normally does, and the location of the spark as it hits a wall will be affected as well. Some other random fun facts I've discovered: - It is possible to escape from a Devalant by tapping R. - The hookshot has the ability to take you to the lower floor, but this feature is not used. It is unclear what was meant to trigger this. - The upper and lower levels of a room may reside in one plane or two, controlled by 7E044A. When 01, each level uses its own plane, and when 02, they both share the same plane. There is also an unfinished third type of room, with 7E044A being 00. In this mode, jumping from a ledge or a pool ladder (or using the hookshot, if it were possible) would change the current room variable to the one south of where you are. Perhaps it was originally meant to actually load a new room? Walking down stairs does not change the room, even though a specific kind of stairs is required to set this mode in the first place. - The blue sword soldier will cause dramatic music to play when placed in Kakariko village, just like the spearman who comes when you talk to the scared girls. - An arrow or spear fired by enemy soldiers can be shot down with silver arrows.
HHS
Experienced Forum User, Published Author, Active player (286)
Joined: 10/8/2006
Posts: 356
I immediately recognized many of the SNES ones, but most of the NES ones are from games I haven't played.
HHS
Experienced Forum User, Published Author, Active player (286)
Joined: 10/8/2006
Posts: 356
It sure does. We can write the above as: For odd N, this equals FN/LN, while for even N, it is LN/5FN. Anyway, it seems that the way to compute the integral is to make the substitution u = tan(ω/2), getting: Now, what about the probability of the guy M spaces to your right winning? This should be obtainable by multiplying each term in the sum or integral by , or cos Mω, respectively. Edit: Oh, I see, it was answered above for an infinite number of statisticians, and it can be written simply as . Edit 2: Ok, it's obviously , so FN-2M/LN for odd N, and LN-2M/5FN for odd N.
HHS
Experienced Forum User, Published Author, Active player (286)
Joined: 10/8/2006
Posts: 356
For this week's problem, I got an answer of 5/11 (the ones to your side have 2/11 chance each, and the ones furthest from you have an 1/11 chance). If there are N statisticians, we can calculate your chance of winning as . There is probably a better way of solving this that doesn't involve trigonometry, although I can't think of any. For an infinite number of statisticians, one would have to compute , which I don't know how to do. Another approach I tried ended me with having to solve the differential equation with f tending to 0 at infinity, and taking f(3) as the answer, but that one too seems hard.
HHS
Experienced Forum User, Published Author, Active player (286)
Joined: 10/8/2006
Posts: 356
I think the best one can do is 750. First, take 1000 bananas and leave 500 in the middle. Then, take 1000 bananas and leave 250 at the 3/4 way point. Then take the rest to the market, along with the bananas you left.
HHS
Experienced Forum User, Published Author, Active player (286)
Joined: 10/8/2006
Posts: 356
Oh crap, didn't see that. I gave up after checking 31, thinking I was completely on the wrong track, lol.
HHS
Experienced Forum User, Published Author, Active player (286)
Joined: 10/8/2006
Posts: 356
Amaraticando wrote:
What is the smallest natural number n such that n has some power whose the last trillion decimal digits are all ones? i.e., nk ends in 111....111 (a trillion 1's) ( ͡° ͜ʖ ͡°)
I suspect that the answer is some ridiculously huge number with more than 300 billion digits in it? I have no idea how to even begin to compute this.
1 2
14 15