Monkey typing "HAMLET" and Website Password

I. Suppose that one monkey presses 10 keys at random. What is the probability that he types the word HAMLET if he is(a)allowed to repeat letters, and (b) not allowed to repeat letters?

I understand the sample space is 26^10, and I understand that there are 5 total ways the word HAMLET could appear given 10 spaces. However, I'm not sure why the answer is (5x26^4)/(26^10).

Where is the 26^4 coming from?

II. You are asked to select a password for a Web site. It must consist of five lowercase letters and two digits in any order. How many possible such passwords are there if (a) repetitions are allowed, and (b) repetitions are not allowed?

(a)The answer is (7c2)*(26^5)*(10^2)

I understand 7c2 (7 spots and choosing 2 numbers), however, why isn't the formula used for "with replacement", since we can use the same number in both spots? Why is 26^5 with regard to order? Also, why is 10^2 multiplied at the end? I thought that's what the 7c2 was counting.

(b) The answer is (7c2)*(26p5)*(10p2), but I basically have the same questions as above. How are they coming up with the different components? I'm not sure when to use each formula (i.e., with/without replacement, with/without regard to order).

Any help would be appreciated!

Re: Monkey typing "HAMLET" and Website Password

Quote:

Originally Posted by

**divinelogos** I. Suppose that one monkey presses 10 keys at random. What is the probability that he types the word HAMLET if he is(a)allowed to repeat letters, and (b) not allowed to repeat letters?

I understand the sample space is 26^10, and I understand that there are 5 total ways the word HAMLET could appear given 10 spaces. However, I'm not sure why the answer is (5x26^4)/(26^10).

Where is the 26^4 coming from?

HAMLET has to appear as one string hence there are five places to place the H.

That leaves four other places to place any other letter whatsoever. Thus $\displaystyle 26^4$

Quote:

Originally Posted by

**divinelogos** II. You are asked to select a password for a Web site. It must consist of five lowercase letters and two digits in any order. How many possible such passwords are there if (a) repetitions are allowed, and (b) repetitions are not allowed?

(a)The answer is (7c2)*(26^5)*(10^2)

I understand 7c2 (7 spots and choosing 2 numbers), however, why isn't the formula used for "with replacement", since we can use the same number in both spots? Why is 26^5 with regard to order? Also, why is 10^2 multiplied at the end? I thought that's what the 7c2 was counting.

There are two places for the digits, $\displaystyle 10^2$ ways to fill them.

There are five place left for the letters, $\displaystyle 26^5$ ways to fill them.

Quote:

Originally Posted by

**divinelogos** II. You are asked to select a password for a Web site. It must consist of five lowercase letters and two digits in any order. How many possible such passwords are there if (a) repetitions are allowed, and (b) repetitions are not allowed?

(b) The answer is (7c2)*(26p5)*(10p2), but I basically have the same questions as above. How are they coming up with the different components? I'm not sure when to use each formula (i.e., with/without replacement, with/without regard to order).

There are $\displaystyle _7P_2$ strings of two digits without repeats. There are $\displaystyle _7C_2$ places to put the first and secomd.

That leaves five places to put the $\displaystyle _{26}P_5$ possible alpha stringa.