Math Fundamentals18 sections · 814 units
Open in Course

At Least One Constraint

(Common restriction pattern)

How many 4-character passwords have at least one digit? Direct counting is complex. Complementary counting: total passwords minus passwords with no digits.

Total (letters and digits): 36^4 = 1,679,616. No digits (only letters): 26^4 = 456,976. At least one digit: 1,679,616 - 456,976 = 1,222,640.

This pattern appears everywhere. "At least one X" = Total - "Zero X".