Exercise · ZW-INCLUSION-EXCLUSION-PRINCIPLE-008 · ★★★ Advanced

How many binary strings of length 8 start with 1 or end with 00?

Choose one option.

Show answer
  • A. \(160\)

Explanation

Starting with 1: \(2^7=128\). Ending with 00: \(2^6=64\). Both: \(2^5=32\). Total \(128+64-32=160\).

Study Discrete mathematics in ZWMath →

Review the concept: Inclusion-exclusion principle

It counts the elements of the union of finite sets \(A\), \(B\), \(C\), … by adding their sizes and correcting what was counted too often in the intersections.

\[\begin{aligned}|A\cup B|&=|A|+|B|-|A\cap B|\\|A\cup B\cup C|&=|A|+|B|+|C|\\&\quad-|A\cap B|-|A\cap C|-|B\cap C|\\&\quad+|A\cap B\cap C|\end{aligned}\]

More practice problems: inclusion-exclusion principle

← ZW-INCLUSION-EXCLUSION-PRINCIPLE-007 ZW-INCLUSION-EXCLUSION-PRINCIPLE-009 →