How Many 5-Character Strings Include At Least One '@' Symbol?

  • Thread starter Thread starter duke_nemmerle
  • Start date Start date
  • Tags Tags
    Counting Strings
Click For Summary
SUMMARY

The discussion focuses on calculating the number of 5-character strings that include at least one '@' symbol using the ASCII character set, which contains 128 characters. The correct approach is to subtract the total number of 5-character strings without the '@' symbol (127^5) from the total number of 5-character strings (128^5). The flawed reasoning presented involved incorrectly assuming that the '@' could occupy one of five positions while the other four characters could be any of the 128, leading to an overcounting of strings with multiple '@' symbols.

PREREQUISITES
  • Understanding of combinatorial counting principles
  • Familiarity with the ASCII character set
  • Basic knowledge of exponential functions
  • Ability to analyze and correct logical reasoning in mathematical proofs
NEXT STEPS
  • Study combinatorial counting techniques in depth
  • Learn about the principle of inclusion-exclusion in combinatorics
  • Explore variations of string counting problems with different character sets
  • Practice problems involving permutations and combinations
USEFUL FOR

Mathematics students, educators, and anyone interested in combinatorial problems and string theory will benefit from this discussion.

duke_nemmerle
Messages
50
Reaction score
1

Homework Statement

Given that the ASCII character system has 128 possible characters how many 5 character strings are there with at least one occurrence of the '@' symbol.



Homework Equations





The Attempt at a Solution


So clearly which symbol we're using doesn't matter, and I see that the right answer comes from considering the total number of length 5 character strings minus the number of strings not containing the '@' character i.e. 128^5-127^5.

My real question is what is wrong with the reasoning that we have 5 choices for where to put the '@' symbol multiplied by the 128^4 possible strings from the other 4 characters. I can see that 128^5-127^5 \not= 5(128^4), but I'm wondering where the flaw in the reasoning is
 
Physics news on Phys.org
duke_nemmerle said:

Homework Statement

Given that the ASCII character system has 128 possible characters how many 5 character strings are there with at least one occurrence of the '@' symbol.



Homework Equations





The Attempt at a Solution


So clearly which symbol we're using doesn't matter, and I see that the right answer comes from considering the total number of length 5 character strings minus the number of strings not containing the '@' character i.e. 128^5-127^5.

My real question is what is wrong with the reasoning that we have 5 choices for where to put the '@' symbol multiplied by the 128^4 possible strings from the other 4 characters. I can see that 128^5-127^5 \not= 5(128^4), but I'm wondering where the flaw in the reasoning is

I think I've figured it out by considering a much smaller alphabet and character length. I was obviously overcounting, but now I see that I'm counting the strings with more than one instance of the character several times each.
 

Similar threads

Replies
3
Views
8K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 16 ·
Replies
16
Views
2K
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
Replies
7
Views
3K
  • · Replies 16 ·
Replies
16
Views
5K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 14 ·
Replies
14
Views
5K
  • · Replies 4 ·
Replies
4
Views
2K