Skip to content

Seven-digit codes with non-decreasing digits

Question

A sign-up code is a string of 77 digits, each from 00 to 99; repeats are allowed and leading zeros are fine. How many codes have digits that never decrease from left to right? (For example 11223451122345 and 99999999999999 qualify but 23456572345657 does not.)

Short answer

1144011440. A non-decreasing code is fixed once you know how many times each of the 1010 digits appears, so count non-negative integer solutions of x0+⋯+x9=7x_0+\dots+x_9=7. By stars and bars that is (167)=11440\binom{16}{7}=11440.

Adapted from QuantQuestions.io; question and answer rewritten by SelfMadeQuant.com.

See the hint and the full worked solution in the question bank (free account).

Open the worked solution

Lessons behind this question

Start with a free lesson: Probability Fundamentals is part of a free topic. Create a free account, no card needed, to read it in full with worked solutions.

Read it free