10/27/2016
Ma/CS 6a
Class 13: Network Flow
By Adam Sheffer
The RAND Corporation
American think tank composed of scientists.
In the 1950s helped decision concerning the
nuclear race, space program, etc.
Contributed to the development of many
scientific t
11/13/2016
Ma/CS 6a
Class 20: Subgroups, Orbits, and Stabilizers
By Adam Sheffer
A Group
A group consists of a set and a binary
operation , satisfying the following.
Closure. For every ,
.
Associativity. For every , ,
= .
Identity. There exists , s
11/4/2016
Ma/CS 6a
Class 16: Permutations
By Adam Sheffer
The 15 Puzzle
Problem. Start with the configuration on
the left and move the tiles to obtain the
configuration on the right.
1
11/4/2016
The 15 Puzzle (cont.)
The game became a craze in the U.S. in
12/2/2016
Ma/CS 6a
Class 27: Shortest Paths
By Adam Sheffer
Nave Path Planning
Problem.
We are given a map with cities and noncrossing roads between pairs of cities.
Describe an algorithm for finding a path
between city A an city B that minimizes
the nu
11/28/2016
Ma/CS 6a
Class 24: More Generating Functions
Road signs from
http:/www.math.ucla.edu/~pak/
By Adam Sheffer
Reminder: Generating Functions
Given an infinite sequence of numbers
0 , 1 , 2 , the generating function of
the sequence is the power ser
Ma/CS 6a: Solution to Set 3
Adam Sheffer
November 11, 2016
1. Adams pet alligator Biscuit likes to play dominoes. Unfortunately, Biscuit does not
understand that the tiles can be rotated by 90 and 270 (he is OK with 180 rotations),
and thus only places th
11/20/2016
Ma/CS 6a
Class 23: Generating Functions
By Adam Sheffer
Reminder: Power Series
We define sums and products of power
series as in the case of polynomials.
= 0 + 1 + 2 2 +
= 0 + 1 + 2 2 +
= + .
= ().
= + .
= =0 .
1
11/20/2016
Reminder: Inv
Ma 6a: HW4 Solutions
1. Fixing any p 1, we will prove this via induction on |E|. If |E| = 0, then |E|/2p = 0, and so the
claim holds as a matching of size 0 exists vacuously. Suppose then the claim is true whenever |E| < n,
for some integer n > 0; let us
11/27/2016
Ma/CS 6a
Class 25: Partitions
Explain the significance of the
following sequence: un, dos, tres,
quatre, cinc, sis, set, vuit, nou, deu.
By Adam Sheffer
Answer
Explain the significance of the
following sequence: un, dos, tres,
quatre, cinc, sis
6a: HW1 Solutions
1. First we will prove the relation
k1
Y
aj = ak 2.
j=0
We use induction on k. For k = 0, we have a0 = 3 = a1 2. For the induction step, the key is to
note that
k+1
k
k
ak+1 2 = 22
1 = (22 + 1)(22 1) = ak (ak 2).
Qk1
Consequently, if we
10/18/2016
Ma/CS 6a
Class 9: Coloring
By Adam Sheffer
Map Coloring
Can we color each state with one of three
colors, so that no two adjacent states
have the same color?
1
10/18/2016
Map Coloring and Graphs
Map Coloring and Graphs
Place a vertex in each st
10/11/2016
Ma/CS 6a
Class 6: Introduction to Graphs
By Adam Sheffer
Todays Class is about
Six Degrees of Kevin Bacon
1
10/11/2016
Six Degrees of Kevin Bacon
Claim. Any actor can be linked through
his/her film roles to Kevin Bacon within six
steps.
Exampl
6a: HW2 Solutions
1. (a) For convenience, denote the set cfw_1, . . . , n by [n], and call a subset X [n] fat if the sum
of the numbers in X is larger than the sum of the numbers not in X. Note that the sum of all the
itnegers from 1 to n is n(n + 1)/2, w
Ma/CS 6a: Problem Set 4
Due noon, Tuesday, November 8th
TA in charge: Karlming Chen
October 24, 2016
1. Prove: If G = (V, E) is a graph such that every vertex of V is of degree at most p, then
G contains a matching of size |E|/2p (p is a positive integer)
9/27/2016
Ma/CS 6a
Class 2: Congruences
1 + 1 5 ( 3)
By Adam Sheffer
Reminder: Public Key Cryptography
Idea. Use a public key which is used for
encryption and a private key used for
decryption.
Alice encrypts her message with Bobs
public key and sends it
10/16/2016
Ma/CS 6a
Class 8: Eulerian Cycles
By Adam Sheffer
The Bridges of Knigsberg
Can we travel the city while crossing every
bridge exactly once?
1
10/16/2016
How Graph Theory was Born
Leonhard
Euler 1736
Eulerian Cycle
An Eulerian path in a graph is
11/29/2016
Ma/CS 6a
Class 26: More Partitions
By Adam Sheffer
Recall: Partitions of a Positive
Integer
For a positive integer , we denote by
the number of ways to write as a
sum of positive integers.
Example. We can write = 5 as
5,
4 + 1,
3 + 2,
3 + 1 +
10/30/2016
Ma/CS 6a
Class 14: Flow Exercises
Flow Networks
A flow network is a digraph = , ,
together with a source vertex , a
sink vertex , and a capacity function
: .
Capacity
7
1
a
s
Source
d
5
c
3
3
b
5
1
t
1
3
e
5
Sink
1
10/30/2016
Flow in a Network
10/4/2016
Ma/CS 6a
Class 5: Basic Counting
By Adam Sheffer
Send anonymous suggestions and
complaints from here.
Email: [email protected]
Password: anonymous2
There arent enough
crocodiles in the
presentations
Only today! 75%
off for
Morphine an
10/25/2016
Ma/CS 6a
Class 12: More Matchings
0
5
1
7
12
12
15
17
By Adam Sheffer
Matchings
A matching in an undirected graph is a
set of vertex-disjoint edges.
The size of a matching is the number of
edges in it.
A maximum matching of is a matching
of m
10/13/2016
Ma/CS 6a
Class 7: More BFS
By Adam Sheffer
Six Degrees of Kevin Bacon
Problem. Given a database of every actor
and the movies that s\he played in, how
can we compute everybodys Bacon
numbers?
We build the actors graph, and run the
BFS algorith
10/23/2016
Ma/CS 6a
Class 11: Matchings
By Adam Sheffer
Task Assignment Problem
Problem.
A set of tasks that need to be complete.
A set of people, each qualified to do a
different subset of tasks.
Each person can perform at most one task.
Each task is
9/30/2016
Ma/CS 6a
Class 4: Primality Testing
By Adam Sheffer
Reminder: Eulers Totient Function
Eulers totient () is defined as follows:
Given , then
= | 1 < and GCD , = 1 .
In more words: is the number of
natural numbers 1 such that
and are relatively
11/8/2016
Ma/CS 6a
Class 18: Groups
Rotation 90
=
Vertical flip
Diagonal flip 2
By Adam Sheffer
A Group
A group consists of a set and a binary
operation , satisfying the following.
Closure. For every ,
.
Associativity. For every , ,
= .
Identity. T
11/10/2016
Ma/CS 6a
Class 19: Group Isomorphisms
By Adam Sheffer
A Group
A group consists of a set and a binary
operation , satisfying the following.
Closure. For every ,
.
Associativity. For every , ,
= .
Identity. There exists , such that for
eve
11/1/2016
Ma/CS 6a
Class 15: Flows and Bipartite Graphs
By Adam Sheffer
Reminder: Flow Networks
A flow network is a digraph = , ,
together with a source vertex , a
sink vertex , and a capacity function
: .
Capacity
7
1
a
s
Source
d
5
c
3
3
b
5
1
t
1
3
e
5
10/20/2016
Ma/CS 6a
Class 10: Spanning Trees
By Adam Sheffer
Problem: Designing a Network
Problem. We wish to rebuild Caltechs
communication network.
We have a list off all the routers, and the cost
of connecting every pair of routers (some
connections m
11/17/2016
Ma/CS 6a
Class 22: Power Series
By Adam Sheffer
Power Series
Monomial: .
Polynomial:
0 + 1 + 2 2 + + .
Power series:
= 0 + 1 + 2 2 +
Also called formal power series, because
we do not think about the meaning of .
1
11/17/2016
Sums and Produc
11/15/2016
Ma/CS 6a
Class 21: Counting with Permutations
By Adam Sheffer
Repeating the Basics
We have a set of numbers
= 1,2,3, , and a permutation
group of .
For example,
= 1,2,3,4,5,6
= id, 1 2 , 3 4 , 1 2 3 4
1
11/15/2016
Equivalence Classes
The gro