Discrete Math Counting Question. I need help with one of those question where you have to count the number of ways you can place r objects into n distinct boxes kinds. I was wondering if someone could solve an example in detail. How many positive integers greater than equal to 1 and less than or equal to 10010 have the property that the sum of their digits is exactly 9?

Bernard Boyer

Bernard Boyer

Answered question

2022-07-16

I need help with one of those question where you have to count the number of ways you can place r objects into n distinct boxes kinds. I was wondering if someone could solve an example in detail.
How many positive integers greater than equal to 1 and less than or equal to 10010 have the property that the sum of their digits is exactly 9?

Answer & Explanation

umshikepl

umshikepl

Beginner2022-07-17Added 11 answers

Step 1
Split the count into two parts: the positive integers less than 10000, which are all of the positive integers having at most four digits, and those between 10000 and 10010 inclusive. The latter part contains only one integer whose digits sum to 9, namely, 10008, so we need only add 1 to whatever figure we get for the first part.
Step 2
Think of the integers from 1 through 9999 as four-digit integers, padding with initial zeroes if necessary. Say that the digits are d 1 , d 2 , d 3 , and d 4 . Then you’re asking for the number of solutions in non-negative integers to the equation d 1 + d 2 + d 3 + d 4 = 9. This is a standard stars-and-bars problem; the answer is
( 9 + 4 1 4 1 ) = ( 12 3 ) .
The reasoning behind that answer is explained fairly well at the link; try reading that, and I’ll try to answer any questions that you may then have.

Do you have a similar question?

Recalculate according to your conditions!

New Questions in Discrete math

Ask your question.
Get an expert answer.

Let our experts help you. Answer in as fast as 15 minutes.

Didn't find what you were looking for?