Pertemuan #01:
Course Overview & CT Concepts
Catherine Olivia Sereati - FT Unika Atma Ja
FTA 101 BERPIKIR KOMPUTASIONAL
Team Dosen :
Dr. Ir. Catherine Olivia Sereati., ST., MT
Gregorius Airlangga., PhD
Julius Bata., S.Kom., M.Kom
Agenda
1. RPS, Kontrak Kuliah
2. Gambaran kuliah
3. Konsep Berpikir Komputasional
RPS & Kontrak Kuliah
RPS
Deskripsi Mata Kuliah
Kemampuan menyelesaikan persoalan membutuhkan cara berpikir yang terstruktur. Berpikir
komputasional merupakan cara berpikir terstruktur yang terdiri dari beberapa konsep seperti
dekomposisi, abstraksi, pengenalan pola dan algoritma.
Mata kuliah Berpikir Komputasional memberikan pengenalan terhadap konsep – konsep
berpikir komputasional, menggunakan konsep – konsep tersebut untuk menyelesaikan
persoalan serta menerapkan dalam komputer.
Pada mata kuliah ini mahasiswa akan mempelajari bagaimana menggunakan dekomposisi,
abstraksi, pengenalan pola, dan algoritma untuk menyusun suatu solusi permasalahan. Selain
itu Mahasiswa juga akan dikenalkan dengan bahasa pemrograman untuk mengimplementasi
solusi yang dibuat.
Computational Thinking
RPS
Capaian Pembelajaran
1. Mahasiswa mampu mengemukakan pendapat secara tertulis secara lisan dan bekerja secara
individu atau berkelompok
2. Mahasiswa mampu menyusun algoritma dalam menyelesaikan suatu permasalahan
3. Mahasiswa mampu membuat program komputer sederhana menggunakan Bahasa
Pemrograman
4. Mahasiswa mampu menerapkan konsep berpikir komputasional pada suatu studi kasus
sederhana
Asesmen : Tes kinerja (praktik) dan Tugas (proyek akhir)
Komposisi nilai :
5. UTS : 20 %
6. UAS : 25 %
7. Tugas : 55 %
RPS
Topik
1. Course Overview, Programming Language
2. Programming Language
3. Basic program structure: control constructs and data types
4. CT concepts – Abstraction
5. CT concepts – Decomposition
6. CT concepts – Pattern recognition
7. CT concepts – Algorithm
8. Program structure: Function
9. Program structure: Testing & Debugging
10. Case Study
Perkuliaha
n
1. Kuliah tatap muka (teams atau gather.town), elearning.atmajaya.ac.id
2. Mahasiswa diharapkan mencoba latihan selama dikelas dan latihan mandiri
3. Blended Gamified + game-based learning + active class-room
Konsep Berpikir Komputasional
Pillars of Computational
Thinking
9
Property of Penn
Engineering
What is computational thinking?
Computational thinking refers to the
thought processes involved in
expressing solutions as computational
steps or algorithms that can be
carried out by a computer.
(Cuny, Snyder, & Wing, 2010; Aho
, 2011; Lee, 2016).
From Digital Promise: https://digitalpromise.org/initiative/computational-thinking/computational-thinking-for-next-generation-science/what-is-computational-thinking/
• Breaking a complex problem
into more manageable sub-
problems
• Putting the solutions to the
sub- problems together gives a
solution to the original,
complex problem
11
Property of Penn
Engineering
Decompositio
n
Decomposition: Outlining a Paper
Introduction
12
Property of Penn
Engineering
Conclusion
Body
Mapping the Earth
13
Property of Penn
Engineering
Collecting the Data
14
Property of Penn
Engineering
Stitching the Images
15
Property of Penn
Engineering
Functionality: Zoom and Search
16
Pattern Recognition
• Finding similarities or shared
characteristics within or between
problems
• Makes the problem easier to solve
since the same solution can be
used for each occurrence of the
pattern
18
Property of Penn
Engineering
Pattern Recognition
Pattern Recognition
Drawing Dogs
19
Property of Penn
Engineering
Pattern Recognition
Drawing Different Dogs
20
Property of Penn
Engineering
Social Media Site: Photo Albums
Metadata
Name(s)
Date
Location
...
Photo
Album
Compress
21
Property of Penn
Engineering
Data
Server
👤
👤 👤
👤 👥
👥
👤
👤 👤
👤
👥
👥 👥
👥
Data Compression
5 3 1 2 1 2 2
22
Property of Penn
Engineering
Data Compression : problem example
Data Representation & Abstraction
• Determining what
characteristics of the problem
are important and filtering
out those that are not
• Use these to create a
representation of what we
are trying to solve
25
Property of Penn
Engineering
Data Representation
& Abstraction
Important:
• name and billing address
• student id
• on-campus address
• phone number
• ...
26
Property of Penn
Engineering
Not Important:
• favorite color
• shoe
size
• food
preferences
• ...
Data Representation: Students
Important:
• author list
• title
• ISBN
• publication
date
• edition
• category
• ratings
• summary
• ...
27
Property of Penn
Engineering
Not Important:
• color of the
cover
• birthplace of authors
• complete contents of the
book
• …
Data Representation: Books
ALGORITHMA
• Fill electric tea kettle
• Bring it to a boil
• Pour hot water in
cup
• Put teabag in cup
• Steep for 4 minutes
• Remove teabag
2
9
Property of Penn Engineering
Making a Cup of T
ea
• Step-by-step instructions of how
to solve a problem
• Identifies what is to be done
(the instructions), and the
order in which they should be
done.
3
0
Property of Penn Engineering
Algorithms
• Often expressed as something humans understand
• Eventually translated into sequences of computer
instructions
• For example, we will discuss “coding” algorithms using
Python
3
1
Property of Penn Engineering
What is an Instruction?
Simple Flowchart
Instruction1
Instruction2
3
2
Property of Penn Engineering
Flowchart: Making a Cup of Tea
Star
t
Stop
Fill electric kettle with water
Boil water
Fill cup with hot water
Put teabag in cup
Let steep for 4 minutes
Remove teabag
3
3
Property of Penn Engineering
Flowchart: Making a Cup of Herbal or Black Tea
type =
“black”?
Stop
Start
Input: “black” or “herbal”
tea?
Fill electric kettle with water
yes
Store input in variable type
Temperature = 212
Steep = 4
Temperature = 180
Steep = 5
Heat water to value of temperature °F
Let steep for value of steep minutes
Remove teabag
no
Put type teabag in cup
3
4
Property of Penn Engineering
Flowchart: Making a Cup of Tea, Revisited
Star
t
Stop
Fill electric kettle with water
Boil water
Fill cup with hot water
Put teabag in cup
Let steep for 4 minutes
Remove teabag
3
5
Property of Penn Engineering
Flowchart: Making a Cup of T
ea Efficiently
Fill electric kettle with
water
Boil water
Fill cup with hot
water Stop
Put teabag in
cup
Star
t
3
6
Property of Penn Engineering
Case Studi : Writing Paper
1. Dekomposisi
2. Abstraksi
3. Pengenalan pola
4. Algoritma
Problem : Menulis artikel/makalah
Step 1st
1. Dekomposisi
2. Abstraksi
3. Pengenalan pola
4. Algoritma
Problem : Menulis artikel/makalah
Makalah
Introduction
Body
Conclusion
1. Dekomposisi
2. Abstraksi
3. Pengenalan pola
4. Algoritma
Problem : Menulis artikel/makalah
Makalah
1. Dekomposisi
2. Abstraksi
3. Pengenalan pola
4. Algoritma
Problem : Menulis artikel/makalah
Makalah
referensi
1. Dekomposisi
2. Abstraksi
3. Pengenalan pola
4. Algoritma
Problem : Menulis artikel/makalah
Algoritma menulis makalah
1. Menentukan ide pokok makalah
2. Mencari dan membaca makalah referensi
3. Menulis paragraf pembuka
4. Menulis beberapa paragraf isi pembahasan
5. Menulis kesimpulan
6. Membaca seluruh makalah
7. Jika ada kesalahan, kembali ke Langkah 3, jika tidak
lanjut langkah 8
8. selesai
Case studi 2:
https://www.coursera.org/learn/compthinking/lecture/u1EfA/
introduction-to-the-graphic-organizer
Assignment :
• Make algorithma for case study 2
• Decomposition: breaking down a
complex problem into smaller parts
• Pattern recognition: finding the
similarities among smaller problems
• Data representation and
abstraction: describing data in a
structured manner and generalizing
details
• Algorithms: step by step
instructions for solving the problem
45
Property of Penn
Engineering
Conclusion Pillars of Computational Thinking
Next
Intro to Programming Language
References :
Computational Thinking for Problem Solving
University of Pennsylvania
https://www.coursera.org/learn/compthinking/lecture/
Problem Solving Using Computational Thinking
University of Michigan
https://www.coursera.org/learn/compthinking/home/module/1

Computational Thinking : Course Overview

  • 1.
    Pertemuan #01: Course Overview& CT Concepts Catherine Olivia Sereati - FT Unika Atma Ja FTA 101 BERPIKIR KOMPUTASIONAL Team Dosen : Dr. Ir. Catherine Olivia Sereati., ST., MT Gregorius Airlangga., PhD Julius Bata., S.Kom., M.Kom
  • 2.
    Agenda 1. RPS, KontrakKuliah 2. Gambaran kuliah 3. Konsep Berpikir Komputasional
  • 3.
  • 4.
    RPS Deskripsi Mata Kuliah Kemampuanmenyelesaikan persoalan membutuhkan cara berpikir yang terstruktur. Berpikir komputasional merupakan cara berpikir terstruktur yang terdiri dari beberapa konsep seperti dekomposisi, abstraksi, pengenalan pola dan algoritma. Mata kuliah Berpikir Komputasional memberikan pengenalan terhadap konsep – konsep berpikir komputasional, menggunakan konsep – konsep tersebut untuk menyelesaikan persoalan serta menerapkan dalam komputer. Pada mata kuliah ini mahasiswa akan mempelajari bagaimana menggunakan dekomposisi, abstraksi, pengenalan pola, dan algoritma untuk menyusun suatu solusi permasalahan. Selain itu Mahasiswa juga akan dikenalkan dengan bahasa pemrograman untuk mengimplementasi solusi yang dibuat. Computational Thinking
  • 5.
    RPS Capaian Pembelajaran 1. Mahasiswamampu mengemukakan pendapat secara tertulis secara lisan dan bekerja secara individu atau berkelompok 2. Mahasiswa mampu menyusun algoritma dalam menyelesaikan suatu permasalahan 3. Mahasiswa mampu membuat program komputer sederhana menggunakan Bahasa Pemrograman 4. Mahasiswa mampu menerapkan konsep berpikir komputasional pada suatu studi kasus sederhana Asesmen : Tes kinerja (praktik) dan Tugas (proyek akhir) Komposisi nilai : 5. UTS : 20 % 6. UAS : 25 % 7. Tugas : 55 %
  • 6.
    RPS Topik 1. Course Overview,Programming Language 2. Programming Language 3. Basic program structure: control constructs and data types 4. CT concepts – Abstraction 5. CT concepts – Decomposition 6. CT concepts – Pattern recognition 7. CT concepts – Algorithm 8. Program structure: Function 9. Program structure: Testing & Debugging 10. Case Study
  • 7.
    Perkuliaha n 1. Kuliah tatapmuka (teams atau gather.town), elearning.atmajaya.ac.id 2. Mahasiswa diharapkan mencoba latihan selama dikelas dan latihan mandiri 3. Blended Gamified + game-based learning + active class-room
  • 8.
  • 9.
  • 10.
    What is computationalthinking? Computational thinking refers to the thought processes involved in expressing solutions as computational steps or algorithms that can be carried out by a computer. (Cuny, Snyder, & Wing, 2010; Aho , 2011; Lee, 2016). From Digital Promise: https://digitalpromise.org/initiative/computational-thinking/computational-thinking-for-next-generation-science/what-is-computational-thinking/
  • 11.
    • Breaking acomplex problem into more manageable sub- problems • Putting the solutions to the sub- problems together gives a solution to the original, complex problem 11 Property of Penn Engineering Decompositio n
  • 12.
    Decomposition: Outlining aPaper Introduction 12 Property of Penn Engineering Conclusion Body
  • 13.
    Mapping the Earth 13 Propertyof Penn Engineering
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
    • Finding similaritiesor shared characteristics within or between problems • Makes the problem easier to solve since the same solution can be used for each occurrence of the pattern 18 Property of Penn Engineering Pattern Recognition
  • 19.
  • 20.
    Pattern Recognition Drawing DifferentDogs 20 Property of Penn Engineering
  • 21.
    Social Media Site:Photo Albums Metadata Name(s) Date Location ... Photo Album Compress 21 Property of Penn Engineering Data Server 👤 👤 👤 👤 👥 👥 👤 👤 👤 👤 👥 👥 👥 👥
  • 22.
    Data Compression 5 31 2 1 2 2 22 Property of Penn Engineering
  • 23.
    Data Compression :problem example
  • 24.
  • 25.
    • Determining what characteristicsof the problem are important and filtering out those that are not • Use these to create a representation of what we are trying to solve 25 Property of Penn Engineering Data Representation & Abstraction
  • 26.
    Important: • name andbilling address • student id • on-campus address • phone number • ... 26 Property of Penn Engineering Not Important: • favorite color • shoe size • food preferences • ... Data Representation: Students
  • 27.
    Important: • author list •title • ISBN • publication date • edition • category • ratings • summary • ... 27 Property of Penn Engineering Not Important: • color of the cover • birthplace of authors • complete contents of the book • … Data Representation: Books
  • 28.
  • 29.
    • Fill electrictea kettle • Bring it to a boil • Pour hot water in cup • Put teabag in cup • Steep for 4 minutes • Remove teabag 2 9 Property of Penn Engineering Making a Cup of T ea
  • 30.
    • Step-by-step instructionsof how to solve a problem • Identifies what is to be done (the instructions), and the order in which they should be done. 3 0 Property of Penn Engineering Algorithms
  • 31.
    • Often expressedas something humans understand • Eventually translated into sequences of computer instructions • For example, we will discuss “coding” algorithms using Python 3 1 Property of Penn Engineering What is an Instruction?
  • 32.
  • 33.
    Flowchart: Making aCup of Tea Star t Stop Fill electric kettle with water Boil water Fill cup with hot water Put teabag in cup Let steep for 4 minutes Remove teabag 3 3 Property of Penn Engineering
  • 34.
    Flowchart: Making aCup of Herbal or Black Tea type = “black”? Stop Start Input: “black” or “herbal” tea? Fill electric kettle with water yes Store input in variable type Temperature = 212 Steep = 4 Temperature = 180 Steep = 5 Heat water to value of temperature °F Let steep for value of steep minutes Remove teabag no Put type teabag in cup 3 4 Property of Penn Engineering
  • 35.
    Flowchart: Making aCup of Tea, Revisited Star t Stop Fill electric kettle with water Boil water Fill cup with hot water Put teabag in cup Let steep for 4 minutes Remove teabag 3 5 Property of Penn Engineering
  • 36.
    Flowchart: Making aCup of T ea Efficiently Fill electric kettle with water Boil water Fill cup with hot water Stop Put teabag in cup Star t 3 6 Property of Penn Engineering
  • 37.
    Case Studi :Writing Paper
  • 38.
    1. Dekomposisi 2. Abstraksi 3.Pengenalan pola 4. Algoritma Problem : Menulis artikel/makalah Step 1st
  • 39.
    1. Dekomposisi 2. Abstraksi 3.Pengenalan pola 4. Algoritma Problem : Menulis artikel/makalah Makalah Introduction Body Conclusion
  • 40.
    1. Dekomposisi 2. Abstraksi 3.Pengenalan pola 4. Algoritma Problem : Menulis artikel/makalah Makalah
  • 41.
    1. Dekomposisi 2. Abstraksi 3.Pengenalan pola 4. Algoritma Problem : Menulis artikel/makalah Makalah referensi
  • 42.
    1. Dekomposisi 2. Abstraksi 3.Pengenalan pola 4. Algoritma Problem : Menulis artikel/makalah Algoritma menulis makalah 1. Menentukan ide pokok makalah 2. Mencari dan membaca makalah referensi 3. Menulis paragraf pembuka 4. Menulis beberapa paragraf isi pembahasan 5. Menulis kesimpulan 6. Membaca seluruh makalah 7. Jika ada kesalahan, kembali ke Langkah 3, jika tidak lanjut langkah 8 8. selesai
  • 43.
  • 44.
    Assignment : • Makealgorithma for case study 2
  • 45.
    • Decomposition: breakingdown a complex problem into smaller parts • Pattern recognition: finding the similarities among smaller problems • Data representation and abstraction: describing data in a structured manner and generalizing details • Algorithms: step by step instructions for solving the problem 45 Property of Penn Engineering Conclusion Pillars of Computational Thinking
  • 46.
  • 47.
    References : Computational Thinkingfor Problem Solving University of Pennsylvania https://www.coursera.org/learn/compthinking/lecture/ Problem Solving Using Computational Thinking University of Michigan https://www.coursera.org/learn/compthinking/home/module/1

Editor's Notes

  • #9 Presenter 2018-10-29 11:29:39 -------------------------------------------- There are four, what we call, “pillars”, to computational thinking: decomposition, pattern recognition, data representation and abstraction (here, called abstraction), and algorithms. We’ll start by discussing what each of these are, and illustrate them in the context of several everyday and real computational problems. In particular, we’ll look at them in the context of the LGBT and Working Dog centers.
  • #11 Presenter 2018-10-29 11:29:39 -------------------------------------------- The first pillar is decomposition. Decomposition is the process of taking a complex problem and breaking it into more manageable sub-problems. Although solving the complex problem as a whole may seem very difficult, the solution to each sub-problem may be much simpler. By putting together the solutions to the sub-problems we can then arrive at a solution to the original, complex problem.
  • #12 Presenter 2018-10-29 11:29:39 -------------------------------------------- You have probably experienced this when given the assignment of writing a paper. Rather than just sitting down at your keyboard and writing from start to finish, you probably start by developing an outline of the essay -- say an introduction, a body containing sections developing each of several main ideas, and a conclusion. You then write each section in turn, starting with the main ideas and ending with the introduction and conclusion, to create the paper.
  • #13 Presenter 2018-10-29 11:29:41 -------------------------------------------- As another example, suppose you were asked to create a detailed, zoomable map of the world -- something like Google Earth -- or at least, to be part of a team to do this. Sounds pretty overwhelming! How would you go about decomposing the problem to make it more manageable?
  • #14 Presenter 2018-10-29 11:29:42 -------------------------------------------- First, you would need to get the images. This would come from a variety of different sources, for example, 2D images from satellites (shown here, point to it) as well as images from multiple 2D cameras aboard planes doing a series of zigzags over locations of interest (shown here, point to it). This is called aerial photography. From these, you can create a 3D model.
  • #15 Presenter 2018-10-29 11:29:42 -------------------------------------------- Having decided on the data sources, the images must be “stitched” together. Here, we shown how three overlapping images are combined. (Point to the overlap) For example, the aerial photography would use something called “photogrammetry” to create a 3-D model of the location. The images would then be superimposed onto a 3-D globe. https://goo.gl/images/WWGH8P
  • #16 Presenter 2018-10-29 11:29:43 -------------------------------------------- You would also create the functionality you wished to provide over this data. For example, you might create various levels of detailed views to enable zooming-in and zooming-out over the map. Here, we see a 1x view of a portion of the map (point to it), followed by a “zoomed in” image at 10x (ANIMATE). You might also annotate the globe and/or images with information about the various locations, for example. a site name or address (ANIMATE). Here we see the Unika Atma Jaya indicated on the map.
  • #18 Presenter 2018-11-05 11:15:10 -------------------------------------------- When we decompose a problem, we frequently find patterns among the sub-problems, i.e. similarities or shared characteristics. Discovering these patterns make the complex problem easier to solve since we can use the same solution for each occurrence of the pattern. Pattern recognition is the ability to identify similarities or shared characteristics within a problem or between different problems. It helps us solve complex problems by recognizing patterns and using the same solution for each occurrence of the pattern. Pattern recognition is also useful in everyday tasks like mulching a garden. Even though each flower bed may be different, the process of mulching is the same for each bed. We clean and weed the bed, bring the mulch, and lay it down. By recognizing this pattern, we can repeat the same process for each flower bed.
  • #19 Presenter 2018-11-05 11:15:10 -------------------------------------------- We’ve been talking about the Working Dog Center, so let’s think about a slightly different problem related to dogs, that of drawing dogs. Although dogs can look quite different from each other, all dogs share several key components: one head, two ears, one body, four legs and a tail (point to these). To draw a dog, we just have to say what the characteristics are of each of these components, and then draw a head, ears, body, legs and tail. For example, when drawing different dogs, we can identify the common components they all have, such as a head, ears, body, legs, and tail. By recognizing this pattern, we can draw any dog by simply drawing these components in the appropriate shape and size.
  • #20 Presenter 2018-11-05 11:15:11 -------------------------------------------- For example drawing this daschund means drawing a long, narrow head, floppy ears, a long body, short legs and a long thin tail. (ANIMATE) Drawing this boxer means drawing a short fat head, pointed erect ears, a medium body, medium legs, and a curled tail. (ANIMATE) Drawing this dalmatian means drawing a medium head, floppy ears, a long muscular body, long legs, and a long thin tail.
  • #21 Presenter 2018-11-05 11:15:17 -------------------------------------------- As another example, consider a social-media website like Facebook and how they might handle the upload of an album of photos. Each photo in the album would first be [ANIMATE] analyzed for metadata (e.g. the names of people in the photo based on previously tagged images), [ANIMATE] compressed (images can be very large!), and then [ANIMATE] metadata and images stored. Although the photos are different, the processing of each photo is the same – we can use pattern recognition (write pattern recognition on the slide?).
  • #22 Presenter 2018-11-05 11:15:17 -------------------------------------------- The process of compression also involves looking for patterns in the data, and replacing those patterns with smaller representations. In this example, we are taking a long array of colored pixels [ANIMATE] and replacing “runs” of the same color pixel by the color and number of occurrences in the “run”. In this example, there is a run of 5 red pixels that is replaced by “red 5”, a run of 3 yellow pixels that is replaced by “yellow 3”, a run of 1 red pixel that is replaced by “red 1”, and so on. This results in a smaller representation. In this example, patterns within the image data are also being capitalized on. (Write “Patterns within Data”?)
  • #25 Presenter 2018-10-29 11:46:18 -------------------------------------------- Data representation and abstraction involves determining what characteristics of the problem are important and filtering out those that are not. From this, we can create a representation of what we are trying to solve.
  • #26 Presenter 2018-10-29 11:46:20 -------------------------------------------- Obviously, your name and billing address are important pieces of information. However, since we need to be able to identify a student, and it is possible that two people have the same name and same address (remote, but possible!), universities frequently assign unique student ids. Other information may also be important: your on-campus address, phone number, major, and birth date, for example. Information that is not important (and therefore would not be included in the representation of a student) include your favorite color, shoesize, food preferences … and any number of things that might be important in another setting.
  • #27 Presenter 2018-10-29 11:46:42 -------------------------------------------- As another example, let’s consider an online retail website that sells Kindle books (like Amazon) and think about what information is important to represent for a catalog entry. Recall that people want to be able to find a book using things like author, title, isbn number, or category of book (such as romantic or thriller) -- and then decide which book to purchase using things like average customer review, price and so on (filtering). Important data to represent therefore includes the author list, title, isbn, publication date, edition, categorie(s), language, price, ratings, and a summary of what the the book is about. Information that is probably not important to represent include the color of the cover, where the author or authors were born, the complete content of the book.
  • #29 Presenter 2018-10-29 11:49:34 -------------------------------------------- For example, suppose I want to make a cup of black tea. To do this, I first fill my electric tea kettle, then bring it to a boil. When the water boils, I pour in the hot water, put a teabag in a cup, let the tea steep for 4 minutes, and then remove the teabag. An algorithm is the starting point for writing a computer program, and is often expressed at a high level using pseudocode or a flowchart rather than the English description given on this slide. Both describe instructions, and the order in which the instructions should be done.
  • #30 Presenter 2018-10-29 11:49:32 -------------------------------------------- An algorithm is a set of step-by-step instructions of how to solve a problem. It identifies what is to be done (the instruction), and the order in which they should be done.
  • #31 Presenter 2018-10-29 11:49:34 -------------------------------------------- So what is an instruction? There are few real rules. Instructions are often expressed as something humans understand rather than something a computer would understand. When writing a program from pseudocode or flowcharts, we therefore decompose and translate these human instructions into sequences of computer instructions. We will discuss actually “coding” algorithms using Python later in the course. For now, we will focus on expressing algorithms with human instructions using flowcharts.
  • #32 Presenter 2018-10-29 11:49:34 -------------------------------------------- A flowchart is a diagram representing instructions as rectangles and the order of instructions using a line with an arrow to indicate the “next” instruction. In this very simple flowchart, we have two instructions where Instruction1 is performed before Instruction2. We will often call this line with an arrow an directed edge (or just edge for simplicity since our edges will always have arrows indicating the direction of flow).
  • #33 Presenter 2018-10-29 11:49:34 -------------------------------------------- Now let’s see how to represent the process of making a cup of black tea that we described earlier in English, using a flowchart. The flowchart starts with a special “start” instruction (indicated as an oval, which we are coloring green for clarity), then the instructions “fill an electric kettle with water”, ”boil water”, “fill cup with hot water”, “put teabag in cup”, “let the tea steep for 4 minutes”, and then “remove the teabag”. The flowchart ends with a special “Stop” instruction (indicated as an oval, colored red for clarity). In addition to black tea, we might also want to make herbal tea, and (using pattern recognition) realize that it is essentially the same process as making black tea. The difference is that we put a different type of teabag in the cup, heat the water 180 degrees rather than boiling, and steep for 5 minutes rather than 4. (Point out the differences on the screen.)
  • #34 Presenter 2018-10-29 11:49:34 -------------------------------------------- We could therefore modify the previous algorithm to first get input from the user as to whether they want black or herbal tea (we assume only two choices), which is indicated using a parallelogram. (Point to it.) We remember this input using a variable called “type”. We then determine the appropriate temperature and steeping time depending on the type of tea. This is done by testing “type”, and setting the appropriate temperature and steeping time depending on whether or not it is black tea. Note that the decision or conditional instruction is indicated using a diamond with “Yes”/ “No” edges coming out. Type, temperature and steeping time are variables that will be used in the algorithm (recall data representation and abstraction).
  • #35 Presenter 2018-10-29 11:49:34 -------------------------------------------- Now, returning to the original problem of making a cup of black tea, you might object to the way in which I did it, since you point out that the teabag could be put in the cup at any point before letting the tea steep. For example, you could fill the kettle, heat the water, put the teabag in the cup, then fill the cup with water [NUMBER THEM]; or you could put the teabag in the cup, fill the kettle, heat the water, then fill the cup with water [NUMBER THEM]; or you could fill the kettle, put the teabag in the cup, heat the water, then fill the cup with hot water [NUMBER THEM AGAIN]. As you can see, no matter which of these orders I use for the steps, the result is always the same: we get both the teabag and the hot water in the cup before letting it steep. Furthermore, if you could do two things at once (in parallel) you could put the teabag in the cup while heating the water or while filling the kettle. Doing these things in parallel could actually reduce the total amount of time it takes to make the tea!
  • #36 Presenter 2018-10-29 11:49:34 -------------------------------------------- We can represent executions in which you do two things at once (in parallel) by having two edges going out of an instruction (in this example, the start instruction). [ANIMATE] This flowchart allows both parallel behavior-- putting the teabag in the cup while filling the kettle and heating the water -- as well as many of the sequential orderings we described earlier, i.e. putting the teabag in the cup, then filling the kettle with water, then boiling the water [NUMBER THEM]; filling the kettle with water, then putting the teabag in the cup, then boiling the water [NUMBER THEM]; or filling the kettle with water, boiling the water, then putting the teabag in the cup [NUMBER THEM]. However, boiling the water must come after putting water in the kettle (point to the arrow), and the teabag must be put in the cup before filling the cup with hot water [SHOW THE LINE]. So the arrows are restricting the order of instructions must be done.
  • #45 Presenter 2018-10-29 11:48:24 -------------------------------------------- The four pillars are Decomposition: where we break down a complex problem or system into smaller parts that are more manageable and easier to understand Pattern recognition: where we find the similarities or patterns among small, decomposed problems so that we can solve more complex problems Data representation and abstraction: where we describe data in a structured manner and generalizing details about data and processes so that they’re reusable and Algorithms: which are a set of finite, step by step instructions for solving this and similar problems Keep in mind that when we use CT, we don’t have to apply all four pillars. For instance, it may not be possible to break down a fairly simple problem into even simpler ones. But we can use these pillars as tools for developing a solution to a problem in such a way that it can be carried out by a computer.