Your Favorite Math/Logic Riddles? 1965
shma asks: "Whether you're involved in the Sciences, Mathematics, or Engineering, you undoubtedly enjoy finding simple solutions to seemingly difficult problems. I'm sure you all have a favorite mind-bender, and who better to share it with than the Slashdot community? Post your own problems and try to solve others. Just one request: If you have figured out the solution, link to it in a post, rather than write it out where anyone can see it." What brain benders tickle your fancy?
"Here's a sample to consider: You're in a dark room with 50 quarters, 18 of which are heads up. You are allowed to move around the coins or flip some or all of them, if you wish. Problem is, it's too dark to tell what you're moving or flipping (no, you can't figure it out by touch either). Your job is to split the coins into two groups, each of which has the same number of heads up coins. How do you accomplish this?"
Look and Say (Score:5, Informative)
Re:easy one (Score:5, Informative)
a^0 = 1
b^0 = 1
c^0 = 1
1 != 2
So, I would submit that that might be true for all nonzero values of n.
Re:Keeping my skills fresh (Score:1, Informative)
http://science.slashdot.org/article.pl?sid=05/09/
In normal trig, it's a^2 + b^2 = c^2.
Thinking back, wouldn't it be cool to have a quadrance-ruler? It would be marked off in units of inches squared, and the reading on it would be the square of the number of inches in distance. (Of course, if you were a communist, that would be centimeters.)
angle answer (Score:3, Informative)
22.5 degrees.
Yes, you can do it iteratively until inifinity, but the minute hand is at 90 degrees off 12, and the hour hand is at 60 for 2, plus 30/4 for the
Re:Phone Numbers (Score:2, Informative)
T = last 4 digits
[250*(80*H + 1) + 2*T - 250]/2
[20000*H + 2*T]/2
10000*H + T
Re:easy one (Score:5, Informative)
Re:Solution (Score:2, Informative)
check it empirically by entering this as a google search:
sqrt(2)^(sqrt(2)^(sqrt(2)^(sqrt(2)^(sqrt(2)^(sqrt( 2)^(sqrt(2)^(sqrt(2)^(sqrt(2)^sqrt(2)))))))))
You don't actually need all the brackets:
sqrt(2)^sqrt(2)^sqrt(2)^sqrt(2)^sqrt(2)^sqrt(2)^sq rt(2)^sqrt(2)^sqrt(2)^sqrt(2)^sqrt(2) will work just as well. It knows to evaluate from right to left.
Re:easy one (Score:2, Informative)
The best riddle site on the net (Score:4, Informative)
100 prisoners are imprisoned in solitary cells. Each cell is windowless and soundproof. There's a central living room with one light bulb; the bulb is initially off. No prisoner can see the light bulb from his or her own cell. Each day, the warden picks a prisoner equally at random, and that prisoner visits the central living room; at the end of the day the prisoner is returned to his cell. While in the living room, the prisoner can toggle the bulb if he or she wishes. Also, the prisoner has the option of asserting the claim that all 100 prisoners have been to the living room. If this assertion is false (that is, some prisoners still haven't been to the living room), all 100 prisoners will be shot for their stupidity. However, if it is indeed true, all prisoners are set free and inducted into MENSA, since the world can always use more smart people. Thus, the assertion should only be made if the prisoner is 100% certain of its validity.
Before this whole procedure begins, the prisoners are allowed to get together in the courtyard to discuss a plan. What is the optimal plan they can agree on, so that eventually, someone will make a correct assertion?
whole bunch of em (Score:2, Informative)
Incidentally, that page has been slashdotted in the past.
Re:Phone Numbers (Score:4, Informative)
b = last 4 digits
((a*80+1)*250 + b+b -250)/2
(a*20000 + 250 + b*2 - 250)/2
a*10000 + 125 + b - 125
a*10000 + b
It's only amazing if you don't know algebra, and no, a calculator is not required. Then again, if the point is to encourage people to eventually put down their calculator and instead try understanding why something works, then I'm all for it.
Except... (Score:5, Informative)
yes it's cute (Score:2, Informative)
Re:Phone Numbers (Score:4, Informative)
(20000a + 250 + 2b - 250) / 2
10000a + b
Re:Link to online version (Score:2, Informative)
Re:The King and the Chalice (only for Experts!) (Score:2, Informative)
One person is appointed the leader. He always turns the cup upside down. Everyone else enters. If the cup is right side up, they leave it, if it upside down, they put it right side up, but only if they previously have not flipped the cup. So the only time the leader would flip the cup is if another prisoner had already been in the room.
So how to deal with the fact that the King can flip the cup as well? Obviously its only an issue if the King flips the cup an odd number of times and then calls in the leader. Not sure how to get around this constraint, and the one that the King can hear them and thus foil the plan. But I'm off to bed, someone else can finish it.
Re:The King and the Chalice (only for Experts!) (Score:2, Informative)
http://www.ocf.berkeley.edu/~wwu/riddles/hard.sht
http://www.ocf.berkeley.edu/~wwu/papers/100prison
(the latter paper mentions a slashdotting, btw)
also see:
http://www.ocf.berkeley.edu/~wwu/riddles/hard.sht
Re:Math and science are obsolete (Score:3, Informative)
The way these values are determined is by equating a function like f(taxation) to total GNP or GDP and graphing the results then finding the highest point on a curve where GNP+f(taxation) is a max. Historically large taxes tend to reduce the GDP and small taxes are insuffient for the government to perform its duties as required by the constitution.
The US currently collects about 3 trillion dollars in taxes every year.
How they do it and what their reasoning is is all freely available online [gpoaccess.gov]
Maybe you can figure out where they're going wrong and run for office.
Re:easy zero (Score:2, Informative)
However, if you're going to try the other limit, lim(x->0) 0^x, the answer would seem to be 0 (but since this function is not continuous, there is no need to make it equal 0).
The theoretical answer? it depends on the function you're looking at.
The pratical answer? Try 1.
Re:Three Salesmen (Score:2, Informative)
Re:The King and the Chalice: full solution (Score:1, Informative)
Now the problem just becomes one of having the leader collect enough tokens. The cup can start up or down, so there may be an extra token in play. Allowing the king to flip the cup out of sight of the prisoners allows him to add or remove a token from the system with each flip. Thus if the prisoners start with a total of x tokens among all of them, over the course of the game that total may change to between x - k and x + k + 1 (+ 1 there because the cup might start sitting upright).
Now, the solution is that all prisoners except the leader start with 2k + 2 tokens (so the prisoners start with a total of (n - 1)(2k + 2) tokens. The leader will say yes once he has collected (n - 1)(2k + 2) - k tokens. We need to show that the leader can always collect this many tokens, and that he cannot get this many tokens unless ever prisoner has left at least one token in the center room.
We can see that the leader can always collect this many tokens because the king can take at most k tokens out of play leaving only (n - 1)(2k + 2) - k tokens. Since all players will be called an arbitrary number of times, they will all get a chance to leave all their tokens in the center room and the leader will get a chance to pick them all up (the ones that the king doesn't take).
Now consider the case where one prisoner is not called out for a very long time and all other tokens are allowed to be transferred to the leader first. In addition we will assume that the cup starts up and that the king adds k tokens to the system. In this case, there are (n - 2)(2k + 2) + k + 1 = (n - 1)(2k + 2) - 2k - 2 + k + 1 = (n - 1)(2k + 2) - k - 1 tokens in play. This is one less that the required number of tokens for the leader to say yes, so he can't possibly say yes until that last prisoner comes out and gets to transfer one of his tokens to the leader.
That is a bit hand wavy, but I think it is a good proof. I have no idea if this is the best possible solution, though. I have good reason to believe that it is not the fastest (if the king chooses who to bring out arbitrarily). Check out http://www.ocf.berkeley.edu/~wwu/riddles/hard.sht
-- corygwilliams AT google's mail place
Re:Riddle (Score:2, Informative)
that the other child is a girl is 2/3.
In the second case where we know the child is the oldest boy there are only 2 possibilites BB and BG. We can't eliminate any possibilites so the chance the second child is a girl is 1/2.
Re:The King and the Chalice (only for Experts!) (Score:4, Informative)
*Spoiler* Don't read the following if you don't wanna know the answer:
1) The prisoners elect one of their own to be a counter, the rest we will call non-counters.
2) When a non-counter comes into the chalice room, if he can he will put the chalice right side up. If it's already right side up, he'll leave it alone. However, each non-counter will only do this once. If he's already flipped it in the past, and it's upside down, he'll leave it upside down.
3) Every time the counter comes in, he checks the chalice. If it's upside down, he'll do nothing. If it's right side up, he'll flip it, and add one to his count. Once he's flipped it n times (n being the prisoner count), he knows everyone has done it. If the original state of the chalice is known, the problem can be modified so he only needs to flip it n-1 times.
Re:The King and the Chalice (only for Experts!) (Score:2, Informative)
Re:easy one (Score:3, Informative)
http://www.faqs.org/faqs/sci-math-faq/specialnumb
There were/are mathematicians who argue that 0^0 is 1, and those that argue that it's undefined.
Re:Three Salesmen (Score:3, Informative)
Re:Phone Numbers (Score:2, Informative)
These sorts of tricks are magical only to those who never took 7th-grade algebra (or won't apply it):
Let a be the three-digit prefix and b be the four digit number.
(((80a+1)250+2b)-250)/2
(20000a + 250 + 2b - 250)/2
(20000a + 2b)/2
10000a + b
Which is obviously your phone number. No, I didn't try it.
More interesting tricks (not puzzles) of this sort rely on less-obvious (unless you know them) arithmetic facts, like relationships between numbers and the sum of their digits.
one of my favorites (Score:2, Informative)
1 1
2 1
1 2 1 1
1 1 1 2 2 1
3 1 2 2 1 1
1 3 1 1 2 2 2 1
1 1 1 3 2 1 3 2 1 1
3 1 1 3 1 2 1 1 1 3 1 2 2 1
continue the series!
Coloured stamps (Score:3, Informative)
Suppose there are three people, called A, B and C. Each of these is a "perfect logician"; that is, given some information, they all are able to immediately draw any and all conclusions that can possibly be drawn from this information. Furthermore, suppose there are four red and four green stamps.
Now, all three of them close their eyes, and two stamps are glued to their foreheads, each; the remaining two stamps are put away. Now, they all open their eyes again.
Then, the first, A, is asked whether he knows the colours of the stamps on his forehead. He says he doesn't. Then B is asked the same thing, and also says he doesn't, and afterwards, C is asked and says he doesn't, too. Now, A is asked a second time, and he still says he doesn't know. But then, when B is asked a second time, he now says he does know.
The question is: how?
Re:the problem of the twelve billiard balls (Score:1, Informative)
http://grinder.home.mchsi.com/games/twelve-ball/ [mchsi.com]
Re:Light Bulb (Score:2, Informative)
an even easier solution would be to get a fireaxe, chop a hole in the door, and flip switches while I looked thru the hole. haven't opened the door and I've solved it in even less time than your method.
when dealing with idiotic interview questions like this, use the unexpected solution.
Re:The King and the Chalice (only for Experts!) (Score:2, Informative)
Accounting for the k flips the king gets to make:
The value k is known to all the prisoners.
One prisoner is the counter, the rest noncounters.
The counter's count starts at 0.
If a noncounter sees the up side down chalice, and
that noncounter has not righted the chalice 2k+1 times
already, then that noncounter will right the chalice.
If the counter sees the right side up chalice, the
counter will turn it up side down, and increment the
count.
The king, with his k royal flips, can augment the
count by up to k, or cancel up to k indications for
the counter to count.
If one noncounter has never been in the room, the maximum
value of the count is (n-2)(2k+1) + k = 2nk + n - 3k - 2.
If every counter has been in the room k+1 times,
which happens inevitably according to the problem,
the minimum value of the count is (n-1)(2k+1) - k = 2nk + n - 3k - 1.
The counter asserts yes when the count reaches 2nk + n - 3k - 1.
If we further assume that the king refills the chalice
with an intoxicating liquor whenever it is right side up...
MOD PARENT TROLL (Score:4, Informative)
Re:My all-time favorite logic puzzle (Score:3, Informative)
"The Guru speaks only once (let's say at noon), on one day in all their endless years on the island."
should read:
"The Guru speaks only once (let's say at noon), on each day of all their endless years on the island."
"only once... on one day" says that after the first day the Guru never speaks again.