Counting strings of alphabets 0,1,2 and 3

In summary: I just wanted to show you how to do it.But if you want me to solve it: there are 10 possible positions for the 3, and for each of those positions there are 9 possible positions for the 0. For the remaining 8 digits, there are 3 choices (1, 2, or 3) for each digit, so we have 9, 3, 3, 3, 3, 3, 3, 3, 3 possible combinations for those digits. That's 9*3^8. So for a weight of 3 we have 10*9*3^8.
  • #1
issacnewton
1,041
37

Homework Statement


Consider the collection of all strings of length 10 made up from the alphabet 0, 1, 2 and 3. How many of these strings have weight 3? How many have weight 4? How many have even weight ?

Homework Equations


Combinations formulae

The Attempt at a Solution


Let me explain what weight is here. So if the string of length 10 formed is 0011002233, then the weight of the string is just the sum of all the digits. So in this example, the weight would be 12. I need help only in the last part. For the weight to be even, there will be two cases. Case 1) No. of 1's is even and no. of 3's is even. And second case is Case 2) No. of 1's is odd and no. of 3's is odd. Now for the Case 1), no. of 1's can be from the set ##\{0,2,4,6,8,10 \}## and no. of 3's can also from the list ##\{0,2,4,6,8,10 \}##. So for Case 1), we have 36 possibilities. It doesn't matter how many 0's and 2's are there, since they will not alter the evenness of the weight of a string. Now for each of this 36 possibilities, I can use combinations formulae to find the no. of possible strings, but that would be cumbersome. Similarly I can do for Case 2) and even there calculations are cumbersome for each odd no. of 1's and each odd no. of 3's. I would like to know if there is a smarter way to do this problem.

Thanks:smile:
 
Physics news on Phys.org
  • #2
For weight three you have three groupings to consider:
- 0, 3 where only one 3 token can be in the string
- 0, 1, 2 where only one 1 and one 2 can be in the string
- 0, 1 where only three 1 tokens can be in the string

From there you count up the ways you can create a string with the limitations above noting that in the string with three 1 tokens you have to drop out duplicates.

So for the one 3 case you have 10 possible positions for the 3.

Your turn.
 
  • #3
jedishrfu, 3 is not an even weight, why are you considering this case ? I only want to find no. of possible strings with even weight.
 
  • #4
For the first digit there are an equal number of possibilities for being odd (1, 3) and even (0, 2). Same for digit 2, so for digits 1 and 2 there are equal numbers of odd (odd+ even, even + odd) and even (odd + odd, even + even) combinations. Extend the argument to the next digit, and the next... The strings with even weight will always be half the total possible strings, i.e. here 410/2.
 
  • #5
IssacNewton said:
jedishrfu, 3 is not an even weight, why are you considering this case ? I only want to find no. of possible strings with even weight.

Did you want me to solve your problem or show how to solve it?
 
Back
Top