SlideShare ist ein Scribd-Unternehmen logo
1 von 8
Intro to unit 3
Lesson 2
Developing a Language
◦ To computers to do what we want we need to know what are the “primitive” operations – the
most basic set of operations that will allow us to do most of the tasks that situation requires.
◦ The art (and science) of using well-define languages of primitive operations to solve problems
is the art and science of algorithms.
◦ Algorithms are precise series of sequences of instructions for processes that can be executed
by a computer and are implemented using programing languages.
◦ One way to think of the study of algorithms is that it is the study of processes – how can use a
small set of instructions to clearly and correctly define a process.
◦ Any time you are trying to write a precise set of instructions for a process to solve a problem
you are designing an algorithm.
Find the Minimum Card Activity:
◦ We have to think computer can act. We have to think of computational processes – processes
than can be executed by a computer – which have specific sets of constraints
◦ You will act as a “Human Machine” while working on this activity.
◦ When acting a machine, we have to keep the limitations of a computer in mind.
◦ Follow the instructions on the activity guide and come up with an algorithm to find the smallest
card in the set.
◦ Some things to consider:
◦ How do you know when to stop?
◦ Do instructions state where and when to start?
◦ It is clear were to put cards back down after you’ve picked them up?
Go to this site: https://perryma.tk/HML/
Define Actions
◦ As we look at these algorithms you came up with, we can see they are not all the same.
◦ However, there are common things that you are all making the human machine do and
commonalities in some of your instructions.
◦ Can we define a language of common Human Machine commands for moving cards around?
What are the commands or actions most of these instruction have in common?
◦ SHIFT (hand) – some form of shifting hands one position down the row left or right
◦ MOVE (hand) – some form of moving a hand directly to a particular card based on its position in the list or
to the position of one of the other hands
◦ COMPARE – some way to compare cards and do something based on the results like: “if card in right hand
is less than card in left hand then…”
◦ GO TO LINE – some way to jump to an earlier or later line in the program
◦ PICK CARD UP/PUT CARD DOWN – some way to do this that also makes clear where to put a card
back to.
The Human Machine:
◦ For our next activity you will be using the commands we just went over in the last slide and
preforming the commands with algorithms.
◦ Complete the packet using these commands
◦ First learn about how the different commands can be used in a sequence so that you can later
apply these command to create a more complex algorithm.
◦ After getting the gist of things you will then use these same commands to create an algorithm to
find the smallest card in a set.
◦ All cards are face up. Card positions have numbers
◦ Don’t need to pick up cards or put them down. There is actually no way to move cards at all only ands
◦ The ending state is well defined – left and touching the min card.
Solution to find Min:
This algorithm has the right
hand shift repeatedly to the
right until it finds a card that is
less than the left hand card, and
then move the left hand to the
position of the right hand – so
the left hand is now on the new
smallest card.
It stops once the right hand
reaches position 7, the end of
the list.
Wrap-up
◦ Different algorithms can be developed to solve the same problem.
◦ Even though you were all trying to solve the same problem (find min) as a class we came up with different
methods for doing it. We would say we came up with different algorithms
◦ Different code can be written to implement the same algorithm
◦ This is sometimes surprising to newcomers. When writing “code” (even with the human machine
language) two people trying to write code to implement the same algorithm may very easily code it
differently.
◦ These two facts embody art of programming and what makes programming so fun, engaging and
creative.
◦ A beautiful algorithm is an elegant and clever idea for how to solve a problem.
◦ A beautiful program is an elegant use of whatever language structures are provided to make the algorithm
actually work on a computer.

Weitere ähnliche Inhalte

Ähnlich wie Min card lesson

1 - Amazing Algorithms (Intro)
1 - Amazing Algorithms (Intro)1 - Amazing Algorithms (Intro)
1 - Amazing Algorithms (Intro)testandtrack
 
Small Basic Calculator Apps lesson
Small Basic Calculator Apps lessonSmall Basic Calculator Apps lesson
Small Basic Calculator Apps lessonEdujetage
 
Tools For Information Processes
Tools For Information ProcessesTools For Information Processes
Tools For Information Processessilvisingh
 
Raspberry Pi and Physical Computing Workshop
Raspberry Pi and Physical Computing WorkshopRaspberry Pi and Physical Computing Workshop
Raspberry Pi and Physical Computing WorkshopRachel Wang
 
G044053060
G044053060G044053060
G044053060inventy
 
MENSU._AND_CALCUL.__PRT_1.pptx
MENSU._AND_CALCUL.__PRT_1.pptxMENSU._AND_CALCUL.__PRT_1.pptx
MENSU._AND_CALCUL.__PRT_1.pptxmahaliacaraan
 
Hasktut
HasktutHasktut
Hasktutkv33
 
Chapter 3 introduction to algorithms handouts (with notes)
Chapter 3 introduction to algorithms handouts (with notes)Chapter 3 introduction to algorithms handouts (with notes)
Chapter 3 introduction to algorithms handouts (with notes)mailund
 
You'll Never Look at Interactive the Same After this Deck
You'll Never Look at Interactive the Same After this DeckYou'll Never Look at Interactive the Same After this Deck
You'll Never Look at Interactive the Same After this DeckDori Adar
 
Introduction to computers
Introduction to computersIntroduction to computers
Introduction to computersDHANIK VIKRANT
 
Mobile vision Android
Mobile vision Android Mobile vision Android
Mobile vision Android Manikanta G
 
Program concep sequential statements
Program concep sequential statementsProgram concep sequential statements
Program concep sequential statementsankurkhanna
 
introduction to machine learning
introduction to machine learningintroduction to machine learning
introduction to machine learningcolleges
 
Coding Unplugged_Focus on problem solvin
Coding Unplugged_Focus on problem solvinCoding Unplugged_Focus on problem solvin
Coding Unplugged_Focus on problem solvinEnkelejdaMica1
 
Computational thinking-illustrated
Computational thinking-illustratedComputational thinking-illustrated
Computational thinking-illustratedCraig Evans
 
Computer science basics for nonit students
Computer science basics for nonit studentsComputer science basics for nonit students
Computer science basics for nonit studentsSrikanth KS
 

Ähnlich wie Min card lesson (20)

1 - Amazing Algorithms (Intro)
1 - Amazing Algorithms (Intro)1 - Amazing Algorithms (Intro)
1 - Amazing Algorithms (Intro)
 
C programming guide new
C programming guide newC programming guide new
C programming guide new
 
Small Basic Calculator Apps lesson
Small Basic Calculator Apps lessonSmall Basic Calculator Apps lesson
Small Basic Calculator Apps lesson
 
Artificial intelligence
Artificial intelligenceArtificial intelligence
Artificial intelligence
 
Tools For Information Processes
Tools For Information ProcessesTools For Information Processes
Tools For Information Processes
 
Unit 2 ai
Unit 2 aiUnit 2 ai
Unit 2 ai
 
Raspberry Pi and Physical Computing Workshop
Raspberry Pi and Physical Computing WorkshopRaspberry Pi and Physical Computing Workshop
Raspberry Pi and Physical Computing Workshop
 
G044053060
G044053060G044053060
G044053060
 
MENSU._AND_CALCUL.__PRT_1.pptx
MENSU._AND_CALCUL.__PRT_1.pptxMENSU._AND_CALCUL.__PRT_1.pptx
MENSU._AND_CALCUL.__PRT_1.pptx
 
Hasktut
HasktutHasktut
Hasktut
 
Chapter 3 introduction to algorithms handouts (with notes)
Chapter 3 introduction to algorithms handouts (with notes)Chapter 3 introduction to algorithms handouts (with notes)
Chapter 3 introduction to algorithms handouts (with notes)
 
You'll Never Look at Interactive the Same After this Deck
You'll Never Look at Interactive the Same After this DeckYou'll Never Look at Interactive the Same After this Deck
You'll Never Look at Interactive the Same After this Deck
 
Introduction to computers
Introduction to computersIntroduction to computers
Introduction to computers
 
E3 chap-02
E3 chap-02E3 chap-02
E3 chap-02
 
Mobile vision Android
Mobile vision Android Mobile vision Android
Mobile vision Android
 
Program concep sequential statements
Program concep sequential statementsProgram concep sequential statements
Program concep sequential statements
 
introduction to machine learning
introduction to machine learningintroduction to machine learning
introduction to machine learning
 
Coding Unplugged_Focus on problem solvin
Coding Unplugged_Focus on problem solvinCoding Unplugged_Focus on problem solvin
Coding Unplugged_Focus on problem solvin
 
Computational thinking-illustrated
Computational thinking-illustratedComputational thinking-illustrated
Computational thinking-illustrated
 
Computer science basics for nonit students
Computer science basics for nonit studentsComputer science basics for nonit students
Computer science basics for nonit students
 

Mehr von Chapelgate Christian Academy

Mehr von Chapelgate Christian Academy (20)

Window portraits
Window portraitsWindow portraits
Window portraits
 
Landscape photography
Landscape photographyLandscape photography
Landscape photography
 
Silent film production
Silent film productionSilent film production
Silent film production
 
Action photography
Action photographyAction photography
Action photography
 
Copyright
CopyrightCopyright
Copyright
 
Hiro
HiroHiro
Hiro
 
Planning a shoot
Planning a shootPlanning a shoot
Planning a shoot
 
Commercial photography
Commercial photographyCommercial photography
Commercial photography
 
Edward weston art history- new
Edward weston art history- newEdward weston art history- new
Edward weston art history- new
 
Portraits dp2 photography
Portraits dp2 photographyPortraits dp2 photography
Portraits dp2 photography
 
Still life photography
Still life photographyStill life photography
Still life photography
 
U3 l4 using simple commands
U3 l4 using simple commandsU3 l4 using simple commands
U3 l4 using simple commands
 
U3 l01 need for programming languages
U3 l01 need for programming languagesU3 l01 need for programming languages
U3 l01 need for programming languages
 
Introduction to Premiere 2018
Introduction to Premiere 2018Introduction to Premiere 2018
Introduction to Premiere 2018
 
U4 l03 Checking your Assumptions
U4 l03 Checking your AssumptionsU4 l03 Checking your Assumptions
U4 l03 Checking your Assumptions
 
U4 l01 What is big data?
U4 l01 What is big data?U4 l01 What is big data?
U4 l01 What is big data?
 
Cinematic elements
Cinematic elementsCinematic elements
Cinematic elements
 
Costume and makeup designers
Costume and makeup designersCostume and makeup designers
Costume and makeup designers
 
Color rgb
Color rgbColor rgb
Color rgb
 
U2 l6 rapid research format showdown
U2 l6 rapid research   format showdownU2 l6 rapid research   format showdown
U2 l6 rapid research format showdown
 

Kürzlich hochgeladen

CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 

Kürzlich hochgeladen (20)

CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 

Min card lesson

  • 1. Intro to unit 3 Lesson 2
  • 2. Developing a Language ◦ To computers to do what we want we need to know what are the “primitive” operations – the most basic set of operations that will allow us to do most of the tasks that situation requires. ◦ The art (and science) of using well-define languages of primitive operations to solve problems is the art and science of algorithms. ◦ Algorithms are precise series of sequences of instructions for processes that can be executed by a computer and are implemented using programing languages. ◦ One way to think of the study of algorithms is that it is the study of processes – how can use a small set of instructions to clearly and correctly define a process. ◦ Any time you are trying to write a precise set of instructions for a process to solve a problem you are designing an algorithm.
  • 3. Find the Minimum Card Activity: ◦ We have to think computer can act. We have to think of computational processes – processes than can be executed by a computer – which have specific sets of constraints ◦ You will act as a “Human Machine” while working on this activity. ◦ When acting a machine, we have to keep the limitations of a computer in mind. ◦ Follow the instructions on the activity guide and come up with an algorithm to find the smallest card in the set. ◦ Some things to consider: ◦ How do you know when to stop? ◦ Do instructions state where and when to start? ◦ It is clear were to put cards back down after you’ve picked them up?
  • 4. Go to this site: https://perryma.tk/HML/
  • 5. Define Actions ◦ As we look at these algorithms you came up with, we can see they are not all the same. ◦ However, there are common things that you are all making the human machine do and commonalities in some of your instructions. ◦ Can we define a language of common Human Machine commands for moving cards around? What are the commands or actions most of these instruction have in common? ◦ SHIFT (hand) – some form of shifting hands one position down the row left or right ◦ MOVE (hand) – some form of moving a hand directly to a particular card based on its position in the list or to the position of one of the other hands ◦ COMPARE – some way to compare cards and do something based on the results like: “if card in right hand is less than card in left hand then…” ◦ GO TO LINE – some way to jump to an earlier or later line in the program ◦ PICK CARD UP/PUT CARD DOWN – some way to do this that also makes clear where to put a card back to.
  • 6. The Human Machine: ◦ For our next activity you will be using the commands we just went over in the last slide and preforming the commands with algorithms. ◦ Complete the packet using these commands ◦ First learn about how the different commands can be used in a sequence so that you can later apply these command to create a more complex algorithm. ◦ After getting the gist of things you will then use these same commands to create an algorithm to find the smallest card in a set. ◦ All cards are face up. Card positions have numbers ◦ Don’t need to pick up cards or put them down. There is actually no way to move cards at all only ands ◦ The ending state is well defined – left and touching the min card.
  • 7. Solution to find Min: This algorithm has the right hand shift repeatedly to the right until it finds a card that is less than the left hand card, and then move the left hand to the position of the right hand – so the left hand is now on the new smallest card. It stops once the right hand reaches position 7, the end of the list.
  • 8. Wrap-up ◦ Different algorithms can be developed to solve the same problem. ◦ Even though you were all trying to solve the same problem (find min) as a class we came up with different methods for doing it. We would say we came up with different algorithms ◦ Different code can be written to implement the same algorithm ◦ This is sometimes surprising to newcomers. When writing “code” (even with the human machine language) two people trying to write code to implement the same algorithm may very easily code it differently. ◦ These two facts embody art of programming and what makes programming so fun, engaging and creative. ◦ A beautiful algorithm is an elegant and clever idea for how to solve a problem. ◦ A beautiful program is an elegant use of whatever language structures are provided to make the algorithm actually work on a computer.