# Thread: help me solve the puzzle

1. Plus the variable names are utterly poor.
Which has nothing to do with the problem.

I think this has been solved or were the answers that were given incorrect?

2. It is in fact the same. Since half the Breeders have boys and half have girls, the number of breeders goes down each breeding cycle, but not the ratio of boys to girls, since they will always be half boys and half girls (in a perfect world). Specifically the ratio will always approach the ratio of male.female births. In real life, more boys are conceived, but more girls are born. Male fetus's have a higher rate of miscarriage. You shoudl also take into account multiple births , both fraternal and identical.

Here is the proof -

Code:
```#include <stdio.h>

int main(){

double Boys = 0.0;
double Girls = 0.0;
double Breeders = 1.0;

while(Breeders > 0.0){
Breeders /= 2.0;
Boys += Breeders;
Girls += Breeders;
printf("Boys - %f  Girls - %f \n" , Boys , Girls);
}

return 0;
}```

3. Again, this cannot be proof because you cannot have a half child or half families left that needs to breed a boy.
Eventually, the number cannot be evenly divided by 2, and this is where most algorithms of this kind fails. I have yet to see any good, realistic algorithm to present the answer of a 1:1 ratio.

4. Originally Posted by Elysia
This is technically unfeasable.
One family cannot have half a child, nor can there be 12.5 families left that needs to have a boy.
Plus the variable names are utterly poor.

cyberfish: It's usually because you use and . Post the reply with code tags around them or the entire post, then edit and remove them. It will work.
@cyberfish: Yeah, you were right. I did it right in my first post, but somehow I managed to screw it up in the second.
Your answer was right. It's 50/50. If you don't believe me/us, then go ahead and read my proof and write a program yourself to find out what number it converges to. It will be one. So except for the converging thing the matter has been proved in my post (well, of course you have to fix it for the mistake I made that cyberfish pointed out, but those changes are trivial).
So for everybody: yes, the answer has been given.

Elysia.... Well, really... I don't care. I wrote this program not to be readable, but to as quickly as I could write the program without even thinking. I didn't write it for you guys, except maybe to run it to get the answer. Also, the variables are used little enough for the program still to be understood in one glance of the eye.
No complains about using namespace std? About using parenthesis between a/b which is completely non-required (I have no idea why I put them there, I just typed it out without thinking, as I said). About the infinite loop where I obviously should have an ending when the solution is close enough?
Well, let's say we're lucky I will never sell the program, or release it as open source software.

"nor can there be 12.5 families left that needs to have a boy."
Can you explain that sentence? You obviously didn't read, or completely understand my post, as there is no part about half families or half babies. It assumes an infinite number of families, then I derive an obvious summation, and wrote a simple program to get the number it converges to. That part is no proof, and unless a lot of people are still unconvinced I shall not give it either. I don't even have it yet, either, but I guess I'd be able to figure it out.

5. Originally Posted by EVOEx
Elysia.... Well, really... I don't care. I wrote this program not to be readable, but to as quickly as I could write the program without even thinking. I didn't write it for you guys, except maybe to run it to get the answer. Also, the variables are used little enough for the program still to be understood in one glance of the eye.
No complains about using namespace std? About using parenthesis between a/b which is completely non-required (I have no idea why I put them there, I just typed it out without thinking, as I said). About the infinite loop where I obviously should have an ending when the solution is close enough?
Well, let's say we're lucky I will never sell the program, or release it as open source software.
The variable names suck. I couldn't make out what the heck they meant or what was what. I give you 0 out of 10 for that code.
And yes, you should probably have broken the loop when the solution was found, otherwise it wouldn't be proof, but more of an informative program.

"nor can there be 12.5 families left that needs to have a boy."
Can you explain that sentence? You obviously didn't read, or completely understand my post, as there is no part about half families or half babies. It assumes an infinite number of families, then I derive an obvious summation, and wrote a simple program to get the number it converges to. That part is no proof, and unless a lot of people are still unconvinced I shall not give it either. I don't even have it yet, either, but I guess I'd be able to figure it out.
You didn't start at 100 families as the question said, but the point is the same. Each time there is 50% chance to get a boy.
So, first, 50 families get a boy.
Then 25 families get a boy.
Then 12.5 families get a boy (!). There can't be 12.5 families. It's not possible, put simply, and therefore it is wrong.

6. Originally Posted by Elysia
The variable names suck. I couldn't make out what the heck they meant or what was what. I give you 0 out of 10 for that code.
And yes, you should probably have broken the loop when the solution was found, otherwise it wouldn't be proof, but more of an informative program.

You didn't start at 100 families as the question said, but the point is the same. Each time there is 50% chance to get a boy.
So, first, 50 families get a boy.
Then 25 families get a boy.
Then 12.5 families get a boy (!). There can't be 12.5 families. It's not possible, put simply, and therefore it is wrong.
Come on, are you trolling here or what?

You give me a 0 ou tof 10 for that code. Well woohoo. It's no test. I don't care if you don't understand it. By the looks of it there's a lot in this topic that you don't understand. As the answer has been stated properly several times.
As I even said in the post: it IS no proof. It was *exactly* an informative program. Even if it was written properly it is no proof that this converges to that value, an actual proof would consist of actual math. So yes, newsflash: it WAS an informative program.
And what the heck they meant. Well, if you looked at the formula I proposed you see that it is exactly that formula implemented. If you can't understand those few lines of C code, even if the variable names are poor, then I'm really underwhelmed by your code interpreting skills.

But... 100 families? Maybe you should read before you complain. Nowhere there was an initial number of 100 families.

Yes, I made a mistake in that post. But you've seemed to make a dozen already, if you're not trolling, which I'm not used to from you. It seems to me you just didn't read the posts properly. But I propose you read them properly before you complain about a legit statement being invalid.
Or criticizing code that was never even meant to be good or readable, just to show the number my result converges to. And even if I didn't write it, if you'd actually read my formula I posted above that, I'd think you'd find the program fairly easy to understand.

7. Ok. Before it becomes a heated discussion just stop this one here only. Here's another one.
Every man in a village of 100 married couples has cheated on his wife. Every wife in the village instantly knows when a man other than her husband has cheated, but does not know when her own husband has. The village has a law that does not allow for adultery. Any wife who can prove that her husband is unfaithful must kill him that very day. The women of the village would never disobey this law. One day, the queen of the village visits and announce that at least one husband has been unfaithful. What happens?
I think that every husband will be killed after that. Tell me if it's correct?

8. The first question doesn't represent genetic mosaics.

The second question only serves to say that every male in the village is either homosexual or bisexual.

Go play "Professor Layton".

"Tell me if it's correct?"

Do you interpret "proof of guilt" as "no proof of innocence"?

[/Edit]

Soma

9. Every man in a village of 100 married couples has cheated on his wife. Every wife in the village instantly knows when a man other than her husband has cheated, but does not know when her own husband has. The village has a law that does not allow for adultery. Any wife who can prove that her husband is unfaithful must kill him that very day. The women of the village would never disobey this law. One day, the queen of the village visits and announce that at least one husband has been unfaithful. What happens?
Assuming the other people involved in the cheating do not confess....

Nothing, unless only one woman did not know a husband has been cheating ( in which case she kills her husband).

Because if more than one husband has been cheating the wives can not prove who it was as they all would know a husband has cheated at some point.

If only one cheated it will be obvious to the wife as she has not known a husband was cheating (when all the other wives already knew).

Still nothing because if the wives have not killed their husbands already (when the discrete event of the queen's announcement happens) they have themselves disobeyed the law (to kill their husbands the day of the cheating).

Unless all 100 husbands cheated earlier that day...

10. Originally Posted by Elysia
Again, this cannot be proof because you cannot have a half child or half families left that needs to breed a boy.
Eventually, the number cannot be evenly divided by 2, and this is where most algorithms of this kind fails. I have yet to see any good, realistic algorithm to present the answer of a 1:1 ratio.
This is a statistical estimation, not a factual example (there are no numbers quoted in the original post for population or normal boy/girl ratio) and as such fractions to determine the weight of each outcome is perfectly valid.

Also pointing out you have assumed an exactly equal chance of a boy or girl, which is not a given in the question (nor is it exactly correct in reality).

Originally Posted by Elysia
Because it clearly says that if there are two things that can happen, there is a 1/2 to get one of those things. Since there are two genders: boys and girls, there is a 50% chance to get either of them.
If Mike Tyson and Bill Gates had a boxing match there are two outcomes, Mike wins or Bill wins. I do not think that equates to a 50% of Bill Gates getting his ear bitten off.

11. Originally Posted by EVOEx
You give me a 0 ou tof 10 for that code. Well woohoo. It's no test. I don't care if you don't understand it. By the looks of it there's a lot in this topic that you don't understand. As the answer has been stated properly several times.
As I even said in the post: it IS no proof. It was *exactly* an informative program. Even if it was written properly it is no proof that this converges to that value, an actual proof would consist of actual math. So yes, newsflash: it WAS an informative program.
And what the heck they meant. Well, if you looked at the formula I proposed you see that it is exactly that formula implemented. If you can't understand those few lines of C code, even if the variable names are poor, then I'm really underwhelmed by your code interpreting skills.
As I said, it was not informative because you failed to write good variable names, thus making it a mess instead of informative. Had you entered variable names, then yes, it would have been informative, albeit still flawed (you admitted it yourself that it has its limits).

But... 100 families? Maybe you should read before you complain. Nowhere there was an initial number of 100 families.
I did miss that one.

Yes, I made a mistake in that post. But you've seemed to make a dozen already, if you're not trolling, which I'm not used to from you. It seems to me you just didn't read the posts properly. But I propose you read them properly before you complain about a legit statement being invalid.
Or criticizing code that was never even meant to be good or readable, just to show the number my result converges to. And even if I didn't write it, if you'd actually read my formula I posted above that, I'd think you'd find the program fairly easy to understand.
I have read the formulas, and they do make sense, but they cannot be applied to any real-world situation, unfortunately, and that is why I'm rejecting their use.

Originally Posted by novacain
If Mike Tyson and Bill Gates had a boxing match there are two outcomes, Mike wins or Bill wins. I do not think that equates to a 50% of Bill Gates getting his ear bitten off.
Note that I never said that I believe in statistical mathematics, but there's just no way there is a 50/50 chance where you have two numbers, etc.
Unfortunately, there's also no other way of calculating it.

12. These sound like questions from a Google Job Interview

13. Originally Posted by Elysia
Note that I never said that I believe in statistical mathematics, but there's just no way there is a 50/50 chance where you have two numbers, etc.
Unfortunately, there's also no other way of calculating it.
There is if only one of those numbers is the outcome. If you can flip a coin and get both heads and tails, then that is what is strange, but it would fit what you seem to think probability is. Don't use your Harvey Dent coin next time you try an experiment like this.

14. The coin can land on its edge, too. And it can heavily favor a specific side for a period of time too, so I wouldn't directly call these things "random." I don't believe one bit in the statistical mathematics.

15. Originally Posted by Elysia
The coin can land on its edge, too. And it can heavily favor a specific side for a period of time too, so I wouldn't directly call these things "random." I don't believe one bit in the statistical mathematics.
Probability does not promise interesting, that is, "random" results. What makes a probability true is if it accurately reflects the ratio of favorable outcomes to all outcomes. The actual outcome is a permutation of tries.