[Math] String probability (with conditional prob and combinations)

combinationsconditional probabilityprobabilitystring-theory

I'm having trouble with the questions below, all relating to string probability. I'll write the problem and then provide my work for my (incorrect) answer. Please help me figure out what I did wrong.

SET1: Assume a string, allowing repetition, is randomly selected from all strings of length 4 from the set A = {r, e, a, s, o, n}.

Q1. What is the probability that it contains exactly one letter that is a vowel?

A1: 6^4 total probability, thus one vowel should be equal to…
(C(4,1) * C(4,3)) / (6^4)

Q2. What is the probability that such a string contains exactly two r's given that it contains exactly two o's?

A2: two r's and two o's in a string of length 4 have 6 permutations, so according to conditional probability, we must show P(two r's | two o's) = P(two r's and two o's) / P(two o's), thus we have… (6 / (6^4)) / (C(4,2) * ((1/6)^2) * C(4,2) * ((5/6)^2))

SET2: How many distinct permutations of the letters in "letters"…

Q1. Begin with two vowels?

A1: 2 * 1 * 5 * 4 * 3 * 2 * 1 = 2 * (5!), since there are two vowel choices for the first spot, one for the second spot, then five remaining letters, then four, etc…

Q2. Begin with two e's or end with two t's?

A2: 2(2 * (5!)) – (2 * 1 * 3 * 2 * 1 * 2 * 1), used similar logic to the logic explained above in A1.

Q3. Have the vowels together?

A3: 6!, since you group the vowels together as one entity then find a place for all 6 entities.

Thank you!

p.s. If someone could format this, I'm not familiar with latex formatting and didn't see anything about math formatting in the advanced formatting help link. :-/

Best Answer

For problem Set1:

I will use $v$ for vowel and $c$ for consonant. For (1), you have strings of length $4$. So $s = _ _ _ _$. You want a single vowel. Suppose $s = v _ _ _$. The remaining three spots are consonants. There are three consonants, with one consonant per slot. So $s = v c c c$. So the number of ways to get $v = \binom{3}{1} = 3$, and the number of ways to get each $c$ is also $3$. So there are $3 * 3^{3} = 3^{4}$ ways to form a string with the first letter a vowel.

Now consider if $v$ is in the second position. The number of such strings is the same as if $v$ was in the first position. So you can easily see that the answer to your question is $3^{4} * 4$.

For the problem Set2:

For your first problem with "letters", there are two e characters. So by the multinomial counting rule, you divide by 2. Thus, the number of ways to start with two vowels is 5!.

You are making the same mistake in the second problem. Since there are two t's, you have to divide by 2. Thus, you have 2∗5!−3! as your answer. Your thinking is correct, though. Count first the number of ways to get two e's upfront (which is the answer to your first problem), then count the number of ways to get two t's at the end (also the answer to your first problem), then subtract out the number of ways to start with two e's and end with two t's (ie., permute the middle 3 characters).

Your answer for part 3 is correct.