Geek Brain Teasers 80
muce writes "A few days ago my cube mate entertained a lot of us engineers by presenting us with the famous Monty Hall problem. That problem sparked a day of strong debates, coding simulations, and ramped writing of equations on whiteboards. Since then we've been thirsting for more good geeky mathematical brain teasers to pass the time at work. Does anybody know of any good ones like the Monty Hall problem, or by chance is there a web page with a collection of them?"
www.greylabyrinth.com (Score:1)
Re:geek brainteasers, oxymoronic? yeah, but... (Score:1)
Don't make the mistake of adding the bellhop's $2, because that's money that is already spent (included in your $27 cost). Actual Room cost($25) + bellhop's cut($2) = $27. So you can see why adding the $2 again is just plain stupid.
geek brainteasers, oxymoronic? yeah, but... (Score:2)
check out the puzzles faq (ftp from rtfm.mit.edu) lots of math puzzles, language puzzles, every sort of puzzle you could want.
if you and two friends go to a hotel, the hotel manager charges you thirty dollars, you split it three ways, ten bucks each, right? then you go to your room, the manager realizes it was only 25, so he sends a bellhop with five dollars to your room. The bellhop steals two bucks, giving you each a dollar back, reducing your expenditure to nine dollars each, nine times three is twenty-seven, plus the two that the bellboy stole is twenty-nine dollars, where's the missing dollar?
Here's a great place to start... (Score:1)
This weblog is devoted solely to brain teasers (under the guise of tech interview questions) and started just a few weeks ago.
Re:This isn't a brain teaser.. (Score:1)
The first try is a 1/3 shot. The second is a 1/2 shot. So, the real question here is will the 1/2 chance match with your 1/3 chance.
Let's add a point. You choose. He opens. You have a sudden bout of amnesia and forget which you chose. Being embarrased you say nothing.
You choose from the remaining two. You are now correct fifty percent of the time.
What are the chances that your second choice is the same as the first choice?
---
ticks = jiffies;
while (ticks == jiffies);
ticks = jiffies;
Re:three travelers at the hotel (Score:1)
This question was asked earlier in the comments. They beat me to it. :-)
---
ticks = jiffies;
while (ticks == jiffies);
ticks = jiffies;
Re:Another puzzle. (Score:1)
The second question was asked for an answer. It would have been asked even if none, or only one, had mud.
---
ticks = jiffies;
while (ticks == jiffies);
ticks = jiffies;
Re:here's a good one.... (Score:1)
99 + 9/9
Too easy, took about ten seconds.
---
ticks = jiffies;
while (ticks == jiffies);
ticks = jiffies;
Re:Another puzzle. (Score:1)
I wasn't arguing the logic. Rather the statement that the second question could not be asked. Every question can be asked, even if there is no answer. This one has an answer and is interesting to some, therefore it was asked. I just didn't think the second sentence of that poster was worded appropriately to convey the intended meaning.
---
ticks = jiffies;
while (ticks == jiffies);
ticks = jiffies;
OK, switching is beter (Score:2)
You'd think you had a 50/50 chance by knowing that you seem to have a choice between two doors. Because, should a second person come along not knowing of your choice, and choose between the two doors, his chances would have to be 50/50.
Let's ask the question another way. Monty asks you to choose a door with no chance to switch. Your chances are 1/3. Even if he opens one of the wrong doors before he tells you if you won or lost, you cannot change, and therefore your chances are 1/3.
Again, but this time Monty asks you to *remove* a door. In other words, you win if the door is *not* the one that you pick. Your chances are 2/3. Even if Monty opens up a losing door before he tells you the winner.
Should you choose to stay or switch *before* you choose any doors, these two cases are stay and switch respectively, showing the odds are 1/3 for staying and 2/3 for switching.
The thing that boggles the mind, is if someone else chose his chances are 50/50. Yes, this is true. But had he known the previous situation, his chances are the same as yours.
It still seems not to make sense since how does opening the door affect your decision. So here is what helped me. When you make your first choice, you have a 1/3 chance of getting the car. So, in 1/3 of the cases, Monty can choose either of the other two doors to open, as they are both losers. In 2/3 of the cases (that is, when you choose a goat door) the door that monty open is chosen by your choice. That is, he can't choose your choice to open, nor can he open the one with the car. Thus, in 2/3 of the cases you *affected* the opening and cancellation of one of the doors. Thus bring it into the equation and allowing it to raise the cahnces of the other door.
---
ticks = jiffies;
while (ticks == jiffies);
ticks = jiffies;
Another puzzle. (Score:3)
I posted this lat time Ask /. had a puzzle of boring Sunday a while back.
Three smart kids are on a beach and all have mud on their foreheads. An old man comes over to them and asks for each of them to look at *both* their friends, and should one *or* both of their friends have mud on their foreheads, they should raise their hands. All three kids look at both of their friends, and seeing mud on both of their friends heads, they raise their hands.
The old man then offers a dollar to anyone who can answer his next question, and prove it. He asks if any of the kids know that they do, or do not, have mud on their foreheads, and if they can prove it. The kids look at each other and are bewildered for a bit. Suddenly, one of them screaches, "Oh!" and raises his hand. He then explains to the old man how he must have mud on his forehead and explains his reasoning. As his reasoning was excellent, the old man gives him the dollar.
What was the boy's reasoning?
---
ticks = jiffies;
while (ticks == jiffies);
ticks = jiffies;
Its "Three Card Monte" (Score:2)
The original is "how many [black|red] cards are there in three face down cards; does the number seem to "change" when one of the cards is revealed?" The problem is from the 16th century (about the time of the application of color to what became the "standard" deck), and the solution came in the 18th century...with no computers involved. The solution uses basic probability mathematics that's still taught as-is in today's Prob&Stats classes for Math and CS Majors.
Re:I don't understand (Score:1)
--
three travelers at the hotel (Score:2)
Three travelers stop at a hotel for the evening. The manager offers the travelers a single room at a cost of $30, to which the travelers agree, each paying the manager $10.
Later that evening the manager realizes that he has over charged the travelers for their room: the price should have been $25 rather than $30. The manager calls the bellhop over, giving him $5 and instructing him to take the money up to three travelers as a refund. On his way up to the travelers' room the bellhop considers that there is no even way to divide $5 between three people, and decides, in the interest of civility, to keep $2 for himself as a tip, giving the travelers' only a $3 refund
When the bellhop gets to the room, he gives the travelers their $3, which they divide equally amoung themselvs, $1 per person, and everyone is happy. Here, however, is the problem: Each traveler has now paid $9 ($10-$1=$9), meaning that they have paid a total of $27 (3*$9=$27) for the room. Add in the $2 that the bellhop kept as a tip and we have $29 ($27+$2=$29). But the three travelers originally paid $30! Where is the missing dollar?
Re:three travelers at the hotel (Score:2)
Exactly true. When I first heard this puzzle I was told that the solution had to do with the order of mathematical operations and precedence, but I have also had the solution explained to me in terms of standard accounting practice. (something about not counting both debits and credits in the same group, but I'm no accountant so I don't remember the details) The real trick is in the telling. This didn't become clear to me, however, till I had to write the problem down, and I found that you had to carefully avoid any mention of the price after the refund (or the price claimed by the bellhop, to obscure his petty theft).
The simplest way I have found to explain the error is to say that you should only count actual dollars that people in the problem are holding: $3 (in the travelers' hands) + $2 (in the bellhop's pocket) + $25 (in the manager's till) = $30 (originally paid for the room).
Still, most people, when they first hear the puzzle, are quite flummoxed and have a very hard time explaining exactly what the error is.
How does this work? (Score:1)
Re:How does this work? (Score:1)
Re:This isn't a brain teaser.. (Score:2)
Monty shows you 1000 doors and asks you to pick the one you think hides a car. You pick door 94. Then Monty opens 998 doors. At each door, he checks the number on the door against a little scrap of paper he has. When Monty is done opening doors, he has revealed 998 goats, and left your selection, door 94, and one other door, door 672, closed.
Monty reminds you that one of the two remaining closed doors hides the 999th goat, and the other hides a brand new car! You can keep your original choice, or change your choice to door 672.
Should you switch?
If yes, how is this different from the three door case?
Re:This isn't a brain teaser.. (Score:2)
Interview Questions (Score:1)
Re:geek brainteasers, oxymoronic? yeah, but... (Score:1)
I've got a question..... (Score:1)
-------------------------------------------
I like nonsense, it wakes up the brain cells.
Re:ok ... the solution ... (Score:3)
Let's assume without loss of generality that you pick the first digit. That rules out cases 4 to 7. Knowing there's at least a 1 rules out case 0. The cases left are 001, 010 and 011. Therefore the odds that there are two 1's is 1/3.
Get it now?
Seven-Eleven (Score:1)
You stop at the local Seven-Eleven and pick out four items. The sum of the four prices is $7.11. The product of the four prices is also 7.11. What are the prices of the four items? Is the solution unique? Are there other sum/product values with solutions? For those who insist on making things more complicated than necessary: there are no taxes, the prices are all integral in cents, and the product is exactly 7.11, not just close and rounded off.
This picture explains why it is NOT 50/50 (Score:2)
http://math.ucsd.edu/~crypto/Monty/montybg.html [ucsd.edu]
This isn't a brain teaser.. (Score:2)
At first glance, there are three doors, two goats, and one car. However, this is misleading.
In any run of the problem, one of the unchosen doors is shown to be a goat. You cannot choose that door, and both it and its associated goat never enter into the statistical problem.
The actual problem has only two doors, one goat, one car. Plain old 50/50 chance. There is no gain to be had by changing doors.
Well, unless the door is hung a bit high and you can see goat legs under the door you have chosen.
Re:This isn't a brain teaser.. (Score:2)
I'd seen the real world equivalent. Took me one try to beat it, and only because I cheated. (Cards you have just laid out in front of you in intentionally spilled beer on do NOT suddenly become dry and fresh. You can always smell the beer)
Take the five changed cards, and invert them on the bottom of the deck. If you know how to tab them into a cut, I'd shuffle a time or two and make them arrive at the bottom. Pick through the deck for them, in front of the patsy. Have the pick made, then tell them to shuffle the six and place them back on top of the deck, removing any chance the order will ring a bell with the patsy. Tell them to think about it, while you grab the deck and deal the changed cards to them after a quick inversion.
Oh, and three socks.
Re:This isn't a brain teaser.. (Score:2)
If I think about it that way, it's still a 1/2 problem since the second goat is a known quantity.
Think about it like this. You are presented with three doors, one open displaying a goat, *before* you make your choice. (When the door is opened is meaningless, as it always displays a goat) You cannot choose the open door, obviously, so there are only 2 to choose from.
Re:monty hall variant (Score:2)
'Man, three kids.. How do you handle the sibling rivalry?' should produce at least one childs name and the gender of the other two. If it doesn't, eg, you get a result like 'Oh, it is/is not terribly bad.' you have to go fishing again. If you had siblings, or have at two children of the same sex, try the empathy ploy. Detail how when you/your children had to share a room, the infighting was worse, and ask if keeping them seperated could be the reason/solution.
Leading, generic talk can get you anywhere.
Re:This isn't a brain teaser.. (Score:2)
You're right, I'm wrong.
[/me bashes his head against the table.]
I hearby apologize to everyone I flamed. I was wrong. For lack of a better programming language at my disposal, here's an Office macro that proves not only am I an idiot, I'd only get the car half as much as Rev Snow.
Sub goat_problem()
Dim chosen As Integer
Dim you As Integer
Dim looper As Integer
Dim swi As Integer
Dim norm As Integer
For looper = 1 To 20000 Step 1
chosen = Int((Rnd() * 3) + 1)
you = Int((Rnd() * 3) + 1)
If (chosen = you) Then norm = norm + 1
If (Not (chosen = you)) Then swi = swi + 1
Next looper
looper = MsgBox("goat " & swi & " " & "notgoat " & norm & " " & swi / norm, vbOKOnly, "goat?")
End Sub
Re:monty hall variant (Score:2)
Re:monty hall variant (Score:1)
-Peter
"There is no number '1.'"
Does it have to be proven using the raised hands? (Score:1)
Birthday puzzler (Score:1)
Re:monty hall variant (Score:1)
The question is: what were the odds of seeing the hockey card? If it was a certainty, then if every boy plays hockey, we're done: there can only be one boy (i.e. it's one boy, 2 girls a 100%)
But if the odds of seeing the card are not 1, then surely it's more likely that a card is observed if there's 2 boys rather than 1?
I guess I'm trying to make the same argument for an increased likelihood of there being two boys as you make for an increased likelihood of there being two girls.
Re:Another puzzle. (Score:1)
If at least one kid is known to have mud, then if a kid sees exactly one muddied forehead then he knows his is also muddy, because if it weren't then the muddied kid he sees would see two kids without mud and know that he is the one. Since he's not saying anthing, he doesn't see two clean foreheads.
Re:This isn't a brain teaser.. (Score:1)
If you trade, the only time you don't get the car is when you picked it in the first place, which was obviously a 1/3 chance. So trading gets the car 2/3 of the time.
Car Talk puzzlers (Score:2)
Coding brain teaser (Score:2)
I never figured it out but apparently it is possible.
Puzzles (Score:1)
Re:Another puzzle. (Score:2)
----
Re:This isn't a brain teaser.. (Score:2)
----
Re:This isn't a brain teaser.. (Score:1)
Step 1
gosh you like typing don't you
Answer. (Score:2)
handB = (mudA or mudC);
Since mudA and mudB are both true, the value of mudC is indeterminate. An individual, therefore, would not know the value of mudC (his own forehead muddiness), solely from handA, handB, mudA, and mudB. However, when the kid saw that at least one of the others was sufferring from the indeterminacy of his own forehead muddiness, the only reason is that that kid is also seeing the same problem of two hands and two muddy foreheads. Seeing this, the kid pronounced that his forehead must certainly also be muddy. QED.
Re:This isn't a brain teaser.. (Score:1)
Yeah. Actually, the question, as usually posed, DOES result in a 50/50 choice. Ie, if someone says to you:
`ok, there are 3 doors, 1 is open, and has a goat behind it, the other 2 are closed, and one of those 2 has a prize behind it, which do you chose`
the answer is it doesnt matter - its 50/50.
You have to include the initial choice and subsequence opening of the doors for it to be counter-intuitive. I think its THAT which confuses people.
It did me, anyway!
I don't understand (Score:1)
Just asking.
--
Re:ok ... the solution ... (Score:1)
No. That's different than the scenario I described. Flip three coins. You're told that there is at least one head, and you're shown one coin at random, and it is a tail. Now, what is the probability that there are two tails?
This is very different than being told "coin 1 is a head, and coin 2 is a tail." Do you see why?
Re:ok ... the solution ... (Score:2)
Re:This isn't a brain teaser.. (Score:2)
Let's look at a simplified version of the possibilities. We'll only consider the case where the prize is behind door #1.
You pick door 1, Monty opens door 2, you stay, you win.
You pick door 1, Monty opens door 2, you switch to door 3, you lose.
You pick door 1, Monty opens door 3, you stay, you win.
You pick door 1, Monty opens door 3, you switch to door 2, you lose.
You pick door 2, Monty opens door 3, you stay, you lose.
You pick door 2, Monty opens door 3, you switch to door 1, you win.
You pick door 3, Monty opens door 2, you stay, you lose.
You pick door 3, Monty opens door 2, you switch to door 1, you win.
(Note that there are 4 additional cases where Monty would open door 1, but he can't since the prize is there. I suspect that this is where some people make their mistake.)
Now, out of those 8 cases, you win 4 times or 50%. In the cases you stay with your original door, you win 2 out of 4 (50%). If you always switch, you win 2 out of 4 (50%).
If you expanded this to all 3 prize locations, you would get 12 out of 24, 6 out 12, and 6 out of 12, or 50% chance no matter what your strategy was.
I think most people make the mistake of not fully considering the case where you pick the prize door in the first place. There are two possible branches from there since Monty can open either incorrect door. If you don't take that into account, then you end up thinking that you only win 1 of 3 by staying but win 2 of 3 by switching.
Like we said, the first door choice really doesn't count for anything. The only choice that matters is the final door you chose. Since you're picking between 2 doors and 1 has the prize, that leads to a simple 50% probability.
Re:This isn't a brain teaser.. (Score:2)
After sleeping on this, I changed my mind. Count me in the "it's better to switch" camp instead of the "50-50" camp.
In the 8 cases I listed, you can drop the first two. When you select the correct door at first, it doesn't matter which door Monty opens. He has two choices that are equivalent from your point of view (between two doors, each of which doesn't have a prize behind it). His choice doesn't impact the probability of you finding the prize.
Marylin vos Savant (Score:3)
As a side note, at one time I heard an explanation of her world record IQ that makes me discount her as the world record holder.
Supposedly IQ scores depend on the sample size taking the test. If a relatively small number of people take the test, even scoring a perfect score can only rate an IQ a few points above the average.
So the story I heard is that the test she set the record on was one of the most widely given standardized IQ tests. I believe she is solidly in the "baby boomer" set and I think this was a school test given years and years ago.
Since no test since then has been given to more people, even a perfect score on every IQ test since then wouldn't result in breaking her record.
Of course, that's just the information I heard. It could be wrong, but it does sound plausable.
Re:This isn't a brain teaser.. (Score:1)
Now, out of those 8 cases, you win 4 times or 50%. In the cases you stay with your original door, you win 2 out of 4 (50%). If you always switch, you win 2 out of 4 (50%).
That's right - by cases. You forget, however, that those cases do not have the same probability. There are four cases in which you picked door 1 initially, but only two for each of the other doors. This means that you already found the right door in half the cases; unless you know from the beginning that door 1 is the right one, your guess can't be that good.
Therefore, if you want to stay with your cases approach, you have to introduce duplicates for all door 2 and door 3 cases, resulting in six cases with switching; in four cases, you win. Regarding the six cases without switching, you are successful in only two of them.
Now we again end up thinking that you only win 1 of 3 by staying but win 2 of 3 by switching, don't we? :-)
Re:monty hall variant (Score:1)
Assuming you mean ln and not log, your answer is wrong. :) Draw up a table.
Re:This isn't a brain teaser.. (Score:1)
Bzzt.
Think of it this way: the host is saying, in effect, you can keep your original door, or you can have both of the other doors, one of which (the goat) I will show you.
So, assuming the host *always* opens a door, it's better to switch.
For your next exercise: what if Monty opens a door only half the time? :)
Re:monty hall variant (Score:1)
I still think you are wrong. :)
The possibilities for the three kids:
1. BBB
2. BBG
3. BGB
4. BGG
5. GBB
6. GBG
7. GGB
8. GGG
We know there is at least one boy and one girl, so we throw out cases 1 and 7. In 3 of the remaining 6 cases, there are 2 boys, so the probability is 1/2.
Even if we say that the BBG combination is the same as GBB (etc), then we are left with BBB, BGG, GBB, GGG, and the answer is the same.
What's wrong with this logic? I really want to know. :)
Re:three travelers at the hotel (Score:1)
Re:ok ... the solution ... (Score:1)
So, although that was unlikely, that leaves us with 6 possible scenerios. Which is right back where we started.
I think you've got me nicely confused here.
Besides, how is seeing a girl's room any different from seeing a boy's schedule? Assuming the question is fair, that leaves us with 1 boy FOR SURE, and 1 girl for SURE.
I guess i'm just confused.
On-Line shared Monty Hall simulation (Score:1)
correct, yet wrong (Score:1)
Where you are wrong is in simply discounting the achievement and mental discipline needed, since if there was a large sample of persons the test was calibrated on, this means the girl scored above all these sampled. :-)
But see it another way: If the girl had been in the sample used to calibrate the test before, we all would be considered to be less intelligent
Still remember, the IQ is just a number which is assigned by a mathematical, but not necessarily scientific model. For example, isn't the IQ distribution supposed to be a gauss curve ? If so, it should to be symmetric about the mean.
That it is not suggests that the tests have been refined in a way that makes it easier to detect smart persons(IQ 100-300), while neglecting dumb persons(IQ 0-100). (ObPC: Excuses if you scored less than 100, you might still be disciplined enough or a mad enough scientist to be cool ).
Looking at it wrong.. (Score:1)
Minus the 5 dollar refund the hotel has $25
You paid have paid $27, $2 to the bellboy, and $25 to the hotel.
$25 + $2 = $27 / 3 = $9 each.
There is no missing dollar, as you can see.
Re:Birthday puzzler (Score:1)
Re:geek brainteasers, oxymoronic? yeah, but... (Score:1)
30 - 5 = 25 - actually paid after refund of 5
25 + 3 = 28 - what they paid plus refund
28 + 2 = 30 - what was paid out plus the bellboys take
each person didn't really pay 9 dollars, rather 28/3 or 9.333...
I'm afraid that you're terribly mistaken because the pockets of the guests are missing 33 cents apiece if this solution is correct. You have not accounted for the missing dollar.
Try this:
3x10 paid out
5 removed = 25 paid out
25/3 = 8.33 paid each.
8.33 + 1 returned = 9.33 accounted for each. The 66 cents missing each is the 2$ that the bellboy has.
The guests didn't pay 9.33 each, they paid 8.33 each and got $1 each back. Those 33 "missing" cents apiece are in the hotel's cash register.
Cyclopatra
"We can't all, and some of us don't." -- Eeyore
Re:monty hall variant (Score:1)
You can't control random environments, but you can easily make some vast oversimplifications of them with meaningless results
Re:This isn't a brain teaser.. (Score:1)
When asked for my choice I say "I pick door number 2" out of the 10 doors.
I have 10% chance of making the good choice.
On the second step of the game I'm asked if I still choose door 2 or if I take the other one (the remainder of the 9 others). In other word I'm asked if I want or if I don't want door 2.
Now, what if the games allows me to point directly the unique door I don't want to open?
I say "I don't choose door 2".
This will mean I'll choose a group of 9 doors which has a 90% chance of containing the prize. Removing 8 empty doors from this set won't change (since there is at least 8 empty doors) my 90% of making the good choice at the beginning.
The second step of eliminating empty doors from the remaining 9 is a disguise. The real question is "do you choose this group of 1 door, or this group of 9 doors". ;)
Presented this way the answer is obvious.
Re:This isn't a brain teaser.. (Score:2)
Try looking at it this way: Monty knows which door the prize is behind. If your first pick is a door with no prize behind it, he can choose to open either of the other doors. If your first pick isn't the door with the prize behind it, he has to open the other door with no prize -- he doesn't have a choice. At the point where you pick a door (say door 1) and Monty is about to open a door there are three possibilities
Possibility 1: Prize is behind door 1: 50% chance Monty will open either
Possibility 2: Prize is behind door 2: 100% chance Monty will open door door 3. 0% chance Monty will open door 2
Possibility 3: Prize is behind door 3: 0% chance Monty will open door 3. 100% chance Monty will open door 2.
Each possibility has a 33% chance of happening. With Possibility 1, if you stay, you win and if you switch, you lose. With Possibility 2, if you stay, you lose and if you switch, you win. With Possibility 3, if you stay, you lose and if you switch, you win. Therefore the probability of switching and winning is 2/3.
Re:ok ... the solution ... (Score:1)
The way I see it, in a collection of 3 binary numbers these are all the possibilities.
case 0: 000
case 1: 001
case 2: 010
case 3: 011
case 4: 100
case 5: 101
case 6: 110
case 7: 111
Case 0 is thrown out because "You are told that there is at least one 1."
Case 7 is removed because "You choose one digit randomly, and are told it is a 0."
We can divide the remaining cases into two sets:
Set A={001, 010, 100}
Set B={110, 101, 011}
The probability of there being two 0's = 1/2.
The probability of there being two 1's = 1/2.
Please explain your reasoning.
Re:monty hall variant (Score:1)
Re:geek brainteasers, oxymoronic? yeah, but... (Score:1)
Re:geek brainteasers, oxymoronic? yeah, but... (Score:1)
another way to look at it is:
hotel/motel got 30
hotel/motel gave back 5
bellboy got 2
customers got 3
hotel/motel has 25
customers have 3
bellboy has 2
25 + 3 + 2 = 30
either way you look at it, there's no money missing.
Re:geek brainteasers, oxymoronic? yeah, but... (Score:1)
here's a good one.... (Score:1)
Re:This isn't a brain teaser.. (Score:1)
Yes, everyone thinks that, and comes to the wrong conclusion,as you did. There's a discussion of the answer here [editthispage.com] - if you switch your choice your chances of winning are 2/3, if you stick, 1/3. The subtlety in the statistical argument derives from the fact that the host is giving you more information half way through the game, which the simplistic statistical interpretation you give doesn't take into account. But if you're still not convinced, the best way to provide evidence is to run a Monte Carlo simulation of the game, or to calculate every possible combination - which is what guy's co-workers were doing.
Re:ok ... the solution ... (Score:1)
Your rule does not hold up in truly random environments. It's attraction is in semi-random environments like process lists and splay trees where it is likely that a certain process will be hit more often than another. Transmeta would know all about this.
Dancin Santa
Re:ok ... the solution ... (Score:1)
Flip a coin 3 times and record the results.
You're saying that if I show you the first as heads, then the second as tails that the odds of the third flip being heads is *higher* than it being tails? I don't buy it.
The odds of any child being male is 50%. Just because you encountered a female room first means very little when you consider that a house is not randomly laid out. "Take the first right" when "Take the first left" is correct could accidentally lead a guest to the girl's room.
Let's say that you had a 10 digit binary number. If the first number you reveal is a 0 and the second is a 1, are you saying that the third number that you reveal is more likely to be a 0?
Dancin Santa
Re:Seven-Eleven (Score:1)
- #!perl -w
}for my $w (1..712) {
- for my $x ($w..(712 - $w)) {
:%.2f :%.2f :%.2f \n", $w/100,$x/100,$y/100,$z/100) if ($w*$x*$y*$z == 711000000);
}for my $y ($x..(712-($w + $x))) {
my $z = 711 - ($w + $x + $y);
printf ("%.2f
}
Dancin Santa
Of course the lameness filter thinks that I have too many lame characters. Maybe if I nip here and tuck there?
Re:Coding brain teaser (Score:1)
Dancin Santa
ok ... the solution ... (Score:1)
The key is that it is more likely that you stumble into a girl's room if there are two girls and one boy. This is easy to show using Bayes' rule.
Because the hockey schedule is in a common location, you get no information from it other than there is at least one boy.
I remember there was spirited debate in class over this one ...
Re:monty hall variant (Score:1)
I re-ran the numbers, and I would like to make the clarification: Every boy plays hockey with probability 1. (I'm Canadian after all.) Other than that I stand by the posted solution. The details are left as an exercise for the reader. :-)
monty hall variant (Score:2)
Here's a variant on the Monty Hall problem that I got from a computer science prof, which illustrates arguments regarding Bayesian inference.
Your friend invites you to his house. You know a priori that he has three children, but you have no information on their genders.
While looking for the bathroom, you accidentally stumble into one of the children's rooms, and find that it is obviously a girl's room.
While in the kitchen, you see a schedule for a boys' hockey team.
So, you know that there is at least one boy and one girl. The question is: what is the probability that there are two boys and one girl?
I am obfuscating the answer so as to let you think about it first: floor(log(7.39))/floor(10^(0.779))
Re:This isn't a brain teaser.. (Score:1)
My understanding of this problem is as follows: Monty chooses one door which to open. The other two are similar in that they are not chosen by him, but they are dissimilar in why they are not chosen by him. The unchosen door which you first select is unchosen simply because it is the door which you selected (and Monty cannot reveal to you whether your first selection was correct or there is no question of whether to switch doors). The remaining unchosen door was not chosen because the chosen door had a goat behind it. To put it another way, by not choosing this door, Monty wasn't forced to show you the car (although, it is possible that he wouldn't have been forced to show you the car, even if he'd not chosen the chosen door instead of this one).
So Monty not choosing the door you initially selected gave you no new information about what's behind it (as he would have done it regardless of the location of the car). However, Monty not choosing the other door does give you new information: namely, that not choosing it didn't result in you seeing the car through the chosen door. (If one of the two doors which you didn't initially select is randomly eliminated -- equivalent to your random selection of a door when the game began --, it cannot, likewise, be said that Monty not choosing the door which you selected will result in Monty not revealing the location of the car. That is, if you initially select a goat door, and the other goat door is randomly eliminated, Monty not choosing your door does result in Monty revealing the location of the car.)
Mathematically, your first selection is from three doors, one of which contains a car -- hence, there is a one-in-three chance that you'll select the door behind which is the car. Monty's choice of which door to open is between the remaining two. When making this decision, he may be faced with three car-goat arrangements (for simplicity, I'm just going to call the remaining doors "left" and "right," since there must be one of each): car left, goat right; goat left, car right; or goat left, goat right. Each of these is equally probable. In either of the first two, Monty must select the one door behind which is the goat, which means that the door not chosen must be the car; this is the case in two thirds of the possible arrangements. In the remaining case, Monty can select either goat door and the remaining door is also a goat. So in two of the three arrangements (or two thirds of them) the door not chosen based on Monty's knowledge of the location of the car actually conceals the car. The other one third of the time, Monty's knowledge is not needed and your first selection is, in fact, the correct one.
2/3 + 1/3 = 1, so the car is still behind one and only one of the doors. But it is twice as likely to be behind the door which you didn't initially select. Monty tells you that by always selecting a non-car door to open. (If Monty selected a door at random, one third of the time he would select the car door and you'd have no chance of winning; two thirds of the time he'd select a goat door and then both doors would possess fifty-fifty odds. [0 + 1/2 + 1/2] / 3 = 1/3, so each door would have a one-in-three chance before he opened one of them and a one-in-two chance after he opened a non-goat door. That is the situation which you described.)
The whole idea here is that you have more information about the door which you didn't initially select.