# Counting Problems

• Sep 14th 2010, 04:41 PM
algorith
Counting Problems
Ok, so I have a test tomorrow and there are a few problems that still don't make sense to me, any help on any one of these would be appreciated.

1) How many sequences of length 5 can be formed using the digits 0 through 9 with the property that exactly 2 of the 10 digits appear (e.g. 05550).

For this one, I get 10 * 9 * C(5,2). But the book tells me I'm wrong and I don't understand why.

2) How many five-card hands are there such that either all cards are from the same suit or from exactly two different suits?

I think it starts with C(13,2). Then choose a way to choose from exactly two suits, this part doesn't make sense to me (Worried)
• Sep 14th 2010, 04:58 PM
undefined
Quote:

Originally Posted by algorith
Ok, so I have a test tomorrow and there are a few problems that still don't make sense to me, any help on any one of these would be appreciated.

1) How many sequences of length 5 can be formed using the digits 0 through 9 with the property that exactly 2 of the 10 digits appear (e.g. 05550).

For this one, I get 10 * 9 * C(5,2). But the book tells me I'm wrong and I don't understand why.

2) How many five-card hands are there such that either all cards are from the same suit or from exactly two different suits?

I think it starts with C(13,2). Then choose a way to choose from exactly two suits, this part doesn't make sense to me (Worried)

(1) There are C(10,2) ways to choose which two digits appear.

EDIT: Sorry I didn't enforce that both digits must appear in the part below, so it's wrong. I am too busy now to correct it.

<wrong>

When you fix the digits it's then 2^5 (think why)

So overall you get C(10,2) * 2^5

</wrong>

(2) You can use inclusion exclusion. And you can rephrase question as asking how many ways to deal a five card hand such that at most two suits appear.

Number of ways to select two suits from four is C(4,2)

When two suits are fixed, number of ways to select 5 cards is C(26,5)

Note that for each suit, we count the number of ways to select 5 cards with just that suit 3 times.

For example, hands with all hearts cards are included in (hearts and spades), (hearts and clubs), and (hearts and diamonds)

Thus we should subtract the duplicates, so finally we get

C(4,2) * C(26,5) - 4 * 2 * C(13,5)
• Sep 14th 2010, 05:36 PM
algorith
Thanks. The first one makes sense now, although the answer is not exactly right, you forgot the case where it's all 1 digit, 2 cases. So it's c(10,2) * (2^5 - 2), that's what the book has anyways. I'm still digesting the second one but it's making more sense. Cheers.
• Sep 14th 2010, 05:38 PM
undefined
Quote:

Originally Posted by algorith
Thanks. The first one makes sense now, although the answer is not exactly right, you forgot the case where it's all 1 digit, 2 cases. So it's c(10,2) * (2^5 - 2), that's what the book has anyways. I'm still digesting the second one but it's making more sense. Cheers.

• Sep 14th 2010, 08:44 PM
Lukybear
For second question, how did you attain duplicates?
• Sep 14th 2010, 08:54 PM
undefined
Quote:

Originally Posted by Lukybear
For second question, how did you attain duplicates?

I'm not sure what you're asking, but I can explain a bit more.

There are C(4,2)=6 ways to choose two suits

(h,c)
(h,d)
(h,s)
(c,d)
(c,s)
(d,s)

Note that each letter appears in exactly three ordered pairs.

So if we were to enumerate all 5 card hands from the 26 cards described by (h,c), among them would be 5 card hands that consist only of hearts, as well clubs.

But we would list those same 5 card hands for hearts when dealing with (h,d) and (h,s). Thus we counted them three times and should subtract two of them.

So it's 4 * 2 * C(13,5) that we subtract: 4 suits; 2 sets of unwanted duplicates; C(13,5) hands in each case.