• Support PF! Buy your school textbooks, materials and every day products Here!

Kinda tricky counting problem.

  • Thread starter cragar
  • Start date
  • #1
2,544
2

Homework Statement



A computer operating system allows files to be named using any combination of uppercase letters (A-Z) and digits (0-9) But the number of characters is at most 4 , And there must be at least 1 letter in each file name.

The Attempt at a Solution


So I break this up into 4 cases. 1 character file name , 2 character file name , 3 character file name , 4 character file name.
For the first case I just have 26 choices because it has to be a letter.
and for the second one I have 2 characters, To make sure I have at least one letter in it
I take all the possible combinations 36*36 minus the combinations with no letters
so I should have [itex] 36^2-10^2 [/itex] for the second one. And this pattern should continue.
So i think the answer is [itex] (26)+(36^2-10^2)+(36^3-10^3)+(36^4-10^4) [/itex]
I didn't simply this so you can see my reasoning.
 

Answers and Replies

  • #2
22,097
3,278
Seems correct!
 
  • #3
2,544
2
sweet
 
  • #4
2
0
You're on the right track.

In the case of only one letter, the rest are numbers, right? So that's 26*10*10*10 combinations. And there are four of those cases, because the letter can be in any of four positions. Using X as a stand-in for any letter and 9 as a stand-in for any number: X999, 9X99, 99X9, 999X.

In the case of two letters, you have six configurations: XX99, X9X9, X99X, 9XX9, 9X9X, 99XX. Each configuration contains 26*26*10*10 combinations.

In the case of three letters, you have four configurations (9XXX, X9XX, XX9X, XXX9), each containing 26*26*26*10 combinations.

In the case of four letters, you have only one configuration with 26*26*26*26 combinations.

So the total number of combinations of filenames is 4*(26^1*10^3) + 6*(26^2*10^2) + 4*(26^3*10^1) + 1*(26^4*10^0).

Hope this helps (and I hope I didn't make a mistake).
 

Related Threads for: Kinda tricky counting problem.

  • Last Post
Replies
2
Views
770
Replies
1
Views
3K
Replies
22
Views
949
  • Last Post
Replies
3
Views
2K
  • Last Post
Replies
8
Views
2K
  • Last Post
Replies
8
Views
4K
  • Last Post
Replies
6
Views
1K
  • Last Post
Replies
19
Views
1K
Top