# Thread: counting principles (not sure what forum this belongs on, hoping someone can help plz

1. ## counting principles (not sure what forum this belongs on, hoping someone can help plz

So i've jumped midway into a course and there are one or two topics I was never there for. On a take home review for me to know what kind of problems to expect on an upcoming test there were the following two problems that I wasn't sure how to approach:

1) suppose we have an alphabet A = {a through z, A through Z, and 0 through 9} (63 characters).

a)Identifiers have NO MORE THAN 8 characters, the first character is upper or lower case alphabetical, successive characters can be any element of A.

How many distinct identifiers are possible? What counting principles are being used?

b) Suppose you are now allowed to have a single _ as the first character provided the second character is upper or lower case alphabetical, but still 8 or fewer characters in an identifier. How many additional identifiers are now possible? What counting principle is being used?

2) Suppose a class has 26 male, and 9 female students. The teacher is forming a discussion panel of 6 members.

a) How many different discussion panels are possible?
b) If the teacher wants 4 males and 2 females on the panel, how many different discussion panels are possible?

Again this is to help me review so if possible I dont want just the answer but someone to spell out how you would walk through this problem so that I can do another one like it in the near future (although the answer would also help so I can double check myself). Thanks for any help! Im aware this isn't necessarily a calculus problem but I really dont know what topic it would fall under.

2. ## Re: counting principles (not sure what forum this belongs on, hoping someone can help

Originally Posted by mathnooblet
1) suppose we have an alphabet A = {a through z, A through Z, and 0 through 9} (63 characters).

a)Identifiers have NO MORE THAN 8 characters, the first character is upper or lower case alphabetical, successive characters can be any element of A.
You left out a crucial piece: Can the same symbol be used more than once(i.e. repeated)?

3. ## Re: counting principles (not sure what forum this belongs on, hoping someone can help

I'm assuming so where as it is not stated so yes. Also I was puzzled on how there are 63 character, turns out "_" is also a character hence the 52 alpha, the 10 decimal, and the blank char. But all rules are stated, so for example in a) the only restriction is first character must be alpha...

I worked on it and ended up with:
52 * 63 to the power of 7 identifiers (the first spot has 52 different chars and the others have 63 chars, with no restrictions stated on repeats wouldn't this be correct?)

for b) I ended up with :
52 * 63 to the power of 6 additional identifiers (first char can now be "_", but if it is then char 2 must be alpha which gives it 52 choices, remaining 6 chars have 63 possible values).

Still not sure what my teacher means by "what counting principles are you using" unless he simply wants "common sense" as the answer... Or am I looking at this problem completely wrong?

For 4 I ended up with:
a) 35 * 34 * 33 * 32 * 31 * 30
b) 26 * 25 * 24 * 23 * 9 * 8
seeing as each char can be any of the 35 students but then obviously the next char has one less choice (student can't be used twice, i think this is his way of implementing whether values can be repeated or not). Then in b the first four chars are restricted to men and the last two are women...

Am I doing this right? What are counting principles, thanks guys !

4. ## Re: counting principles (not sure what forum this belongs on, hoping someone can help

Originally Posted by mathnooblet
I'm assuming so where as it is not stated so yes. Also I was puzzled on how there are 63 character, turns out "_" is also a character hence the 52 alpha, the 10 decimal, and the blank char. But all rules are stated, so for example in a) the only restriction is first character must be alpha...
I worked on it and ended up with:
52 * 63 to the power of 7 identifiers (the first spot has 52 different chars and the others have 63 chars, with no restrictions stated on repeats wouldn't this be correct?)!
That is correct if the code has to be eight symbols long.
But the question says up to eight (implies at least one)
So $\displaystyle \sum\limits_{k = 0}^7 {52 \cdot {{63}^k}}$

5. ## Re: counting principles (not sure what forum this belongs on, hoping someone can help

Originally Posted by Plato
That is correct if the code has to be eight symbols long.
But the question says up to eight (implies at least one)
So $\displaystyle \sum\limits_{k = 0}^7 {52 \cdot {{63}^k}}$
not sure what your notation means. And more importantly what counting principles are these?

So 52 * 63 to the k
where k can be 0, 1, 2, 3, 4, 5, 6, 7 for the possible number of digits... And then wouldnt' I need to add all these possibilities since each 52 * 63 to the k is a possible set?
So 52 * 63 to power of 7 + 52 * 63 to power of 6 ......... + 52 * 63 to the power of 0?

6. ## Re: counting principles (not sure what forum this belongs on, hoping someone can help

Originally Posted by mathnooblet
not sure what your notation means. And more importantly what counting principles are these?

So 52 * 63 to the k
where k can be 0, 1, 2, 3, 4, 5, 6, 7 for the possible number of digits... And then wouldnt' I need to add all these possibilities since each 52 * 63 to the k is a possible set?
So 52 * 63 to power of 7 + 52 * 63 to power of 6 ......... + 52 * 63 to the power of 0?
That is a summation $\displaystyle \sum\limits_{k = 0}^7 {52 \cdot {{63}^k}}=52+52\cdot 63+52\cdot 63^2+\cdots+52\cdot 63^7$
It counts eight possible lengths of the code.

7. ## Re: counting principles (not sure what forum this belongs on, hoping someone can help

Originally Posted by Plato
That is a summation $\displaystyle \sum\limits_{k = 0}^7 {52 \cdot {{63}^k}}=52+52\cdot 63+52\cdot 63^2+\cdots+52\cdot 63^7$
It counts eight possible lengths of the code.
so in other words I was right with "So 52 * 63 to power of 7 + 52 * 63 to power of 6 ......... + 52 * 63 to the power of 0" ??

sum the 8 different possible lengths, and all this added up gives you the total possible number of identifiers?

And no clue what my teacher means by what counting principles?

8. ## Re: counting principles (not sure what forum this belongs on, hoping someone can help

Originally Posted by mathnooblet
And no clue what my teacher means by what counting principles?
I would tell my students that it is the multiplicative principle .

9. ## Re: counting principles (not sure what forum this belongs on, hoping someone can help

Hi there! We are in the same class so hopefully we can help each other!! What he means by counting principle is: are we using combinations (where order does not matter and there can be no repeating "values", think of a poker hand) or permutations (where repetition is not allowed) or are we just using the standard counting principle? For the combinations, we would use the formula: n!/[k!(n-k)!] where n is the total number of elements to choose from and k is how many elements we want to choose out of the total number of elements. For the permutation, we would use n!/(n-k)!. If we are just using the standard counting principle (when repetitions are allowed) we use n^k.

For the first question:
We want the first choice to be either upper or lower case alpha. So we have 52 options and we want to choose 1. This would be C(52,1) or combination 52 elements choose 1. For the next 7 characters, we can choose from the entire set. So we have 63 options and we want to choose 7. This would be C(63,7) or combination 63 elements choose 7. Now just plug into the combination formula above.

For the second question:
The first two characters, order matters and we can't repeat (because we can't have a _ followed by a _) so we want to use the permutation formula. This would be P(53,2) or permutation 53 elements choose 2. Then for the last 6, we just use a combination like above but for 6 elements instead of 7.

Does that help? I can also help you with the next problem if you would like me to.