Announcements • Presentations tomorrow • Updated instructions on website • Send name of who will do screen sharing • Peer feedback forms • Arrive early to Zoom call • Get something to draw with • PM6 posted • Quiz 3 • Office hours by appointment only this week • Elissa video • Course evaluations • Making your website public
Coloring is Harder than You Think CS 115 Computing for the Socio-Techno Web Brian Brubach
Computer Science Theory • Ask questions about what is even possible • What problems can computers solve? • Time à How fast can be we solve them? • Space à Can we do it without using too much memory/space? • Approximation algorithms à If we can’t solve it or not fast enough, can we find an approximate solution? • Often use worse case analysis, the hard instance of a problem • How are different problems related • Sometimes like going back to kindergarten • Topics include: counting and coloring • Today I’ll show you how to become a millionaire by coloring • When programming, it’s helpful to know if you’re trying to solve an intractable/impossible problem
Warm Up • What are the odds that two people living in the state of Maryland have exactly the same number of hairs on their head?
Warm Up • What are the odds that two people living in the state of Massachusetts have exactly the same number of hairs on their head? • No beards! Only hairs on top of head! • Not including people who shave their heads!
Warm Up • What are the odds that two people living in the state of Massachusetts have exactly the same number of hairs on their head? • No beards! Only hairs on top of head! • Not including people who shave their heads! • Less than 200,000 hairs on any human head • Roughly 6.8 million people in Massachusetts
Pigeonhole Principle • If you have 𝑜 + 1 pigeons and 𝑜 pigeonholes, at least two pigeons will share a hole
Pigeonhole Principle • If you have 𝑜 + 1 pigeons and 𝑜 pigeonholes, at least two pigeons will share a hole
Pigeonhole Principle • If you have 𝑜 + 1 pigeons and 𝑜 pigeonholes, at least two pigeons will share a hole
Pigeonhole Principle • If you have 𝑜 + 1 pigeons and 𝑜 pigeonholes, at least two pigeons will share a hole
Pigeonhole Principle • If you have 𝑜 + 1 pigeons and 𝑜 pigeonholes, at least two pigeons will share a hole
Pigeonhole Principle • If you have 𝑜 + 1 pigeons and 𝑜 pigeonholes, at least two pigeons will share a hole
The Map Coloring Problem • What is the maximum number of colors needed to color any map so that no neighboring countries/states/counties are the same color? • I.e., how many different crayons do you need to buy to color any map?
One extra rule…
One extra rule… No Alaskas! • Each country must be contiguous (one connected space)
Color the maps with as few colors as possible • Neighboring countries can’t be the same color • Corners touching doesn’t count as neighboring • How many colors do you need?
How many colors needed?
How many colors needed?
How many colors needed?
How many colors needed?
How many colors needed?
How many colors needed?
How many colors needed?
How many colors needed?
How many colors needed?
How many colors needed?
How many colors needed?
How many colors needed?
How many colors needed?
How many colors needed?
How many colors needed?
Need at least 4 colors! Why?
Draw a map that needs as many colors as possible • Neighboring countries can’t be the same color • Corners touching doesn’t count as neighboring • No Alaskas • Don’t draw too many countries • Can you draw a map that requires 3, 4, 5, 6, or more colors?
History of Map Coloring • 1852 Francis Guthrie • Coloring the counties of England • Noticed he needed four colors, but not more • Asked: is four enough to color any map or do we need more?
History of Map Coloring • 1852 Francis Guthrie • Coloring the counties of England • Noticed he needed four colors, but not more • Asked: is four enough to color any map or do we need more? • 1879 Alfred Kempe proves the Four-Color Theorem • Only need four colors to color any map
History of Map Coloring • 1852 Francis Guthrie • Coloring the counties of England • Noticed he needed four colors, but not more • Asked: is four enough to color any map or do we need more? • 1879 Alfred Kempe proves the Four-Color Theorem • Only need four colors to color any map • 1880 Peter Tait finds another proof
History of Map Coloring • 1852 Francis Guthrie • Coloring the counties of England • Noticed he needed four colors, but not more • Asked: is four enough to color any map or do we need more? • 1879 Alfred Kempe proves the Four-Color Theorem • Only need four colors to color any map • 1880 Peter Tait finds another proof • 1890 Percy John Heawood shows that Kempe’s proof was wrong!
History of Map Coloring • 1852 Francis Guthrie • Coloring the counties of England • Noticed he needed four colors, but not more • Asked: is four enough to color any map or do we need more? • 1879 Alfred Kempe proves the Four-Color Theorem • Only need four colors to color any map • 1880 Peter Tait finds another proof • 1890 Percy John Heawood shows that Kempe’s proof was wrong! • 1891 Julius Petersen shows that Tait’s proof was wrong!
History of Map Coloring • 1852 Francis Guthrie • Coloring the counties of England • Noticed he needed four colors, but not more • Asked: is four enough to color any map or do we need more? • 1879 Alfred Kempe proves the Four-Color Theorem • Only need four colors to color any map • 1880 Peter Tait finds another proof • 1890 Percy John Heawood shows that Kempe’s proof was wrong! • 1891 Julius Petersen shows that Tait’s proof was wrong! • 1976 Kenneth Appel and Wolfgang Haken • Any map (with no Alaskas) can be colored with four colors (no maps require five colors) • Checked 1,936 small maps using computer assistance • Proof is 400+ pages long (Checked by Dorothea Blostein)
4-coloring of US
4-coloring of US
4-coloring of World
4-coloring of World
Including the ocean
What about maps that only require three colors? • Some maps (e.g. Australia) only require three colors • Suppose someone hands you a map and asks, “Can this be colored with three colors or does it need four?” • What would you do?
What about maps that only require three colors? • Some maps (e.g. Australia) only require three colors • Suppose someone hands you a map and asks, “Can this be colored with three colors or does it need four?” • What would you do? • Try all possible 3-colorings?
What about maps that only require three colors? • Some maps (e.g. Australia) only require three colors • Suppose someone hands you a map and asks, “Can this be colored with three colors or does it need four?” • What would you do? • Try all possible 3-colorings? • There are 3 % ways to color an 𝑜 country map with 3 colors ( 3 &' > 1 million)
What about maps that only require three colors? • Some maps (e.g. Australia) only require three colors • Suppose someone hands you a map and asks, “Can this be colored with three colors or does it need four?” • What would you do? • Try all possible 3-colorings? • There are 3 % ways to color an 𝑜 country map with 3 colors ( 3 &' > 1 million) • The answer is unknown!
Becoming a millionaire by coloring • Algorithm: simply a method or set of instructions for solving a problem • E.g. a cake recipe is an algorithm for baking a cake
Becoming a millionaire by coloring • Algorithm: simply a method or set of instructions for solving a problem • E.g. a cake recipe is an algorithm for baking a cake • Suppose you could design algorithm that answers the question, “Can this map be colored with three colors or does it need four?”
Becoming a millionaire by coloring • Algorithm: simply a method or set of instructions for solving a problem • E.g. a cake recipe is an algorithm for baking a cake • Suppose you could design algorithm that answers the question, “Can this map be colored with three colors or does it need four?” • This would solve one of the seven Millennium Prize Problems which each carry a $1 million prize
Becoming a millionaire by coloring • Algorithm: simply a method or set of instructions for solving a problem • E.g. a cake recipe is an algorithm for baking a cake • Suppose you could design algorithm that answers the question, “Can this map be colored with three colors or does it need four?” • This would solve one of the seven Millennium Prize Problems which each carry a $1 million prize • Coloring is related to the P vs. NP problem • Only one of the other problems (Poincaré conjecture) has been solved, but they didn’t accept the prize money
Recommend
More recommend