Combinatorics, Inclusion/Exclusion

Channel:
Subscribers:
2,700
Published on ● Video Link: https://www.youtube.com/watch?v=KdhhaKZdwxI



Duration: 1:49:27
103 views
1


Today we talked more about combinatorics, including ways of estimating about how long before we run out of social security numbers or license plates, how quickly a password can be guessed, and so forth. It's an essential math skill for a computer scientist to use when making ballpark figures for run times. It's nice to know if a program will run in a couple minutes, a couple days, or the heat death of the universe.


We then moved on to the Inclusion/Exclusion Principle, which governs the size of a set when doing Union operations. For Unioning two sets together, you take the size of each set, add them together, then delete the count of all duplicates (given by the intersection). For bigger combinations of sets, you figure out the size by adding the size of all the sets by themselves, subtracting the intersection of all pairs of sets, adding in the intersection of all triads of sets, subtracting out all the different ways of putting four sets together, and so forth.


We finished off by talking about how to do input in C++ using getline and stringstream, which is a really useful and powerful tool for parsing input. Don't leave home without it.







Tags:
csci 26
combinatorics
inclusion/exclusion
set theory
getline
c++
stringstream