[Math] “Statistics”: How many of these begin and end with the letter “S”

permutationsstatistics

How many distinct permutations are there of the letters
in the word “statistics”? How many of these begin
and end with the letter s?

The first part of the question I do understand. You have to use permutation with identical items. This is based on the number of letters.

$$\binom{10}{3,3,1,2,1} = 50400$$

Yet for the second part I am confused as to what the directions means. It says that how many letters begin and ends with letters s so does one eliminate $2$ s and calculate this problem normally?

BONUS:
If so using a similar example how does one find out if how many of these begin and end with the letters m for the word
"mathematicsman"?

Best Answer

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