Remember that $EA$ and $UO$ are being treated as single letters. Let $X = EA$ and $Y = UO$. How many permutations are there of $XIY$. The answer is $3!$.
Then how many contain AE and EI
This is equivalent to containing $AEI$. Treat that as a super letter. You have then two other letters. So how many permutations are there of three letters?
and how many end with O.
We have four slots and four distinct letters. $- - - - O$. How many ways are there to permute the four-letter prefix amongst four distinct characters? That's just $4!$.
Oh my, such confusion! Let's try to simplify this, yet keep its essence.
Instead of statistics, let's use stats. There are 30 unique
arrangements, of which 3 have s at each end:
$$ \frac{5!}{2!\,2!} = 30\; \; \text{and} \; \; 3!/2! = 3.$$
So we can get the second number by removing s from each end
and dealing with what remains.
This means that in a random permutation. the probability of
getting an s at each end, should to 0.1.
In the simulation program below, I have avoided the messiness
of dealing with character strings in R, by substituting numbers
for letters in stats
(1 represents s). A million random
permutations ought to give 2-place accuracy, so the answer
substantially matches the theoretical value.
stats = c(1,1,2,2,3)
n = length(stats)
m = 10^6; x = numeric(m)
for (i in 1:m) {
perm = sample(stats,n)
x[i] = (perm[1]==1 & perm[n]==1) }
mean(x)
## 0.099806
Now let's use mamam
instead of mathematicsman
. Again here, we can
use the standard method find $\frac{5!}{3!\cdot 2!} =10$ as the number of unrestricted, distinguishable permutations. If we ignore two of the (indistingusihable) m
's, then we
have the 3 arrangements of ama
. So the probability
a random permutation has m's at both ends should be $3/10 = 0.3.$ The simulation below
confirms this.
mamam = c(1,1,1,2,2)
n = length(mamam)
m = 10^6; x = numeric(m)
for (i in 1:m) {
perm = sample(mamam,n)
x[i] = (perm[1]==1 & perm[n]==1) }
mean(x)
## 0.300217
Best Answer
We really need to choose $5$ non-A letters from the $8$ non-A's available, and put them in a row after the A.
The first letter (after the obligatory A) can be chosen in $8$ ways.
For each of these ways, the second letter can be chosen in $7$ ways.
For each choice of first and second, there are $6$ ways to choose the third, and then $5$ ways to choose the fourth, and $4$ ways to choose the fifth, for a total of $(8)(7)(6)(5)(4)$.
Another way: We can choose the $5$ letters from the $8$ available in $\binom{8}{5}$ ways. For every choice, we can line up the $5$ chosen letters in $5!$ ways, for a total of $\binom{8}{5}5!$.
Another way: We do not find the $\text{P}(n,r)$ notation particularly useful. But since it was mentioned in the post, we want to make a $5$-letter word (to append to A) from the $8$ non-A's. There are $\text{P}(8,5)$ ways to do this.