Kinda tricky counting problem.

cragar
Messages
2,546
Reaction score
3

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 36^2-10^2 for the second one. And this pattern should continue.
So i think the answer is (26)+(36^2-10^2)+(36^3-10^3)+(36^4-10^4)
I didn't simply this so you can see my reasoning.
 
Physics news on Phys.org
Seems correct!
 
sweet
 
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).
 
There are two things I don't understand about this problem. First, when finding the nth root of a number, there should in theory be n solutions. However, the formula produces n+1 roots. Here is how. The first root is simply ##\left(r\right)^{\left(\frac{1}{n}\right)}##. Then you multiply this first root by n additional expressions given by the formula, as you go through k=0,1,...n-1. So you end up with n+1 roots, which cannot be correct. Let me illustrate what I mean. For this...
Back
Top