INFO

A sequence composed solely of the characters 0 and 1.
These strings are fundamental in computer science and digital systems—used to represent binary data, machine instructions, and logic states.

How Many Binary Strings of Length ?

IMPORTANT

In general, the number of strings of length over an alphabet with characters is:

  • : number of choices per position
  • : number of positions

See also: Power Rule


Examples

1. Latin Alphabet Words

How many 4-letter words can be formed over the Latin alphabet (26 letters)?

2. Passwords with Mixed Characters

How many 8-character passwords can be made using uppercase, lowercase, and digits?

3. Passwords with Disjoint Character Sets

How many 8-character passwords contain only uppercase, only lowercase, or only digits?

NOTE

This is a direct application of the Sum Rule.


Complement Method: “At Least One” Conditions

4. At Least One Uppercase Letter

How many 8-character passwords contain at least one uppercase letter?

Let:

  • Total passwords:
  • Passwords with no uppercase (only lowercase + digits):

Then:

Alternate form:

TIP

This is a classic use of the complement principle. See also: Inclusion Exclusion


Complement Method: “At Least One 0”

5. 4-Digit Strings with at Least One 0

How many 4-digit strings (digits 0–9) contain at least one 0?

  • Total:
  • No 0s (digits 1–9 only):

So:


Exact Count Methods

6. Exactly Zeros in a 4-Digit String

Breakdown:

7. First Occurrence of 0

Alternative breakdown:


Distribution Interpretation

8. Distributing 10 Distinct Candies to 4 Children

If each candy independently goes to one of 4 children:

If each child gets exactly one candy and order matters:

NOTE

See Power Rule and rPermutations for context.