The online racing simulator
Ughhh... statistics.
(19 posts, started )
Ughhh... statistics. (SOLVED!)
Ok, so if someone wants to explain to me what the REAL answer is, I'd be grateful:

Suppose that a monkey is seated at a computer keyboard and randomly strikes the 26 letter keys and the space bar. Find the probability that its first 39 characters (including spaces) will be "to be or not to be that is the question." (Enter your answer in exponential form.)

I just assumed the answer would be (1/27)^39, but, as usual, I'm wrong, and I have no idea why. It seems like a fairly straightforward problem.
Can I phone a friend..?
Where'd the monkey find a period key?

:o
How do you know you're wrong? What is the answer supposedly?

Your working looks fine to me, but I'm no statistician.
Quote from tristancliffe :How do you know you're wrong? What is the answer supposedly?

Your working looks fine to me, but I'm no statistician.

I don't know for SURE that it's wrong. I was trying to help a friend with this problem over IM last night. She said that it told her the answer was wrong when she typed it in, and then she ran out of attempts. I almost want to say that the program probably didn't like the way she entered it -they're very picky. However, it didn't say what the correct answer was... that's why I'm so curious.
That monkey is a chimpance or a gorilla?

I really hate statistics :vomit:
Last subject I passed at my engineering studies

P.S: This is more combinatory than statistic, isn't it?
[Edit:
Never mind, missed a bit of the question]
Quote from Dajmin :There's no change in the odds of him hitting a key each time and there's no limit to the keys he's allowed to hit, therefor surely the odds each of those 39 times is still 27:1 (or 1/27 if you prefer)?

And are you to take the size of the space bar into account?

Lol no. Anyway, the odds of each successive key hit is, as you say, still a 1 in 27 chance of being correct. I know that much. So I guess my question is, am I doing the math the right way when it comes to summing up all the possibilities? Someone here has GOT to know the answer.
As far as I can tell, it IS combinatory. I just don't know how to combine it - since the way I did it is supposedly wrong.

EDIT: Damn you Dajmin. I'll leave what you wrote anyway since it makes sense.
It makes sense in theory, and it may very well be the case. The first "t" is definitely going to be 27:1.

However, in real life the odds of someone accidentally hitting the "o" after the "t" are far greater. Damn you mathematicians

Umm...maybe I'll think about it more. The odds of him hitting the "o" are also 27:1, but the odds of him having hit the "t" before hand...gah, I give up. Can't do it.

For god's sake man, I'm a musician, not a maths professor!
Yep, the odds will be greater, exponentially, for every letter typed correctly. That's my guess anyway.
I'm starting to think that (1/27)^39 is right and the program didn't like the way she entered it. God knows how much trouble I've had with my online chem/physics homework getting it to accept an answer in the correct format.

EDIT: RESOLVED! Talked to her this morning. It was right, the program needed everything divided out and stuff and entered a certain way. Stupid.
If you've copied the question exactly as it should be, then the probability is 0 because, as DWB already said there's a '.' in there which is not available to the monkey!

If you put the '.' there by mistake, or you didn't but it's not a trick question, your answer of (1/27)^39 is correct.*

*This obviously assumes that the odds of hitting any key is the same, and that hitting the same key multiple times in succession is no more likely than hitting any other combination of keys.
Quote from joshdifabio :If you've copied the question exactly as it should be, then the probability is 0 because, as DWB already said there's a '.' in there which is not available to the monkey!

If it's not a trick question, your answer of (1/27)^39 is correct.

Well, if you read the question, it says the first 39 characters... which is JUUUST shy of the period But yeah, it was the right answer.
Yeah that's true, although it actually quotes 40 characters so it's still a mistake really!
You sure who want to call it statistics ?
The probabilty that the 1st letters he strokes is a "t" is 1/27, and since the monkey will not keep the "t" pressed, this letter is available in next action, so 1/27 again (indepenent actions), and so on....

1/27 * 1/27 * .....
Wrote a quick program to confirm the obvious answer of (1/27)^word length and of course it's correct.


package shakespeareanmonkeys;

public class ToBeOrNotToBe {
public ToBeOrNotToBe() {
final int[] keys = new int[27];
final int numTimesToRun = 50;

long[] countsPerRun = new long[numTimesToRun];

boolean stop;
int count;
final String target = "to be ";

// Fill up 26 letters
for(int i=97; i<123; i++) {
keys[i-97] = i;
}

// Then add a space
keys[26] = 32;

for(int j=0; j<numTimesToRun; j++) {
stop = false;
count = 0;

while(!stop) {
StringBuilder output = new StringBuilder();

for(int i=0; i<target.length(); i++) {
output.append((char) keys[(int) (Math.random() * keys.length)]);
}

if(output.toString().equals(target)) {
stop = true;
countsPerRun[j] = count++;
}

count++;
}
}

long averageAttempts = 0;

for(int i=0; i<countsPerRun.length; i++) {
averageAttempts += countsPerRun[i];
}

averageAttempts = averageAttempts / countsPerRun.length;

System.out.println("Average number of attempts for "+target.length()+" character long target: "+averageAttempts);
}

public static void main(String[] args) {
ToBeOrNotToBe toBe = new ToBeOrNotToBe();
toBe.toString();
}
}

Attached images
results.png
Lmao
#18 - wark
Quote from wark :Apes are not monkeys.

From Wikipedia:
Because of their similarity to monkeys, apes such as chimpanzees and gibbons are often called "monkeys" in informal usage, though they are not monkeys

I embrace the "informal usage" excuse

Ughhh... statistics.
(19 posts, started )
FGED GREDG RDFGDR GSFDG