|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#16
|
|||||
|
|||||
|
Re: Maths problems (interesting ones)
I'll start thinking aboot the coin one, but right now with the fruit, I'm pretty sure you take just two pieces of fruit.
Each guard you give him half (1/2 of two fruit is 1 piece) then he gives you one piece back (back up to two). You never lose any fruit. |
|
#17
|
|||||
|
|||||
|
Re: Maths problems (interesting ones)
Look at it like this: there are two children, one who opens the door, and one who doesn't. Before she opens the door, the possibilities are:
Door Opener / Non Door opener Boy / Girl Boy / Boy Girl / Girl Girl / Boy Once she opens the door, the first two possibilities are eliminated, leaving only the options that the shy child is either a Boy or a girl. In other words, the sex of the one child has nothing to do with the sex of the other. Prove me wrong. ![]() EDIT: Even better, look at it like this: FAMILIES WITH TWO CHILDREN: 25% have two boys - A girl will answer the door 0% of the time 50% have a boy and a girl - A girl will answer 50% of the time 25% have two girls - a girl will answer 100% of the time If we take the product of the two percentages in each row, we get some more numbers to cloud the issue: PROBABLILITY THAT A GIRL WILL ANSWER... ...and the family has two boys - 0% ...and there's a boy and a girl - 25% ...and the family has two girls - 25% So, a girl will answer (0% + 25% + 25%) = 50% of the time. Exactly half of those responses will come from families with two girls, and exactly half will come from families with a boy and a girl. Or I could be completely off base - let me know. Last edited by Kris Verdeyen : 07-07-2004 at 18:42. |
|
#18
|
|||||
|
|||||
|
Re: Maths problems (interesting ones)
so the odds are somewhere between 1/3 and 1/2?
Somebody start knocking! |
|
#19
|
||||||
|
||||||
|
Re: Maths problems (interesting ones)
diobsidian,
I've heard the first, so I won't answer. As for the second, you forgot to disclaim that the person can't carry more then reasonably possible, or something like that. For example, FizMan's answer is the most efficient way to get 2, but if you want 3, all you have to do is start with 130. Or for 4, start with 258. Another thing of interest is that if you were to start with 1, you'd cut it in half for the first guard, and then he'd have to somehow give you 1, and you'd have 1.5. After the next guard, you'd have 1.75. If there was an infinite number of guards, you would have 2, but it would probably be spoiled from having been cut open so long ![]() |
|
#20
|
|||||
|
|||||
|
Re: Maths problems (interesting ones)
I think you're off Kris... I'm going to trust my highschool Finite math on this one...
We'll do it your way: Door Opener / Non Door opener Boy / Girl Boy / Boy Girl / Girl Girl / Boy Okay, a girl opens the door... so you say that eliminates the first two possibilities... Why? Remember, two combinations of boy/girl exist, and you've eliminated one of them for the wrong reason. Whoever opens the door does not determine what children exist in the family (with the exception of the boy/boy possibility) If you want to keep your method of reasoning, we have to add more possibilities. That is, the order of children. I'll mention the first born child, the other is safely assumed to be the second born: Door Opener / Non Door opener Boy (1st born) / Girl Boy (1st born)/ Boy Boy / Girl (1st born) Boy / Boy (1st born) Girl (1st born)/ Girl Girl (1st born)/ Boy Girl / Girl (1st born) Girl / Boy (1st born) Eliminate the Boys answering the door, you're left with the last four. We can eliminate one of the extraneous Girl/Girl possibilities as well. Girl (1st born)/ Boy Girl / Girl (1st born) Girl / Boy (1st born) Voila, 1/3. |
|
#21
|
||||
|
||||
|
Re: Maths problems (interesting ones)
Okay. I, too, have heard those before, so I'll propose my own (well, as you might guess, it is by no means original with me). Suppose that there is a game where we flip a coin. If the first time the coin is flipped it lands on heads, I pay you $2 (2^1), if the first time it lands on heads is the second toss, I pay you $4 (2^2), if the first time it lands on heads is the third toss, I pay you $8 (2^3), ad infinitum. Using simple probability, tell me how much you would pay me to play this game and still be able to make a decent profit (but enough to tempt me to agree to the game).
|
|
#22
|
|||||
|
|||||
|
Re: Maths problems (interesting ones)
You mean, for example, if I said, "Hey mtrawls, I'll pay you $20 to play <insert above mentioned game here> with me"?
|
|
#23
|
||||||
|
||||||
|
Re: Maths problems (interesting ones)
Quote:
I've included the code below in case someone wants to review my work. Code:
/** @mainpage license * Copyright (c) 2004 Joseph Ross * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ /** @file smiths.c * * @author Joseph Ross, christmasboy_81@rossesmail.com * @date 7/7/2004 * * This program attempts to solve the smith's children problem as defined as * problem #8 in this thread on chiefdelphi.com: * http://www.chiefdelphi.com/forums/sh...3&page=1&pp=15 * * The problem is as follows; * Mr and Mrs Smith have two children. You ring at their door, and one of their * two children, a girl opens the door. What is the probability that the other * child is also a girl? * * The problem is also stated at * http://www.julienstern.org/riddle_sol.php3?id=7 and gives the answer as 1/3 * * The algorithm used is as follows; * * @li assign two kids as boys or girls randomly and idependently of each other * @li pick one of the two to answer the door. * @li if the one picked is a girl, check if the other one is a girl and record * the number of times of each. * @li divide the number of girls from the first pick by the number of girls * from the second pick. * * The answer, as given by this program is 1/2. */ #include <stdio.h> #include <stdlib.h> #include <time.h> /** The 1 is a Girl (0 is a boy) */ #define GIRL 1 /** Calculates the answer to the smiths children problem * * @param argc the number of arguments to the program. * @param *argv[] array of pointers to the arguments of the program. * * @retval 0 no error. * @retval 1 no argument given. * @retval 2 invalid number of iterations. * */ int main(int argc, char *argv[]) { int i; // counter. int kids[2]; // array of two kids. int its = 0; // number of iterations to run. int second_girls = 0; // number of times the second kid was a girl. int first_girls = 0; // number of times the first kid was a girl. int first_kid = 0; // which kid answered the door. if (argc != 2) { printf("usage: smiths <number of iterations>\n"); return(1); } its = atoi(argv[1]); if (its <= 0) { printf("usage: smiths <number of iterations>\n"); printf("number of iterations must be greater then 0\n"); return(2); } srandom(time(NULL)); for(i=0;i<its;i++) { //pick the gender of the kids kids[0] = random() % 2; kids[1] = random() % 2; //pick which kid opens the door first_kid = random() % 2; //count first girl and check second kid if first kid is girl if (kids[first_kid] == GIRL) { first_girls++; //check second kid if (first_kid == 0 && kids[1] == GIRL) { second_girls++; } else if (first_kid == 1 && kids[0] == GIRL) { second_girls++; } } } //print results printf("iterations:\t%i\n", its); printf("first girls:\t%i\n", first_girls); printf("second girls:\t%i\n", second_girls); printf("%% second girls:\t%f\n", (double)second_girls/first_girls); return(0); } |
|
#24
|
|||||
|
|||||
|
Re: Maths problems (interesting ones)
ok ok enough debate
the answer is 1/3 Right, 4 possiblities, as most of you got boy/girl girl/boy boy/boy girl/girl from genetics but if you find its a girl, you only eliminate one of them (boy/boy) not 2. thus the probability - 1/3 (2 where the other is a boy and 1 where other is a girl) . i quote an answer someone else wrote You know that they have two children, that is four possibilities (Boy-Boy, Girl-Boy, Boy-Girl and Girl-Girl). Because you know that one of them is a girl, the first possibility is ruled out. So the probability that the second one is a girl is 1/3. Another one : Three cowboys are fighting together in a meadows. The first one, John, is a good shooter, he kills his target 2/3 of the time, and miss one third of the time. The second, Slim, is an average shooter, whose chances to kill and miss or even. The third, Bob, is a poor shooter, he only kills his target 1/3 of the time. They look at one another in silence... They still look... Sweat starts pearling one their faces... OK. Anyway. Their rule is the following. They shoot in rounds. One shot per round. They always shoot at the best shooter but themselves. They do as many rounds as neccesary so that either they all die or only one remains alive. Who has the most chances to survive? (Thanks to Matthias for this one) oh and joe, dont answer this one lol seeings as you probably know where to find the answer lol A grandfather clock chimes the appropriate number of times to indicate the hour, as well as chiming once at each quarter hour. If you were in another room and heard the clock chime just once, what would be the longest period of time you would have to wait in order to be certain of the correct time? Let us go into heroic fantasy land. The story takes place in a antic land where dwarves are mining to extract gold. The king is visiting the mine when he ears voices around the corner: "I have a neat trick: we have to melt gold bars the size of this mold, that is exactly 100 grams. I remove just a tiny fraction to all my bars and they all weight 99 grams. Their scales are not precise enough, they don't see anything..." The king tries to run after then, but they ear him and manage to flee among the corridors. Annoyed, the king summons the gods, who grant him a gift from the future: a digital scale. The digital scales works as follows: you put whatever you want on the scale, (nothing happens then), you press a button and the exact weight of what is on the scale appears. Then, the scale vanishes. Note that before you have pressed the button, no weight appears and once you have pressed the button the weight won't change even if you add or remove things. Armed with this mighty scale, the king summons all his 100 workers. How will he find the cheater? Last edited by Denman : 08-07-2004 at 06:51. |
|
#25
|
|||||
|
|||||
|
Re: Maths problems (interesting ones)
Yes, it IS 1/3. REMEMBER what I told you? The door does NOT, I repeat, had NO bearing on the possible combinations of children. IF you CHOOSE to go that route of using the door for logic, you ARE EXCLUDING possibilities.
And it's too early in the morning for me to figure out your code right now, but I'm pretty sure it's flawed too since again, you're using the door for reference and therefore probably excluding possibilities. Grandfather Clock Question: 1 hour and a half. Five possibilities: Either it hit a quarter of an hour (on some hour OTHER than 12 o'clock) OR it hit a quarter of an hour (15, 30, or 45 minutes) on 12 o'clock OR it hit 1 o'clock In the first possibility, all you have to wait is 45 minutes, in which case you'll hear it chime more than once. In the second possibility (15 minutes) you'd have to wait 1:45 for the clock to chime more than once. In the third possibility (30 minutes) you'd have to wait 1:30 for the clock to chime more than once. In the fourth possibility (45 minutes) you'd have to wait 1:15 for the clock to chime more than once. In the fifth possibility (1 o'clock) you'd have to wait 1 hour for the clock to chime more than once. As you wait, if the clock still chimes once at an HOUR AND A HALF, you've elminated all the possibilities but one (number 2) and you know for a fact that it's CURRENTLY 1:45 and when you heard the first chime, it was 12:15. Cowboy question: I'm going to go with a 54.78% chance that Bob (the poorest shooter) will win. I hope I'm right; good ol' notepad: Code:
.83 -> .66 -> .5478 win for 1/3 guy <- .33 .50 -> .33 -> .0451935 all die <- .66 .090387 1/2 wins <- .50 .33 -> .0451935 win for 1/3 guy Last edited by FizMan : 08-07-2004 at 08:00. |
|
#26
|
|||||
|
|||||
|
Re: Maths problems (interesting ones)
yes right for grandfather , however i havn't worked out the cowboy one yet as i am meant to be working
Grandfather clock answer You would have to wait 90 minutes between 12:15 and 1:45. Once you had heard seven single chimes, you would know that the next chime would be two chimes for 2 o'clock. |
|
#27
|
|||||
|
|||||
|
Re: Maths problems (interesting ones)
Quote:
if ABC < DEF and ABC < GHI, one of ABC is light if ABC < DEF and ABC = GHI, one of DEF is heavy if ABC = DEF and ABC < GHI, one of GHI is heavy if ABC = DEF and ABC > GHI, one of GHI is light if ABC > DEF and ABC = GHI, one of DEF is light if ABC > DEF and ABC > GHI, one of ABC is heavy The other three combinations are not possible if exactly one coin is different. Once it's narrowed down to three coins, just compare two of them. If they don't balance, you already know whether the fake is heavy or light; just choose that one. If they do balance, the other must be the fake. Quote:
|
|
#28
|
||||
|
||||
|
Re: Maths problems (interesting ones)
Quote:
Quote:
Keep working on the 12 coin problem - its a real toughie! |
|
#29
|
|||||
|
|||||
|
Re: Maths problems (interesting ones)
Quote:
|
|
#30
|
|||||
|
|||||
|
Re: Maths problems (interesting ones)
Quote:
Quote:
Think for yourselves and come up with the answer! Don't tell me that your high school math teacher told you this was the answer, and therefore it's so. There is more than one way to look at any problem - the challenge here is to determine, at a fundamental level, what is different between the way your math teacher looks at the problem and the way I've outlined it above. I don't see anything fundamentally different, but just because I don't doesn't mean it isn't there. My proof and Joe's simulation both show the answer to be 1/2. I've also included an Excel simulation that does the same - why are we wrong? |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Interesting thought | Lisa Perez | Chit-Chat | 3 | 05-07-2004 23:38 |
| Do you all have problems with.... | Munkaboo | Website Design/Showcase | 19 | 03-03-2003 19:51 |
| Joystick problems | archiver | 2001 | 3 | 24-06-2002 02:40 |
| Radio problems -- not | archiver | 2000 | 1 | 23-06-2002 22:23 |