1 / 4

Counting Warmup

Counting Warmup. Strings of 7 bits. How many have a run of at least 3 1s? Let S={0,1} 7 Let R⊆S be the strings with a run of 3 1s R={0,1} * 111{0,1} * ∩S To count R, split it into disjoint subsets and count the subsets

bowie
Download Presentation

Counting Warmup

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Counting Warmup

  2. Strings of 7 bits How many have a run of at least 3 1s? Let S={0,1}7 Let R⊆S be the strings with a run of 3 1s R={0,1}*111{0,1}*∩S To count R, split it into disjoint subsets and count the subsets Break R into subsets according to the position of the FIRST block of three 1s A string in R could be of the form 111xxxx, 0111xxx, x0111xx,xx0111x, or abc0111 where x is 0 or 1, and abc is any string of 3 bits except 111 16+8+8+8+7=47 Sum rule: If R=R1∪…∪Rn and the Ri are pairwise disjoint, then |R|=|R1|+…+|Rn|

  3. Strings of 7 bits How many members of S have a run of exactly 3 1s but not longer? Easiest to calculate how many have a run of at least four 1s and take the difference: 1111xxx, 01111xx, x01111x,xx01111 so20total 47-20=27 General rule: If A⊆B then |B-A|=|B|-|A|

  4. Strings of 7 bits How many members of S have a run of at least 3 1s or at least 3 0s? # with 3 1s + # with 3 0s - # with both (so they will not get counted twice) General rule: |A∪B|=|A|+|B|-|A∩B| Strings with both a run of 3 1s and 3 0s = 000111x, 111000x, 00001111, 1111000, 1000111, 0111000: 8 possibilities 47+47-8=86

More Related