SlideShare a Scribd company logo
The best programmers I’ve meet
knew how to sort a deck of cards
       pretty d*mn well

            Tony Tran
Story Time ☺
Image source: http://www.eyebrowmagazine.com/__data/assets/image/0010/10045/megan_fox_naked_5.jpg
What if


• Given: Deck of playing cards
• Goal: To retrieve any card as fast as
  possible!
•   Constraints: No real constraints, do whatever you want with the cards! Just don’t
    be a smart @s*!




                WHAT WOULD YOU DO!?!
Find me:

    Approaches:
    1. Do nothing to the deck (Cost: 52 lookups)




Cost is analyzed in worst case scenario.
"Anything that can go wrong will go wrong.“ – Murphy’s Law
Approaches:
 1.   Do nothing to the deck (Cost: 52 lookups)
 2.    Group cards by suits (Cost: 4+12 = 16 lookups)




3. Group cards by faces (Cost: 12+4 = 16 lookups)
Image source: http://www.flickr.com/photos/60601862@N00/942476116/
What if


• Given: 99 note cards with a unique
  number written on each card.
• Goal: To retrieve any card as fast as
  possible!
•   Constraints: No real constraints, do whatever you want with the cards! Just don’t
    be a smart @s*!




         WHAT WOULD YOU DO!?!
Find me:

    Approaches:
    1.   Do nothing to the deck (Cost: 99 lookups)
    2.   Create bins for groups of 100 and just throw the cards into the bin.
         Example:

                                                      (Cost: 99 lookups)
                                                      When given cards:
                                                      1,2,3, ,99



                          bins



Cost is analyzed in worst case scenario.
"Anything that can go wrong will go wrong.“ – Murphy’s Law
Find me:
    Approaches:
    1.      Do nothing to the deck (Cost: 99 lookups)
    2.      Create bins for groups of 100 and just throw the cards into the bin. (Cost: 99 lookups)

    3.       Sort the deck! Then perform binary search to find
             card.
             (cost: log2(99) lookups ~= 7 look ups)




          Depiction of binary search (does not show entire search)




Cost is analyzed in worst case scenario.
"Anything that can go wrong will go wrong.“ – Murphy’s Law
Find me:
    Approaches:
    1.      Do nothing to the deck (Cost: 99 lookups)
    2.      Create bins for groups of 100 and just throw the cards into the bin. (Cost: 99 lookups)

    3.       Sort the deck! Then perform binary search to find
             card.
             (cost: log2(99) lookups ~= 7 look ups)




          Depiction of binary search (does not show entire search)



                                                                                                      ☺

Cost is analyzed in worst case scenario.
"Anything that can go wrong will go wrong.“ – Murphy’s Law
How does this apply to
                  programming?




Abstraction!
Key point #1 and #2:
      1. Being able to abstract a problem to
        something less complex, or more familiar,
        will make the problem easier!



       2. Abstracting a problem to a problem that
       has already been solved is even better!
       You don’t really have to do any work!

Image source: http://www.scientificamerican.com/media/inline/3E0F9160-E7F2-99DF-358998AA3C1A910F_1.jpg
Other fans of abstraction



  What is the shortest path from 1 to any other node?




• “the purpose of abstraction is not to be vague,
  but to create a new semantic level in which one
  can be absolutely precise.” - Edsger W. Dijkstra
INTERNET!!!




“[OSPF] computes the shortest path tree for each route
using a method based on Dijkstra's algorithm, a shortest
path first algorithm.”
Keypoint #3
         3. There’s no such thing as a dumb problem




  Problem: Given a spatula and a dish of pancakes (say 6 for now), how would
  you flip the pancakes such that the pancakes become sorted with the largest pancake
  at the bottom and smallest at the top? How many steps would it require?




Image source: http://sfist.com/attachments/SFist_Brock/pancakes.jpg
Initial State:
                        GOAL




                 FLIP
Someone familiar:
SORTING PANCAKES == SORTING BY PREFIX REVERSAL




• Bill Gates & Christos Papadimitriou,
  Bounds For Sorting By Prefix Reversal.
  Discrete Mathematics, vol 27, pp 47-57,
  1979.

         We referred to bounds as “Costs”
Key Points:
1. Being able to abstract a problem to something less complex, or
   more familiar, will make the problem easier!
2. Abstracting a problem to a problem that has already been solved is
   even better!
3. There’s no such thing as a dumb problem.




4. Be creative and have fun with problems.
You have the ability to create an entire world
at your fingertips!
-THANK YOU-

New title proposal:
The best programmers I’ve meet knew how to ABSTRACT PROBLEMS pretty d*mn well




    “The hardest part of solving a problem is to completely understand it to
    a point where you can see it from many different perspectives and abstractions”
    -A very wise T.A.



      Thank you,
      -Tony Tran
      @quicksorter
     P.S. My gf will probably be reading this, so the story at the beginning
     didn’t really happen 0-=) But really, it didn’t ☺

More Related Content

Similar to Quicksorter V2

Artificial intelligence
Artificial intelligenceArtificial intelligence
Artificial intelligence
Sriharsha Koritala
 
Can you subitize?
Can you subitize?Can you subitize?
Can you subitize?
Dream Realizations
 
Startup camp berlin 2012
Startup camp berlin 2012Startup camp berlin 2012
Startup camp berlin 2012
Ahmet Emre Acar
 
Pie Bellies, Colonoscopies and the Doorway of Forgetfulness - Structuring Use...
Pie Bellies, Colonoscopies and the Doorway of Forgetfulness - Structuring Use...Pie Bellies, Colonoscopies and the Doorway of Forgetfulness - Structuring Use...
Pie Bellies, Colonoscopies and the Doorway of Forgetfulness - Structuring Use...
Corinne Brown
 
Crinovate
CrinovateCrinovate
Crinovate
Melissa Penton
 
Deep Learning Class #0 - You Can Do It
Deep Learning Class #0 - You Can Do ItDeep Learning Class #0 - You Can Do It
Deep Learning Class #0 - You Can Do It
Holberton School
 
DL Classe 0 - You can do it
DL Classe 0 - You can do itDL Classe 0 - You can do it
DL Classe 0 - You can do it
Gregory Renard
 
Fundamental counting principle powerpoint
Fundamental counting principle powerpointFundamental counting principle powerpoint
Fundamental counting principle powerpoint
mesmith1
 
Intro session(final) 2020
Intro session(final)   2020Intro session(final)   2020
Intro session(final) 2020
AditiSaxena72
 
Core Methods In Educational Data Mining
Core Methods In Educational Data MiningCore Methods In Educational Data Mining
Core Methods In Educational Data Mining
ebelani
 
Wellington presentation
Wellington presentationWellington presentation
Wellington presentation
Ackermanj
 
2.2 notes a
2.2 notes a2.2 notes a
2.2 notes a
mbetzel
 
Math day 5
Math day 5Math day 5
Math day 5
Alicia Zents
 
probability 2.ppt
probability 2.pptprobability 2.ppt
probability 2.ppt
Izah Catli
 
893169224799965600 math lesson1
893169224799965600 math lesson1893169224799965600 math lesson1
893169224799965600 math lesson1
Kathy Favazza
 
42629 lecture 4 pt2
42629 lecture 4 pt242629 lecture 4 pt2
42629 lecture 4 pt2
Tom Howard
 
Day 11 least common multiple
Day 11 least common multipleDay 11 least common multiple
Day 11 least common multiple
Erik Tjersland
 
PHIL123 2007 Creative Thinking Dan Turton.ppt
PHIL123  2007 Creative Thinking Dan Turton.pptPHIL123  2007 Creative Thinking Dan Turton.ppt
PHIL123 2007 Creative Thinking Dan Turton.ppt
RAVISHANKARRAI4
 
Chapter7ppt.pdf
Chapter7ppt.pdfChapter7ppt.pdf
Chapter7ppt.pdf
SohailBhatti21
 
Experience Design in the Museum
Experience Design in the MuseumExperience Design in the Museum
Experience Design in the Museum
Sebastian Deterding
 

Similar to Quicksorter V2 (20)

Artificial intelligence
Artificial intelligenceArtificial intelligence
Artificial intelligence
 
Can you subitize?
Can you subitize?Can you subitize?
Can you subitize?
 
Startup camp berlin 2012
Startup camp berlin 2012Startup camp berlin 2012
Startup camp berlin 2012
 
Pie Bellies, Colonoscopies and the Doorway of Forgetfulness - Structuring Use...
Pie Bellies, Colonoscopies and the Doorway of Forgetfulness - Structuring Use...Pie Bellies, Colonoscopies and the Doorway of Forgetfulness - Structuring Use...
Pie Bellies, Colonoscopies and the Doorway of Forgetfulness - Structuring Use...
 
Crinovate
CrinovateCrinovate
Crinovate
 
Deep Learning Class #0 - You Can Do It
Deep Learning Class #0 - You Can Do ItDeep Learning Class #0 - You Can Do It
Deep Learning Class #0 - You Can Do It
 
DL Classe 0 - You can do it
DL Classe 0 - You can do itDL Classe 0 - You can do it
DL Classe 0 - You can do it
 
Fundamental counting principle powerpoint
Fundamental counting principle powerpointFundamental counting principle powerpoint
Fundamental counting principle powerpoint
 
Intro session(final) 2020
Intro session(final)   2020Intro session(final)   2020
Intro session(final) 2020
 
Core Methods In Educational Data Mining
Core Methods In Educational Data MiningCore Methods In Educational Data Mining
Core Methods In Educational Data Mining
 
Wellington presentation
Wellington presentationWellington presentation
Wellington presentation
 
2.2 notes a
2.2 notes a2.2 notes a
2.2 notes a
 
Math day 5
Math day 5Math day 5
Math day 5
 
probability 2.ppt
probability 2.pptprobability 2.ppt
probability 2.ppt
 
893169224799965600 math lesson1
893169224799965600 math lesson1893169224799965600 math lesson1
893169224799965600 math lesson1
 
42629 lecture 4 pt2
42629 lecture 4 pt242629 lecture 4 pt2
42629 lecture 4 pt2
 
Day 11 least common multiple
Day 11 least common multipleDay 11 least common multiple
Day 11 least common multiple
 
PHIL123 2007 Creative Thinking Dan Turton.ppt
PHIL123  2007 Creative Thinking Dan Turton.pptPHIL123  2007 Creative Thinking Dan Turton.ppt
PHIL123 2007 Creative Thinking Dan Turton.ppt
 
Chapter7ppt.pdf
Chapter7ppt.pdfChapter7ppt.pdf
Chapter7ppt.pdf
 
Experience Design in the Museum
Experience Design in the MuseumExperience Design in the Museum
Experience Design in the Museum
 

Recently uploaded

The Unbelievable Tale of Dwayne Johnson Kidnapping: A Riveting Saga
The Unbelievable Tale of Dwayne Johnson Kidnapping: A Riveting SagaThe Unbelievable Tale of Dwayne Johnson Kidnapping: A Riveting Saga
The Unbelievable Tale of Dwayne Johnson Kidnapping: A Riveting Saga
greendigital
 
高仿(nyu毕业证书)美国纽约大学毕业证文凭毕业证原版一模一样
高仿(nyu毕业证书)美国纽约大学毕业证文凭毕业证原版一模一样高仿(nyu毕业证书)美国纽约大学毕业证文凭毕业证原版一模一样
高仿(nyu毕业证书)美国纽约大学毕业证文凭毕业证原版一模一样
9u08k0x
 
Top IPTV UK Providers of A Comprehensive Review.pdf
Top IPTV UK Providers of A Comprehensive Review.pdfTop IPTV UK Providers of A Comprehensive Review.pdf
Top IPTV UK Providers of A Comprehensive Review.pdf
Xtreame HDTV
 
定制(uow毕业证书)卧龙岗大学毕业证文凭学位证书原版一模一样
定制(uow毕业证书)卧龙岗大学毕业证文凭学位证书原版一模一样定制(uow毕业证书)卧龙岗大学毕业证文凭学位证书原版一模一样
定制(uow毕业证书)卧龙岗大学毕业证文凭学位证书原版一模一样
0md20cgg
 
_7 OTT App Builders to Support the Development of Your Video Applications_.pdf
_7 OTT App Builders to Support the Development of Your Video Applications_.pdf_7 OTT App Builders to Support the Development of Your Video Applications_.pdf
_7 OTT App Builders to Support the Development of Your Video Applications_.pdf
Mega P
 
The Evolution of the Leonardo DiCaprio Haircut: A Journey Through Style and C...
The Evolution of the Leonardo DiCaprio Haircut: A Journey Through Style and C...The Evolution of the Leonardo DiCaprio Haircut: A Journey Through Style and C...
The Evolution of the Leonardo DiCaprio Haircut: A Journey Through Style and C...
greendigital
 
DIGIDEVTV A New area of OTT Distribution
DIGIDEVTV  A New area of OTT DistributionDIGIDEVTV  A New area of OTT Distribution
DIGIDEVTV A New area of OTT Distribution
joeqsm
 
Christian Louboutin: Innovating with Red Soles
Christian Louboutin: Innovating with Red SolesChristian Louboutin: Innovating with Red Soles
Christian Louboutin: Innovating with Red Soles
get joys
 
240529_Teleprotection Global Market Report 2024.pdf
240529_Teleprotection Global Market Report 2024.pdf240529_Teleprotection Global Market Report 2024.pdf
240529_Teleprotection Global Market Report 2024.pdf
Madhura TBRC
 
Unveiling Paul Haggis Shaping Cinema Through Diversity. .pdf
Unveiling Paul Haggis Shaping Cinema Through Diversity. .pdfUnveiling Paul Haggis Shaping Cinema Through Diversity. .pdf
Unveiling Paul Haggis Shaping Cinema Through Diversity. .pdf
kenid14983
 
I Know Dino Trivia: Part 3. Test your dino knowledge
I Know Dino Trivia: Part 3. Test your dino knowledgeI Know Dino Trivia: Part 3. Test your dino knowledge
I Know Dino Trivia: Part 3. Test your dino knowledge
Sabrina Ricci
 
Emcee Profile_ Subbu from Bangalore .pdf
Emcee Profile_ Subbu from Bangalore .pdfEmcee Profile_ Subbu from Bangalore .pdf
Emcee Profile_ Subbu from Bangalore .pdf
subran
 
Divertidamente SLIDE muito lindo e criativo, pptx
Divertidamente SLIDE muito lindo e criativo, pptxDivertidamente SLIDE muito lindo e criativo, pptx
Divertidamente SLIDE muito lindo e criativo, pptx
lunaemel03
 
From Swing Music to Big Band Fame_ 5 Iconic Artists.pptx
From Swing Music to Big Band Fame_ 5 Iconic Artists.pptxFrom Swing Music to Big Band Fame_ 5 Iconic Artists.pptx
From Swing Music to Big Band Fame_ 5 Iconic Artists.pptx
Swing Street Radio
 
Barbie Movie Review - The Astras.pdfffff
Barbie Movie Review - The Astras.pdfffffBarbie Movie Review - The Astras.pdfffff
Barbie Movie Review - The Astras.pdfffff
theastras43
 
Meet Dinah Mattingly – Larry Bird’s Partner in Life and Love
Meet Dinah Mattingly – Larry Bird’s Partner in Life and LoveMeet Dinah Mattingly – Larry Bird’s Partner in Life and Love
Meet Dinah Mattingly – Larry Bird’s Partner in Life and Love
get joys
 
Everything You Need to Know About IPTV Ireland.pdf
Everything You Need to Know About IPTV Ireland.pdfEverything You Need to Know About IPTV Ireland.pdf
Everything You Need to Know About IPTV Ireland.pdf
Xtreame HDTV
 
Modern Radio Frequency Access Control Systems: The Key to Efficiency and Safety
Modern Radio Frequency Access Control Systems: The Key to Efficiency and SafetyModern Radio Frequency Access Control Systems: The Key to Efficiency and Safety
Modern Radio Frequency Access Control Systems: The Key to Efficiency and Safety
AITIX LLC
 
The Ultimate Guide to Setting Up Eternal IPTV on Your Devices.docx
The Ultimate Guide to Setting Up Eternal IPTV on Your Devices.docxThe Ultimate Guide to Setting Up Eternal IPTV on Your Devices.docx
The Ultimate Guide to Setting Up Eternal IPTV on Your Devices.docx
Xtreame HDTV
 
Orpah Winfrey Dwayne Johnson: Titans of Influence and Inspiration
Orpah Winfrey Dwayne Johnson: Titans of Influence and InspirationOrpah Winfrey Dwayne Johnson: Titans of Influence and Inspiration
Orpah Winfrey Dwayne Johnson: Titans of Influence and Inspiration
greendigital
 

Recently uploaded (20)

The Unbelievable Tale of Dwayne Johnson Kidnapping: A Riveting Saga
The Unbelievable Tale of Dwayne Johnson Kidnapping: A Riveting SagaThe Unbelievable Tale of Dwayne Johnson Kidnapping: A Riveting Saga
The Unbelievable Tale of Dwayne Johnson Kidnapping: A Riveting Saga
 
高仿(nyu毕业证书)美国纽约大学毕业证文凭毕业证原版一模一样
高仿(nyu毕业证书)美国纽约大学毕业证文凭毕业证原版一模一样高仿(nyu毕业证书)美国纽约大学毕业证文凭毕业证原版一模一样
高仿(nyu毕业证书)美国纽约大学毕业证文凭毕业证原版一模一样
 
Top IPTV UK Providers of A Comprehensive Review.pdf
Top IPTV UK Providers of A Comprehensive Review.pdfTop IPTV UK Providers of A Comprehensive Review.pdf
Top IPTV UK Providers of A Comprehensive Review.pdf
 
定制(uow毕业证书)卧龙岗大学毕业证文凭学位证书原版一模一样
定制(uow毕业证书)卧龙岗大学毕业证文凭学位证书原版一模一样定制(uow毕业证书)卧龙岗大学毕业证文凭学位证书原版一模一样
定制(uow毕业证书)卧龙岗大学毕业证文凭学位证书原版一模一样
 
_7 OTT App Builders to Support the Development of Your Video Applications_.pdf
_7 OTT App Builders to Support the Development of Your Video Applications_.pdf_7 OTT App Builders to Support the Development of Your Video Applications_.pdf
_7 OTT App Builders to Support the Development of Your Video Applications_.pdf
 
The Evolution of the Leonardo DiCaprio Haircut: A Journey Through Style and C...
The Evolution of the Leonardo DiCaprio Haircut: A Journey Through Style and C...The Evolution of the Leonardo DiCaprio Haircut: A Journey Through Style and C...
The Evolution of the Leonardo DiCaprio Haircut: A Journey Through Style and C...
 
DIGIDEVTV A New area of OTT Distribution
DIGIDEVTV  A New area of OTT DistributionDIGIDEVTV  A New area of OTT Distribution
DIGIDEVTV A New area of OTT Distribution
 
Christian Louboutin: Innovating with Red Soles
Christian Louboutin: Innovating with Red SolesChristian Louboutin: Innovating with Red Soles
Christian Louboutin: Innovating with Red Soles
 
240529_Teleprotection Global Market Report 2024.pdf
240529_Teleprotection Global Market Report 2024.pdf240529_Teleprotection Global Market Report 2024.pdf
240529_Teleprotection Global Market Report 2024.pdf
 
Unveiling Paul Haggis Shaping Cinema Through Diversity. .pdf
Unveiling Paul Haggis Shaping Cinema Through Diversity. .pdfUnveiling Paul Haggis Shaping Cinema Through Diversity. .pdf
Unveiling Paul Haggis Shaping Cinema Through Diversity. .pdf
 
I Know Dino Trivia: Part 3. Test your dino knowledge
I Know Dino Trivia: Part 3. Test your dino knowledgeI Know Dino Trivia: Part 3. Test your dino knowledge
I Know Dino Trivia: Part 3. Test your dino knowledge
 
Emcee Profile_ Subbu from Bangalore .pdf
Emcee Profile_ Subbu from Bangalore .pdfEmcee Profile_ Subbu from Bangalore .pdf
Emcee Profile_ Subbu from Bangalore .pdf
 
Divertidamente SLIDE muito lindo e criativo, pptx
Divertidamente SLIDE muito lindo e criativo, pptxDivertidamente SLIDE muito lindo e criativo, pptx
Divertidamente SLIDE muito lindo e criativo, pptx
 
From Swing Music to Big Band Fame_ 5 Iconic Artists.pptx
From Swing Music to Big Band Fame_ 5 Iconic Artists.pptxFrom Swing Music to Big Band Fame_ 5 Iconic Artists.pptx
From Swing Music to Big Band Fame_ 5 Iconic Artists.pptx
 
Barbie Movie Review - The Astras.pdfffff
Barbie Movie Review - The Astras.pdfffffBarbie Movie Review - The Astras.pdfffff
Barbie Movie Review - The Astras.pdfffff
 
Meet Dinah Mattingly – Larry Bird’s Partner in Life and Love
Meet Dinah Mattingly – Larry Bird’s Partner in Life and LoveMeet Dinah Mattingly – Larry Bird’s Partner in Life and Love
Meet Dinah Mattingly – Larry Bird’s Partner in Life and Love
 
Everything You Need to Know About IPTV Ireland.pdf
Everything You Need to Know About IPTV Ireland.pdfEverything You Need to Know About IPTV Ireland.pdf
Everything You Need to Know About IPTV Ireland.pdf
 
Modern Radio Frequency Access Control Systems: The Key to Efficiency and Safety
Modern Radio Frequency Access Control Systems: The Key to Efficiency and SafetyModern Radio Frequency Access Control Systems: The Key to Efficiency and Safety
Modern Radio Frequency Access Control Systems: The Key to Efficiency and Safety
 
The Ultimate Guide to Setting Up Eternal IPTV on Your Devices.docx
The Ultimate Guide to Setting Up Eternal IPTV on Your Devices.docxThe Ultimate Guide to Setting Up Eternal IPTV on Your Devices.docx
The Ultimate Guide to Setting Up Eternal IPTV on Your Devices.docx
 
Orpah Winfrey Dwayne Johnson: Titans of Influence and Inspiration
Orpah Winfrey Dwayne Johnson: Titans of Influence and InspirationOrpah Winfrey Dwayne Johnson: Titans of Influence and Inspiration
Orpah Winfrey Dwayne Johnson: Titans of Influence and Inspiration
 

Quicksorter V2

  • 1. The best programmers I’ve meet knew how to sort a deck of cards pretty d*mn well Tony Tran
  • 4. What if • Given: Deck of playing cards • Goal: To retrieve any card as fast as possible! • Constraints: No real constraints, do whatever you want with the cards! Just don’t be a smart @s*! WHAT WOULD YOU DO!?!
  • 5. Find me: Approaches: 1. Do nothing to the deck (Cost: 52 lookups) Cost is analyzed in worst case scenario. "Anything that can go wrong will go wrong.“ – Murphy’s Law
  • 6. Approaches: 1. Do nothing to the deck (Cost: 52 lookups) 2. Group cards by suits (Cost: 4+12 = 16 lookups) 3. Group cards by faces (Cost: 12+4 = 16 lookups)
  • 8. What if • Given: 99 note cards with a unique number written on each card. • Goal: To retrieve any card as fast as possible! • Constraints: No real constraints, do whatever you want with the cards! Just don’t be a smart @s*! WHAT WOULD YOU DO!?!
  • 9. Find me: Approaches: 1. Do nothing to the deck (Cost: 99 lookups) 2. Create bins for groups of 100 and just throw the cards into the bin. Example: (Cost: 99 lookups) When given cards: 1,2,3, ,99 bins Cost is analyzed in worst case scenario. "Anything that can go wrong will go wrong.“ – Murphy’s Law
  • 10. Find me: Approaches: 1. Do nothing to the deck (Cost: 99 lookups) 2. Create bins for groups of 100 and just throw the cards into the bin. (Cost: 99 lookups) 3. Sort the deck! Then perform binary search to find card. (cost: log2(99) lookups ~= 7 look ups) Depiction of binary search (does not show entire search) Cost is analyzed in worst case scenario. "Anything that can go wrong will go wrong.“ – Murphy’s Law
  • 11. Find me: Approaches: 1. Do nothing to the deck (Cost: 99 lookups) 2. Create bins for groups of 100 and just throw the cards into the bin. (Cost: 99 lookups) 3. Sort the deck! Then perform binary search to find card. (cost: log2(99) lookups ~= 7 look ups) Depiction of binary search (does not show entire search) ☺ Cost is analyzed in worst case scenario. "Anything that can go wrong will go wrong.“ – Murphy’s Law
  • 12. How does this apply to programming? Abstraction!
  • 13. Key point #1 and #2: 1. Being able to abstract a problem to something less complex, or more familiar, will make the problem easier! 2. Abstracting a problem to a problem that has already been solved is even better! You don’t really have to do any work! Image source: http://www.scientificamerican.com/media/inline/3E0F9160-E7F2-99DF-358998AA3C1A910F_1.jpg
  • 14. Other fans of abstraction What is the shortest path from 1 to any other node? • “the purpose of abstraction is not to be vague, but to create a new semantic level in which one can be absolutely precise.” - Edsger W. Dijkstra
  • 15. INTERNET!!! “[OSPF] computes the shortest path tree for each route using a method based on Dijkstra's algorithm, a shortest path first algorithm.”
  • 16. Keypoint #3 3. There’s no such thing as a dumb problem Problem: Given a spatula and a dish of pancakes (say 6 for now), how would you flip the pancakes such that the pancakes become sorted with the largest pancake at the bottom and smallest at the top? How many steps would it require? Image source: http://sfist.com/attachments/SFist_Brock/pancakes.jpg
  • 17. Initial State: GOAL FLIP
  • 18. Someone familiar: SORTING PANCAKES == SORTING BY PREFIX REVERSAL • Bill Gates & Christos Papadimitriou, Bounds For Sorting By Prefix Reversal. Discrete Mathematics, vol 27, pp 47-57, 1979. We referred to bounds as “Costs”
  • 19. Key Points: 1. Being able to abstract a problem to something less complex, or more familiar, will make the problem easier! 2. Abstracting a problem to a problem that has already been solved is even better! 3. There’s no such thing as a dumb problem. 4. Be creative and have fun with problems. You have the ability to create an entire world at your fingertips!
  • 20. -THANK YOU- New title proposal: The best programmers I’ve meet knew how to ABSTRACT PROBLEMS pretty d*mn well “The hardest part of solving a problem is to completely understand it to a point where you can see it from many different perspectives and abstractions” -A very wise T.A. Thank you, -Tony Tran @quicksorter P.S. My gf will probably be reading this, so the story at the beginning didn’t really happen 0-=) But really, it didn’t ☺