Counting - $9$ digit number consisting of $5$ odd and $4$ even digits, not sure how to do the 2nd step

151 Views Asked by At

So I'm trying to calculate the total number of $9$-digit combinations consisting of $5$ odds and $4$ evens ($1$ through $9$).

I calculated it as $5^5 \cdot 4^4$. The order of even and odds don't matter. I was wondering, is there another step I need to do to factor that odd and even numbers can be in any positions?

3

There are 3 best solutions below

4
On

Your answer is incorrect.


You calculated the number of all 9-digit combinations starting with $5$ odd numbers and $4$ even numbers.

This is not what the question is asking. For example, you only count $111112222$, but not $111121222$


To solve the problem, think about constructing a $9$ digit number in two steps:

  1. First, select the positions of the odd numbers.
  2. Then, pick the odd numbers for the odd positions, and even numbers for the even positions.
0
On

Is there another step I need to do to factor [in] that even and odd numbers can be in any positions?

Yes, we must choose which positions are occupied by odd numbers. The number of ways of selecting a subset of $k$ elements from a set of $n$ elements is $$\binom{n}{k} = \frac{n!}{k!(n - k)!}$$ where the symbol $\binom{n}{k}$ is read "$n$ choose $k$" and $n!$ is read "$n$ factorial". By definition, $0! = 1$ and $n!$ is the product of the first $n$ positive integers when $n$ is a positive integer.

In this case, we need to choose five of the nine positions for the odd integers, which can be done in $$\binom{9}{5} = \frac{9!}{5!4!} = \frac{9 \cdot 8 \cdot 7 \cdot 6 \cdot 5!}{5! \cdot 4 \cdot 3 \cdot 2 \cdot 1} = \frac{9 \cdot 8 \cdot 7 \cdot 6}{4 \cdot 3 \cdot 2 \cdot 1} = 3 \cdot 7 \cdot 6 = 126$$ ways. Notice that choosing the positions of the odd integers forces us to fill the remaining four positions with even integers.

Since there are $5$ choices for each of the five odd digits and $4$ choices for each of the $4$ even digits, there are $$\binom{9}{5}5^54^4$$ nine-digit positive integers with five odd digits and four even digits that can be constructed using the digits $1, 2, 3, 4, 5, 6, 7, 8, 9$.

For background, you may want to read about

0
On

Your answer is incorrect


As the question asks about combinations

Let us define $a_i$ as number of times the digit $i$ has been taken.

$\therefore a_1 + a_3 + a_5 + a_7 + a_9 = 5$

$a_2 + a_4 + a_6 + a_8 + a_0 = 4$

We have $\binom{9}{5}$ ways for the first statement and $\binom{9}{4}$ for the second

$\therefore$ Total number of combinations = $\binom{9}{5}\binom{9}{4} = 15876$