How many strings of four letters have x in them

  • Thread starter Thread starter Mr Davis 97
  • Start date Start date
  • Tags Tags
    Strings
AI Thread Summary
The discussion centers on calculating the number of four-letter strings containing the letter 'x'. One approach calculates the total by placing 'x' in one of four positions and filling the remaining three with other letters, yielding 62,500 combinations. Another method counts the total strings and subtracts those without 'x', resulting in 66,351. The discrepancy arises from the first method accounting for exactly one 'x', while the second allows for at least one 'x'. Clarification reveals that the first answer is incorrect for the original question, which asks for at least one occurrence of 'x'.
Mr Davis 97
Messages
1,461
Reaction score
44

Homework Statement


How many strings of four lowercase letters have x in them?

Homework Equations

The Attempt at a Solution


It seems that there are two ways of doing this. First, there are four ways to choose where the x goes, and then there are 25^3 number of ways to choose what the other letters are. So in total there would be 4(25)^3 = 62500 ways.

But another valid way would be to count the complement. That is, there are 26^4 strings of four lowercase letters, and there are 25^4 strings of lowercase letters with no x. Thus 26^4 - 25^4 = 66351 would be how many lowercase letters have an x.

These two numbers obviously don't match. So what could I be doing wrong?
 
Physics news on Phys.org
Mr Davis 97 said:

Homework Statement


How many strings of four lowercase letters have x in them?

Homework Equations

The Attempt at a Solution


It seems that there are two ways of doing this. First, there are four ways to choose where the x goes, and then there are 25^3 number of ways to choose what the other letters are. So in total there would be 4(25)^3 = 62500 ways.

But another valid way would be to count the complement. That is, there are 26^4 strings of four lowercase letters, and there are 25^4 strings of lowercase letters with no x. Thus 26^4 - 25^4 = 66351 would be how many lowercase letters have an x.

These two numbers obviously don't match. So what could I be doing wrong?
Is the question "How many strings of four lowercase letters have exactly one x in them?" It makes a difference whether there is exactly one occurrence of this letter or if there can be two or more of these letters in the string.
 
Mark44 said:
Is the question "How many strings of four lowercase letters have exactly one x in them?" It makes a difference whether there is exactly one occurrence of this letter or if there can be two or more of these letters in the string.
Ah! I read the question wrong. Does this mean that first answer is incorrect, as it deals with the case of having exactly one, while second answer is correct, since it deals with the case of having at least one x?
 
Mr Davis 97 said:
Ah! I read the question wrong. Does this mean that first answer is incorrect, as it deals with the case of having exactly one, while second answer is correct, since it deals with the case of having at least one x?
The first calculation you did is for exactly one x. There are four ways to choose where the x goes, times the 25 other possibilities in the other three positions. IOW, ##\binom 4 1 \cdot 25^3 = 62,500##. Your other calculation allows for at least one, but no more than four x's to appear.
 
I picked up this problem from the Schaum's series book titled "College Mathematics" by Ayres/Schmidt. It is a solved problem in the book. But what surprised me was that the solution to this problem was given in one line without any explanation. I could, therefore, not understand how the given one-line solution was reached. The one-line solution in the book says: The equation is ##x \cos{\omega} +y \sin{\omega} - 5 = 0##, ##\omega## being the parameter. From my side, the only thing I could...
Back
Top