ECT Lesson Plan: Sorting Data
Lesson plan at a glance...
| In this lesson plan… |
Students gather data from classmates and analyze categorical and quantitative data using spreadsheet functions and/or Python. Decomposition is used to break the sorting process into individual steps and students learn how to design algorithms. Upon completion of this lesson, students will be able to write algorithms to calculate the mean, median, mode, and range of data. Additionally, students will be able to use spreadsheet functions or programming instructions to sort data based on different criteria, leading to the identification of patterns and trends.
For more advanced activities on sorting data, view the ECT Lesson Plan “Sorting the World’s Cities.”
Confirm that your computer is on and logged-in | 1 to 3 minutes | |
Confirm that your projector is turned on and is projecting properly | 1 to 4 minutes | |
Confirm that all students’ computers are turned on and logged-in | 3 to 5 minutes | |
Download and install Python 2.x (https://www.python.org/downloads) or navigate to Trinket (https://trinket.io/) | 5 to 10 minutes |
10 minutes | |
10 minutes | |
15 minutes | |
5 minutes |
Activity Overview: In this activity, students will gather meaningful and relevant content from each other using data collection. They will use the collected data in the following activities.
Activity: Collect class data, such as shoe size vs. height in inches, and enter it into a spreadsheet. |
Activity Overview: In this activity, students will recognize patterns within a data set through the process of sorting the data based on various criteria (height and shoe size). They will use a spreadsheet or Python to organize a set of data. Students recognize that by sorting data, we can more easily generalize the pattern between height and shoe size.
Notes to the Teacher: Instructions for how to organize a set of data using Google Sheets are: Sort by shoe size:
Sort by height:
Sort by name:
Instructions for how to use Python to organize a set of data are:
|
Activity: Have students sort the data by height and list the the five tallest students and the five shortest students. They can do this either by hand, electronic spreadsheet, or Python. Ask them the following questions: Q1: Can you identify the tallest and shortest students faster before or after sorting the data? Repeat the process for the data on shoe size. Q2: Name the people who are on both “top five” lists. Name any people on the list of the five tallest, but not on the list of students with the largest shoe size. |
Assessment: A1: It is faster to identify the information that we wish to find after the data has been organized. By sorting data, we can more easily identify a pattern between height and shoe size. We can generalize the pattern if we notice that as height increases, shoe size also increases. A2: Answers will vary. Students see how different patterns overlap, as well as the limits of some generalizations. |
Activity Overview: In this activity, students design algorithms by decomposing a process into individual steps.
Activity: Have students write an algorithm to calculate each of the following:
|
Teaching Tips:
|
Assessment: Writing an algorithm helps students to decompose a process into individual steps.
|
Activity: Ask your students the following questions: Q1: What step of the spreadsheet algorithm corresponds to the function “sorted( )” in Python? Q2: In the line of code “orderednames = sorted(datasearch, key=GetName)“, which argument tells Python the name of the data that we want to analyze? Q3: What part of the program instructs Python to sort by Height? Q4: What part of the Python program most closely corresponds to hitting the [Return] or [Enter] key and seeing the data sorted in the spreadsheet? |
Assessment: A1: Clicking on Sort A-Z from the data menu corresponds to the sorted function in Python. Students see that there is some overlap in the algorithm used to sort data in Excel and the built-in functions used in Python. A2: The data from our spreadsheet is stored in a variable called datasearch, so when we type datasearch into the sorted function we are telling Python what data to sort. By focusing on a single line of code within a relatively lengthy program, students begin to understand the individual parts of a multi-step process (decomposition). A3: The line orderedheights = sorted(datasearch, key=GetHeight)gets the data from datasearch, and runs it through the function GetHeight. Identifying the part of an algorithm that performs a specific function encourages students to focus on decomposing a multi-step process. A4: The print statements instruct Python to print the answer to the screen similarly to how hitting [Return] or [Enter] instructs the spreadsheet to display the result. Students see how an algorithm in Python corresponds to an action in a spreadsheet. |
Activity Highlights: In this activity, students will finish the lesson by demonstrating their understanding of the key concepts covered during this lesson.
Student Activity: Journaling: Students respond to the following prompt in their journal or word processor: In what other situations might you need to sort data and how would it help with data analysis? |
Learning Objectives | Standards |
LO1: Students will be able to collect data from classmates and enter it into a spreadsheet. | Core Subject CCSS MATH.CONTENT.HSS.ID: Interpreting Categorical and Quantitative Data. Computer Science CSTA L2.CT.14: Examine connections between elements of mathematics and computer science including binary numbers, logic, sets and functions. |
LO2: Students will be able to sort data, using a spreadsheet or Python. | Computer Science CSTA L3A.CT.4: Compare techniques for analyzing massive data collections. UK 4.2: Develop and apply their analytic, problem-solving, design, and computational thinking skills. |
LO3: Students will be able to recognize and generalize patterns in sorted data. | Computer Science AUSTRALIA 10.4 (Collecting, managing and analyzing data): Analyse and visualise data to create information and address complex problems; and model processes, entities and their relationships using structured data. CSTA L3B.CT.9: Analyze data and identify patterns through modeling and simulation. |
LO4: Students will be able to write algorithms to calculate mean, median, mode, and range of a set of data | Computer Science CSTA L2.CT.1: Use the basic steps in algorithmic problem-solving to design solutions (e.g., problem statement and exploration, examination of sample instances, design, implementing a solution, testing and evaluation). UK 3.2: Understand several key algorithms that reflect computational thinking [for example, ones for sorting and searching]; use logical reasoning to compare the utility of alternative algorithms for the same problem. |
Term | Definition | For Additional Information |
Algorithm | A series of instructions that can be repeated over and over with the same result for a given input (e.g. recipe, computer software, sheet of music notes). | |
Pattern | A discernible regularity in the world or in a man-made design (i.e. data) | |
Sorting | Any process of arranging items according to a certain sequence or in different sets, by either ordering or categorizing |
Concept | Definition | |
Algorithm Design | Creating an ordered series of instructions for solving similar problems | |
Data Analysis | Making sense of data by finding patterns or developing insights | |
Data Collection | Gathering information | |
Decomposition | Breaking down data, processes or problems into smaller, manageable parts | |
Pattern Generalization | Creating models of observed patterns to test predicted outcomes | |
Pattern Recognition | Observing patterns and regularity in data |
Contact info | For more info about Exploring Computational Thinking (ECT), visit the ECT website (g.co/exploringCT) |
Credits | Developed by the Exploring Computational Thinking team at Google and reviewed by K-12 educators from around the world. |
Last updated on | 06/30/2015 |
Copyright info | Except as otherwise noted, the content of this document is licensed under the Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache 2.0 License. |
ECT: Sorting Data of