Unit 0. Introduction
Revision Date: Jul 22, 2019 (Version 3.0)Summary: This optional lesson can be used as a brief preview to the course on the first day of class when teachers typically have many classroom administrative tasks to accomplish, but teachers also want to set the stage for the class. Students begin thinking about the influences of technology as they engage in a Think-Pair-Share strategy about the computing innovations that have impacted their lives. In addition, this is an opportunity to set beginning expectations about interacting with classmates in collaborative activities and to model writing in the content area.
Outcomes:
Overview:
Source: This lesson is adapted from Code.org (Unit 1 Lesson 00)
Innovation is an important theme of this course. Students will become more aware of how innovation in technology has affected their lives.
Student computer usage for this lesson is: none
Student journals, if they are ready. Otherwise, paper for students to write on.
This short activity can be used after any required first-day administrative duties.
Each lesson in the course will start out with a brief prompt for students to respond to in their journals. They will pair off to discuss their answers, then share their findings with the class.
If you have the journals ready, have students write the answer to this prompt in the journal: Identify technological innovations that you and/or your families use. (At LEAST four, how many can you name?)
If Clarification is Needed:
Note: Written communication is an important skill. This curriculum provides a variety of opportunities for students to develop the skills that they will need to perform well in the Performance Tasks.
Summarize the various ways that computing innovation has affected our lives. Assign the following homework.
Ask students to interview an adult and ask, "What computing innovation has had the most impact on your life? In what ways has your life been affected?"
Students will record the adult’s answer and compare and contrast the answer with their own original answer in a brief paragraph.
Optional Extension:
Suggest that students create timelines showing the years when the various innovations were invented or became available to consumers. (They could make their best guesses as a class and reorder the ideas on the board.)
Paragraph about the positive and negative impacts of the innovation that has had the most impact on the student's life in journal at the end of class.
Paragraph for homework that compares and contrasts an adult's answer to their own journal entry answer after conducting a discussion with an adult at home.
Unit 0. Introduction
Revision Date: Jul 22, 2019 (Version 3.0)Summary
Through presentations, videos, and discussion, students discover how technology has been changing and brainstorm ideas for how the next generation will have a different relationship with technology than the current generation. Students will also learn the relative measures of computer storage (KB, MB, etc.)
This is a prelude to the idea of big data and the impact of technology as well as an introductory opportunity to start to develop team norms, effective group participation and a respectful environment where every student is encouraged to contribute and share their perspective.
Outcomes
Overview
1. Introduction (5 min) - Students journal about the different relationships each generation has with technology.
2. Activities (40 min) - Students practice organizing by relative size and create posters to demonstrate learning.
3. Wrap-up (5 min) - Posters are shared with the class.
Student computer usage for this lesson is: none
Videos:
PowerPoints (in the Lesson Resources folder):
Students should have paper for taking notes. (If desired, use preprinted Information Age Notes, in the Lesson Resources folder)
Print out "Relative Measure Word Strips to cut" papers and "Measure Quantity Word Strips to cut" papers (in the Lesson Resources folder) and cut them into strips to give to students for the activity.
8 big sheets of big poster paper to place at the front of the room labeled:
Post-it notes for students
1. Journal: How were computers and technology different one generation ago?
2. Pair and share journal ideas, compile a class list. (Ideas you might suggest if they’re stuck: bigger, slower, less storage, less portable, not inside of so many other things, not as pervasive, less voice ability, less connection to the Internet, phones weren't very smart, more expensive, Previous generation: land lines, stand in one place when talking on the phone, separate cameras, internet via phone modem, no GPS, etc.)
3. Prompt students to come up with their own definition of what "1 generation ago" means. (Now a generation is considered to be about 25 years. A century ago it was about 20 years - from Ancestry.com)
{optional question for thought/discussion: Why were generations shorter a hundred years ago? ( don't tell them the answer, try to lead them to ask each other good questions to guide them to an answer: shorter lifespans, more death from disease, younger marriage age http://www.ancestry.com.au/learn/learningcenters/default.aspx?section=lib_Generation )}
4. Discuss the connections between what computing concepts are available and the communication, jobs and services that are available from one generation to the next.
Hand out mixed up relative measure papers (a document with strips to cut is in the Lesson Resources folder) to 8 students.
Ask them to try to line up by relative size at the front of the room to display the terms from smallest to largest. Ask if the class agrees, make changes by group vote. Don’t tell them if they're right yet. Tape or post the strips to the front wall.
Teacher Note: Be sure to get students' names and introduce them as part of the goal of developing a classroom community of learners. Continuously encourage positive social interactions.
Hand out the 8 papers with measured quantities (a document with strips to cut is in the Lesson Resources folder).
Ask those students to try to match themselves up with the relative measure papers. Give the class a chance to rearrange by group vote. Tape or post the strips to their relative measure paper.
Display the posters created by the class, share details and ideas from the posters. Have students journal or write a reflection on these key questions:
Additional Activities if Time Permits:
Instead of having students move to the front of the room to sort the paper strips into order, you could print a set for each group of 3-4 students and have them match and arrange them at their desks.
If students have a strong interest, or if you have extra time, use the ideas in "Extensions to the lesson on the Future of Technology" document located in the resources folder.
Self-checking exercise on identifying storage terms (KB, MB, etc.)
Assess group dynamics. Did everybody participate? Was communication positive within groups and respectful of the different needs and perspectives of group members?
Unit 0. Introduction
Revision Date: Jul 22, 2019 (Version 3.0)Summary: This lesson is a basic introduction to algorithms and the nature of intelligence. Students will play tic-tac-toe (noughts and crosses is the British version) between a “highly intelligent piece of paper” and a human. Students will explore how to create an algorithm and the concept of computer intelligence.
Outcomes
Overview
Source: This lesson is adapted from a lesson created by Paul Curzon, Queen Mary, University of London.
Student computer usage for this lesson is: none
A PowerPoint for this lesson is included in the Lesson Resources folder - IntelligentPaper.pptx and IntelligentPaper.pdf
Copies for student pairs of "intelligent paper directions" with tic-tac-toe directions on one side, and blank on the other - in the Lesson Resources folder - IntelligentPaperDirections.pdf
The wrap-up questions are available in the Lesson Resources folder as Questions To Consider.docx
Optional: a musical greeting card, a paper folded into a fortune teller (http://en.wikipedia.org/wiki/Paper_fortune_teller), a page of equations
The Python program for the optional activity is located in the Lesson Resources Folder - TicTacToeAI.py
What could make a piece of paper intelligent? (Think-Pair-Share)
(Use IntelligentPaper.pptx in the Lesson Resources folder to help deliver this lesson.)
Challenge the students by saying that you have a piece of paper that is at least as smart as any human. (Show the blank side of the paper, don't tell the students yet, but it has directions on how to play tic-tac-toe on the back.) Ask if anybody believes that this is possible.
Show students examples of "smart papers," such as:
Encourage discussion and debate, prod students to argue their point for or against intelligence, and get them to develop their own criteria and definition for intelligence. Write the class definition and criteria on the board.
Tell the class that the paper has never lost a game: it has perfect intelligence.
Challenge students to play a game against the paper. The paper is peripherally challenged (it has no arms, and thus needs somebody to do its work for it). One person represents humankind, while the other person represents the paper. Play tic-tac-toe with a partner. The paper must begin the game.
Possible outcomes:
But, the paper WILL NOT LOSE.
Try letting humankind go first. (Wait and try it: The paper will lose. Why?)
Challenge students to write out detailed directions (an algorithm) that will never lose the game whether it goes first or second. Point out that algorithms are made by putting detailed steps in order (sequencing), making choices depending on the situation (selection) and repeating certain sections (iteration).
Students should use their new algorithm to play against each other. Follow the same model for the paper versus the human game.
Discuss:
Computers programs implement algorithms.
Computer programs carry out algorithms by controlling the computer memory, central processing unit, input and output. When we carried out our tic tac toe algorithm what did we do that corresponds to each computer component?
Memory:
Central Processing Unit:
Input:
Output:
Additional Possible Activities and Discussions Time Permitting:
See if students know what a CPU is. If not, define. [
CPU is the abbreviation for central processing unit or processor, the brains of the computer where most calculations take place.
Reflection: (written in journal or discussed as a class)
How is a computer CPU (processor) similar to/different from a human brain? (both process information, can use logic and math, can follow instructions; computers only do what they are told, can work without need of food or sleep, etc.)
A human only has 1 brain but a computer can have multiple CPUs. How could a computer with multiple processors (CPUs) divide up a task like playing tic-tac-toe? (This is a good optional exercise if there is extra time, to divide up what the steps are and see if any can be done in parallel to save time. example: one processor checks rows, one checks colums to see if there is a winner)
Have students write their own definitions for the four words at the end of the presentation:
(Use PyCharm or some other Python environment to show the TicTacToeAI.py program from the Lesson Resources folder.)
Assign homework for Lesson 1-1: Provide students a copy of the “Questions to Consider” in the resources folder and assign the reading:
Blown to Bits – Chapter 1, can be found here http://www.bitsbook.com/wp-content/uploads/2008/12/chapter1.pdf and is available in the lesson resources folder for Unit 0 Lesson 3.
Extension: If you have extra time, have a championship contest between one set of student-generated instructions and another, alternating who goes 1st and 2nd. You can work in groups of three, with one person acting as the judge if desired.
Vocabulary entries in journals from the end of the PowerPoint presentation
Group participation in interactive activity
Writeup about a more general solution
Unit 1. Your Virtual World
Revision Date: Jan 04, 2020 (Version 3.0)Pre-lesson preparation
Students must complete a pre-reading assignment (the first chapter of Blown To Bits, which is available online or in the Resources folder). This pre-reading can be assigned at the end of Unit 0.
Summary
Students will read about the "Digital Explosion" and discuss exponential growth. They will discuss and share insights on what a world without digital communication would be like and investigate some of the things that are possible because of digital communication. They will then share their findings with the class.
Chapter 1 of "Blown to Bits" and the lesson motivate students to begin thinking about the advancement of technology and its impact on many aspects of their lives (both positively and negatively). Subsequent lessons will research particular impacts on society in more depth.
Students will consider a world without digital communication to emphasize the impact that computers have on their everyday lives and how integral computers and digital communication have become to our ordinary existence.
Outcomes
Student computer usage for this lesson is: none
TEACHER RESOURCES
In the Lesson Resources Folder:
Prior to the Lesson:
During the lesson, students will need:
This lesson assumes that students have either taken a previous CS course or that you have done Unit 0, so that students know what a computer is, how to write a basic algorithm, and the basic history of technology. It also assumes that students have read Blown to Bits, Chapter 1.
Set a timer. In your journal list all the ways you communicated in the past 24 hours both in person and using technology. Give students 1 minute to list all of the ways they have engaged in communication today (verbal/non-verbal). Compile a class list of commucations used.
Use a creative method for dividing students up into teams of 3-4 (line up by birthday, etc.)
You can use the presentation "What If Part 1" as a guide through this lesson.
At School | At Home | Other Places |
Have students discuss with their partner the answers to the pre-reading questions from Blown To Bits Chapter 1 (see Questions to Consider in Teacher Resources).
Choose an open-ended question from the pre-reading questions. Either:
Have partners pick their most interesting answers and post them or write them on something in the front of the room to share with the class.
Have students work in pairs to discuss and answer the following questions. (If possible, provide students with calculators. An exact value is not required to formulate an answer. The choices reflect three different types of growth.)
Someone offers you a summer job with a choice of three pay rates:
1. $10 per hour for eight hours of work for day for 30 days.
2. One dollar the first day, two dollars the second day, three dollars the third day, and so on (increasing by one dollar each day).
3. One cent on day one, two cents on day two, four cents on day three, and so on (doubling each day for 30 days).
Which pay rate would you choose? Why? What does this illustrate?
Solution: After 30 days,
Clearly, the last choice is the best, even though it starts with the lowest value (although you are unlikely to receive such an offer!)
This activity illustrates exponential growth (which was discussed in the chapter in the context of data growth).
Students may not use any digital devices to complete this activity. This assignment must be handwritten. If students need a copy of their assignment for the class discussion, they must write another copy. Have students submit their assignment at the start of the next class.
Have students write in their journals: What is the most important digital device in your life? Why is it the most important?
Use the presentation "What If Part 2" to remind the students about the scenario from the previous class. Working in the same teams from the previous class, have the students develop a step-by-step plan for getting a message to their parents without using any form of digital communication. This activity must be completed without using any digital tool.
Teams brainstorm and organize ideas about the impact of digital communication. This activity uses the results from the Day 1 homework.
Discussion: Students work in their teams to answer the following questions:
Each member of your team should choose one of the following topics:
*Note – these topics are just suggestions
In the following question, fill in the blank with your chosen topic. Write a paragraph responding to the question. Be sure to include examples and evidence to support your ideas and answer.
Imagine that the digital world that we know now never existed. There are no computers or cell phones -- no digital communication at all. Write a short story that takes place in this non-digital world. Include how your characters would communicate in different situations and how daily life would be. Be as creative as you can.
If time permits, have a few students share their stories.
For this activity, students need to use their last social media post the created on Day 1.
Journal - Hooray! Digital communication has been restored after three years. Look at your last social media post, and think about the following questions.
Have students discuss their reflections with an elbow partner.
Consider different ways to choose teams and assign team roles
Interview with a User of an Enhancing Technology
If you are familiar with an individual who benefits from an abilities-enhancing innovation or a technology that helps the individual overcome a disability, interview the person about the impact the technology has had on his or her life. Ask them questions about how the innovation works, how it has affected the way they live (the ways in which they play or work). Ask about how it has affected their family and friends. If possible, record the interview. Ask for permission to share with your classmates or to post online.
Speculate about Today's Innovations
Select a recent innovation - something recently in the news. Predict the impact that this innovation will have on individuals. Predict any societal impacts you can foresee. Label the impacts as positive or negative. Explain your reasons for the label.
Unit 1. Your Virtual World
Revision Date: Jan 11, 2020 (Version 3.0)Summary
Computing greatly affects the everyday lives of today's teens, but many of them are not consciously aware of these influences. In this lesson, students investigate the impact of the Internet on their lives.
Using a presentation about modern computers as an example, the teacher models the process of asking questions, organizing ideas, doing research, and giving a presentation. Students will then work in assigned groups to create presentations on the Internet and its Impact using online collaboration tools.
Students will experience some of the many collaborative tools available online and develop effective group communication skills.
Students should understand more about what the Internet is, what a computer is, and how the Internet affects our daily lives.
Students should develop an improved understanding of the power of the Internet as a positive agent of change.
Students should use collaborative online tools to work in effective groups using good research skills to deliver a worthwhile presentation.
Students describe ways that greater speed, detail and precision in processing information is possible because of computation.
Outcomes
Student computer usage for this lesson is: required
Teacher Resources
Student Resources:
Crowdsourcing Resources:
Instruct students to think about the following questions and journal about their thoughts. Afterwards, have them pair up and share their answers with each other. (See slide 2 of the presentation in the lesson folder: "Unit 1 lesson 2 LIGHT".)
(Use the Unit 1 Lesson 2 LIGHT presentation for this activity.)
(See Research and Collaboration Assessment Rubric.) Since this is the first significant collaborative activity of the course, discuss team dynamics and norms, communication skills and conflict resolution, in addition to an overview of what online collaborative tools can be used. Review the collaborate assessment rubric together and creatively introduce the good interpersonal skills you expect (see below)
If possible, act out examples of how NOT to use good interpersonal skills. ( a cooperative student with some drama experience can be a great partner to plan in advance with)
Assign students to investigate and use online collaboration tools to:
Part 1 - Preliminary research and collaborative development of pecha kuchas on the impact of the Internet (20 min)
Part 2 - Preliminary presentations/sharing and feedback (10 min)
Part 3 - Research and collaborative development of complete pecha kucha presentations on the impact of the Internet (35 min and homework / out-of-class time as desired)
(See the self and group assessments and "Pecha Kucha Student Handout" in the lesson folder.)
Discuss how computation facilitates the creation and modification of computational artifacts with enhanced detail and precision.
Teachers are encouraged to have students present single slides and give each other feedback before continuing to do the research for the complete presentations.
Students are working in collaborative teams for the first time, use reflections and dialog to assess how effectively they are using online tools to collaborate and how they are resolving issues working as a team.
Students create a presentation while working in groups and using online collaboration tools. A rubric will be used to assess the student group presentations along with self-reflections.
Unit 1. Your Virtual World
Revision Date: Jun 11, 2020 (Version 3.0)Students will read about and discuss the issues that arise from the use and misuse of technology. Over the two sessions, students will assess their current uses of computing devices and then narrow their focus to research and then discuss social media, online retail and banking, cloud data storage, and government surveillance as a class.
Student computer usage for this lesson is: required
These materials may be useful if you want to spend some time with the entire group discussing a few key topics.
Ask students:
What benefits come from taking the AP Exam?
Who should take the AP Exam?
Show the AP Exam Goals presentation.
Discuss student responses to the questions after the presentation.
Assign each student a number from 1 to 4. Students read the associated articles and prepare a 1 minute summary of a way computing fostered creativity.
Groups share their summaries.
Ask students to define the following. Compare their definitions to the ones below.
Computing innovations can have unintended consequences. We will investigate some ethical considerations that should be considered before releasing a new development. For this activity, group students in pairs. If there is an odd number of students then a group of three may be used.
As a class suggest revision(s) to the 10 Commandments of Computer Ethics.
Divide the class into four groups. Each topic group will work together to explore resources and prepare to share with the other groups tomorrow. Each student in the group should make their own copy of the worksheet, so they can bring them back to their original jigsaw groups. Students use their worksheet (ExploringInnovationsWorksheet.docx) to identify and record
After completing the worksheet, students should complete the Venn diagram (ExploringInnovationVenn.docx) to summarize key impacts of an innovation.
The topics (and examples of positive (+) and negative (-) impacts) include:
For each of the above topics, there is a resource sheet in the lesson folder that can be provided to student groups. (Optionally, you may want to create additional resource sheets, or let students select other topics and find their own resources.)
Each group should discuss its progress this far in researching their topic. Students will have 10 minutes tomorrow to prepare to make a presentation to the rest of the class.
Students should take a few minutes to journal about the following prompt:
Topic Groups: Have students briefly assemble into topic groups to compare and revise notes.
Jigsaw Groups: Have students assemble into their original jigsaw groups. Each member will present the information on the topic that was researched. All notes need to be shared within these groups.
Regroup and discuss the topics as a class if time permits.
Each student should select a topic that they would like to explore further and write the topic in their journal. It might be a narrow subtopic from the broader topics that were explored within this lesson. They might also want to write down a few interesting innovations connected to a topic. They will refer back to this during the practice performance lesson later in the unit.
Unit 1. Your Virtual World
Revision Date: Jun 11, 2020 (Version 3.0)Summary
A bit is a single unit of information. Bits are the fundamental building blocks of digital computing. There are many different ways to represent a single bit physically, and collections of bits can be combined to represent everything from numbers to electronic books, to control programs for interstellar probes. In this lesson, students will learn how bits are stored and how they can be used to represent information. Students will further explore how numbers can be represented in binary form, how to convert numbers between these different forms, and how they are used by different applications.
This lesson should be repeated with increasing levels of expectations. The first time this lesson is taught the emphasis is on binary and conversion to decimal, and representation of letters and colors using binary - ASCII and RGB colors.
The second time it is taught should be during Unit 2. The previous topics should be reviewed with the emphasis this time on conversion to hexadecimal and representations of decimal values to support the idea of different number types in Python.
The final time it should be taught - perhaps at the beginning of the Internet Unit - the emphasis should be on comparing binary and hexadecimal values without converting them to binary. This should support students understanding of the formatting and use of internet packets.
Outcomes
Overview
Session One
Session Two
Session Three - New for 2020-2021
Optional Activities
Source
Parts of this lesson were adapted from code.org.
The students will...
Student computer usage for this lesson is: required
For the Student
For the Teacher
In the Lesson Resources folder:
Available on the Web for Teachers:
Jacquard loom: early computer programming
The teacher will introduce the "Jacquard Loom," an early machine that made use of punch cards to make complicated textiles.
Represent Values as a Light Switch
Teaching Tip: Guiding the students toward understanding that the number of switches determines how many numbers can be represented. The pattern is 1 switch = 2 (or 21) numbers, 2 switches = 4 (or 22), 3 switches = 8 (or 23), etc.
Use the "JustBits" presentation in the lesson folder to explore different ways to represent bits, and different ways in which bits can be used to store different kinds of information.
General Presenting Tips:
Presentation Guide:
9 + 4 as 1001 00 0100
11 – 3 as 1101 01 0011
2 * 5 as 0010 10 0101
15 / 5 as 1111 11 0101
Say: In this course, we will use the Python programming language. In Python the size of an integer we represent is not limited to 32 or 64 bits as some programming languages. Python integers are limited in size only be the memory space the computer has. The exam reference sheet produced by the College Board for this course invisions integers the same way that Python does - only limited in size by the computer's memory.
Converting between decimal and binary
Use the "BinaryConversionWorksheet" in the lesson folder (from Code.org) to let students explore (individually or in pairs/small groups) how to build an algorithm for converting binary to decimal. As you progress through the activity, answer questions as they arise, or ask students to explain how they arrived at the answer to check for understanding.
Other extensions and activities that may be useful:
Introduction
Option 1:
Option 2:
Extension: If you want to give your students more practice problems for in-class practice or homework, you can use the worksheet generator at http://www.worksheetworks.com/math/numbers/systems.html
How are text, colors and images saved in hexadecimal format? Select some of the following to present and discuss with the class.
Journal
Students should consider the following prompt, and record their thoughts in their journals:
Introduction
Have students discuss with elbow partners then add to their journals a description of how the computer represents a collection of bits as:
Herding Bits Activity 1 (20 min)
Open Google Drive and create a new Google Sheet. Copy the URL of this New York Times article into cell A1. We will use the software in Google Sheets to find the author of this article and then you will use it to find the author(s) of two other New York Times articles of your choice.
Find how the New York Times identifies the author of its articles.
View the New York Times article on the web page.
Highlight the name of the author, right click and select inspect (the element) that contains the author’s name.
Find the itemprop property in the element and verify that it is assigned the same value as in the formula below.
=IMPORTXML(A1,"//span[@itemprop='name']")
Configure and use the IMPORTXML function in Google Sheets.
Copy the formula above into cell H1 and press enter.
Verify that the name of the author is displayed in cell H1.
Working with elbow partners identify two other New York Times articles and use this technique to have the software in Google Sheets round up the author of each article.
Herding Bits Activity 2(20 min)
Sometimes the information is contained in a larger structure (herd) called a table. This time we will use the software in Google Sheets to copy a table from a web page then use the table values to find information.
Collect the bits contained in the World’s Tallest Buildings table found on Wikipedia.
Copy the URL from the link above to cell A1 on a new Google Sheet.
Copy the formula below into cell A3 to herd the bits from the second table on the web page to your spreadsheet.
=importhtml(A1,"table",2)
Copy the table values to a new sheet.
Select lines 3 through the end of the table and copy them to the clipboard (ctrl-c).
Create a new Google Sheet.
Use ctrl-space-c to paste the values into the new sheet starting at cell A2.
Select column D and use the Data menu to sort the data into alphabetical order by country name.
Find the three countries with the most buildings listed among the world’s tallest buildings.
Discuss with elbow partners what other tables might be interesting to scrape from the internet. Try and find one of those tables online and herd those bits into a spreadsheet.
Elbow partners share the results of their attempts with the class students should explain in thirty seconds:
What table they tried to find.
Their success at scraping or herding the bits.
What information they might extract fromt their table.
Questions in the AP Classroom Question Bank may be used for summative purposes.
Sixty of the 80 questions are restricted to teacher access. The remaining 20 questions are from public resources.
Questions are identified by their initial phrases.
A computer program uses 3 bits to represent int...
An online store uses 6-bit binary sequences to ...
Part 1 - Exploring Physical Bit Representations
Teaching note: The research and writing activity in this lesson presents an opportunity to talk about copyright laws and emphasize that copied content must be credited to the rightful author or organization.
Part 2 - Sharing the research
Teaching note: Model writing skills through a variety of writing opportunities and prompts. Encourage students to write complete sentences that clearly communicate their ideas.
The Extension section above gives a variety of outside activities, some of which are appropriate for verbal and others for tactile learners.
Note: If there are students in the class with physical limitations who are unable to stand, stretch, or squat, the game can be modified appropriately:
Visual - Decimal, Binary, Octal, and Hexadecimal Number Systems Video - http://whyu.org/whyUPlayer.php?currentchapter=3¤tbook=1&youtubeid=5sS7w-CMHkU
OR - https://www.youtube.com/watch?v=_oaBT-TndCs
Kinesthetic - Hexadecimal Drum Machine - http://www.mathsisfun.com/games/hex-drums.html
Auditory - Hexadecimal File Music - https://www.youtube.com/watch?v=fyBf4Y2mVzs
Extension Activity 1. Students that have mastered the conversion techniques can peer-tutor students [one-on-one] that are having difficulty solving the conversions.
Extension Activity 2. Students can observe their computer’s network interface card (NIC) MAC address in hexadecimal, and convert the MAC address to binary and decimal.
See algorithms of number system conversions:
Alternative presentation for Gifted Students doing Decimal to Hexadecimal Conversion:
For decimal number x:
Convert x=603 to hex:
n=2, 162=256 < 603
n=3, 163=4096 > 603
So
n = 2
d2 = int(603 / 162) = 2
Δ = 603 - 2×162 = 91
n = 1, x = Δ = 91
d1 = int(91 / 161) = 5
Δ = 91 - 5×161 = 11
n = 0, x = Δ = 11
d0 = int(11 / 160) = 1110 = B16
Δ = 11 - 11×160 = 0
(d2d1d0) = 25B
Answer: x = 60310 = 25B16
Learn to Count in Binary and Hexadecimal - http://webelfin.com/webelfindesign/counthex.html
ADDITIONAL/ALTERNATE FORMATIVE ASSESSMENT MATERIAL or Class Activity if time permits - from unplugged.com
http://csunplugged.org/binary-numbers
Brainstorm reasons for storing and communicating secret messages. Challenge students to think of both helpful and problematic reasons. Students record at least two of each.
View steganography presentation. Presentations are available on YouTube.
Abdullah Seddiq (MIT Blossoms) has Counting Systems with teacher's guides and additional resources. This video aims to explain counting systems (Decimal, Binary, Hexadecimal). Students will get to know how to convert numbers between these systems. Also students will learn how to do some byte and bit level operations. They will use a Visual Basic (VB) application that changes colors through logical operation on numbers. See also The Magic Picture: Steganography in Bitmap Files
Assessment Questions:
Journal check - questions presented as described in the lesson plan
ASSESSMENT QUESTIONS
Getting Started section: questions on converting between bases and describing the purpose of hexadecimal numbers.
Unit 1. Your Virtual World
Revision Date: Jun 11, 2020 (Version 3.0)Summary
Computing innovations have the potential to significantly impact our lives, both positively and negatively. In order to understand the full range of impact (or lack of impact) of a given innovation, one must consider how differences in geographic location, culture, and socioeconomic status influence the effect that given innovation has on a specific group of people. Students learn about the digital divide on national and global levels and analyze how three different computing innovations impact people, making ethical considerations while doing so in order to determine if the impact is beneficial or harmful.
Outcomes
Students will:
Student computer usage for this lesson is: optional
For the Student
For the Teacher
In the Lesson Resources folder:
Present "Lesson1_5" PowerPoint slides (in the Lesson Resources folder).
Analyzing the Ethics of an Innovation (Slides 3 – 10) :
The Digital Divide (Slides 12 - 17):
For this portion of the lesson, students will be analyzing the impacts of two innovations: artificial intelligence and the Find My Friends App. A worksheet for this activity (“Analyzing Impacts of Digital Innovations”) can be found in the lesson resources folder (Lesson1_5wkst.docx).
If you come up with an innovation that solves a problem, what concerns do you need to consider
before releasing it to the world?
(Possible answers: Whom will it benefit or harm? Are there people it won't reach at all?)
Questions in the AP Classroom Question Bank may be used for summative purposes.
Sixty of the 80 questions are restricted to teacher access. The remaining 20 questions are from public resources.
Questions are identified by their initial phrases.
An author is considering publishing an e-book u...
Historically, it has been observed that compute...
Students will analyze the innovation of 3D printing in the same manner they did for AI and the Find My Friends App, except they will be finding at least one online source on their own from which to draw their information. Provide students with the “Lesson 1.5 Homework” found in the lesson resource folder (Lesson1_5hw.docx) and provide them with the instructions given on Slide 22.
This assignment gives students practice analyzing the impacts of an innovation on their own, as well as attributing facts to a resource and the information to include for that resource for the Explore Performance Task. (The Explore PT is introduced later in the curriculum.) The worksheet Lesson1_5hw (in curriculum resources folder) can be used to support students, or they can write this information on a blank piece of paper, etc. The worksheet does not specify which innovation they are researching, so you could reuse it for future research related to the impacts of innovations.
For students who require more time for processing and writing down the impacts of AI, show the video a second time (the narrator in the video talks quickly).
If time is limited, split students up so that half of them are analyzing AI and the other half are analyzing the Find My Friends App. Have students review their findings with another student who analyzed the same innovation. Then have them jigsaw (https://www.teachervision.com/group-work/cooperative-learning/48532.html ) with students who analyzed the other innovation to share what they found.
Guided notes would be helpful for ELL or SpED.
Journal:
Homework:
Explore Performance Task
Unit 1. Your Virtual World
Revision Date: Jun 11, 2020 (Version 3.0)Summary
Previous lessons in the "Your Virtual World" have investigated the impact of computer innovations on society. In this lesson, students will learn how using technology can enhance our abilities to solve larger and broader problems (problem solving). The lesson begins by examining reCAPTCHAs, which most students will be familiar with, but they may not realize how they solve two significant problems. It continues with solving problems at scale with distributed computing and crowdsourcing.
Outcomes
Student computer usage for this lesson is: required
For the Student
For the Teacher
Think-Pair-Share: Solving problems with reCAPTCHA
Say: Today we are going to examine Crowdsourcing a strategy for enlisting the work of many people to identify problems, solve problems and share solutions via the internet. And we are going to examine how computing technology facilitates the collection and creation of this information.
As a class, read the following from the paragraph from the NY Times article Crowdsourcing, For the Birds.
Tens of thousands of birders are now what the lab calls “biological sensors,” turning their sightings into digital data by reporting where, when and how many of which species they see. Mr. Martinka’s sighting of a dozen herons is a tiny bit of information, but such bits, gathered in the millions, provide scientists with a very big picture: perhaps the first crowdsourced, real-time view of bird populations around the world.
Watch the video What is Crowdsourcing?. https://www.youtube.com/watch?v=Buyub6vIG3Q (2:50)
Point out distributed computing to solve big science problems:
Display some examples from a service like BOINC that lets you help cutting-edge science research using your computer. BOINC downloads scientific computing jobs to your computer and runs them invisibly in the background. It's easy and safe.
About 30 science projects use BOINC; examples include Einstein@Home, IBM World Community Grid, and SETI@home. These projects investigate diseases, study global warming, discover pulsars, and do many other types of scientific research.
Citizen science is scientific research conducted at least in part by individuals from many different locations who contribute relevant data to research using their own computing devices. You don't need to be a scientist to contribute to citizen science.
Direct students to Akinator.com or 20Q and play an online game that aggregates human information. Teachers may have students do this independently or work together as a whole class.
Direct students to Kickstarter.com. Students choose what they think is worthy of funding and respond to the following
Watch Video: Crowdsourcing and Crowdfunding Explained (3:48) https://www.youtube.com/watch?v=-38uPkyH9vI
While students watch the video they take notes about crowdsourcing including:
Questions in the AP Classroom Question Bank may be used for summative purposes.
Sixty of the 80 questions are restricted to teacher access. The remaining 20 questions are from public resources.
Questions are identified by their initial phrases.
Both online newspapers and social media sites are
Which of the following is a true statement abou...
Students describe how people participate in a problem-solving process that scales using examples from citizen science (or another example of problem-solving.
The purpose of this activity is for students to contribute their knowledge to the aggregated collection of knowledge known as "Wikipedia."
http://allthingsd.com/20130719/after-waze-what-else-can-mobile-crowdsourcing-do/.
https://www.datacamp.com/community/tutorials/simplifying-sentiment-analysis-python
https://trends.google.com/trends/?geo=US
"Picture Stitching" is the practice of blending hundreds of photos to create one huge detailed picture.
Stitched 365-gigapixel image of Mont Blanc created by stitching together 70,000 images http://www.in2white.com/# .
Geo-referenced 3D model of Zurich
Can students imagine additional possible crowdsourcing or citizen science projects?
How does online collaboration improve problem solving abilities?
Sample assessment questions:
Unit 1. Your Virtual World
Revision Date: Jul 23, 2019 (Version 3.0)Summary:
This is the unit assessment for the first unit of the AP Computer Science Principles curriculum - Your Virtual World. This curriculum provides both a testbank of questions with answers for objective questions, and a sample final unit exam prototype for teacher use extracted from the testbank.
Outcomes:
Overview:
This assessment ascertains that students have a basic understandings of all the concepts presented in the unit, therefore, all learning objectives are assessed in this unit.
Students should be aware of the magnitude of impact on individuals and society that result from technological advancements in computing, as well as the rapid pace of change that occurs because of new developments.
Student computer usage for this lesson is: optional
In the Lesson Resources folder:
Make sure each student has a copy of the assessment and the necessary writing instruments.
Allow one 45-50 minute class session to administer this assessment.
Distribute the Unit Assessment Test, which consists of 25 objective questions and a choice of four essay prompts. (Teachers can instruct students in selecting one or more short essay responses for students to answer, based on teacher preferences and time allotments.)
Collect all papers from the students.
This is the summative unit assessment for Unit 1 - Your Virtual World. A sample summative test and a testing databank of questions are provided by the curriculum. (Note that the sample assessment may not be appropriate for some classes, depending on the particular focus that the teacher has taken -- e.g., the sample assessment includes hexadecimal conversions, which are an optional component of Lesson 1-4.)
Unit 1. Your Virtual World
Revision Date: Jul 23, 2019 (Version 3.0)Pre-lesson preparation
Review the Teaching Technical Writing slides to help prepare teaching the topics of research and writing. It may be wise to review citation styles and pick one you want your students to use -- as long as they are consistent, the particular style should not matter. For Session 2, you can print out the Cut it Out activities from the slides for your students if you want them to try for themselves on paper.
Summary
Students will learn the basics of technical writing and research, practicing skills including finding good sources, citing properly, and differentiating between quoting, summarizing, and plagiarism.
Outcomes
Overview
Session 1
Session 2
Student computer usage for this lesson is: required
Additional resources on the basics of research include the following. Keep in mind that what will benefit students the most for this lesson is to focus on tips and guidelines related to content rather than generic advice like avoiding too many adverbs.
Discussion: What is research?
Refer to the "Teaching Technical Writing" slides in the Resources folder for an overview on technical writing and the process of research as well as advice on teaching those topics.
Discussion about good sources of information and what meets that criteria [5 min]
Finding good sources of information [10 min]
Discussion about quoting, paraphrasing with attribution, and plagiarism [15 min]
Practice judging plagiarism vs. appropriate citations [10 min]
Journal Entry
With the time remaining, have students reflect and write in their journal what topics they are considering for their performance task and which sources of information they plan to find first.
Discussion: Who writes?
Use the "Writing Tips Process and Style" slides in the Resources folder to guide this lesson and begin with the questions and overview on slides 2 and 3.
Interactive Lesson: The Writing Process [20 min]
Group Activity [20 min]
Journal Entry or Homework: two options
Have your students reflect and write responses to one or both of the following:
Session 1 Journal:
Session 2 Journal / Homework:
Unit 1. Your Virtual World
Revision Date: Jun 24, 2020 (Version 3.0)Summary: Students will explore the impacts of innovations in a guided lesson and produce a 1-minute screen capture video (artifact) to summarize their findings.
Outcomes:
Overview:
Session 1:
Session 2:
Student computer usage for this lesson is: required
In the Lesson Resources folder:
For the Teacher:
A quick activity that requires an effective Internet search
Explore Project - Introduction
Brainstorming
(Limiting the choices will allow students to compare and contrast their final artifacts, facilitate self-assessment, and make it possible to identify exemplars of each option.)
Develop a Plan
Students should complete the planning sheet to determine what they will need to accomplish for the project in class on day 2.
Journal Entry
Give students a few minutes warning before the end of class. With 4 or 5 minutes remaining, have students reflect and write in their journal a verbal snapshot of the artifact they are creating.
Practice performance task
Some students will benefit from having a teacher-selected topic and a step-by-step plan for completing the task.
While the students are completing the task, check for understanding by asking the students:
The artifact (1-minute screen capture) from this task and a reflection on the creative process can be used as a summative assessment using the rubric in the Teacher Resources
Unit 1. Your Virtual World
Revision Date: Jan 11, 2020 (Version 3.0)This is the first of three lessons where students research computing innovations.
This lesson will focus on what a computing innovation is and what the harmful and beneficial effects are.
Explain that in this lesson students will investigate computing innovations and their impacts. The first session will be for research and presentation preparation. Our next session will be for the presentation of the research. The research and presentation will be done in groups of three.
Brainstorm a list of innovations that might be computing innovations. Have the class vote on which innovations are computing innovations according to these guidelines:
Have the class evaluate the innovations listed to see if any of them should be placed in a different category according to this definition.
Say: Like all innovations, computing innovations have an original purpose that motivated their design and guided their development but the innovation may have impacts and effects beyond that purpose. Whether intended or not computing innovations have changed how we communicate with our families and friends, how we obtain and collect news, how we investigate and prosecute crimes and how we conduct business.
Place class members into teams of three.
Have each team select a computing innovation - not necessarily one previously discussed - and research answers to the following questions. Students should collect at least one reference for each answer.
Students use their research to prepare a poster presentation for their project. All team members must be involved in the presentation.
In this lesson, we will study and present views of beneficial and harmful impacts of computing innovations. The same effect may be beneficial to some and harmful to others. Each presentation must answer the following questions.
What is the name of the computing innovation?
What is the function of the innovation?
How does the innovation use computing?
How might the innovation impact fields other than computing such as the sciences or the arts?
What information does it need to perform its function?
Who has been impacted in a positive way by the innovation?
How were they impacted positively?
Who has been impacted in a negative way by the innovation?
How were they impacted negatively?
Unit 2. Developing Programming Tools
Revision Date: Jun 11, 2020 (Version 3.0)Summary
Students will be introduced to programming for the first time. They will learn about computer science, computing for good, some of the potential outcomes of programming, and the definition of abstraction. Students will also be learning about program design.
Students must understand that stereotypes of computer programmers are not accurate and that 'coding' is something everyone can learn to do. Computing can be a creative expression and used for good.
Possible misunderstandings: The term NGO is used in the article Programming for Good: The Story of Code for India, without explicitly defining it as Non-Governmental Organization.
Abstraction is a tricky idea. Python allows us to describe what we want to do such as "print" and "input" because it provides the details that explain to the computer how to accomplish the task of taking many keypresses followed by a press of the Enter key to allow the computer to store the information we entered, and also knows how to take information stored in the computer's memory and cause it to appear as a series of recognizable dots on the screen using print. Computer programs use input, output, processing, and memory.
The design topics taught in the 2020-2021 session introduce both user interaction and user experience design.
Outcomes
Student computer usage for this lesson is: required
TEACHERS need to have the class and user accounts set up in Runestone to track student progress.
For the Students:
Note: If computer is not being used, students will need their own copies of the articles
[use the Presentation on Programming Python in Runestone]
Journal Entry: What are some ways that writing programs is a creative endeavor? [ slide 2]
Share answers with your elbow partner. Then share answers with the class.
Open Discussion: What are some ways you know that computing has been used for “good?” [ slide 3 ]
Go to Programming for Good: The Story of Code for India
http://www.attendly.com/programming-for-good-the-story-of-code-for-india/
Read articles or selected text in pairs, with alternating pairs each reading one article. Pairs of pairs get together to share what they read and what they got out of the article.
In pairs, answer the following questions:
Check for Understanding: Teams should share their answers to their instructor.
Have students sketch the computer hardware architecture diagram in Python for Everybody Chapter See https://books.trinket.io/pfe/01-intro.html#computer-hardware-architecture.
Explain that computer processes guide the flow of information that is input, processed, stored or output. The processor (CPU) uses short term memory for doing calculations and temporary storage and long term memory if needed. Have students sketch the computer components diagram above. Explain to students that they will learn to program to develop software using each of these components.
The program output is usually based on both input values and values already in memory. Watch the following video to see how this occurs.
Watch the video on how programs use input, processing, memory, and output to run programs. https://www.youtube.com/watch?v=BSTrWhAGta8
Read Computer Hardware architecture by Dr. Severance.
https://books.trinket.io/pfe/01-intro.html#computer-hardware-architecture
.
Have students go to the article Seven things you should know if you’re starting out programming at
http://www.theguardian.com/info/developer-blog/2011/oct/07/programming-developer-journalist
Pre-reading activities:
In pairs or groups of three, assign each group to read and summarize one of the seven programming principles in the article.
Check for Understanding: Each person should write a 140 character tweet on their topic, next class the group should share their findings with the class.
Getting Started (5 min)
Journal
Say: Online tools support collaboration by allowing programmers to share and provide feedback on ideas and document. Often this collaboration takes place online. What are some online tools you think programmers might use to collaborate?
Student share responses. Be sure that receiving feedback from both developers and users is discussed.
Guided Activities (40 min) Use the Program Design presentation in the Lesson 1 Resource folder.
Say: Success and failure are both about meeting criteria. To know if our efforts are a success, we need to know what the requirements are. So the first step of the design process is investigating the program requirements. In the development process, the design phase outlines how to accomplish a given program specification. Software developers typically organize the overall program into a collection of individual components or modules. Collectively, the component or modules meet the program's requirements.
Highlight: The users are important!
Highlight: Innovation is enhanced by group collaboration!
Jigsaw: In groups of four, read and discuss the four techniques for identifying requirements as listed by Hans Jonasson.
For each of the four techniques, use the Design Techniques table to list the techniques purpose, its advantages, and its limitations
Technique |
Purpose |
Advantage |
Disadvantage |
Say: User interaction design, at its heart, is all about satisfying the end-user’s needs and wants. The design may include brainstorming, storyboarding or even used interaction design as is this activity.
As a class, watch this short UI/UX Design Process video to see how many of the following design strategies are illustrated.
Investigate user interface design (UI) https://www.usability.gov/what-and-why/user-interface-design.html
Investigate user experience design (UX). User Interaction Foundation
On the board, have students list possible ways that an investigation can be performed and keep going until all of the following methods have been uncovered:
The rest of this unit will address techniques used in the development phase of a program.
Development is both iterative - with multiple rounds of testing and improvement - and incremental with development occurring in small testable steps.
Development then should include documentation throughout its development and support program testing throughout to meet the overall design requirements. Documention is important whether working individually or collaboratively. Documentaion includes comments stored within programs where supported by the programming language (not all languages support comments) and outside the program (such as in web pages).
True/False. For each of the following statements, work with an elbow partner to determine if the statements are true or false.
For the false statements, modify the statements so they are meaningful and true.
Program documentation describes the function and development of program segments.
Comments written in a program are read by the computer before the program can execute.
Program documentation is best done after the program is written and tested.
For efficiency reasons, program documentation should only be written when working in a collaborative program development environment.
If a programming environment does not support comments then none should be used.
Program documentation comments should be as terse as possible since they are internal notes to the developers.
Bookmark or store your these true statements for future reference.
Design requires a lot of effort throughout the programming project.
Write a short paragraph explaining to a new project manager the benefits of investing this time in the design process.
Questions in the AP Classroom Question Bank may be used for summative purposes.
Sixty of the 80 questions are restricted to teacher access. The remaining 20 questions are from public resources.
Questions are identified by their initial phrases.
A program is expressed in a programming language.
The diagram below shows a circuit composed of two
Oral reading strategies such as "popcorn reading" where students take turns reading a paragraph and then pass the reading off to another student in the class, or other reading strategies such as students reading together quietly in pairs, can be used for longer texts.
Longer readings can be broken up by sections or paragraphs to speed the lesson up or keep students engaged.
Activity 1 could be assigned as homework from the day before as a step into this lesson to allow more time in class for the other readings:
Additional activity: Ask students to read the Preface (pages iii-iv) and Chapter 1 introduction and section 1.1 (pages 1-2) of Python for Everybody and answer these questions:
Students will use several different strategies for reading and writing responses based on their readings.
Classroom discussions and student responses (written and oral) will allow instructors to check for understanding.
Summative assessment will be included in Part 2 on the use of the PyCharm IDE.
Student handout filled in
Tweet from optional homework assignment
Progress recorded in Runestone for the General Introduction
Unit 2. Developing Programming Tools
Revision Date: Sep 08, 2019 (Version 3.0)Summary
PyCharm, an IDE for Python, will be introduced. Keywords, file, and variable naming conventions will be addressed.
Outcomes
Overview
Students will learn what an IDE (Integrated Development Environment) is and why it is good to use one when programming.
Students will be able to find, configure and use the PyCharm IDE to write, save, run, debug and retrieve their Python modules according to the requirements of their instructor.
Student computer usage for this lesson is: required
For the Students
Have students go to the article Seven things you should know if you’re starting out programming at
http://www.theguardian.com/info/developer-blog/2011/oct/07/programming-developer-journalist
Introduction to PyCharm
Teacher note: This may be a good time to have students configure the default Working Directory as shown in the Python and PyCharm Installation and Configuration Guide file in the lesson resources folder.
and del from not while
as elif global or with
assert else if pass yield
break except import print
class exec in raise
continue finally is return
def for lambda try
(from http://www.pythonforbeginners.com/basics/keywords-in-python)
Students are to:
Sample code (will throw an error)
# author = 'iam tester'
# date July 4, 2024
# name.py
name = 'Ima Tester'
age = 15
print (name + " is " + age + " years old.")
The above code will throw an error, because age
is an integer and needs to be expressed as a string OR concatenated using a comma (,)
.
name = 'Ima Tester'
age = 15
print (name,"is",age,"years old.")
Important notes about naming your files and variables:
and del from not while
as elif global or with
assert else if pass yield
break except import print
class exec in raise
continue finally is return
def for lambda try
(from http://www.pythonforbeginners.com/basics/keywords-in-python)
Students can work in pairs, side by side, to help each other through each step of the process.
Checks for understanding throughout the entire process of learning to use the PyCharm IDE by using active participation in trying each step of the process and having students help their elbow partner when difficulties arise.
Assessment tasks:
Unit 2. Developing Programming Tools
Revision Date: Jan 05, 2020 (Version 3.0)Summary
This is the first day of a two-session lesson sequence with topics covered by mini-lectures, explorations, and practice exercises.
Outcomes
Overview
Students will provide a definition of "algorithm".
Students will identify the characteristics of describing algorithms in English, pseudocode, or a programming language.
Students will demonstrate an understanding that there are different algorithms for different situations, such as parallel processing for multiple CPUs.
Student computer usage for this lesson is: none
PowerPoint Slides for mini-lectures (AlgorithmsPseudocode1.pptx in the Lesson Resources folder)
Excel sheet summary for creating a 4-by-4 Magic Square (MagicSquare4by4.xls in the Lesson Resources folder)
(optional) 16 papers, each with a number from 1-16 on it for students to use when acting out the magic square.
–Small group, then large group, review of two previous homework assignments (students were assigned to use two sources to find definitions of "algorithm" and were assigned to write down the steps involved in a daily task – creating a peanut butter and jelly sandwich; getting to school; brushing teeth; completing homework; etc…) The definitions, sources, and algorithm steps were to have been entered into their journal.
- Have students consider solving problems alone or with others. Point out that some computers have more than one processor and an algorithm can be written to do 2 or more processes in parallel. Consider some complications that might arise in the simple algorithms that have been developed by students if there were multiple CPUs.
Say: In programming, a code statement is a part of program code that expresses an action to be carried out. Note that it is a single action. Each step of an algorithm is to be carried out on its own and exactly as written.
– Act out selected homework “steps of a daily task” to highlight the potential ambiguity of English instructions. While acting out the algorithm have students look for the three sufficient parts of any algorithm - steps done in sequence, steps selected if a condition is met and steps done that are repeated.
Algorithms that appear similar differ in that they yield different side effects or results. For many tasks however, more than one algorithm has been developed that accomplish the same tasks - though they may not be equivalent in some ways. For instance, some may be simpler, some may be faster, some may be more efficient but all may still be be correct in the sense of achieving the desired result.
– Review Understanding by Design (UBD)-style slide for “Algorithms and Pseudocode: Need to Understand / Important to Know or Do / Worth Being Familiar With” (slide 2 of AlgorithmsPseudocode1.pptx presentation in Lesson Resources folder).
Students join groups that have developed algorithms to accomplish the same task. Students are to exchange algorithms and determine:
Time permitting, the class creates a 4-by-4 Magic Square, as described in MagicSquare4by4.xls in Lesson Resources folder. Sixteen students should be chosen to represent the sixteen numbers, and physically move into the 16 spaces following the algorithm in this document. (This provides an example of a “simple” algorithm that solves a more complex problem; it also gets the students out of their seats and moving around).
Reflect: Would it be easier or harder for 2 people to work on this together? (multiple CPUs or parallel processing)
–In AlgorithmsPseudocode1.pptx (presentation in Lesson Resources folder), walk through “Main Ideas”; “Representing Algorithms”; and “Sequential Algorithms” slides, including pseudocode circle example.
"In your words" pair/share as the concept of what an algorithm is (and what is not an algorithm -- e.g. "sort the numbers") is developed.
Class-wide development of the graphical organizer should be facilitated with scaffolding to support students who are having difficulty with the concept.
The following "Checks for Understanding" could be used to guide the students towards the two learning objectives.
Objective: Students will be expected to learn to provide a definition of "algorithm".
Objective: Students will learn to identify the characteristics of describing algorithms in English, pseudocode, or in a programming language.
Students will research formal definitions of algorithms. These will be entered into their journals and pair-shared with a peer.
Students will write out the sequence of steps in one or more daily living tasks, such as "brushing their teeth" or "building a peanut butter and jelly sandwich." These will be entered into their jourmals and pair-shared with a peer. Selected solutions will be "acted out" in the classroom.
Unit 2. Developing Programming Tools
Revision Date: Jun 11, 2020 (Version 3.0)Pre-lesson Preparation
This is the second session on algorithms
Summary
During the second session, the students will use pseudocode to describe an algorithm.
Outcome
Overview
Students will write pseudocode using sequencing, selection, and iteration constructs.
Student computer usage for this lesson is: optional
Files in the Lesson Resources folder:
AlgorithmsPseudocode2.pptx : PowerPoint Slides for mini-lectures
Student Handout and Key for Matching Pennies Game
Student Handout for Rock Paper Scissors
Psuedocode Summary and Examples of common Algorithms.docx
Journal: Describe the algorithm of another student. Is there enough detail to allow somebody to follow the steps?
Walk through “Selection Statements”; “Iteration / Repetition” slides from the AlgorithmsPseudocode2 file in the Lesson Resources folder. Emphasize:
1. Whenever you need to store information, it must go into a variable. So think about what variables might be needed when you are creating your algorithm
2. Program steps are executed in the order they are listed from top to bottom.
3. Selection and Iteration statements require conditionals. Identify a conditional as something that returns a True or False answer. If selects the next statement to occur by answering the conditional question as being true or false. I have in the past pointed out the True and Then both start with T so TRUE always does the THEN, wherease Else and False both end with LSE, so when the answer if FALSE, you do the ELSE.
While continues to loop as long as the conditional answer is TRUE. When the conditional answer is false, the algorithm jumps to the statement after the End While.
4. Nearly all programming languages are equivalent in terms of being able to express any algorithm. Each has its own way to use variables, conditions and repetition which are needed for a solution to almost all algorithms. Clarity and readability are important considerations when expressing an algorithm in a natural language or a programming language
During powerpoint, guide students through the Game of Matching Pennies (a student working copy and a solution key is in the Master Teacher Resource folder for this lesson).
Students work in pairs to create and share their pseudocode. Use the Rock Paper Scissors hand out to have student pairs psuedocode Rock Paper Scissors. Your algorithm should play the game 10 times and count the number of times each player wins and the number of times they tie.
Students may create their algorithms form scratch or remix exisiting ones.
If there is time, have groups switch algorithms and critique the algorithm of the other group.
Walk through pseudocode syntax summary handout called Pseudocode Summary and Examples of common Algorithms.docx in Lesson Resources folder.
Students work through challenges and check their results against sample solutions.
Review slide: "Why we have leap years."
Questions in the AP Classroom Question Bank may be used for summative purposes.
Sixty of the 80 questions are restricted to teacher access. The remaining 20 questions are from public resources.
Questions are identified by their initial phrases.
A flowchart is a way to visually represent an a...
A programmer completes the user manual for a vi...
An algorithm has been developed to compute the ...
Central High School keeps a database of informa...
Consider the code segment below. The code consi...
Consider the following code segment. A segment of
The algorithm below is used to simulate the res...
The question below uses a robot in a grid of sq...
Two lists, list1 and list2, contain the names o...
Assign students to create pseudocode for leap years.
Pairing of students and crossing pairs to form groups of four should be used for the set of exercises that are part of this lesson.
Think-Pair-Share
Students will write pseudocode for algebra / geometry formulas. These will be entered into their class notes.
Students will write pseudocode for determining if a year is a leap year. This will be entered into their journals.
Unit 2. Developing Programming Tools
Revision Date: Jan 12, 2020 (Version 3.0)Summary
Students learn simple Python programs and their structure, as well as the basics of debugging.
Programs can be developed to solve problems (to help people, organizations or society), for creative expression, to satisfy personal curiosity or to create new knowledge.
Additional outcomes beyond the original purpose of a program are possible.
Outcomes
Student computer usage for this lesson is: required
For the Students:
https://github.com/spyder-ide/spyder
http://interactivepython.org/runestone/static/thinkcspy/index.html
Jigsaw: Divide students up into 5 groups. Have each group prepare a creative presentation on one of the topics below with visuals or an active component (rap, song, dramatic reading, etc.) to convey the message of that section. Groups have 15 minutes to prepare a 2-minute presentation.
To minimize time spent debugging in support programming goals:
Journal: Use formative assessment Questions 1 - 3:
Set up your IDE and Python at home (if you can) or use an online Python IDE such as https://repl.it/languages/Python3 or ideone.com . Type up a simple "Hello World" program and get it to run. Bring in evidence that it works or write a few sentences about the issues you are having in trying to install it or write about your experience using an online IDE, or write out the code for Hello World without looking at any notes and report on how easy or hard it was to remember the details. (Be careful not to make any student feel awkward for lack of a home computer they are allowed to install softare on)
Collect handwritten notes or evidence that Python 3 is set up at home or the student is able to use https://repl.it/languages/Python3 or ideone.com. As students work on tutorial, address specific issues with students who had trouble with install.
Complete an introductory tutorial:
Runestone Ch. 1 http://interactivepython.org/runestone/static/thinkcspy/GeneralIntro/toctree.html
Develop the beginnings of a chat bot where the computer and user introduce themselves to each other. The computer asks a question, the user provides a response and the computer responds back again, including the user input within the response (see https://groklearning.com/csedweek/ for ideas). Extend: Give your chatbot a personality like a friend, grandfather, therapist, or child.
First discuss: How can additional desired outcomes happen independently of the original purpose of a program? (examples: a program like chatbot could help someone learn a new language, provide entertainment for a shut-in. Computer games can increase reflexes, logic skills, provide motivation for someone in physical therapy)
Answer Formative assessment Questions # 4 - 6:
4) Name several different input devices.
5) How do we comment a Python program? Why do we use comments?
6) In your journal, make a tree diagram, name the three types of errors, and give examples of each. Which type of error do you think is the hardest to detect and why?
Write code to introduce yourself. Display your name. Greet and ask for three interests. Display the three interests and give a reply like "That's interesting!" Print your code. Next day: Have students introduce one another by “running the code" of a classmate. If you cannot get PyCharm to install, use http://ideone.com/ or repl.it or create this program by hand on paper.
Suggested strategies:
In your journal, make a tree diagram, name the three types of errors, and give examples of each. Which type of error do you think is the hardest to detect and why?
Find the errors in an algorithm or in Python statements covered to date
Define what debugging is and give examples of the 3 categories of bugs (syntax, logic(semantic) and runtime)
Describe the differences between programming and debugging.
Unit 2. Developing Programming Tools
Revision Date: Jan 05, 2020 (Version 3.0)Pre-lesson Preparation
Create a table of values of all types and print a copy of them on the cardstock for each group. Cut the papers up into individual cards, so each value is on its own card. Place each group's cards in a plastic bag.
Summary
Students are introduced to basic programming vocabulary, including integers, floats, strings, values, and expressions. They will work through a set of guided notes and slides, and, then, be released to explore Python through an independent (or paired) exercise.
Outcomes
Overview
Student computer usage for this lesson is: required
In the Lesson Resources folder:
Runestone: Values and Expressions
Write a reflection on the homework from last class to write code to introduce yourself. The program should:
Did you run into any errors?
Do you feel that you can easily write this kind of code?
Share results with an elbow partner.
Teacher Note: Ideally, students are paired with people they don't work with as frequently, in order to promote classroom culture.
Point out that Python is a high level programming language. It provides many tools that make it easy to build complex programs with little effort. Among these tools are the ability to store and retrieve values and evaluate (find the single value of) expressions. Python can evaluate - find the specific value of - variables, variables with operators like plus and times, and of functions.
Numeric values can be constants like an integer, retreived form numeric variables or calculated based on expressions that combine values or variables witharithemtic operators.
In order for the computer to execute the code, it must translate(compile) the Python statements into a lower level language that the particular computer can understand and process. A variety of different variable types is one of the abtractions that are available in a high level programming language, and the language must define how the data is both stored and manipulated for each kind of data. You do not need to understand HOW the implementation works in order to use variables in your program.
Refer to the PowerPoint called Values and Types in the Lesson Resources folder.
'.'
is a float (ie. 2.0)True
and False
(they must be capitalized!)Check for Understanding: Have students write an integer on their paper (check with their elbow partner that it is a number). Ask students to turn that integer into a float with the same numerical value. Talk about going the opposite direction (float to int).
(Example answers: int: 3 float: 3.0 or 3.00 or ...)
"hello"
+ "world"
= "helloworld"
"hello"
+ " world"
= "hello world"
"hello"
+ 2 produces an errorTrue
and False
(they must be capitalized!)i< j
i<=j
i>=j
i>j
i == j
i!= j
('='
means something else!)Teacher Note: See Differentiation for two variations of this activity.
Students are to complete the Lesson 2.9 Order of Operations in Runestone (https://runestone.academy/runestone/books/published/thinkcspy/SimplePythonData/OrderofOperations.html)
Students will complete the Exploration Questions worksheet which is found in the Lesson Resources folder and complete one of the two exercises below.
2 + 5
5 * 2
5 ** 2
5 / 2
5 % 2
5 + 2 * 4
5 * 2 - 3
"pay attention to details'
' " what's for lunch?", my partner asked'
"What's for lunch?", my partner asked"
Ideas for grouping students:
Group Activity Variations:
Checks for understanding are incorporated throughout the lesson.
Exit ticket questions are incorporated into lesson.
Unit 2. Developing Programming Tools
Revision Date: Jan 12, 2020 (Version 3.0)Summary
Students will learn to manipulate variables and value assignments through an activity in which they must become the variable. By the end of the lesson, they will have identified variables as memory locations. They will also assign, copy, and destroy values in order to perform a swap algorithm and visualize Python's manipulation of variables and values in memory.
Outcomes
Overview
Student computer usage for this lesson is: none
For the Students:
Optional:
For the Teacher:
team1 = "Miami Heat"
team2 = "Washingon Wizards"
temp = team1
team1 = team2
team2 = temp
What is a variable? What are some things in your life that change often?
See slides in Lesson Resources Folder for a guided introduction.
Disposable cups, index cards, names for variables on strings (to hang around students' necks)
tree
, because the word tree
has no relevance to your age.)team1
because we’re talking about sports teams. Put the name around the student’s neck to indicate they have become the variable team1. This student has now become team1
, and should not respond to any other names! Note: A variable name will never have quotes around it - that would indicate that it is a string (i.e., a type of value rather than a variable's name). Variables can be identified (loosely) by words or letters that are not in quotes and are not keywords (for, if, else, etc.).team1
. Because we have never used this variable before, we are initializing it - putting something in this box (memory location) for the first time. On the board, write team1 = "Miami Heat"
team1
is the same as the Washington Wizards; it is only where were are currently keeping that team. Write “Miami Heat” on a notecard and put it into the cup.team1
and "Miami Heat", this time using team2
and "Washington Wizards".team1
and team2
?team1
and team2
to swap their values. Key point: when we access a variable and put its value in the place of another variable, that value is being copied. By doing so, however, any previous value in the variable is lost. temp
.temp
.)temp
variable, so the variables do not overwrite one another.temp
(named so because we will not be using it very long). Write temp = team1
on the board. Notice that in this assignment, it looks like we are setting a variable equal to another variable. Instead, we are setting the variable temp
equal to the value inside the variable team1
. This means that the value is copied to a second location.temp
.temp
cup.team1
. Write team1 = team2
on the board.team2
and copy the text from the notecard onto a new one. Move to team1
and replace the previous notecard with this new one.team1
. Rip up the notecard or throw it in the trash.team2 = temp
by following the same process. Look at the code written on the board and ask a student to walk us through each step.
CFU: Why did we create the variable temp
?
(Because variables overwrite the values of one another, and if we were to just set team2 = team1
we would lose one of the values.)
Students should notice:
In reality, Python actually has a "shortcut syntax" that allows us to make this swap in one step. It looks like this:
a,b = b,a
If we wanted to swap the values in team1
with team2
, we would simply have to write:
team1,team2 = team2, team1
Here, Python is doing exactly what we were doing. It is internally creating a variable (which has no name but serves the same purpose as our temp
variable), using it as a place holder, and then completing the swap.
To assign a value to a variable in Python we use the equal sign such as age = 15. On the exam produced by the College Board an arrow is used to indicate assignment.
Using the syntax on the College Board's exam reference sheet, an arrow “←” is used so the same assignment is written age ← 25.
Why would the makers of Python build in this function? What other uses does it have?
A version of this worksheet can be found in the Lesson Resources folder, titled "Swap to the Top".
Give students a list of games that have been played by the teams on the board, and the resultant new ranking. Have them create a piece of code that will reorganize the teams into the correct ranking. (They can assume that the variables team1
... team13
already exist and have been initialized to the Friday ranking.) Give them the option of doing so through the use of manipulatives, or on their own paper.
Discuss: All computer programs can be broken down into smaller, simpler steps. By developing components, testing to be sure they are correct and combining them you can create complex, correct programs. Did students get a feeling for systematic development, and how to trace a program one step at a time to verify correctness? Distribute Exit Ticket in Lesson Resources Folder which asks students to figure out the values of variables hello and goodbye after the code in each exercises been executed.
What is the difference between a variable in a math class and in a computer science class? What is the difference between a float and an integer? Why would you use one instead of the other?
Continue working on "Swap to the Top" worksheet.
Create a 3 column ‘one-pager’. In the left column, create a copy of the code from the activity (a swap algorithm) including team1
, team2
, and temp
that performs the complete swap. In the middle column, write steps that occur in the code (Step 1: Initialize variable and assign the value). In the third column, the students should draw a visual of what that looks like in terms of disposable cups and index cards. (They can just write the variable name on the cup, rather than drawing in a person as well.)
Checks for Understanding are embedded in the lesson. They are also shared below.
What is the type of “Miami Heat”?
(“Miami Heat" is a string. We know this because it has quotes around it .)
What is the difference between a value and a variable?
(Values can be stored in variables. The content of a variable can change to different values, but its name will always be the same because the name is just an identifier of a location in memory.)
Think-Pair-Share: A value is only safe (and not lost to the world of cyberspace) if it is in a variable. A variable can only hold one value at a time. How can we swap values between team1 and team2?
(various answers)
Why did we create the variable temp
?
(Because variables overwrite the values of one another, and if we were to just set team2 = team1,
we would lose one of the values.)
Task: Create a piece of code that will rearrange the ranking of the teams in order to reflect the outcome of previous games. (Independent Practice)
Unit 2. Developing Programming Tools
Revision Date: Jan 11, 2020 (Version 3.0)Summary
Students will learn how programs can solve problems using the various types of conditional statements in Python programs.
Decisions in programs are made using conditional statements.
Outcomes
How are comparison operators and Boolean expressions used with conditional statements?
Student computer usage for this lesson is: required
In the Lesson Resources folder:
Reference Texts:
Online interpreters:
Think of a decision you make in your daily life and how you make the decision. In your journal, write about your decision and the process you use to decide.
Teaching note: take a few minutes to have students share responses (whole class, elbow partners, small groups).
==, !=, <, >, >=, <=
Includes AND, OR, and NOT
Say: The College Board’s exam reference sheet uses:
Example: Type various combinations of Boolean values (True / False) with Boolean operators (not, and, or) into the IDE (PyCharm)
Suggested Activity: What’s in the box?
Materials: Two small opaque containers, one small item for each container, two post-it notes.
Set-Up Directions: Set up the activity before the class arrives, following the directions below:
if numofGreen > numofBlack:
open green box
else:
open black box
Activity Directions:
Show the example from How to Think Like a Computer Scientist text (ActiveCode:6 (ch05_4)) or a similar example. Briefly demonstrate how to read flowcharts while showing the example from How to Think Like a Computer Scientist. Point out that the API (https://docs.python.org/3/library/) is always available as a language reference to help translate from algorithms/flowcharts into code. The API describes many tools to make it easier to create programs and is an important tool for all programmers.
If desired an if-else statement that returns boolean values can be replaced by the conditional expression or vice versa.
Instead of:
if (x < y):
return True
else:
return False
we could use:
return x < y
Define: A code segment refers to a collection of program statements that are part of a program.
Have students answer the following questions:
1. What will be printed by the following code segment?
x=15
if x==25:
print ('Pizza is yummy')
else:
print ('My teacher is awesome')
2. What will be printed by the following code segment?
x=35
y=52
if x!=25 and y==52:
print ('Pizza is yummy')
else:
('My teacher is awesome')
Suggested Coding Example:
n = input('Please enter your password: ')
if n=='P@s5w0d':
print ('Welcome, correct user!')
else:
print ('Incorrect, try again')
Say: The College Board’s exam reference sheet uses if and if-else statements like Python except it uses curly braces to indicate the block of statements controlled by if or if-else statements.
IF(condition)
{
}
IF(condition)
{
}
ELSE
{
}
1 Complete the following Runestone Activities
2 If/else practice problem: In the IDE, write a program that will prompt a user to enter a value for a food item. Evaluate the variable food.
If the value of food
is equal to “potato salad,” display “In Stock”. If the value of food
is not equal to “potato salad,” display “Not in Stock”.
Test your program with the following values for food:
pizza
popcorn
potato salad
Thinking about conditional execution, answer the following questions.
Alternate Instructional Strategy for Guided Practice :
Alternate Instructional Strategy for Journal: Interactive Journaling
Unit 2. Developing Programming Tools
Revision Date: Jul 22, 2019 (Version 3.0)Pre-lesson preparation
Students must have an understanding of using conditional statements, and have completed all the assignments from Lesson 2-8.
Summary
Students will learn how programs can solve problems using nested and chained conditional statements in Python programs.
Outcomes
Overview
Students must know that conditional statements can be used inside of other condtional statements using nested and chained conditional statements.
Vocabulary:
Student computer usage for this lesson is: required
In the Lesson Resources Folder:
Reference Text:
Project Ideas:
In your journal, write what will be displayed by the following code segment. How do you know your answer is correct?
x=2500
if x < 1000:
print(“small number”)
else:
print(“big number”)
Show physical representation using real life example by revisiting the box example from previous lesson:
Materials: Four small opaque containers, four small items, two opaque containers big enough to fit two small opaque containers, Six post it notes to label each container with a color
Set Up Directions: Set up the activity before the class arrives following the directions below:
if numofBlue > numofIndigo
if numofRed > NumofOrange
open red box
else
open orange box
else
if numofYellow > NumofGreen
open yellow box
else
open green box
The Activity Directions
Demonstrate the coding process of the example below.
Guided Activity 1 - Coding Example: Write a program that evaluates a variable "age" and displays a group age category (you are not an adult, you are a senior citizen or you are an adult.)Suggested Instructional Strategy - Think Aloud - model your thought process for solving this problem. Include comments in your code.
age = 18
if age < 18:
print(“you are not an adult”)
else:
if age is > 65:
print(“you are a senior citizen”)
else:
print(“you are an adult”)
Write a program that prompts the user for their age and displays their age category ( you are not an adult, you are a senior citizen or you are an adult.) If they are older than 200 display a message that reads "humanly impossible".
age = int(input("How old are you"))
if age < 18:
print("you are not an adult")
elif age > 200:
print("humanly impossible")
elif age >= 65:
print("you are a senior citizen")
else:
print("you are an adult")
Assign students random numbers from 0 - 250. Have students decide what group they belong to (child, adult, senior citizen, not human) and explain why they made their choice. *** You could have students physically move into the groups, hold up a sign with their answer or answer quietly in their journal.
***Note
It is recommended that:
All partners should be actively involved in the program development. For example, you may choose to employ Pair Programming, in which one partner “drives” (types and uses the mouse) while the other “navigates” (reviews and helps to guide what the driver is doing), with the partners changing roles every 20 minutes. Another method of collaboration is for each partner to develop pieces of the program, combine those pieces, and provide frequent feedback to each other during the development process.
-The College Board Computer Science Principles, Performance Assessment ©2014
Thinking about Nested and Chained Conditional Statements, answer the following questions:
Extensions
Homework
Alternate Instructional Strategy:
Alternate Instructional Strategy: Interactive Journaling
Students will create a collaborative program demonstrating concepts introduced in this two part lesson. Students will be assessed using a rubric and will reflect on their learning in their journal
Unit 2. Developing Programming Tools
Revision Date: Jun 11, 2020 (Version 3.0)Summary
In this lesson, students will be introduced to the concepts of iteration and for
loops.
Outcomes
Overview
Note: Turtle graphic examples in this lesson work with the community version of the PyCharm IDE and Python 3.4.1.
Students must understand that programs use the concept of iteration to perform repeated tasks.
Student computer usage for this lesson is: required
In the Lesson Resources folder:
Required materials:
Useful additional resources:
Discuss with the school’s AP Testing Coordinator before presenting to students.
Schools exam registration policies and procedures
AP Exam fees, fee policies, and fee reductions
Confirm that students have joined the MY AP class section.
Show the AP Exam Registration presentation.
Give student’s time to register for the exam.
Verify that students can see the date and time of their exam in the class section view in My AP.
Journal: Think about events in your life that require a repeated action. They could be something simple such as eating a bowl of cereal. List two events in your life that require an action to be repeated. What is the action? What prompts the need for the action to happen? How often does the action happen?
Note: Students will extend their reflections later in the lesson.
Materials: 5-10 objects that can be stacked (lego, duplo blocks, plastic cups…)
The activity: Place the objects on a table.
1.Say: “At the conclusion of this activity, all of the objects will be stacked.”
Chose one object to begin with.
2. Say: “I will start with this object and I will continue to stack until there are no single objects left on the table. How many times do you think I will stack an object? Why?”
3. Ask: "Are there any single objects on the table?”
Students should answer yes. Stack one object on your beginning object
4. Ask “ Are there any single objects on the table?”
Students should answer yes. Stack one more object on your started stack. Continue to ask if there are any single objects on the table until the stack is completed and there are no more single objects on the table. Keep a tally of how many times you repeated the process.
5. Ask: “How many times did we repeat the process? Did your prediction match the result?"
6. Explain to the students how the activity represents the concept of iteration and continue into the discussion of iteration.
Computers are used in assembly lines and other places with lots of repetition because they can be almost perfectly accurate thanks to sensors that can be calibrated to the millimeter, and without needing to take a break.
Choose one of the events you wrote about in your previous journal entry. Take a moment to write the pseudocode for the repetitive action associated with that event.
Note: Check for understanding while students are working.
Example: Eating a slice of pizza:
While pizza on plate
pick up from plate
take a bite
place on plate
bite is consumed
loop
This guided activity introduces students to for
loops using turtle graphics.
(See handout in Lesson Resources folder: Turtle Graphics Guided Activity: The for loop)
Give students the following code stem. Have the students alter the code to perform the listed tasks.
Code Stem:
import turtle # Allows us to use the turtles library
window = turtle.Screen() # Creates a window to display graphics
bob = turtle.Turtle() # creates a turtle named bob
#Write your code here
window.exitonclick() # Exits the window when clicked
1. Have the turtle draw a triangle using a turtle
2. Now that you know how to add turtles and program them to draw lines repeatedly, use your imagination and creative ability to create your own picture using multiple for
loops and turtles.
Journal: In your journal summarize the process you used to create your picture. What problems did you encounter? What concepts do you need clarified?
Questions in the AP Classroom Question Bank may be used for summative purposes.
Sixty of the 80 questions are restricted to teacher access. The remaining 20 questions are from public resources.
Questions are identified by their initial phrases.
Consider the following code segment, which uses...
The following question uses a robot in a grid o...
Students can be given a copy of the guided activity handout to follow along.
a variety of checking for understanding techniques
quick quizzes
peer review
interactive journaling
Students will use for loops and turtle graphics to create graphic representations of iteration. They modify a code stem using turtle graphics to:
1. draw a triangle
2. draw a picture using multiple for loops and turtles.
Unit 2. Developing Programming Tools
Revision Date: Jun 11, 2020 (Version 3.0)Summary
Students continue learning about iteration by using while
loops and nested iteration. Students work through a guided tutorial on while
loops and learn more turtle graphics features. They also have the opportunity to utilize the pair programming model to facilitate collaboratively writing programs using for
loops, while
loops, and turtle graphics. Throughout the lesson, students are given the opportunity to use their journal as a reflective tool.
Outcomes
while
loops. for
and while
loops can be written (nested) inside of other for
and while
loops.Outline
for
and while
loops with turtle graphicswhile
loops. for
and while
loops can be written (nested) inside of other for
and while
loops.Student computer usage for this lesson is: required
In the Lesson Resources folder:
Other:
What will be displayed at the end of this program?
y=0
for x in range (0, 8):
y += 1
print (y)
Define the Pair Programming Model: As the name implies, pair programming is where two programmers share one computer. One programmer codes while the other observes the code as it is typed in. The two programmers switch roles frequently. Common models such as pair programming exist to facilitate collaboration.
Introduce the Activity:
Solutions to both programs are in the slideshow.
Open Repeat Loops.ppt in the Teacher Resourses.
Say: The College Board’s exam reference sheet uses REPEAT loops instead of for and while loops. The REPEAT n TIMES { } executes the block of statements n times.
The College Board's REPEAT UNTIL(condition) { } structure executes the block of statements without ending until the Boolean expression condition evaluates to true. If the condition never evaluates to true the loop coninue indefinitely (called an infinite loop).
In the REPEAT UNTIL(condition), the Condition is evaluated before the loop body is executed so if the condition evaluates to true the loop body is never execued.
Ask: Which of the two REPEAT loops is most like the Python for loop and which is most like the Python while loop?
Display the example REPEAT loops questions in the slideshow, one at a time. Give the students a moment to determine the answer, then prompt students for his/her response "How many chose Answer A?" Then do the same for B, C, D. Then give correct answer (answer is in the Notes section of the ppt).
Journal: In your journal, summarize the process that you used with your partner to create the collaborative project. How did each partner contribute? Did you have any differences, if so, how did you resolve them? Was there any benefits to working in a pair ie able to identify programming and/or algorithm errors?
Questions in the AP Classroom Question Bank may be used for summative purposes.
Sixty of the 80 questions are restricted to teacher access. The remaining 20 questions are from public resources.
Questions are identified by their initial phrases.
A summer camp offers a morning session and an a...
The code segment below uses the procedure IsFound
The figure below shows a robot in a grid of squ...
The figure below shows a robot in a grid of squ...
The procedure Draw (length, direction) is used to
Various checking-for-understanding techniques:
Quick quizzes
Peer review
Interactive journaling
Students will work collaboratively to develop a program that uses nested iteration and turtle graphics.
Unit 2. Developing Programming Tools
Revision Date: Jan 12, 2020 (Version 3.0)Summary
In Python, a function is a named sequence of statements that belong together. In this lesson, students learn why functions are used, how they are used, and how they are defined.
Outcomes
Overview
Source
Students will work extensively with the online version of How to Think Like a Computer Scientist (HTLACS) hosted by Runestone Interactive.
Students will understand the purpose of functions and how they allow a program to be built and maintained in a modular way.
Predictable Misunderstandings:
- students often think that functions (or any code) written will run. They don't connect that it must be called in order to be run.
- students often think that functions have access to variables that they don't have access.
Student computer usage for this lesson is: required
Other:
Point out: Data values can be stored in simple variables, lists of items, or standalone constants and can be passed as input to, or output from, procedures.
Say: The exam reference sheet uses the name PROCEDURE instead of the Python word function. It provides:
Say: The entire exam reference sheet will be given to students when they take the end of course exam.
.
Homework: Students should read Python for Everybody Chapter 4: Sections 4.7, 4.8 and 4.9. Complete Exercises 2 and 3.
Answer the following questions:
Students should be paired through this exercise since paired discussion is used for formative assessment. Question can be provided to students through a variety of formats including production of a Google form or using student response systems.
Three suggested strategies are:
After Activity D, have students compare results with their elbow partners. Discuss any unresolved issues. This strategy can be used after any check for understanding.
After Activity F, ask students to suggest a rule for creating functions that would help avoid this error.
Students work alternately between the web site, partners, and the whole group. Teachers are to monitor student responses to the questions following each activity to be sure that students are addressing the key content within each activity.
Unit 2. Developing Programming Tools
Revision Date: Jun 11, 2020 (Version 3.0)Summary
This is the third session of a three-session lesson sequence with four topics covered by mini-lectures, explorations, and practice exercises.
Outcomes
Overview
An algorithm is more than just a sequence of steps: levels of abstraction are crucial to the working of algorithms, and sequencing, iteration, and other control structures are ubiquitous.
There are various ways of implementing the algorithm - running sequentially or parts running in parallel.
Student computer usage for this lesson is: optional
In Lesson Resources folder:
[Optional topic] Wikipedia article on Conway date algorithm.
Access to Youtube videos of people and Lego Robots solving Rubik's cubes.
Videos:
https://www.youtube.com/watch?v=X0pFZG7j5cE and /or
https://www.youtube.com/watch?v=_d0LfkIut2M
https://www.youtube.com/watch?
One or more Rubik's cubes.
Links to PDF copies of youcandothecube's solution to Rubik's cube (also copied into the Lesson Resources folder):
You Can Do the Rubik's Cube
Daily Homework Review
Go to this link: https://playtictactoe.org/ to demonstrate an online Tic Tac Toe game
Questions in the AP Classroom Question Bank may be used for summative purposes.
Sixty of the 80 questions are restricted to teacher access. The remaining 20 questions are from public resources.
Questions are identified by their initial phrases.
A programmer wrote the program below. The program
Consider the following program code. The block ...
In the program below, y is a positive integer (...
Programs I and II below are each intended to ca...
Two grids are shown below. Each grid contains a...
For the optional activity (Conway Algorithm), some students may have difficulty adding and subtracting dates to translate from a known day-of-the-week to another day in the same month. A chart on the wall, or a current calendar, could be a help.
Some students who are strong in other areas will have difficulty with the spatial aspects of manipulating a cube while retaining an orientation that will let them complete the steps of one of the sub-algorithms without errors. They may need to be paired with another student or the instructor until they master the technique of holding the cube fixed while rotating a face.
The notation of face turning (e.g. R versus R' or L versus L') can be confusing. Having the students practice with an empty jar with a lid can help. Orient the lid up (U), down (D), left (L), right (R), front (F), or back (B). The hand movement to screw the lid on is the same hand movement needed to perform the non-accented face turn. The hand movement needed to screw the lid off is the same as the accented turn (U', D', L', R', F', B').
Variation for class that does not have Rubik's cubes: Use the images from the Solution Guide: www.youcandothecube.com
Online rubik's cube solver:
The following "Checks for Understanding" could be used to guide the students towards the three learning objectives.
Objective: SWBAT translate sample pseudocode into a Python function.
Objective: SWBAT recognize layers of abstraction for solving a Rubik's cube.
SWBAT to identify sequencing, selection, and iteration elements in a problem solution.
Students will translate prior pseudocode into Python routines. They will recognize if their programs work correctly.
Students will deconstruct one of the Rubik's cube solution stages. These analysis results will be shared and critiqued.
Unit 2. Developing Programming Tools
Revision Date: Jan 05, 2020 (Version 3.0)Summary
In the first portion of this lesson, students continue their inquiry into the properties of functions, with a focus on communication to and from other functions. In the lab portion of the lesson, students develop three Python modules using both Runestone Interactive and their Python IDE. Students use their own functions to perform calculations and draw a variety of polygons and a circle using turtle graphics.
Outcomes
Overview
Session 1
Session 2
Student computer usage for this lesson is: required
In the Lesson Resources folder:
Other:
Teaching Note:
Use of a format such as Google forms is sugggested for collecting student responses to the questions for each activity. It is important to keep this portion of the class moving so students have enough time for the labs. Have students work with partners during their program development so they will have someone to share their progress with. Use a timer and have students briefly share their progress roughly every 10 minutes. This will not only help them understand an iterative development process, but also gives students practice with a collaborative development style.
power
inside the function?power
given that value?drawSquare
, drawTriangle
, and drawOctagon
, along with main module code that calls each function.drawPolygon
function code and finish implementing the drawPolygon
function.drawCircle
function in Finally a Circle (the second half of the Lessons from a Triangle lab).
Iterative development works by developing, then sharing, programs at many points during the development process. Students should work in pairs as they create their programs and share the work through various completion stages.
Students who are completing projects quickly should be introduced to the Python turtle API at (https://docs.python.org/3.4/library/turtle.html). Students can investigate and implement such methods as fill
, speed
and others as described by the API documentation.
Check for understanding by assessing student performance on the Runestone Interactive questions. Students should first try to resolve any difficulties with their partners and groups.
Students should be able to make suggestions for creating and using functions.
Identify and address any areas discovered that students have been unable to come to a consensus understanding.
Have students reflect on the pair programming process as prompted in the lesson.
Create functions that receive parameters, perform calculations using those parameters, and return a value.
Write a function to return the slope and y-intercept of a function of the line through two points.
Write functions to create a variety of polygons and a circle.
Unit 2. Developing Programming Tools
Revision Date: Sep 08, 2019 (Version 3.0)Summary
Students will use the online book Python for Everybody to complete a two-session guided lab in which they will explore the use of strings in Python.
Outcomes
Students will be able to:
len
function to get the number of characters in a string[m:n]
find
method and slicingOverview
Session 1:
Session 2:
for
and while
loops. Students must decide which loop structure is appropriate, based on the nature of a program's requirements.Student computer usage for this lesson is: required
In the Lesson Resources folder:
Other:
find
method for Python 3.4 can be found at:Journal Question: What is a string?
stringtester.py
to test code as they go though the lesson.Section 6.1: A string is a sequence
Section 6.2: Getting the length of a string using len
len
function, which returns the number of characters in a string. Explain that empty spaces between words and punctuation also count as characters. Remind students of previous lessons concerning ASCII values for all characters, including blank spaces and punctuation.fruit
variable from the previous sample, have students return the number of characters using the len
function.IndexErrors:
that the length of the string and the highest index value in that same string are not the same value. The length of the string banana
is 6; the index values are numbered from 0 to 5, inclusive.len
, then have students type the sentence into the console in PyCharm to check their answers.Section 6.3: Traversal through a string with a loop
while loop and incrementing the index value of each character.
Journal Question: Explain why the length of a string is one digit higher than the highest index value of the same string.
word = "alphabet"
index = 0while index < len(word):
letter = word[index]
print (letter)
index = index + 1
index += 1
in place of index = index + 1
.stringtester.py
file used to test the code that they created during the last lesson. Section 6.3: Traversal through a string with a loop continued
Sample solution:
fruit = "watermelon"
length = len(fruit)
index = length - 1
while index >= 0:
letter = fruit[index]
print(letter)
index -= 1
for
loop instead of a while
loop to traverse a string.for
loop to traverse a string.while
loop than a for
loop to traverse a string and share their ideas. Expect answers such as “it is easier to make a for
loop” and “it is harder to move backwards through a for
loop than a while
loop.”char
in the example is used as a variable and is not a keyword in Python. It can be replaced with another word or letter. Have students use x
instead of char
in their sample for
loop code to test this concept. This is an opportunity to have a discussion about using meaningful variable names so they have self-documenting code. Section 6.4: String slices
[n:m]
syntax to indicate returning a string from the nth character to the mth character, not including the mth character.print(fruit[0:3]) # returns app because a is in the 0th position and the second p is in the 2nd position.
# The slice goes to ‘p’ not including the ‘p’.
print(fruit[:3]) # Still returns app because a is in the 0th position.
# Leaving the first index blank begins the slice at the beginning of the string,
# and the second p is in the 2nd position.
# The slice goes to ‘p’ not including the ‘p’.
print(fruit[3:]) # Returns le because l is in the 3rd position.
# Leaving the second index blank ends the slice at the end of the string.
print(fruit[:]) # Returns apple because n begins at zero and m goes to the end of the string.
fruit
is a string, what does fruit[:]
mean?Section 6.10: Parsing strings
find
method and apply slicing in this section.find
method. Explain that the find
method returns the position at which the substring we are searching for begins.find
method without error.message = 'Meet me at the clock tower @ 7:00 a.m.'
atSign = message.find('@')
print (atSign)
This code sample returns 27
, indicating that the @ sign is at index value 27 in the string.
Journal: How are string functions used in everyday life? (search engines to find information quickly, school databases to look up student information, many more). How much more efficient is a computer at looking through millions of strings of data compared to a human? Extension: what if you were looking for a particular face in a crowd in a video, how could computational tools enhance that process?
Students can work in pairs while new concepts are introduced and practiced.
One advanced student could be assigned to be the "checker" for each row and have them raise a flag or something similar when they have checked off everybody in their row as having one small group of programming exercises complete and correct. Possibly offer a token prize to the winning row.
For example, after Section 6.3, the following exercise could be assigned:
Code checks for understanding and concept checks for understanding are provided with each new function, method, or concept introduced.
Summative coding assessment:
Sample answer code:
name = 'Pat Miller'
space = name.find(' ')
firstName = name[0:space]
print (firstName)
It is recommend that a 10-question multiple choice quiz that requires students to evaluate code samples from these lessons, determining the output or possible outcomes when the code is run be developed.
Unit 2. Developing Programming Tools
Revision Date: Jun 11, 2020 (Version 3.0)Summary
This lesson answers the question "What is a list and what can I do with one?". Students will find the answer to this question by exploring list operations and methods, as well as investigating how lists are modeled in real-world situations.
Outcomes
Student computer usage for this lesson is: required
In the Lesson Resources folder:
Other:
Journal:
Solicit some responses. Point out that different lists contain different kinds of information.
Say: In programming, we use data collections like lists for much the same reason as you use lists. A list is a sequential collection of data values that can be referenced using a single name and each value in the list is identified by an index. In some other programming languages, lists can be referred to by different names, such as an array. Today we are going simulate the way Python implements lists.
Optional: Review the string commands. Use the Lists.docx found in the Lesson Resources folder.
See the file called LinkyListy Role Play in the Lesson Resources folder. Note: You can change student names to students within your class.
Create a human “list of students”. See the file called LinkyListy Role Play in the Lesson Resources folder. Note: The directions below are an example. Change student names to students within your class.
Create a List of students by starting with an empty list and modify the list by following program below.
Designate a section of the board or a poster to act as the console/printer for output and a volunteer student to act as the printer driver.
Designate an area at the front of the room for the computer memory (and future students).
As students are called by the program, have each student come up to stand in front of the room where memory resides.
Have each student point to the student that follows them to form a linked list as they come to the front.
LinkyListy Role Play Program:
students = []
students.append('Joe')
students.append('Pat')
students.append('Alea')
students.append('Marta')
print(students)
#add additional commands to append or insert 4 or 5 more students
print(students)
print(len(students))
print(students[3])
students.reverse()
print(students)
print('David' in students)
students.sort()
print(students)
more = ['Tom', 'Laverne']
students = students + more
print(students)
pets = ['fish'*3,'dog']
del students[1]
del students[2:4]
students.insert(0, 'Jennifer')
students = students + pets
print(students)
print(students.index('Marta'))
1.2.2 Check for understanding:
Ask students to give an example and then explain the effect of several of the List methods. For example, students.append(“Zoe”) would add Zoe to the end of the list of students. students.insert(4, “Larry”) would add Larry at index position 4 and slide everyone else down one slot. This could be done as a placemat activity. Use different colored markers for each student to write the example. Turn placement and ask the next student to explain the effect.
Notes:
list: len(students)
print(students[2])
List Membership (in, not in): print(“Mary” in students)
Concatenation and repetition (+ *):Make a list of more Python commands on sentence strips. On back of the sentence strip, write the output or trace of the statement after it has executed onto the back of the card. Have one student hold the deck of cards and cycle through them. Ask students to read a card and predict the output. Meanwhile, students who are in the list will change positions to demonstrate the behavior within the list. The holder of the card provides feedback or congratulatoins in checking the correctness of classmate's responses.more = ["Tom", "Laverne"]
students = students + more
pets =['fish'*3,'dog']*2 # creates a list of ['fishfishfish','dog','fishfishfish','dog']
del students[2], del students[2:4]
stu = students.pop(2)
, stuLast = students.pop()
. The pop method pops (deletes and returns) an element at a given index or the last element if no index is provided.Say:
aList ← [value1, value2, value3,...] creates a new list that contains the values value1, value2, value3, and … at indices 1, 2, 3, and … respectively and assigns it to aList. |
aList ← [ ] creates a new empty list and assigns it to aList. |
aList ← bList assigns a copy of the list bList to the list aList. |
APPEND(aList, value) increases the length of aList by 1, and value is placed at the end of aList. |
REMOVE(aList, i) removes the item at index i in aList and shifts to the left any values at indices greater than i. The length of aList is decreased by 1. |
LENGTH(aList) evaluates to the number of elements currently in aList. |
List traversal - all elements: FOR EACH item IN aList { <block of statements> } The variable item is assigned the value of each element of aList sequentially, in order, from the first to last. |
Discussion: How are lists the same and how are they different from Strings?
Have the students do the Runestone lab activities for Lists to reinforce the above concepts. (http://interactivepython.org/runestone/static/thinkcspy/Lists/toctree.html)
Demonstrate that lists are mutable with the following activity
None
for the empty stalls.Discuss what kind of information can be acquired when a program processes data.
Describe some possible tables, diagrams, text, or other visual tools that could be used to communicate insight and knowledge gained from data.
Homework
Create a list of 5 students that contain the students' name, age, and hair color. Use a loop to extract the information for each student and print it out.
Teacher Note: Consider using the YumYumCupcake problem (see Formative Assessment) as part of tomorrow's opening exercises.
The first of two sessions creating and traversing lists in Python and EarSketch.
Discuss: Lists are collections of values combined into a single entity. What are some lists or other data collections used by music apps? How do the lists make the programs more appealing to their users?
Say: Today we will be learning to implement lists like those we acted out or use in our music apps.
Modify EarSketch Asg. 6.2 by adding a fourth music clip to the drums list. Modify the call to the makebeat function so it always uses the last music clip in drums. Test your program by adding a fifth music clip to drums.
The second of two sessions creating and traversing lists in Python and EarSketch.
Say: Lists are collections of values combined into a single entity. The collections of data in our lists yesterday were unchanging and we learned to access individual elements of the lists. Today we will use Python to add elements to a list and to obtain a part or slice of a list while the program is running.
Show the video: List appending and slicing.
Modify EarSketch Asg. 6.4 by adding another music clip to the clips list. Discuss with an elbow partner how the pan and vol lists change to correspond to the addition of the music clip. Make the appropriate changes to these lists in EarSketch Asg. 6.4.
In this session, we will review two topics required by the Create Performance Task - User Input and User Defined Functions
Say, we review defining our own custom functions. Once defined, we can use them like any other function.
The fundamental approach to solving large programming problems is breaking them down into small function definitions and then calling those functions to solve the original complex problem. You will use the strategy of breaking a problem down into smaller parts and implementing each part separately throughout your programming experience.
7. Chapter Seven: Defining Your Own Functions
Today we will define functions to respond to user input with dynamic lists in EarSketch.
Brainstorm some ways a user of an EarSketch program might want to affect the output produced by an Easketch program.
Choose either topic from the brainstormed list or the sample provided in User Input and Programmer Defined Functions below for students to implement. If you choose to implement suggestions brainstormed by students you may want to provide User Input and Programmer Defined Functions as an example.
Say: The exam reference sheet operations on lists include means of accessing and assigning values to a list and procedures for inserting, appending and removing list values.
Say: Students will have a copy of the entire exam reference sheet while they take the end of course exam from the College Board. The exam reference sheet also includes the FOR EACH item IN aList { }.
Have students move the user input section to a fourth user defined function. Students are to describe the algorithm used in their user input function in their own words.
Questions in the AP Classroom Question Bank may be used for summative purposes.
Sixty of the 80 questions are restricted to teacher access. The remaining 20 questions are from public resources.
Questions are identified by their initial phrases.
Two grids are shown below. Each grid contains a...
Consider the following program, which is intended
In the program below, the initial value of x is 5
The code fragment below is intended to display ...
The code fragment below is intended to display ...
yumYumCupcakes = ["chocolate mousse" *3, "vanilla creme", "strawberry fluff", "chocolate mousse"*2].
Have a customer purchase a vanilla creme cupcake if there are any, check how many chocolate mouse cupcakes are in the display case, bake some more, and add them in. Drop one cupcake on the floor and throw it away.Paired programming: Make a zoo of animals and demonstrate the use of at least 6 different list operations and methods. Try to make a story with your code.
Unit 2. Developing Programming Tools
Revision Date: Jul 22, 2019 (Version 3.0)Summary
To conclude the unit, students will complete a small project as well as a written assessment. The project requires students to parse text and search through lists or words to find a specific characteristic. The assessment covers integers, strings, booleans, loops, if statements, and lists.
Outcomes
Overview
Students should synthesize concepts from the previous lessons to create their first project in PyCharm. This lesson also pushes a student to think about how to design a function, and the relationship between algorithms and functions.
What are the key elements we need to think about when designing a function?
Student computer usage for this lesson is: required
In the Lesson Resources folder:
'is_palindrome'
that inputs a word and determines whether that word is a palindrome. If it is, return True
, otherwise return False
.'is_palindrome'
.Students work individually on the Word Play and Assessment which are found in the lesson resource folder.
Allow students to continue working to the end of class on their projects; have individual check-ins with students to make sure that they are on track and have a clear idea of what they need to complete the following day.
Option to allow students to complete Word Play with partners to promote collaboration, then complete the written assessment individually.
Teacher will monitor the progress of the students on each of the programs in Word Play.
Written assessment (see google drive)
Project Assessment (see google drive for project and rubric)
Unit 3. Information and the Internet
Revision Date: Jun 11, 2020 (Version 3.0)Summary
In this lesson, students will analyze what the Internet is and its basic functionality. Students will learn how the Internet works and how the implementation of the Internet has affected our society. They will discuss the idea of the Internet as a delivery service to get bits from one place to another.
For homework students, should have read and made brief notes on the following sections from the "Blown to Bits" book (Online book link: http://www.bitsbook.com/wp-content/uploads/2008/12/B2B_3.pdf):
These sections are on pages 91-92 & 301-303 in the pdf version.
The Internet and the systems built on it have a profound impact on society.
The Internet has many layers and was designed to be fault tolerant with redundant features.
Outcomes
Student computer usage for this lesson is: required
Blown to Bits (Abelson, Ledeen, Lewis): http://www.bitsbook.com/
Optional Student Handout: Internet Change Student Handout
Answer Key for Teacher: Internet Change Answer Key
The following links provide background on the topics covered in this lesson:
Ask: How does the Internet work?
Journal: Define
Share student responses and develop class definitions.
Compare student responses to the following.
Say: How did the internet and web browsers come about? The internet wasn't originally intended for everyone. Originally it was a tool for scientists to communicate.
Show how the Internet has grown from the small ARPANET system to what it is today.
Show the video Who Invented the Internet and Why through 4:49.
Ask: How is all this interesting and valuable information represented?
Answer: binary.
Lead students to develop the concept that lower-level abstractions can be combined to make higher-level abstractions such as texting (SMS), email, images, sound or video. (ie: one byte can represent one note, put notes together to make a soundtrack. 6 bytes make 1 color pixel. Put pixels together to make a picture. Put sound and pictures together to make a video)
Ask: who and what was theWorld Wide Web was originally intended for?
Answer: only for rapid and easy exchange of information within the scientific community.
Point out how, like many innovations, it grew beyond the original vision, but because of the limited view of its use in the beginning, there were serious holes in the security design of the system. Other design features, like scalability, have served the system well over many years.
Ask: How is information retrieved on the Internet?
Answer: Web browsers make requests for image, sound, web page and other files using the http or https protocols.
Requested files are broken into smaller pieces and the transmission of these pieces is done following the TCP/IP protocol.
Discuss the following sections from pages 301-303 in the "Blown to Bits" book. (Online book link: http://www.bitsbook.com/wp-content/uploads/2008/12/B2B_3.pdf):
In this activity, students will each share one thing they have learned from this lesson. This can be done in several ways depending on time constraints or disabilities. All students should participate in some way before leaving the classroom.
Questions in the AP Classroom Question Bank may be used for summative purposes.
Sixty of the 80 questions are restricted to teacher access. The remaining 20 questions are from public resources.
Questions are identified by their initial phrases.
ASCII is a character-encoding scheme that uses ...
Consider the following numbers. Binary 1100Deci...
Using a real-time network tool that measures the number of views per minute, students generate a question that can be answered using this tool. They will then collect the data and write a report that answers this question. The report should use current real-time screenshots for data and examples. (Note: Students can possibly start this assignment in class, but will likely need to complete as homework.)
Possible question(s) to use for a future test:
Unit 3. Information and the Internet
Revision Date: Jun 11, 2020 (Version 3.0)Summary
The Internet is growing to connect to everything we do in our lives. Over the years, it has grown from being a representation of static content to web 2.0: a place where users interact with a collection of users and "things." In this lesson, the students will conceptualize devices that collect data and send it through the Internet.
The Internet is an ever-evolving system of increasing complexity. It has evolved from representing static information to providing interactivity of data between users and objects (things).
Outcomes
Student computer usage for this lesson is: optional
Students need access to paper for documentation.
Blown to Bits (Abelson, Ledeen, Lewis). Text is free as pdf: http://www.bitsbook.com/
Access to Internet connectivty for these links/videos:
In the Lesson Resources Folder:
Say: Devices connected to the Internet collect data. Sometimes those devices and the programs that store and process the data can have applications that the developers did not intend and may be very significant. For instance, consider this video from CNN about an app called Strava. https://www.cnn.com/2018/01/28/politics/strava-military-bases-location/index.html Play the video.(2:12). Have a brief discussion using the following questions as prompts.
Say: Data collection is not just from devices people knowingly use but increasingly from things connected to the internet they may not be aware of. Many computing innovations affect people in ways that were not anticipated.
Show the video (no audio except music) on how an average everyday person uses objects connected to the Internet in our current society: https://www.youtube.com/watch?v=ZgWbWCv0J5E (3:58)
Summary: A day in the life of the Internet of things shows these things connected to the Internet: cell phone, thermostat in the house, car entry system and radio, car GPS intelligently looking for available parking, parking sensors on the ground using mesh networking (short-range connections to a larger deployment system in a central box), a heart rate monitor with results that can be viewed online in real-time, a watch that connects with a cash register/inventory system, a package pickup system that connects with a drone to take the package directly to the customer.
Say: The data collected today is too large to be processed by people. Two strategies used to analyze large amounts of data are called data mining and artificial intelligence. While both tools regularly find useful results - useful in science and in business - the information obtained may result, in adverse decisions made against individuals or groups.
Students read the May 21, 2019 Guardian article, Facial recognition will soon be everywhere. Are we prepared? (https://www.theguardian.com/commentisfree/2019/may/21/facial-recognition-privacy-prepared-regulation). As students read, have them prepare to respond to the following prompts.
Say: Originally people generated the traffic on the internet. In the future, the vast majority of traffic on the internet will be generated by things.
Show this video about how data is generated by devices connected online:
Ask students if there were any objects that they did not think about earlier that are connected to the Internet. Adjust the list as needed. Analyze which devices would continue to be a high priority or useful if the ability to communicate on the Internet was suddenly diminished by an event like a hurricane or earthquake.
Journal. Pair and share.
With a partner, imagine a device that might someday be a part of the "Internet of Things," but currently does not exist. An example might be a shoe that has its own wireless acquired IP address and keeps track of how many steps one takes each day. (Note: This may already exist.)
As a small group, the students should create a document answering the following questions:
This document should also include a sketch of the device.
Students display a thumbs up or thumbs down to this question: Did this lesson help you comprehend the concept of the Internet as an entity that is comprised of both people (users) and objects or machines?
Read Blown to Bits (Pg 303 - 306) - IP Addresses - stop at "The Key to It All: Passing Packets."
Say: Today we will think about the future of the internet. The internet was designed to be scalable or to be adaptable to serve increasing demands. This ability to adapt to meet increases in demand, or scalability, was a design goal of the original internet. It was not part of the internet's original design to serve commercial needs.
Ask students to respond to these questions about how commercial needs have impacted them.
Say: Revenue from advertising is used to pay many of the expenses for content and services delivered by the internet. Businesses use data they collect about individuals to put them in a group and to target them for ads. Individuals and businesses both can benefit from seeing advertisements that most interest them.
Ask: Think about how individuals and groups could be harmed by the targeting of ads. Have a brief discussion about the possible harms. Be sure to address the three bullet points below.
Students create a story to summarize what they have learned about what the internet is and what they expect it to become in the future. The summary should include what impact the internet has already had, what impacts they think it might be intended to have in the future and what unintended impacts it might have.
Say: As you think about the future of the internet remember that the protocols it uses are open to everyone so technologies not yet developed can be adapted to use them. In this project, you are asked to envision what one of these technologies might be.
Students may present the story in written or other formats.
Questions in the AP Classroom Question Bank may be used for summative purposes.
Sixty of the 80 questions are restricted to teacher access. The remaining 20 questions are from public resources.
Questions are identified by their initial phrases.
Two computers are built by different manufactur...
Which of the following best explains what happens
Using the document in the Lesson Resources folder called "Commercial Python Project", assign students the project to explore more about the "Internet of Things" and think about what the future of the "Internet of Things" might be. In the project, students consider creating their own product commercial template. Consider adding the requirement that their program includes conditional statements. Extra time will be needed.
The rubric for this project can also be found in the Lesson Resources Folder
Ask students to think about and document how their selected device may have an impact on our daily lives. Could their be any controversy associated with their device or the use of their device? If so, what is that controversy? Students should document their opinions and/or findings.
When selecting the pairs, aim for diversity of background, so the students learn how others view technology.
With a partner, imagine a device that might someday be part of the Internet of Things, but currently does not exist.
As a group, the students should submit a document answering the following questions:
This document should also include a sketch of the device.
How does the Internet effectively connect devices and networks?
How do devices and networks that make up the Internet communicate?
Unit 3. Information and the Internet
Revision Date: Jun 11, 2020 (Version 3.0)Summary
This lesson delves deeper into the structure of the Internet and routing protocols. Students will explore the necessity of redundancy by using packets to transmit sections of data. They will then discuss standards for packets and routing. The class will simulate a network in which each student is a node through which they will send email packages from one node to another.
Outcomes
Overview
Students will be able to:
Student computer usage for this lesson is: none
1. Materials required
2. Copies to make
3. Digital resources (check for access)
4. Required background knowledge
Prompt students to respond in their journals to one or more of these questions:
Discussion: Invite students to share their journal entries. The class should come to the general consensus that while their computer doesn’t know where to find everything on the Internet, it is able to pass information or requests from one location to another.
Transition Remark: Previously, we looked at the general structure of the Internet and how it works. Today, we will look more closely at the process of sending information between two locations using the Internet. Let's see what this looks like through a video(Code.org packets) or World of Science video. (After video) We are going to simulate this same action by sending packets of information to each other without leaving our seats.
Introduction:
Transition Remark: Our simulation of the protocol system on the Internet has been relatively tame. In reality, it doesn’t always work this nicely. Sometimes packets are lost; not all the information you want to transmit fits in one packet; or some routers are unable to keep working. Fortunately, the Internet is full of redundancy that allows it to keep working even if some parts fail to work, and we can send large data sets through multiple packets. We’re going to run our simulation again, but this time living in the "real world."
Discussion: How does redundancy of routers contribute to Internet fault tolerance?
Transition Remark: We just participated in a simulation that allowed us to become nodes within the Internet. By filling out the back side of your IP worksheet, each of you was essentially becoming a router. Each routers contains a configuration table with information that it can use to send packets to the correct location.
Discussion:
Conclusion: This information should be written in the student's journal.
Reflection: This may be completed as an exit ticket for formative assessment or in student journals.
Questions in the AP Classroom Question Bank may be used for summative purposes.
Sixty of the 80 questions are restricted to teacher access. The remaining 20 questions are from public resources.
Questions are identified by their initial phrases.
A user enters a Web address in a browser, and a...
What is the minimum number of connections that ...
Assessment will occur informally through the discussion questions:
Reflection questions for journal:
Assessment Questions:
Explain the role of the Internet Protocol address for each device on the Internet.
Why is the assignment of an IP address critical to connecting a device to the Internet?
How does Internet router redundancy contribute to Internet fault tolerance?
How does redundancy of routers contribute to the Internet's ability to scale to more connections?
Explain how relatively small packets are used to transmit large files on the Internet and identify what information each packet must possess.
Identify a standard protocol for Internet packet communication.
Unit 3. Information and the Internet
Revision Date: Jun 11, 2020 (Version 3.0)Pre-lesson Preparation
Students must complete the pre-reading assignment: Blown to Bits (pages 303 - 306 in the PDF). They should read the sections about DNS, Protocols, and IP Addresses.
Summary
The purpose of the Domain Name System is to resolve domain names to IP address for computers on the Internet.
For the next two lessons, students will investigate the workings of the Domain Name System (DNS). They will then design and enact a simulation of DNS. Students will use their simulation to request and receive web pages, implement DNS caching, and investigate DNS poisoning.
Outcomes
Overview
Session 1 - Introduce DNS
Session 2 - Create DNS Improvisation
Students describe characteristics of the Internet that influence the systems built on it.
Students explain how computers can be used to get a web page from a new web server.
Students work as part of a collaborative group using effective communication to accomplish a task.
Student computer usage for this lesson is: required
Blown to Bits (either electronic or hard copy)
Access to the Internet for these sites:
Excel or similar software
"DNSWorksheet" document and "Favorite Domains (Sample List)" spreadsheet in lesson resources folder
Addtional Resources
https://studio.code.org/s/netsim Code Studio Internet Simulator
Student friendly explanation of DNS https://studio.code.org/s/netsim
Version 1 - If students have access to the system console window, use it to complete the following steps.
Directions for Host Configuration and DNS in Action Using the Console Window:
Version 2 - If the Console is blocked for your students, you can still demonstrate most of the console commands on your computer. If it is blocked for you as well, use a web site such as http://pingtool.org and the prompts below.
Note: If the Console is blocked, students will need a way to obtain unique IP addresses. A document named "DHCP Simulator" (in the lesson folder) contains 30 unique IP formatted addresses. Print and cut out the blocks and allow a student dubbed DHCP to give them out at random.
Directions for Host Configuration and DNS in Action Activity Without the Console Window:
During the investigation, students should answer the following questions in their journal:
Journal Questions for Version 1:
Students should attempt to answer these questions based on the previous activity:
Suggested Answers
Journal Questions for Version 2:
Students should attempt to answer these questions based on the previous activity:
Have students pick one or more of the following questions to answer in their journals:
Put the following list of DNS and other devices on the board. As a class, students are to create a diagram of the way devices 1 – 5 interact to resolve domain names (similar to the last picture in the overview.) Have students draw the picture on the board and agree that it is correct before they write it in their journals.
Getting Started/Introducing Activity (5 min)
The teacher will explain the following activity to the students:
Show DNS explained (https://www.youtube.com/watch?v=72snZctFFtA) 3:20 - 5:39.
Teachers will explain that the Internet is much bigger than the Web, but for our simulation purposes, we will only be trying to access web pages from web servers.
Questions in the AP Classroom Question Bank may be used for summative purposes.
Sixty of the 80 questions are restricted to teacher access. The remaining 20 questions are from public resources.
Questions are identified by their initial phrases.
According to the domain name system (DNS), whic...
What is the minimum number of connections that ...
Which of the following is a characteristic of the
When pairing up students in "Think - Pair - Share," use a random generator such as random.org (use list tool) to randomly pair students.
Students create a list of things in their lives that are identified by unique numbers.
1. End to End Architecture 6.1.1B
A. Describe the “end to end” architecture of the Internet.
B. Explain how the “end to end” architecture facilitates connection of new devices.
2. Internet Names and Address Rules 6.1.1 E
A. Describe how computers are uniquely identified and connected on the Internet.
3. DNS Function 6.1.1 G
A. Briefly explain the primary use of the Domain Name System made by users of the Internet.
4. DNS Hierarchy 6.2.1 B
A. Describe the hierarchy of the Domain Name System.
Unit 3. Information and the Internet
Revision Date: Jan 04, 2020 (Version 3.0)Pre-lesson Preparation
This lesson will require some room setup or prep for best delivery of instruction. Some of the setup should have been done in the previous lesson.
Summary
In this lesson, students will expand their knowledge of how the Domain Name System (DNS) works by acting as a class to simulate the use of DNS to retrieve web pages.
Once the simulation is functioning students enhance its efficiency through the use of caching.
Poison the DNS cache by adding false DNS replies (DNS poisoning).
Students discuss with their groups how DNS works and how it supports Internet growth.
Then they explain in their journals how:
DNS works
Caching is both a benefit and a security risk.
DNS supports Internet growth.
In this lesson, students will expand their knowledge of how DNS works by acting out a simulation of DNS in action and using it to retrieve web pages. This is a two-session lesson. The first session is for students to get the simulation functioning, with the teacher serving as director. As students realize they need to "fix" their implementation of the simulation (modify their scripts), they record the insights in their journals.
In Session Two, students take on different roles and conduct a dress rehearsal that is entirely student-led. Teachers then introduce DNS caching and DNS poisoning. Once the simulation is functioning, students will address both increased efficiency due to DNS caching, and cybersecurity concerns associated with DNS.
Outcomes
Overview
Session 1 - Acting the Simulation
Session 2 - Round 2 of Simulations
The characteristics of the Internet influence the systems built on it.
Domain Name Servers are essentially the "address book" of the Internet and store information to help Internet systems route transmission requests and replies.
A list of character protocols is provided as a resource. These may help students learn their roles.
Student computer usage for this lesson is: required
This lesson requires extensive preparation.
Acquire:
24 envelopes per class – one or two per host per rehearsal and production.
Post-it Notes
One color for students to use to self-select roles.
One color for students to use to record DNS information.
One color for students to use to initiate requests.
Print:
One copy of character protocols for each student.
One copy of Routing Table.docx for each student router.
One copy of DNS cache for each root, TLD, ANS and local DNS server and each host.
Four copies of each device/character role page (web, router, root, TLD, ANS and local DNS and host).
Three or four copies of the first page web page, grouped by domain.
Warm Up:
Distribute post-it notes to each student.
Casting Characters:
Beside each device listed on the board, there should be the number of students needed to play each role. As soon as students complete their post it notes, have them choose their role by placing the post it notes next to the device name.
Below are suggested numbers of actors per role for two class sizes. Students take their seats and add their name and IP address to their router table.
Device List |
16 Students |
30 students |
Host |
4 |
8 |
Local DNS |
2 |
4 |
Root |
1 |
1 |
Top Level Domain |
2 |
3 |
Authoritative Name |
4 |
6 |
Web Server |
4 |
6 |
Router |
1 |
2 |
Once students select a role, each device group should meet briefly to discuss what information they have to collect from the post-it notes on the board. They will go and obtain either a script that informs them what to do during the play, (how their device works) or all the printed web pages from their server.
Gathering Data:
Post this list of directions and allow devices to go to the board and obtain the required IP address information.
Before the play can start, these seven sets of data still have to be collected.
Notes:
Steps to complete the play:
Explain: Both domain names rules name and IP address rules have changed over time.
Have students watch these two videos:
Afterwards, they should record responses to these two prompts:
Set the stage:
Distribute scripts, envelopes, and post-it notes.
Note: Use the character protocols from the previous session during the dress rehearsal, especially if the students are struggling.
This play is improvisational with Hosts requesting whichever pages they want. Restart the system with all Hosts online.
Introduce the security problems associated with plain text messages and with DNS poisoning:
Students will research this topic and report on security issues (among other aspects of DNS) in their summary report.
If the previous lesson has not been assessed, assign the entire summary in the document entitled "DNS Summary."
The simulation will be acted out at least three times. Students should change to a new role each time.
Use the character protocols during the dress rehearsal.
Students are to reopen their spreadsheets from the previous lesson.
Show the students how to create a simple "if statement" in a spreadsheet. The spreadsheet will become a tool where a user can type a domain name into a cell. If the respective IP address of that domain name is found, then that IP address is shown. If it is not then a "0" appears.
(See the sample spreadsheet in the Lesson Resources folder called "Sample Spreadsheet")
A. Describe one rule change for names used on the Internet. Describe the rule before and after the change.
B. Describe one rule change for IP addresses used on the Internet. Describe the rule before and after the change.
C. Describe briefly the process by which the Domain Name System operates.
D. Briefly describe one way the Domain Name System was not designed to be completely secure.
E. Briefly describe one security concern and one coping strategy for the Domain Name System insecurity.
Unit 3. Information and the Internet
Revision Date: Jan 04, 2020 (Version 3.0)Summary
This lesson investigates how the world wide web and search engines work. Concepts of browsers and servers as well as he spiders that crawl the web in search of valuable information, the data farms that store the data, and the processes used to organize current and historical data. The search process starts before you ever type a query, by crawling and indexing trillions of documents. Students will create a concept map illustrating their understanding of the operations of a search engine. A concept map is an artifact that could be created as part of the Explore Performance Task at the end of Unit 3.
Outcomes
Students will be able to:
Overview
Source
The slides for the guided exploration of search methods were adapted from slides provided by Marie desJardins at the University of Maryland, Baltimore County.
Students will understand how the world wide web is structured and operates.
Students will understand the many processes that are required for an effective search engine.
Students will create diagrams and concept maps, do some investigations and discuss how search engines work, and then will individually use a computational tool to create an online diagram illustrating their understanding.
Student computer usage for this lesson is: required
Students should journal on the following question:
"How many searches do you think are done each day using the Google search engine?"
Pair and share, then show this amazing live counter of internet searches: http://www.internetlivestats.com/google-search-statistics/
Use the slide presentation "About Search Engines" (in Lesson Resources folder) to direct students through this lesson.
Jigsaw into third’s and assign each third one of the following tasks. Have students answer their assigned question based on the reading.
Read paragraphs 1 and 2 of Understanding Browser Tracking by Goodwill Community Foundation, Inc. What have you used online recently that is keeping a record – tacking – your usage?
Read paragraphs 1 and 2 of Locational Privacy – Issues by Electronic Privacy Information Center. What devices or systems are tracking your or your family’s location?
Read paragraphs 1 and 2 of HOW COMPANIES USE PERSONAL DATA AGAINST PEOPLE section 2.4 Key developments in recent years. How do companies individually identify us?
Share responses to each question with the class.
Describe at least three differences between the internet and the world wide web and identify which is searched by search enginges like Google or Bing.
Have students create a concept map of ideas relating to search engines, doing additional research to round out their understanding. (See Teacher Resources for online tools that can be used to create concept maps.)
Share ideas from the students' concept maps. Point out that the concept map (if done online) is an artifact that was created using a computer to present information visually.
Optional Extension: (for fast moving classes who need more to do)
Google tracks everything that everyone queries. (Is this an invasion of your privacy?) The results are fascinating.
Look at www.google.com/trends. You can look at trends by region and limit them to a date and/or place. For example search for “Obama, McCain” limiting your search to 2008, and the United States. What conclusions do you draw?
Pick another topic of interest to explore in Google trends to reveal society’s interests.
Students can create diagrams and concept maps on paper by hand if that is helpful.
Be sure to assign roles to pairs when working together. Don't allow one partner to be passive while the other is active.
Students create a concept map of what they learned with additional research on the topic.
Students will develop a visual diagram of the processes involved in indexing the Internet by a search engine.
Unit 3. Information and the Internet
Revision Date: Jan 12, 2020 (Version 3.0)Summary
This lesson has two main objectives.
The first focuses on search engine algorithms and the impact search engines have on our lives. Search engine page rank algorithms rely on many factors to predict what someone is looking for. The business advantage of appearing on the front page of a Google search is tremendous. However, as more information is tracked about our interests and preferences in order to customize the results of our searches, we have to ask whether or not the loss of privacy is worth the results.
The second objective is to introduce students to creating a visual artifact (knowledge required for performance tasks). Students will research a page ranking subtopic, prepare a one minute speech, and (if possible) create a video to accompany the speech.
Outcomes
Session Two
Students will understand that the page rank algorithm depends on many factors, has changed over time, and has a large impact on the traffic that a site gets.
Students will give examples of how their activity online is tracked and how the knowledge of them is used to taylor the results and the possible repercussions.
Students will create an artifact using screen capture of themselves discussing and analyzing an aspect of searching.
How can computing extend traditional forms of human expression and enhance people’s ability to find information and solutions?
Student computer usage for this lesson is: required
Students should take a few minutes to journal on the following question:
Which are you more likely to do if you don't see an answer to a search request on the first page: click forward to page 2 of the results or ask the question differently? Why?
(Encourage students to discover that it is very valuable to business to appear at the top of the search engine rankings and that often thousands or millions of results are returned in a single search.)
(Use the PageRank presentation in the lesson folder to guide the discussion.)
Note: Guidelines for the teacher are in the "Teacher Notes on PageRank Presentation" document. This document also contains an answer key. (Students can record their notes in the "PageRank Student Handout".)
Read Fast Fact the Protect PII on Social Media published by the US Navy.
What concerns does the Navy have about the information posted online?
Do these same concerns apply to people not in the military?
Read the first three sections Internet is forever, except when it is not from Ask Leo.com.
How hard is it to permanently delete information once it is posted on the internet?
What advice would you give to a young person about posting their information online?
Why could it be beneficial for a search engine to keep track of what people are searching for? In what ways do computers enhance our ability to solve problems? Discuss.
(Possible answer to lead students toward: Topics sporadically become popular, and knowing what results people like can make it easy to suggest sites to others looking for similar things. History data can also enable a search engine to suggest a search phrase when a single word or only a few letters are typed in. The better a search engine knows what you are looking for, the better it can filter results to include results relevant to your query.)
Explain that students will be creating a presentation on the topic they researched in the last session. This presentation should be scripted, and make use of a PowerPoint and sources from the internet. They will have 30 minutes to make this presentation. (Slide 8 is made for video creation, but works well for general presentations too.)
For classes with enough video recording equipment for all groups:
Explain that students will create their own video explanations of how one feature of search engines works. Go over the "1 minute talk directions.odt" together to help students organize their video. The creative design process to develop such a short, focused product requires good teamwork, organization, and creativity. Plan out what the key message is, what visuals will add the most value, and then craft the wording to fit within the 1 minute time frame.
Students should split into their groups and begin work. Allow only 10 minutes for additional research as needed. They will take the remaining 25 minutes to:
Show as many videos/ group presentations as you can share with the class. If there are videos, assign the remainder to be watched as homework and have students bring in notes on the key points learned from each video.
Session 3 New for 2020-2021
Getting Started
Warmup:
1 What can we conclude from the following two statements?
2 How do you think the computer can tell which bits are for the title of a page and should be large and which bits represent plain text on the page and should be smaller?
Say: According to the Dublin Core Metadata Initiative Metadata Basics page (), metadata is "data about data" -- specifically, descriptive metadata -- is structured data about anything that can be named, such as Web pages, books, journal articles, images, songs, products, processes, people (and their activities), research data, concepts, and services. Creative Commons Attribution 3.0 Unported License
In this session, we will investigate what metadata is, its relationship to data, and its uses.
Watch the first 40 seconds of this video to complete these two sentences.
Metadata are pieces of information that make studies ______________ & ______________.
Metadata helps you make_________ of the ___________.
Watch the first 90 seconds of this video. After watching the Meta... What? Metadata! video, define metadata in your own words.
Say: Let’s answer two questions about the metadata for this image.
.
Colin Hines www.ColinHinesPhotography.com [CC BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0/)]
Now view its metadata.
Think-pair-share: Discuss with your elbow partner
Say: If metadata tells us what data means - what information it contains - then what tells us what metadata means.?
Consider the XML for these messages.
<messages>
<note id="23">
<to>Marcus</to>
<from>Lin</from>
<heading>Reminder</heading>
<body>Don't forget our appointment!</body>
</note>
<note id="24">
<to>Lin</to>
<from>Marcus</from>
<heading>Re: Reminder</heading>
<body>What meeting</body>
</note>
</messages>
Ask: How does the metadata make using the data itself more effective?
The metadata tells us what the data (in black) means. To find out what XML, means we need to consult a standard. Examine the standards recommended by the W3C for XML.
Say: On a web page the data is what people need to see. The metadata is what computer systems use to present the data in useful ways. One large computer system is the internet. Every message/file transmitted on the internet is first broken into small fragments and each fragment packed in packets. These packets contain a lot of metadata that make delivery of the packets by the routers (computers) of the internet both possible and reliable.
Visit the IP packet structure web page and examine the metadata that is part of every packet transmitted on the internet and answer these questions.
Watch this video from International Privacy.org then discuss these two questions with your elbow partner.
For a shorter class, don't have students take notes, just discuss the slides.
For the Explore performance task, each student should be able to create their own artifact. You could have the students work on the presentations individually in this lesson, as a practice for the Explore task, if your class is fairly competent with the technology. For students with less experience (or to save time during presentations), it could be beneficial to have students create these artifacts in pairs, with some pairs repeating topics for comparison.
Students share best definitions of page rank related terms
Students analyze web pages for reasons for differences in page rank
Students create a one-minute video clip on a topic related to the operation of search engines.
Unit 3. Information and the Internet
Revision Date: Jul 22, 2019 (Version 3.0)Summary: This lesson is designed for students to review basic statistics, including calculations of the mean, median, mode, and standard deviation. It will also give the students some experience using spreadsheet software to calculate the statistics and to create histograms. Note: This lesson is intended primarily as a review and a reminder of material that should already be familiar to the students. If your students have little familiarity or experience with using Excel to compute statistics or generate plots, you may wish to extend this lesson to two sessions, and provide more scaffolding and instruction on the basic mechanisms.
Outcomes:
Overview:
Source: This lesson was adapted from Unit 2: The Engineering Design Process, Lesson 2: Collecting and Processing Information ©2013 International Technology and Engineering Educators Association Foundations of Technology, Third Edition/ Technology, Engineering, and Design
The students must understand the basic statistical concepts of mean, median, mode, and standard deviation. They must also be able to use spreadsheet software to calculate the statistics and to create histograms.
Students often have some initial difficulty learning how to use formulas in the spreadsheet software to do the calculations.
Student computer usage for this lesson is: required
For Each Student:
Review of Statistics:
Present a review of basic statistics (min, max, mean, median, mode, and range), and use the following board exercise to have the class review their understanding of these basic concepts:
Discussion:
Ask the class to come up with situations where it might be most useful to compute the mean, median, or mode of a set of values. Encourage them to understand that each of these statistics can be useful in different situations, but may be misleading. Have them generate sets of data that would give "misleading values" for mean (if there is an "outlier value"), median (if the values have a longer "tail" on one side than the other), or mode (if there is a frequent value that happens to occur at one end or the other of a wider range).
Note: The teacher may want to do this activity along with the students, displaying the spreadsheet on a screen so that the students may ask questions and see how to do the statistical calculations using the spreadsheet software. Students who do not have much experience with spreadsheets may need more scaffolding and instruction. (If you have many such students, you may wish to spread this lesson out over two class sessions.)
Students will use spreadsheet software, such as Excel, to calculate the average number and standard deviation of candy color in an individual-sized bag of M&Ms, Skittles, or other colored candy. Optionally, students may compare their results to other online published statistics for each candy.
Candy Statistics |
||||||
Trial Number |
1 |
2 |
3 |
4 |
5 |
6 |
Yellow |
17 |
20 |
24 |
19 |
19 |
17 |
Red |
21 |
13 |
19 |
21 |
15 |
18 |
Blue |
10 |
18 |
16 |
18 |
21 |
20 |
Brown |
7 |
12 |
5 |
12 |
12 |
14 |
Green |
26 |
26 |
16 |
17 |
22 |
18 |
Orange |
24 |
16 |
20 |
15 |
15 |
16 |
Package Total |
105 |
105 |
100 |
102 |
104 |
103 |
The students will also need to create columns further to the right labeled Mean, Median, Mode, and Standard Deviation.
Mean |
Median |
Mode |
Standard Deviation |
19.375 |
19 |
19 |
2.199837656 |
18.125 |
19 |
19 |
2.799872446 |
17 |
17.5 |
18 |
3.338091842 |
9.5 |
10 |
12 |
3.380617019 |
21.125 |
22 |
22 |
3.833592124 |
18.25 |
17.5 |
16 |
3.284161124 |
SUM
function.
Yellow Candy σ = |
2.199837656 |
Get on |
3Cs |
25.97451297 |
|
2S |
23.77467531 |
|
1s |
21.57483766 |
|
Mean |
19.375 |
|
-1s |
17.17516234 |
|
-2s |
14.97532469 |
|
-3s |
12.77548703 |
Students will answer the following question in their journals:
Learners may be paired to assist each other in the use of the spreadsheet software.
The teacher should frequently check the students' work for accuracy as the lesson progresses so that misunderstandings may be quickly resolved.
Unit 3. Information and the Internet
Revision Date: Sep 28, 2019 (Version 3.0)This is the second of three lessons where students will research a computing innovation.
This lesson will focus on:
Identify data privacy, security, or storage concern
Say: In this lesson, we are going to work individually to investigate a computing innovation. All computing innovations use data and to some degree expose the data to risk. In this lesson, you will identify a computing innovation and describe a privacy, storage or cybersecurity concern.
All computing innovations have a purpose, a purpose that guided the developers in its production. Some privacy, data security or data storage concerns about the innovations may have been known by the developers. Others may have become known only after the innovation was in use.
With elbow partners, list five or so kinds of information that most people want to remain private. Create a class list of these a list of these.
Say. Some personally identifiable information is protected by law is PII. Have students visit this website for a definition of PII. (https://github.com/ca-cwds/Information-Security/wiki/Definition-of-PII-(Personally-Identifiable-Information))
Provide the list below and ask students to identify what elements in our list are also listed as proteced by law.
Personally identifiable information (PII) is information about an individual that identifies, links, relates, or describes them. Examples of PII include:
Select one of the three concerns from activity 1 to focus upon.
Research and prepare a report assessing the risk and providing guidance on how to protect against that risk. The report must include citations of at least two references assessing the concern and two reference for protecting against the risk.
Prepare a one minute report about the concern you wrote about in the last sessions.
Computing Innovation data concern presentations.
Unit 3. Information and the Internet
Revision Date: Nov 07, 2019 (Version 3.0)Summary
This lesson provides the students with an opportunity to practice the AP CSP Explore Performance Task with a given set of tasks from which they may choose. Students will use a rubric to perform self-assessment of work generated for the Explore Performance Task.
Outcomes
Overview
Session 1
Session 2
Session 3
Source: The lesson models the College Board AP CSP Explore Performance Task.
The students will be able to use reliable research findings to generate a computational artifact and respond to questions on that innovation.
Student computer usage for this lesson is: required
In the Lesson Resources folder:
Instruct the students that they are to use their findings to generate a computational artifact and a one-page paper on an innovation.
The artifact is an original digital artifact screencast or knowledge map diagram that you create to express the effects of your chosen innovation.
Students are to generate a written document in which they respond directly to the following prompts. Their document should be a one-page paper that may include illustrations.
Writing responses to questions posed on "Practice Explore Task Response Document" and creating artifact.
Remind students that brevity is important for the performance tasks; it is a talent to be able to get a message across with real content succinctly.
I have made this letter longer than usual, only because I have not had time to make it shorter. ~Blaise Pascal (1623-1662).
Have students complete the "Practice Explore Task Job Completion" form, indicating where they are in the process of the Practice Artifact.
Complete any additional research needed to complete the document (if needed).
The previous evening's homework was to complete the paper that students were working on in the previous class. Pass out the rubric and have students go through their paper to verify that they have all points covered. Point out that most of the points awarded are based on the report (75% of the total score) and the artifact represents 25% of the score. Teacher will need to circulate to assist where needed.
Have students complete a Job Progress form indicating where they are in the process of the Practice Artifact.
Complete the paper using the rubric as a guide. Complete the plan for the artifact; you will have one more class period to work on the artifact before the project is due.
The previous evening's homework was to complete responses to "Practice Explore Task Response Document" modifications as indicated using the rubric that students received in the previous class. Using the artifact part of the rubric, have students go through their plans for the artifact to verify that they have all points covered. Point out that most of the points awarded are based on the report (75% of the total score) and the artifact represents 25% of the score. Teacher will need to circulate to assist where needed.
The responses to "Practice Explore Task Response Document" for the Practice Explore Performance Task should be complete. Students should be focused on the artifact. The entire project will be collected next class.
Have students complete a Job Progress form indicating where they are in the process of the Practice Artifact.
Complete artifact using the rubric as a guide. The Practice Explore Performance Task is due at the start of the next period.
SPED/LLD: need to be frequently monitored and assisted as needed.
Teachers may choose to spread this activity out into multiple class sessions over a longer period of time, to give students some more time to work on the paper and artifacts at home (especially if the class meets every day, since "overnight homework" is often difficult for students to complete effectively when they are involved in other after-school activities and have assignments for other classes).
Practice Explore Performance Task -- provide feedback, using College Board's rubric (Explore_Performance_Task_Rubric_Nov2015.pdf and the CSM detailed Explore Task writing rubric (CSMattersWritingRubric.docx and CSMattersWritingRubric.pdf) -- both can be found in the lesson folder
Explore Performance Task
Unit 3. Information and the Internet
Revision Date: Jun 11, 2020 (Version 3.0)Pre-lesson Preparation
Assigning some of the research as homework will allow more in-depth research.
Summary
Reflecting on the fact that the Internet was not designed with security in mind, students will examine the devastating impact of cyber attacks. Students will study types of cyber attacks and the vulnerabilities they exploit and identify the roles of software, hardware, people, and the Internet. Students will identify potential cybersecurity concerns in systems built on the Internet.
6.3 Cybersecurity is an important concern for the Internet and the systems built on it.
The Internet was not built with security in mind, leaving computers vulnerable to cyber attacks. This makes cybersecurity an extremely important concern when designing and implementing systems that are built on the Internet. Students need to be able to identify potential problems that could arise and potential options for protecting against these problems.
Outcomes
Student computer usage for this lesson is: optional
In the Lesson Resources folder:
Journal Sample Response:
Example for Presentations:
Information to present about firewalls. (Included in the slides)
“You can protect against certain attacks. One way to protect against them is a firewall.”
(Note: There is a PowerPoint to be used with this entire lesson: "Cyber Security Lesson Slides" in the Lesson Resources folder.)
In their journals or as a class, students should discuss the following:
2a. Say: What can be done to protect our online security and privacy? Institutions can implement Multifactor and 2-factor authentication.
Show the videos: Multifactor and 2-factor authentication
Discuss: multifactor identification. Be sure all four points below are discussed. (Suggestion, play it like Family Feud, keep getting ideas until all key points below have been revealed and add other ideas as they are suggested)
2b. Say: What can we as users do?
Discuss with students what they think they can do. Be sure all six points below about what users can do are discussed.
Individuals can manage passwords, network and credit card use.
Organize the class into seven groups and assign a topic above to each. Ask students to think about what the technology is, why it is important and how it is used.
Allow students five minutes to research the topics. Allow 5 minutes to prepare a poster about each. Present and answer questions about each.
4a. Say: All real-world systems have errors or weaknesses that make the susceptible to attack. One approach to making them safe is to detect and prevent these attacks. We are going to investigate malware and virus attacks. Show the video Malware: Difference Between Computer Viruses, Worms and Trojans. Have a brief class discussion on computer viruses using the questions below as prompts.
4b. Say: Attacks come from unknown senders, or spoofed or compromised known senders. Show the What is Phishing video. Have a brief class discussion on phishing using the questions below as prompts.
4c. Say: Some attacks take advantage of keyloggers. Show the Cyber Security Minute: Keyloggers video. Have a brief class discussion on keyloggers using the questions below as prompts.
4d. Ask: Why is the danger of free downloads is a special risk to young people? Visit the site 7 Quick Sites That Let You Check If a Link Is Safe and identify two tools you could use to identify safe downloads.
4e. Ask: What is an access point to a network? (Ans: a point of connection that can communicate with the network)
Say: According to Wikipedia, A rogue access point is a wireless access point that has been installed on a secure network without explicit authorization from a local network administrator. Rogue access points can give access to the network with authorization and can be used to intercept or modify network traffic that is traveling through it.
Solicit at least 3 examples of how this could be a problem on a secure network.
4f. Ask: What does it mean if something is malicious? (Ans: it has bad intentions)
Say: According to ZDnet,"85% of all malspam sent in Q2 2019 (April, May, and June) contained a link to a malicious file download, rather than the actual malicious file attached to the email." Have a brief class discussion on malicious email using the questions below as prompts.
4g. Say: In addition to attachments and malicious links - whether in an email, message or on a web page, email from an unknown sender or a known sender whose computer has been compromised may contain active contents such as forms or videos that can be used to compromise your computer security, your privacy or both. Discuss with students ways malicious software can be installed on their computers. Be sure to address the points below.
Optional programming activity.
Visit the PyPi website keylogger 2.7.3 and read the Use cases.
Optional research activity.
Students will be grouped by the type of attack they read about. They will conduct research to answer the following questions: (some resources will be provided, but students can also search for others. If no computers are provided, it will be up to the teacher to find these additional resources)
Visit the Top 10 Malware January 2019 report.
Visit the us-cert.gov report on Ransomware.
What is ransomware?
How can you protect yourself?
Questions in the AP Classroom Question Bank may be used for summative purposes.
Sixty of the 80 questions are restricted to teacher access. The remaining 20 questions are from public resources.
Questions are identified by their initial phrases.
A certain social media Web site allows users to...
A retailer that sells footwear maintains a single
When a cellular telephone user places a call, the
Many Web browsers allow users to open anonymous...
Which of the following has the greatest potential
Which of the following is considered an unethical
Real World Connection: Protecting your Computer
Choose one of the following articles to read, based on the operating system you have running on one of your home computers, or the computer you normally use.
Answer the following questions:
If yes, answer the following questions:
If no, do the following:
Optional: Use this extended checklist to enhance the security of your computer.
The teacher will see where the students place the cyber attacks as they read about them on the impact graph and give appropriate feedback.
The teacher will monitor the research on cyber attacks and check for accurate information.
The teacher will clarify misconceptions that become evident during the group presentations.
Students will complete a journal entry by responding to questions about their personal and school related data being accessible through the Internet.
Unit 3. Information and the Internet
Revision Date: Jul 22, 2019 (Version 3.0)Summary
Students are introduced to the topic of cryptography and learn to perform two encryption techniques. The students will identify the role of the algorithm and key in the encryption process. Students will use abstraction to see the general process used in symmetric encryption. The students will consider the strength of ciphers and the importance of keeping the key a secret.
Outcomes
Overview
Student computer usage for this lesson is: optional
In the Lesson Resources folder:
Optional: Lesson slides with the key questions, encryption demos, and diagrams (the teacher could simply read the questions and present demos and diagrams by writing on a board).
For examples, consider reviewing The Code Book by Simon Singh.
Journal:
Tell the students, “This problem is not a new one. Throughout history, people, including government and military officials and personnel, business owners, and others, have wanted to send secret messages to someone but worried that the message could be intercepted along the way.”
There are two ways to try to keep the message secret: Steganography and Cryptography.
Explain the basic difference between the two.
Present two different encryption techniques, showing one example of each.
An alternative to this lecture portion above is to have students independently study the same concepts using a reading, video, or online learning tool. Here are some suggested resources:
Summarize with this overview: "Each encryption scheme involves an algorithm and a key. The algorithm is the set of steps that you follow to accomplish the encryption. The key is the secret piece of information that is needed to know exactly how to apply the algorithm in this case. This allows you to securely send encoded information across the Internet and decode it when it arrives. Some codes are more secure than others."
Have the students pair up and practice sending each other encrypted messages, then decrypting them to make sure they end up with the correct message.
A worksheet called "Cryptography Partner Practice" is provided in the Lesson Resources folder.
Ask the students: “How difficult would it be to crack a message that was encrypted using the Caesar (shift) cipher if you didn’t know the key? How would you do it?” (Easy, try each of the 25 possible shifts.)
Present: There are two ways to increase the strength of encryption:
Option #1: Increase the number of possible keys.
A general substitution (not limiting to just a shift) dramatically increases the number of keys. The number of keys in this case is the number of permutations (different orderings) of the 26 letters in the alphabet. This can be computed by multiplying the 26 options for the first letter in the cipheralphabet, by the 25 remaining options for the 2nd letter, 24 remaining options for the 3rd letter, etc. (26! or 26 factorial).
The answer: 4.032914e x 1026 keys (Google will calculate it for you).
This analysis makes it seem as though a substitution cipher would be unbreakable, but clever people have invented tricks (e.g., frequency analysis) that can be used so you don't have to try all of the different keys.
Option #2: Use a better algorithm.
For example, use a polyalphabetic cipher that combines multiple cipher alphabets.
(If time allows, you can have students explore other ciphers. For further study, see Khan Academy or The Code Book by Simon Singh.)
Present a diagram that shows high-level view of the encryption and decryption process (see The Code Book, p. 11).
Journal:
Use the "Cipher Python Project" worksheet in the Lesson Resources folder. Students are tasked to create a simple Caesar cipher program that uses ASCII values to shift messages by a certain letter. The rubric for this project is also in the Lesson Resources folder.
The teacher will evaluate student responses to the journal entries, class discussion questions, and the students performance during the encryption practice.
Unit 3. Information and the Internet
Revision Date: Jun 11, 2020 (Version 3.0)Summary
In this lesson, students will learn two solutions to the key distribution problem and the mathematical foundations behind these solutions. They will make connections between encryption, the use of SSL/TLS in web browsers, and the use of digital certificates. Students will recognize the value of open standards used in modern cryptography.
Outcomes
Overview
Session 1
Session 2
Student computer usage for this lesson is: optional
In the Lesson Resources folder:
Students should answer the following questions in their journals:
Suggested Review
Motivation: Present the Key Distribution Problem:
Introduce the following topic. Allow for discussion among the class about possible solutions to the problem presented.
After the class has come up with some ideas, reveal a solution to the problem that was found using math.
Present Key Information: Dreamers to the Rescue – Two men, two solutions, one important mathematical idea.
The system also uses powers (base/exponent). Very briefly review power notation.
Students should answer this question in their journals:
Research Hellman and Diffie’s work on public-key exchange, identify the big ideas of CS Principles that show up, and provide specific examples of how they are related to what you find out about Hellman and Diffie's work. Alternately, read about the British group that developed the same solution as Hellman and Diffie's to public key encryption in secrecy (http://cryptome.org/ukpk-alt.htm).
Students will read the following question and record their thoughts in their journals:
Have students present ideas from their journal entries. Use this as a way to review the Key Distribution Problem, and the team that tackled the problem.
Present Diffie’s Solution - Public Key Cryptography
Have students act out three short scenes (see "Public Key Encryption Plays") in order to illustrate how the system works. (It is advisable to select "dramatic" students to fill the four roles.)
Roles
Overview
Follow Up question to ask the students: Who do you have to trust for this system to work? (2 min)
What are the mathematical details that enable this idea of work? (Don't worry, we are not going to fully answer this!)
Discussion: Do “Open Standards” make sense in the world of Cryptography?
The systems of encryption used on the web have been "standardized" (meaning that everyone agrees to use the same systems) so that computers all over the world can communicate with each other. These standardized systems could be "proprietary" (meaning the details are kept secret), or they can be "open" (meaning the details are shared for anybody to see).
Students will Think-Pair-Share about the following prompts:
Possible responses
Benefits of open encryption
Benefits of open standards
- The bigger picture: Open Internet standards are the cornerstone of the Internet’s success. They enable its existence, facilitate its growth, and provide a platform that supports creativity, as well as social and economic opportunity for its billions of users. Open standards are implemented around the world in all kinds of Internet products and services. https://www.internetsociety.org/policybriefs/openstandards
Note: Heartbleed vulnerability is a good example of something that was eventually caught because of open standards. (This could be a homework assignment to read about it)
Drawbacks
Students should read this question and record their thoughts in their journals:
Questions in the AP Classroom Question Bank may be used for summative purposes.
Sixty of the 80 questions are restricted to teacher access. The remaining 20 questions are from public resources.
Questions are identified by their initial phrases.
What is the minimum number of connections that ...
Which of the following are true statements abou...
Which of the following best describes a Distrib...
Which of the following is LEAST likely to indic...
Which of the following statements about securit...
Read about Heartbleed vulnerability in SSL. Reflect on how open standards relate to this.
RSA Encryption Algorithm Video: http://youtu.be/M7kEpw1tn50
The teacher will observe and evaluate student responses to journal entries, class discussion questions, and class activities.
Unit 3. Information and the Internet
Revision Date: Jan 05, 2020 (Version 3.0)Summary
This lesson will increase student awareness of the concept that there are dangers associated with Internet usage. It addresses Internet Security with issues inherent to Internet usage: viruses, worms, Trojan horses, and identity theft. The primary objective of this lesson is to equip students with knowledge that will enable them to make responsible choices regarding their Internet use, to prevent security risks. This lesson introduces key vocabulary, discusses Internet security and provides students the opportunity to explore the causes and effects of common security problems.
Students will:
Outcomes
Student computer usage for this lesson is: required
Teacher's resources:
Students' resources:
Students will read the following prompt and respond in their journals:
Consider the following questions and discuss answers as a class:
On your home computer, see how vulnerable you are to malware and identity theft:
If there is additional time, watch one of the TED talks
Students can create an "Identity Theft Prevention Action Plan," including a purpose and list of ten guidelines, to share with family and friends after they have researched prevention tips on the FTC website.
Unit Assessment and Investigate/Explore Performance Project – at end of unit.
Unit 3. Information and the Internet
Revision Date: Jun 11, 2020 (Version 3.0)Data is stored and transmitted online efficiently using many different kinds of hardware and software to send it quickly and accurately. Data can be compressed to take up less storage room and transmission time and, at the core, the entire system is made up of simple circuits that work with binary information that flows at an incredible speed all around the world. The security and privacy of this constant flow of data deserve understanding and attention. Students will investigate different areas of privacy and share with the class.
This flexible lesson includes additional material if the teacher would like the opportunity to reteach key concepts such as binary, abstraction, Internet functionality and also teachers the layers of hardware abstraction from transistors and logic gates up to computing devices.
The accompanying assessment can be used in class or as homework. (20 min) optional
Student computer usage for this lesson is: required
The Computer Science Field Guide http://csfieldguide.org.nz
Coding and compression: http://csfieldguide.org.nz/en/chapters/coding-compression.html
Data representation: http://csfieldguide.org.nz/en/chapters/data-representation.html
Use the binary number calculator to check conversion calculations
How computer memory works (5:05) http://ed.ted.com/lessons/how-computer-memory-works-kanawat-senanan
Presentations: Unit3Lesson14_InternetData_Presentation, Unit3Lesson14LogicGates_Presentation.
Worksheets: Accompanying student notes to be filled in. Unit3Lesson14_InternetData_StudentHandout, Unit3Lesson14LogicGates_Handout. Also Unit3Lesson14_InternetData_ReviewSection
How does information get from one computing device to another using the Internet? (also on Slide 1 of the Unit3 Lesson14_InternetData_Presentation)
Slides 2-3 review the basic steps to sending information online:
This is a review of unit 3. Pair, share and discuss. Identify weak areas of student understanding.
If students need additional review: provide the handout: Unit3Lesson14_InternetData_ReviewSection (to accompany slides 4-9) and continue with the presentation, otherwise use the handout as an assessment.
Distribute Unit3Lesson14internetData_StudentHandout (slides 10-11) on data compression and abstractions from low level to high level with notes to accompany the video how computer memory works (5:05)
Say: To protect ourselves online we need to understand some facts about how data is collected and used. Assign each of the following to a pair of students. Each pair is to prepare and present a 30 second (2 or 3 sentences) explanation for why their fact is most important. After two minutes give each pair a chance to present their explanation.
Present Unit3Lesson14_LogicGates_Presentation about hardware abstraction.pptx
Distribute Student handout: Unit3Lesson14LogicGatesHandout.docx
Assessment (20 min) optional or can be used as homework.
Also available Logic Gates additional practice handout and informational article.
Questions in the AP Classroom Question Bank may be used for summative purposes.
Sixty of the 80 questions are restricted to teacher access. The remaining 20 questions are from public resources.
Questions are identified by their initial phrases.
A new bank plans to make customer convenience a...
More than any other lesson so far, this lesson should be customized to meet the needs of the students. If they have a background in electronics and logic circuits from science or STEM classes, or have a firm grasp of binary number conversion and how the internet works, these sections of the lesson can serve as a very quick review skipping past the slides with extra detail.
For advanced students: Use the Unit 3 Lesson 14 assessment and the Unit 3 Lesson 14 Data on the Internet - Review Section as summative assessments after a brief review.
For students who do not have this background knowledge, use the presentations and notes.
Notes and exercises for binary encoding, data compression, logic circuits, how the internet works and layers of hardware abstraction.
Unit 3 Lesson 14 Summative Assessment
and
Unit 3 Lesson 14 Data on the Internet - Review Section
can be used as a formative or summative assessment.
Unit Explorations of Computing Innovations
Revision Date: Jun 23, 2020 (Version 3.0)In the Explore Performance Task (EPT), students choose and explore a computing innovation. The EPT requires students to select and investigate a computational innovation that:
● Has or has had the potential to have significant beneficial and harmful effects on our society, economy, or culture.
● Consumes, produces, and/or transforms data.
● Raises at least one data storage concern, data privacy concern, or data security concern.
Students are expected to complete the EPT with minimal assistance from anyone. Students will have 8 hours of class time to complete, and submit:
● Computational Artifact
● Written Responses
Written Responses
Suggested Schedule October 2017
This schedule provides a schedule for 10 50-minute sessions, in order to meet the 8-hour in-class minimum required by the College Board.
Sessions 1 and 2 Using Development Processes and Tools
Sessions 3 -5 Analyzing Impact of Computing
Research:
Find an additional fact about the purpose or function of the CI
Find at least one effect of the CI
Find a group that benefits from an effect.
Find a group that is harmed by the effect.
Sessions 6 - 8 Analyzing Data and Information
Research:
Find the concepts the CI manages and the data it uses to manage it
Find how the data is consumed, transformed or produced
Find a data security, data privacy or data storage concern of the data the CI uses
Find a group that is harmed by the effect.
Finding and Evaluating Information - References and Submitting Documents
Sessions 9 and 10
Session 1: Identify performance task requirements and choose a computing innovation
Session 2: Review EPT Rubric and Research - Day 1
Session 3: Draft Written Responses part 2A, 2C, and 2E
Session 4: Research - Day 2
Session 5: Artifact Design
Session 6: Artifact Development
Session 7: Artifact Development
Session 8: Written Responses to parts 2B, 2D, and 2E
Session 9: Complete Artifact and Written Responses and Create PDF versions
Session 10: Submit Artifact and Written Responses
Students will be able to identify beneficial and harmful effects of a computing innovation.
Students will be able to explain how the innovation uses, produces, and/or transforms data.
Students will be able to explain a privacy, security, or data storage concern related to the innovation.
Student computer usage for this lesson is: required
AP Computer Science Principles Explore Performance Task -- Explore_Performance_Task_Nov2015.pdf in lesson resources folder
AP Computer Science Principles Performance Task Rubric -- Explore_Performance_Task_Rubric_Nov2015.pdf in lesson resources folder
Teachers should have instructed students in each of the following before this lesson.
Teachers and classmates may help students to understand the Explore Performance Task, help students manage the process, and help them to submit the required projects. Once the work on the project begins, however, students must work individually without assistance.
Teachers should influence student selection of a computing innovation (see Exploring Computing Technologies in the Explore_Performance_Task_Nov2015 in lesson folder). However, teachers may not require selection of particular topics for students.
Direct students to find a computing innovation and its:
Guide student understanding of the products that they must produce, including:
Teachers should:
Teachers may:
Teachers may not:
Session 1 develops student understanding of the EPT requirements and guides selection of a computing innovation to explore. If this was done in the practice task, then questions addressed in this session may be assigned as homework, with students using the first day to do preliminary research.
Session 2 develops student understanding of the rubric, so they know the level of expectations that readers will have when scoring them. If this was done during the practice EPT, then the questions assigned in the section may be assigned as homework and the full day used for student research.
Tell students:
Today you will begin the Explore Performance Task. It is an exploration of a computing innovation of your choice according to the guidelines established by the College Board. The goal of this task is to deepen your understanding of computer science principles.
Exercise 1:Provide students with a copy of the Explore Performance Task (Explore_Performance_Task_Nov2015 in lesson folder) description from the College Board. Students should read the Overview section on page 1 and answer the three questions below, sharing their answers with elbow partners. (2 min)
After students share with elbow partners, address any questions students have to this point. (3 min)
Students should read the General Requirements section beginning on page 1 and answer the seven questions below sharing their results with elbow partners. (10 min)
After students share with elbow partners, address any questions that students have to this point. (5 min)
Students should read just the first two paragraphs of the Submission Requirements section on page 2 and answer the four questions below sharing their results with elbow partners. (3 min)
After students share with elbow partners, address any questions students have to this point. (2 min)
Assign students to 5 groups and assign a section a - e to each group. Have each group answer these two questions for each section (10 min)
After completing the four exercises, students are to choose a computing innovation to explore and share their choice with you. (15 min)
Before the next lesson, students must select and submit to you the name of the computing innovation.
Tell students:
Today will be your first research day. Before starting your research, we will examine the rubric that readers will use when scoring your computational artifact and written response.
Provide students with a copy of the Explore Performance Task Rubric (Explore_Performance_Task_Rubric_Nov2015.pdf in the lesson folder). Jigsaw the rubric. Assign students into five groups and assign one row of the rubric to each group. Students are to prepare a 60-second response to these three questions about their row of the rubric. (2 min)
Each student group shares their insights based on these three questions. (5 min) Students put any questions that they have about the rubric on a post it note and put the question on the board.
Students must work individually from this point until the projects are ready to be submitted.
Students research their computing innovation, especially addressing the first two components of written response 2A and written response 2C, while collecting references to be included as a part of written response 2E.
At the end of class, students complete a daily progress report. Teachers will collect the progress report in order to monitor progress but may not provide any feedback to students on content.
Tell students:
Today, students are to plan and draft responses to the first two parts of written response 2A and written response 2C, and begin creating reference section 2E. Students should include citations for information in parts 2A and 2C.
Respond to each of the student's questions posted on the board. You may clarify student understanding of project requirements and expectations.
After drafting these responses, students continue researching the computing innovation.
At the end of class, students complete a daily progress report. Teachers will collect the progress report in order to monitor progress but may not provide any feedback to students on content.
Tell students:
Students are to continue research into their computing innovation focusing on written response 2D while collecting references to be included as part of written response 2E.
At the end of class, students complete a daily progress report. Teachers will collect the progress report in order to monitor progress but may not provide any feedback to students on content.
Tell students:
Today, you will begin the second portion of the EPT by planning your Computational Artifact.
Students reread the Explore Task Submission Requirement item 1 and answer the following 2 questions. ( 2 min )
Plan to accomplish the goals you specified in your answers to question 1 and 2.
At the end of class, students complete a daily progress report. Teachers will collect the progress report in order to monitor progress but may not provide any feedback to students on content.
Tell students:
This is the first of two days scheduled for students to create their computational artifacts. Start today by planning what you need to get done each of the two days and how much will be done on this first day.
After planning the two days of artifact development, students complete today's portion.
At the end of class, students complete a daily progress report. Teachers will collect the progress report in order to monitor progress but may not provide any feedback to students on content.
Tell students:
This is the second of two days scheduled for students to create their computational artifacts. After this session the next two sessions are intended for students to complete both written responses and the computational artifact.
At the end of class, students complete a daily progress report. Teachers will collect the progress report in order to monitor progress but may not provide any feedback to students on content.
Tell students:
This is the first of two days scheduled for students to complete the EPT. This session is scheduled to focus on the written response. As time permits students may work on their computational artifact.
Students complete their written response.
At the end of class, students complete a daily progress report. Teachers will collect the progress report in order to monitor progress but may not provide any feedback to students on content.
Tell students:
This session is for students to complete constructing the two required documents of the EPT and save them in an appropriate format.
Reread and revise each Written Response including an inspection of references, associated citations and total word limits. Save the written response in PDF format.
If students are submitting their computational artifact as a PDF, it may not exceed 3 pages. The College Board also accepts multimedia files containing the computational artifact. Acceptable formats are mp3, mp4, wmv, avi, mov, wav or aif. If students elect to create multimedia files, the files may not be longer than 1 minute nor larger than 30MB in size.
At the end of class, students complete a daily progress report. Teachers will collect the progress report in order to monitor progress but may not provide any feedback to students on content.
Tell students:
There are three goals for this session.
Students upload both files. (15 min)
Computational Artifact Presentations
Post Task Reflection
What did you learn about the computing innovation you explored?
What advice would you give to students in next year's class?
Daily planning and progress reports
Students may not recieve feedback on the content of the EPT until after it has been submitted. Once they are submitted to the College Board EPT can be assesed using the EPT rubric.
Unit 4. Data Acquisition
Revision Date: Jun 11, 2020 (Version 3.0)Summary
In this lesson, students will learn how to acquire and analyze data to find answers to questions and solutions to problems. Students will consider whether or not the data they are presented with is necessarily valid, and research some of the various data sources online.
Outcome
Overview
Session 1
Session 2
Students will be able to acquire data and analyze it to find answers to a specific question or solutions for a specific problem.
Student computer usage for this lesson is: required
Student computer usage for second lesson is: optional
In the Lesson Resources Folder
Webpages Session 1
Webpages Session 2
For this session, use the presentation "Finding Data" in the Lesson Resources Folder.
Given this data: [slide 1]
A blood drive at the local high school reveals that 20% of the students were HIV positive.
Journal on these questions:
Lead the students in discussion using the bullets below and slide 2 of the PowerPoint as guidance. Students should talk about WHY they assumed the data was true or were uncomfortable questioning the truth of the data.
Part 1 - Discussion
Data comes from many places and takes many forms [slide 3]
Part 2 - Brainstorm
Brainstorm as a class: what kinds of data are generated? Possible answers:
● transforming every element of a data set, such as doubling every element in a list, or extracting the parent’s email from every student record
● filtering a data set, such as keeping only the positive numbers from a list, or keeping only students who signed up for band from a record of all the student
● combining or comparing data in some way, such as adding up a list of numbers, or finding the student who has the highest GPA
● visualizing a data set through a chart, graph, or other visual representation
Give students the worksheet: Homework Unit 4 Lesson 1.
There are 10 videos to choose from, each 10-15 minutes long. Either allow students to self-select, or assign them a particular video. Students should watch the video and answer the questions on the worksheet. This is an opportunity to discuss plagiarism: students are expected to watch the video and write from their own experience.
For this session, use the presentation: Finding and Analyzing Data from the Lesson Resources Folder
Students should journal on the following: Describe at least 2 ways that we create meaning out of data. [slide 1]
Part 1: Correlation vs. Causation
Part 2: Data Science
Businesses like Amazon and NetFlix learn the habits of different customers and make recommendations based on their previous choices and others who share similar characteristics (like Google ads).
See if anybody knows the story of Moneyball (based on a true story) of how a baseball team made decisions based on data analysis to become winners, https://en.wikipedia.org/wiki/Moneyball_(film) and how Vivek Ranadivé--who knew little about basketball but owned a multi-million dollar computer processing company and knew how to choose and analyze data--coached his then twelve-year-old daughter’s National Junior Championship basketball team to the national championship game. He relied upon his sporting knowledge of soccer and cricket paired with his analytic mindset, to create a system of play which allowed his relatively un-athletic team to excel. From the moment that he used intellect and his business experience to coach an inexperienced team to the championship game, the man who once thought basketball was “mindless” was hooked on the sport. http://www.newyorker.com/magazine/2009/05/11/how-david-beats-goliath
Describe how the data sets needed could pose challenges regardless of size, such as:
Present homework from the previous day after watching TED talks on data. [slide 8]
Summarize all of the questions from the homework to be presented to the class and collect the written summaries to grade.
In your writing journal, map out the steps to answer a specific question or find a solution to solve a specific problem using data.
Questions in the AP Classroom Question Bank may be used for summative purposes.
Sixty of the 80 questions are restricted to teacher access. The remaining 20 questions are from public resources.
Questions are identified by their initial phrases.
A student is recording a song on her computer. ...
An Internet service provider (ISP) is considering
Digital images are often represented by the red...
Which of the following is a true statement abou...
Data analysis activities from NOAA, NASA, and more! - http://climate-expeditions.org/educators/activities.html
What is data acquisition? - http://www.ni.com/data-acquisition/what-is/
Data analysis and graphs (with Excel sample) - http://www.sciencebuddies.org/science-fair-projects/project_data_analysis.shtml
Collecting and analyzing data - http://ctb.ku.edu/en/table-of-contents/evaluate/evaluate-community-interventions/collect-analyze-data/main
Using Excel for Handling, Graphing, and Analyzing Scientific Data: A Resource for Science and Mathematics Students - http://academic.pgcc.edu/psc/Excel_booklet.pdf
Journal day 1:
Given this fictitious data:
A blood drive at the local high school reveals that 20% of the students were HIV positive.
Journal day 2: Describe at least 2 ways that we create meaning out of data.
Homework: Feedback from a TED video on big data
Students complete the Data Search and Analysis student activity.
Write an outline of an algorithm to make a data-based decision about what movie to produce or what sports team member to hire.
Unit 4. Data Acquisition
Revision Date: Sep 22, 2019 (Version 3.0)Summary
Students will define and identify models and simulations. They will work in groups to propose a simulation that could be used to investigate a hypothesis.
Outcomes
Overview
Source
Some of the ideas in this lesson were adapted from the CS10K community site, https://sites.google.com/site/mobilecsp/lesson-plans/realworldmodels
Student computer usage for this lesson is: optional
These videos supplement the material covered in this lesson:
Introduce Vocabulary
Choose one of the simulations at Phet simulations and answer the following.
View these two videos
Bill Nye and a scaled model of the solar system (4:17)
https://www.youtube.com/watch?v=97Ob0xR0Ut8
Computer Generated Model of a Solar System (2:41)
https://www.youtube.com/watch?v=8z5mwAlxBYc
Students create a journal entry responding to these two questions:
Students discuss each of the following with elbow partners then groups.
From each group students share at least one response to each prompt.
Examples of models (do not need to show the entire videos for student understanding):
Examples of Simulations:
Have students find and share simulations in each of the following:
Unit 4. Data Acquisition
Revision Date: Jun 11, 2020 (Version 3.0)Summary
Students will formulate a hypothesis, run simulations, and analyze the results to determine what needs to be modified in their hypothesis and/or the simulation itself.
Outcomes
Overview
Source
The coin flipping extension is based on a CS10K lesson: https://sites.google.com/site/mobilecsp/lesson-plans/lp-coinflip-miniprojects
Students will be able to:
Student computer usage for this lesson is: required
The PowerPoint "Using Data and Simulations" can be found in the Lesson Resources folder.
Penny Bias article to go with lesson extension: http://mathtourist.blogspot.com/2011/02/penny-bias.html
For the Monty Hall Problem extension:
Online simulation of the problem: http://math.ucsd.edu/~crypto/cgi-bin/MontyKnows/monty2?1+17427
There are several videos on YouTube demonstrating and explaining the Monty Hall Problem.
An animated video: https://www.youtube.com/watch?v=mhlc7peGlGg length is 5:48
Live action video: https://www.youtube.com/watch?v=4Lb-6rxZxx0 length is 5:30
There is sample code for the die Python program in the Lesson Resources Folder called 4-3 Sample Code.py
Journal:
Have students share their answers with the class.
import random
at the top of the coderandom.randint(min,max)
returns a 'random' integer between the min and max values (inclusive).Ask the class: What are the advantages/disadvantages of using a program vs. actual dice?
How quickly can the computer generate thousands of test cases?
Can the computer be used to analyze the test cases as well as to generate the random numbers?
Journal: Summarize how a program can be used as a simulation to test a hypothesis.
Questions in the AP Classroom Question Bank may be used for summative purposes.
Sixty of the 80 questions are restricted to teacher access. The remaining 20 questions are from public resources.
Questions are identified by their initial phrases.
A car manufacturer uses simulation software dur...
The algorithm below is used to simulate the res...
Students can be provided with the code for a function to simulate rolling one die and use it to develop the rest of the program.
After the first group activity, the teacher can swap a student from each group to allow different input into the next group activity.
This extension is based on advanced mini project # 4, which can be found here: https://docs.google.com/a/smcps.org/document/d/1AKHpiQ87bE4W1YzHlAFh2uNAHuEtdMOCQVV6HfxfDzc/edit
Students read an article about the 'randomness' of flipping a penny: http://mathtourist.blogspot.com/2011/02/penny-bias.html
Next, students should hypothesize the results of lining up 10 pennies on edge and knocking them over (as described in the article). Students need to determine how many times to run the experiment, collect data, and analyze the results.
Students should work in pairs to write a computer simulation for the penny experiment. (Note: this is a program based on experimental data, not theoretical.)
Discuss as a class the validity of the simulation written. Can this simulation be used for other coins?
In the game show "Let's Make a Deal", the original host was Monty Hall. Onvery show, Monty would present a player with three doors or curtains to choose from. The contestant was asked to choose a door in search of a prize. After making a selection, Monty Hall would open one of the doors not selected by the contestant to reveal a non-prize (perhaps a goat). Then Monty would ask if the contestant wanted to change their choice.
After explaining the show to the class ask, "Should the contestant change?" Students should propose a hypothesis.
Have the students design a simulation to test their hypothesis (discuss what is the data collected and the number of times the simulation should run to collect data). After running the simulation, students should evaluate their hypothesis and determine whether it needs to be modified or whether the simulation needs to be modified.
If Monty Hall had four doors, what should the contestant do?
What should the contestant do if they know that Monty does not know what is behind each door?
Online simulation of the problem: http://www.math.ucsd.edu/~crypto/Monty/monty.html
There are several videos on YouTube demonstrating and explaining the Monty Hall Problem.
An animated video: https://www.youtube.com/watch?v=mhlc7peGlGg length is 5:48
Live action video: https://www.youtube.com/watch?v=4Lb-6rxZxx0 length is 5:30
Review student journal entries and class discussions to determine students' understanding of simulations, a hypothesis, and the ability to determine a method to test a hypothesis.
Describe an algorithm to simulate drawing an ace of any suit from a standard deck of cards.
Make a hypothesis about drawing cards from a standard deck of cards and determine how to collect data to answer your hypothesis.
Unit 4. Data Acquisition
Revision Date: Jan 05, 2020 (Version 3.0)Summary
This lesson introduces students to reading information from an input file and writing to an output file as a functionality of Python programming as an example of using a data source to gain insight. The students will then apply these concepts to program a simple Dice Roll application to generate data. This lesson will prepare students to read and write files for use in later Data Acquisition lessons.
Outcomes
Student computer usage for this lesson is: required
Python for Everybody by Charles Severance, http://do1.dr-chuck.com/pythonlearn/EN_us/pythonlearn.pdf.
Explanation of the CountIf function in Excel https://support.office.com/en-us/article/COUNTIF-function-e0de10c6-f885-4e71-abb4-1f464816df34.
The mbox.txt and mbox-short.txt files are in the Lesson Resources Folder.
Think-Pair-Share
Have students review their journal entries as a class and note the advantages and disadvantages on a white board.
The students should code the examples in the book as the teacher proceeds through the lessons.
Discuss what possible data sources might be used as input to programs. Brainstorm ways that combining data sources, clustering data, and classifying data are parts of the process of using programs to gain insight and knowledge from data. Point out to students that data doesn't always fall from trees in exactly the quantity, quality, and format needed for your program. A programmer needs to be a critical consumer of data and know when to use multiple sources, clean the data, or sort through to find the right breadth and variety of data needed.
countIf
function in Excel.this = COUNTIF(A1:A1000,1)
counts how many 1s are in the range A1 to A1000. You can show the example on the Microsoft office help website. https://support.office.com/en-us/article/COUNTIF-function-e0de10c6-f885-4e71-abb4-1f464816df34countif
function to compare the distribution of the rolls for how many times each number 2 through 12 was rolled with the pair of six-sided dice to the distribution for the 12-sided die.
Have students work in pairs as the new concepts are introduced and practiced.
For a class needing more scaffolding: Work as a group. Have students take turns around the room to read aloud the brief text in each section in Chapter 7. Do the short exercises together with a "row captain" assigned to each row (or group) in the classroom who is in charge of checking that everybody in their row has completed each short task and has gotten the help needed to finish. Row captains help each other until the entire class has successfully completed each task. Report out on what challenges were encountered, recording problems and solutions at the front of the classroom as the class works. Rotate the role of row captain for each section.
For more independent students: Introduce/demonstrate the key ideas first and then allow student to work through Chapter 7 at their own pace.
The teacher will check the student’s code for understanding.
The teacher will check for understanding as each new concept is introduced.
Exercise 7.1 Write a program to read through a file and print the contents of the file (line by line) all in upper case. Executing the program will look as follows:
python shout.py
Enter a file name: mbox-short.txt
FROM STEPHEN.MARQUARD@UCT.AC.ZA SAT JAN 5 09:14:16 2008
RETURN-PATH: <POSTMASTER@COLLAB.SAKAIPROJECT.ORG>
RECEIVED: FROM MURDER (MAIL.UMICH.EDU [141.211.14.90])
BY FRANKENSTEIN.MAIL.UMICH.EDU (CYRUS V2.3.8) WITH LMTPA;
SAT, 05 JAN 2008 09:14:16 -0500
You can download the sample input file from https://www.py4e.com/code3/mbox-short.txt
Exercise 7.2 Write a program to prompt for a file name, and then read through the file and look for lines of the form:
X-DSPAM-Confidence: 0.8475
When you encounter a line that starts with “X-DSPAM-Confidence:” pull apart the line to extract the floating point number on the line. Count these lines and the compute the total of the spam confidence values from these lines. When you reach the end of the file, print out the average spam confidence.
Enter the file name: mbox.txt
Average spam confidence: 0.894128046745
Enter the file name: mbox-short.txt
Average spam confidence: 0.750718518519
Test your file on the mbox.txt and mbox-short.txt files.
Unit 4. Data Acquisition
Revision Date: Jun 11, 2020 (Version 3.0)Pre-lesson Preparation
Your students will need computers for this lesson. If you would like to show students a working dartboard simulation (with a circular dartboard), check that your browser can run a Java plug-in. Be sure to update, activate, and disable the plug-in as needed for security purposes.
Summary
In this lesson, students will explore basic data analysis concepts in Python, learn about code extensibility, create a simple simulation from scratch, and reuse their code to make a more elaborate simulation.
Outcomes
Overview
Session 1:
Session 2:
Part of this lesson was adapted from http://www.nzmaths.co.nz/resource/dartboards and http://www.nzmaths.co.nz/resource/more-dartboards.
The development of a program from scratch to solve a specific problem is presented to students by creating a simulation that lets them see how software can model a real-world process. Additionally, the concepts of extensibility and code reuse are shown through hands-on programming experience.
Some real-world problems have digital input data, many have analog (sound, light, pictures, motion, temperature, etc.) which needs to be considered when determining how to gather input and what to use as input.
Student computer usage for this lesson is: required
The Lesson Resources folder contains an example program showing how to use Python's random function to simulate tossing a coin, as well as a Dartboard.py solution. There is also a comparison between this python code, and some pseudocode that one may write before coding Dartboard.py, titled "Pseudocode vs Python."
An alternative lesson outline using Runestone and PyCharm to code a simulation and use it to develop, refine and test hypotheses in is the lesson folder. The lesson is in a file named "Monte Carlo Simulation to Calculate Pi.docx".
Think-Pair-Share: Writing programs "from scratch"
Get students' attention by asking them to play with the Dartboard Simulator (requires the Java browser plug-in) as they think about the following scenario and answer the related questions:
Suppose you want to write a program that simulates tossing virtual darts. Each dart will land at a point on a square virtual dartboard that is one unit long on each side. Each point on this dartboard has both an x and a y coordinate, both of which are between 0 and 1. The bull's-eye is a square in the center of the dartboard with sides of length 0.5 units.
Have the program ask the user how many darts they want thrown. The program should then simulate throwing these darts by generating a random landing location (a random x and a random y coordinate) on the dartboard for each dart. Recall how to use Python's random functions (by reviewing the previous lessons' dice simulation). As darts are thrown, the program counts how many darts land within the center square, the bull's-eye. The bounds of bull's-eye are [0.25, 0.75] on both the x and y axes. Finally, the program should print out the number of darts thrown and the number that landed within that rectangle.
Have your students answer the following questions:
Take the rest of the class time to have your students begin programming their simulation. If they are not able to finish before the session ends, you may want to assign the program as homework, or devote the beginning of the second session to finishing the program. They will need their programs for the work in the next session.
You may want to remind students how to use Python's random function. The following code may be a useful example:
Example random coin flipping code (the python file is available in the Lesson Resources folder):
import random # Needed for random number generation
number_of_heads = 0
for i in range(0, 100):
x = random.random() # Generates a random floating point (decimal) number between 0 and 1
if x > 0.5:
number_of_heads = number_of_heads + 1
print "The number of heads in 100 coin flips is ", number_of_heads
Have your students finish their dartboard programs, as they are needed in the next session. Alternatively, if they have finished their programs, you could assign the "Collecting and Analyzing Data" think-pair-share of the next session as a homework, to be discussed in the next session.
Journal: Making your programs extensible
Think-pair-share: Collecting and analyzing data
Discuss with your students how we often want to reuse our code for a new project, and how it is not uncommon when developing a program for the requirements to change. Both of these changes benefit from extensibility in code. Your students will get to test the extensibility of their dartboard program by reusing what they have to fit with a new objective: make a three-ringed circular dartboard. Point out that an iterative design process often starts with a simpler problem and then generalizes or extends that program to apply to other situations.
As before, this program should first ask a user how many darts they would like to throw. Then, it should use that input to simulate throwing darts at a circular dartboard. Finally, it should print the number of darts thrown, the number of darts that hit the bull's-eye, the number that hit the middle ring, the number that hit the outer ring, and the number that missed completely. This circular dartboard is similar to the one from the previous session's robot exercise: it has a central circular bull's-eye surrounded by a middle ring, which is in turn surrounded by an outer ring. The coordinates for this dartboard are: the center is at coordinate (0,0); the outermost ring is a circle with radius of 3; the middle has a radius of 2; and the bull's-eye has a radius of 1. Simulate throwing a dart by picking random x and y coordinates, each between -3 and 3. Since this range is a square, some darts may miss the dartboard completely. For this program, students may reuse as much of their square dartboard code as they need, but make sure to preserve their original program separately.
Questions in the AP Classroom Question Bank may be used for summative purposes.
Sixty of the 80 questions are restricted to teacher access. The remaining 20 questions are from public resources.
Questions are identified by their initial phrases.
A cable television company stores information a...
A large data set contains information about all...
Biologists often attach tracking collars to wil...
Have your students finish their circular dartboard programs and answer the following questions:
Note: graphics.py may be used with this lesson to create a visualization - http://mcsp.wartburg.edu/zelle/python/ppics2/code/graphics.py
Another Note: In order to run graphics.py, you may possibly need to save files in the same Python folder as the program being written due to student access and student space restrictions in your network, (i.e. if the link cannot point back to a network drive file due to restrictions).
The students will produce two simulation programs on their own: the square dartboard simulation and the circular dartboard simulation.
The students will record their understanding of extensibility in their journal.
The students will gain experience collecting data in both sessions.
The students will think analytically about their programs by answering the questions in Session 1 and in the homework for Session 2.
Unit 4. Data Acquisition
Revision Date: Jan 04, 2020 (Version 3.0)This is the third of three lessons where students will research a computing innovation.
This lesson will focus on:
Identification of the data used by a computing innovation
Explain how the data is consumed, produced, or transformed.
Students must understand how to identify data used in a computing innovation and explain how the data is consumed, produced, or transformed.
Today students will select and research a computing innovation in preparation for a written report about the innovation.
This lesson will focus on:
Identify the data used in a computing innovation
Explain how the data is consumed, produced, or transformed.
Say: To complete this project students will have to find a somewhat detailed explanation of how the innovation works or more specifically how it consumes, produces or transforms the data it uses. In this activity, students are to iterative select and research computing innovations until they identify one that is of interest to them and that they can obtain a description of the data it uses and the way in which the data is consumed, produced, or transformed.
When students have identified a topic with adequate references available they are to identify the topic for you, describe the data the computing innovation uses and provide at least one reference for how the data is used.
Working in pairs, students are to propose and do preliminary research for a report:
Students are to
Describe the computing innovation they are researching
Describe the data the computing innovation uses both in the sense of the information the innovation needs and the data the comprises that information.
Prepare an outline of their report.
When students finish their descriptions and their outline - and submit them for initial review - they should continue their research and begin individually writing their reports.
Reports should be returned to students in pairs.
Teacher feedback is focused on the computing innovation and data the computing innovation is using.
Students read and assess the feedback, and as needed ask questions about the responses.
Activity 2
Before resuming their reports ask students to share any resources they found useful in identifying how their innovation uses data.
Students resume researching and writing their reports.
Wrap up
When the report is finished it should individually be submitted for assessment.
Think-pair-share:
Ask students to respond to these two questions.
Do you think the use of the computing innovation you researched differs from the way its developers originally intended?
Is it possible for the developers of a computing innovation to think of every possible future use of the innovation they created?
How can the rapid sharing of a program or running a program with a large number of users result in significant impacts beyond the intended purpose of the programmer?
Written projects in preliminary form. Verify that students are describing the innovatinand have identified the nformation the innovation is using.
Written projects in final form. Check that students have explained how the data the information is processed. They should explain what te computer in the computing innovation is doing with the data they identified.
Unit 4. Data Acquisition
Revision Date: Jan 05, 2020 (Version 3.0)Summary
This lesson teaches students to use simulations to develop, refine and test hypotheses. NetLogo, which is used throughout the lesson to illustrate the use of functional and data abstraction, is a programmable modeling environment for simulating natural and social phenomena.
NetLogo is a variation of the Logo language instead of Python, so students are not expected to write new code in this lesson. See http://www.ianbicking.org/docs/PyLogo_lightning.html for a comparison of Logo and Python.
Outcomes
Students will understand that models are abstractions of real environments and will recognize the rationale for, and limitations of, modeling techniques to analyze problems.
Students will recognize the use of functional and data abstractions in modeling.
Students will be able to develop and test hypotheses using an experimental approach in a modeling framework.
Overview
Session 1 - Modeling in NetLogo
Session 2 - Models and Hypothesis Design
Session 3 - Hypothesis Testing
Note: This lesson introduces another programming tool and environment: NetLogo. Teachers may choose to complete only the first session (on the basics of NetLogo), to expose students to a new computational platform and way of thinking, to extend the ideas in Unit 4 about modeling and simulation.
Students will understand that models are an abstraction of real environments and will recognize the rationale for and limitations of modeling techniques to analyze problems.
Students will recognize the use of functional and data abstractions in modeling.
Students will be able to develop and test hypotheses using an experimental approach in a modeling framework.
Student computer usage for this lesson is: required
NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University. Evanston, IL. NetLogo tutorial packet online web version http://ccl.northwestern.edu/netlogo/docs/
Modeling and Simulation 101 video ( https://www.youtube.com/watch?v=X-6zxImekOE )
See http://www.ianbicking.org/docs/PyLogo_lightning.html for a comparison of Logo, PyLogo and Python.
New Mexico "Computer Science for All" bases the entire course on modeling and simulation using NetLogo http://www.cs4all.org/NM-CS108L-Week3-Final
Question: Describe something that can be modeled using a simulation.
Introduce modeling and simulation using the first four minutes of the Modeling and Simulation 101 video ( https://www.youtube.com/watch?v=X-6zxImekOE ). Students open a document for notes for today's session.
Students should record and briefly discuss these four statements about modeling and simulation:
To start, all students should download NetLogo from this link http://ccl.northwestern.edu/netlogo/ or use the web version of the program.
Students should work through the NetLogo tutorial packet either in groups or as a class.
In particular, students should be encouraged to notice commonalities in programming languages (sequence, conditionals, iteration, abstraction) and how differences in languages provide specific tools best suited to particular problems. The domain of modeling and simulation is a huge area in computational thinking, and NetLogo is one of many languages well suited to problem-solving in this domain. Point out that Python is used for modeling and simulation, but to be clear and readable requires the abstraction of libraries to build on that provide the same functionality that comes with a language like NetLogo.
There will be some "thought questions" throughout that students should discuss in their groups and as a class.
Students should complete an exit ticket listing one interesting idea they learned, or one question they have about NetLogo or modeling.
Review yesterday's NetLogo lesson and ask the students to share what they learned, how NetLogo is similar to or different from Python, and any questions they have about how it works. Point out that it is the ABSTRACTION available in NetLogo that makes it easier to read and write simulation programs because it has features built into it that are readily available that you can build on. This PowerPoint details the abstractions in NetLogo with the accompanying transcript from CS for All in New Mexico. List abstractions available in Python that are different from NetLogo or PyLogo. What is built into each language that makes it easy to use?
Ask each student to write a hypothesis that can be tested with this simulation, share the hypothesis with elbow partners, and briefly experiment with the parameters to informally test the hypothesis.
Note: The "Hypothesis Testing Worksheet" which will be used for the next two lessons is available in the Lesson Resources Folder
For the rest of today's session and Session 3, students will work in teams of four students to select a model to experiment with, then divide into two partner sets to develop a hypothesis, devise an experimental plan, test the hypothesis, and write about their results.
Directions
Partners should revisit their hypotheses, and choose one hypothesis to focus on first. (They can test both hypotheses if they have time.) Each partner pair should write the name of their model and their selected hypothesis on the board, to share with the other students.
For the next twenty to thirty minutes, students should carry out their experiments and record the appropriate measurements.
At the end of the section or for homework, students should write up their findings in a short report, showing the data they've collected (optionally in a graphical form, particularly if assigned as homework), discussing what the data says about their hypothesis, and concluding whether the hypothesis is supported or refuted by the simulation.
Students should come back into their teams to share their findings, and discuss the advantages and disadvantages of using models and simulations to develop and test hypotheses.
Students will share and post their hypothesis before testing and sharing the results. Teachers will verify that the hypothesis are falsifiable and testable by the simulations.
Students will select a model, develop a hypothesis, design an experiment, and use a simulation to test the hypothesis.
Unit 4. Data Acquisition
Revision Date: Jun 22, 2019 (Version 3.0)Pre-Lesson Preparation: Students need to have already chosen a topic and had it approved by the instructor. Students can use the following sources to help choose a data set:
http://www.data.gov/ , http://data.princeton.edu/wws509/datasets , http://www.statsci.org/datasets.html
Summary:
This lesson is the summative assessment for Unit 4 on Data Analysis. Students will select a data set and write a small Python program to analyze the data. Students will then write a summary of their findings to demonstrate understanding of the data analysis process.
Outcomes:
Overview:
Students will demonstrate their understanding of the process of collecting and evaluating data.
Student computer usage for this lesson is: required
Rubric provided on Google Drive - Rubric - Unit 4 Summative Assessment.htm in the lesson folder.
Verify that every student has selected a topic (approved by the instructor in advance) and address what the goal is for today.
Students will either individually or in pairs (instructor's decision) create a small program that reads data from a file, analyzes it, creates a simple simulation and finally writes data to a file.
Presentation about the expectations of the homework assignments.
Each student should create a 2-page typed summary that explains the following areas:
Instructor has the option to have students work individually or in pairs for this assessment.
Review Rubric with class and clarify expectations.
Students will be assigned a unit project, with a topic of their choice, to demonstrate their understanding and mastery of the concepts of data collection and analysis.
Unit 5. Data Manipulation
Revision Date: Jan 12, 2020 (Version 3.0)Summary
Big Data has been defined in many different ways. Easy access to large sets of data and the ability to analyze large data sets changes how people make decisions. Students will explore how Big Data can be used to solve real-world problems in their community. After watching a video that explains how Big Data is different from how we have analyzed and used data in the past, students will explore Big Data techniques in online simulations. Students will identify appropriate data source(s) and formulate solvable questions.
Students are introduced to parallel and distributed programming and to their use with big data.
Journal: How can a computer gather data from people? (Think-Pair-Share)
Remind students of the mind guessing game: http://en.akinator.com/ or 20 questions http://www.20q.net/
Discuss: How can the computer learn from people when playing one of these games? How many different answers do you think it could possibly know?
Teacher note: students are not expected to actually play this game during class.
Read The Rise of Big Data in chunks: An Introduction to “Big Data” (20 mins) Reading can be found at: http://www.foreignaffairs.com/articles/139104/kenneth-neil-cukier-and-viktor-mayer-schoenberger/the-rise-of-big-data
Show the first 3-5 minutes of this clip. (It becomes a bit dry, so just show the amount that is appropriate for your students to get the idea): https://www.youtube.com/watch?v=7D1CQ_LOizA
Some examples of how big data is used appropriately:
Some examples of how big data was inappropriately used:
Students are to pick three topics they want to research that use big data. It is preferred that these topics relate to something learned this year in the course (e.g., the need for IPv6). Tomorrow, as the students enter class, they will sign up on a list with their chosen topic. Since the students will have three options, it is likely they will get one of their selected topics to research.
Journal: Think about your daily and weekly activities. What types of data are being stored about you?
Remind students to think about what they do online, in stores, while in a car, etc.
Review the steps to processing Big Data:
As a class, walk through these steps using the two files in the lesson resources folder (FailedBanklist.csv & Consumer_Complaints.csv)
Step 1.
Demonstrate how files such as these can be obtained at http://catalog.data.gov/dataset
Formulate questions such as:
Step 2.
Extract data source into a format supported by underlying tools
Open one of these files in Notepad (or some simple editing program such as Notepad++) and demonstrate how the actual data itself is separated by commas, thus the file name “csv” for comma-separated value.
Open both files in Microsoft Excel. Complete a find for the bank name “Banco Popular de Puerto Rico” on both lists. You may want to first sort the data by bank name to find this bank or you can use CTRL + F to find the bank name (see screenshots below).
Steps 3 & 4.
Normalize data (remove redundancies, irrelevant details)
In this step, there is technically no need to remove redundancies or irrelevant details but you can show the students how you could remove data or limit the data to a particular data set. For example, if were to want to look at only the banks from Maryland, you can use the filter tool to only view those banks from MD.
Make data uniform (user-entered data may include abbreviations, spelling errors, or inconsistent capitalization without changing the meaning of the data)
Cleaning data: Depending on how the data was collected, it may not be uniform. Therefore the data may need to be cleaned before it can be processed. Cleaning the data is the process that makes the data uniform without changing its meaning. For example, replacing all equivalent abbreviations, spellings, and capitalizations of the same word.
Step 5.
Import data into the tool
Right now the file type is as a csv file. By resaving the file as a .xlsx file it becomes a true spreadsheet file.
Step 6.
Perform analysis
We have determined that the bank “Banco Popular de Puerto Rico” is on both lists. Now ask the students “Why is this bank on both lists?” Note: On the Failed Bank list the Banco Popular de Puerto Rico is actually an acquiring institution. By looking more closely at the dates of the acquisition of the failed bank “Westernbank Puerto Rico” one can formulate some possible deductions that maybe the reason “Banco Popular de Puerto Rico” is on the complaint list is because they had recently taken over a failed bank. It could be possible that some of these complaints were related to this recent acquisition.
Step 7.
Visualize Results
Explain to students that they will learn more about visualizing their results in Unit 6. They can complete graph visualization in excel. Show them the website: http://www.gapminder.org/. Explain that even though a visualization in excel is not interactive like http://www.gapminder.org/, they can complete some form of visualizing their data by using a spreadsheet. Note: http://www.gapminder.org/ is VERY attention-grabbing. Only briefly show the students what they can do with it (see how data changes over time, look at many different data sets and download data in different forms - including csv and xlsx formats).
Students should research their selected topics from homework. Some possible websites for finding data are listed above under “Possible good resource(s) for data collection.”
Students are to get your approval for a topic and then use the Big Data Sets Worksheet in the Lesson Resource Folder to find big data sets that are related to the approved topic.
Students are to review using http://www.gapminder.org/ looking specifically at life expectancy. Students will write one question after “playing” the timeline of life expectancy using gapminder on an exit slip before leaving class. For example, one may write “Why is the life expectancy of countries such as Denmark, Sweden, & Norway typically higher than other countries throughout most of the timeline?”
Challenge students to work in teams of four to find:
After 2 min stop students and ask them to share how they approached the problem.
Say: You split the task into pieces, and each person worked at the same time to get the job done more quickly than would be possible by yourself. This is parallelism. In computing, parallelism can be defined as the use of multiple processing units working together to complete some task. There are many different kinds of hardware that can serve as a “processing unit”, but the principle is the same: a task is broken into pieces in some way, and the processing units cooperate on those pieces to get the task done. Basic of Processes with Python
Students launch a Python 2 IDE such repl.it or JDoodle and paste the following code adapted from the Basics of Processes with Python web page.
from multiprocessing import *
def sayHi():
print "Hi from process", current_process().pid
def procEx():
print "Hi from process", current_process().pid, "(parent process)"
otherProcess1 = Process(target=sayHi, args=())
otherProcess1.start()
otherProcess2 = Process(target=sayHi, args=())
otherProcess2.start()
otherProcess3 = Process(target=sayHi, args=())
otherProcess3.start()
### execute
procEx()
Students execute the code - and debug if needed.
Review the definition of scalability. Ask how the scalability of systems is an important consideration when working with data sets, as the computational capacity of a system affects how data sets can be processed and stored.
Ask: What do the numbers mean in each line of output?
Explain:
Discuss:
Use the questions below as prompts. Students share until the idea that parallel solutions scale more effectively is discussed.
Say: Computer scientists use the term scaling to mean how a process responds to increases in the size of the project.
Say: In the first activity we saw an example of a program where more than one computer processor on a computer could be used at a time. Sharing a task among the processors on many computers is an example of distributed problem-solving. Distributed computing shares components of a software system among multiple computers so a large task can be done in less time using the resources available to each of the computers - including both processing and storage resources. Students read the first 5 paragraphs of the OpenScientist.
Discuss: With elbow partners, discuss what are the advantages of distributed computing and choose the top three projects that interest you from the list on the OpenScientist.
Say: Parallel and distributed computing are powerful tools but they have their limits in terms of increasing efficiency.
Show this graph of Amdahl’s Law by Daniels220 at English Wikipedia, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=6678551.
Ask:
Explain: The “speedup” of a parallel solution is measured in the time it took to complete the task sequentially divided by the time it took to complete the task when done in parallel. The 4 different colored lines represent four different processes with increasing portions that can be done in parallel. At first, they all speed up as more processors are used. After a time, adding more processors no longer speeds up each process. The sequential parts of processing limit the overall time.
Discuss: With elbow partners, students discuss why they think this is the case. Students share until these key points are verbalized:
Wrap up:
Students return to the OpenScientist and choose the project that most interests them.
Say: Parallel computing consists of a parallel portion and a sequential portion.
Students identify a part of their chosen project that is done in serial and a part that is done in parallel.
Students are to submit a document stating their topic for research using Big Data. This document should answer the questions:
Topic:
How is Big Data used to solve or remedy the topic?
Link(s) used to find Big Data? (i.e. data.gov, etc)
How has the transformation of data storage affected how data itself is used?
Answer: Storage and processing of large digital data enables us to analyze large data sets quickly rather than small sampling sizes as used before.
How can a computer use Big Data to make predictions?
Answer: Computers can use smart algorithms, powerful processors, and clever software to make inferences and predictions for solvable questions.
How can parallel processing help scale a solution to a Big Data problem?
Larger problems often have more parallelizable segments. The more processes that can be done in parallel the faster the overall process will become.
Unit 5. Data Manipulation
Revision Date: Jun 24, 2020 (Version 3.0)Summary
Big Data has been defined in many different ways. Easy access to large sets of data and the ability to analyze large data sets changes how people make decisions. Students will explore how Big Data can be used to solve real-world problems in their community. After watching a video that explains how Big Data is different from how we have analyzed and used data in the past, students will explore Big Data techniques in online simulations. Students will identify appropriate data source(s) and formulate solvable questions.
Overview
Session 1- What is Big Data?
Session 2 – Where can big data be used?
Student computer usage for this lesson is: required
Reading assignment and video clips for Session 1:
Possibly useful resource(s) for data collection:
Big Data Concepts:
Sample data sets (both acquired from http://catalog.data.gov/dataset) :
Journal: How can a computer gather data from people ? (Think-Pair-Share)
Remind students of the mind guessing game: http://en.akinator.com/ or 20 questions http://www.20q.net/
Discuss: How can the computer learn from people when playing one of these games? How many different answers do you think it could possibly know?
Teacher note: students are not expected to actually play this game during class.
Read The Rise of Big Data in chunks: An Introduction to “Big Data” (20 mins) Reading can be found at: http://www.foreignaffairs.com/articles/139104/kenneth-neil-cukier-and-viktor-mayer-schoenberger/the-rise-of-big-data
Break students into groups or pairs and jigsaw the seven units of the reading. Each group is to summarize their section in a tweet sized comment (not more than 140 characters).
Share tweets with the class.
Explain to students that big data is impacting every area of life. By using more data and processing power we can make better decisions. As an illustration, show a clip from the movie Moneyball: (3 mins) https://www.youtube.com/watch?v=rMObWsKaIls
After students watch, they create a journal entries explaining at least two ways data was used to better manage the baseball team. Partners discuss journal entries. Share at least one observation with table groups and then share at least one observation from each group with the class.
Show the first 3-5 minutes of this clip. (It becomes a bit dry, so just show the amount that is appropriate for your students to get the idea): https://www.youtube.com/watch?v=7D1CQ_LOizA
Some other concepts to point out to students if there is time:
Some examples of how big data is used:
Some examples of how big data was inappropriately used:
Students are to pick three topics they want to research that use big data. It is preferred that these topics relate to something learned this year in the course (e.g., the need for IPv6). Tomorrow, as the students enter class, they will sign up on a list with their chosen topic. Since the students will have three options, it is likely they will get one of their selected topics to research.
Journal: Think about you daily and weekly activities. What types of data are being stored about you? What information (a collection of facts and patterns) is extracted from the data?
Remind students to think about what they do online, in stores, while in a car, etc.
Guided Activities (10 min) – Processing Big Data
Review the steps to processing Big Data:
As a class, walk through these steps using the two files in the lesson resources folder (FailedBanklist.csv & Consumer_Complaints.csv)
Step 1.
Demonstrate how files such as these can be obtained at http://catalog.data.gov/dataset
Formulate questions such as:
Are there any banks that are on both the complaint list and the failed bank list?
Can we make some deductions about banks that may be on both lists? If so, what deductions can we make?
Step 2.
Extract data source into a format supported by underlying tools
Open one of these files in Notepad (or some simple editing program such as Notepad++) and demonstrate how the actual data itself is separated by commas, thus the file name “csv” for comma separated value.
Open both files in Microsoft Excel. Complete a find for the bank name “Banco Popular de Puerto Rico” on both lists. You may want to first sort the data by bank name to find this bank or you can use CTRL + F to find the bank name (see screenshots below).
Step 3.
Normalize data (remove redundancies, irrelevant details)
In this step, there is technically no need to remove redundancies or irrelevant details but you can show the students how you could remove data or limit the data to a particular data set. For example, if were to want to look at only the banks from Maryland, you can use the filter tool to only view those banks from MD.
Step 4.
Import data into tool
Right now the file type is as a csv file. By resaving the file as a .xlsx file it becomes a true spreadsheet file.
Step 5.
Perform analysis
We have determined that the bank “Banco Popular de Puerto Rico” is on both lists. Now ask the students “Why is this bank on both lists?” Note: On the Failed Bank list the Banco Popular de Puerto Rico is actually an acquiring institution. By looking more closely at the dates of the acquisition of the failed bank “Westernbank Puerto Rico” one can formulate some possible deductions that maybe the reason “Banco Popular de Puerto Rico” is on the complaint list is because they had recently taken over a failed bank. It could be possible that some of these complaints were related to this recent acquisition. Is there any other information that can be gathered? What opportunities for identifying trends, making connections, and addressing problems does the data provide?
Step 6.
Visualize Results
Explain to students that they will learn more about visualizing their results in Unit 6. They can complete graph visualization in excel. Show them the website: http://www.gapminder.org/. Explain that even though a visualization in excel is not interactive like http://www.gapminder.org/, they can complete some form of visualizing their data by using a spreadsheet. Note: http://www.gapminder.org/ is VERY attention-grabbing. Only briefly show the students what they can do with it (see how data changes over time, look at many different data sets, and download data in different forms - including csv and xlsx formats).
Students should research their selected topics from homework. Some possible websites for finding data are listed above under “Possible good resource(s) for data collection.”
Students are to get your approval for a topic and then use the Big Data Sets Worksheet in the Lesson Resource Folder to find big data sets that are related to the approved topic.
Students are to review using http://www.gapminder.org/ looking specifically at life expectancy. Students will write one question after “playing” the timeline of life expectancy using gapminder on an exit slip before leaving class. For example, one may write “Why is the life expectancy of countries such as Denmark, Sweden, & Norway typically higher than other countries throughout most of the timeline?”
Students are to submit a document stating their topic for research using Big Data. This document should answer the questions:
Topic:
How is Big Data used to solve or remedy the topic?
Link(s) used to find Big Data? (i.e. data.gov, etc)
How has the transformation of data storage affected how data itself is used?
Answer: Storage and processing of large digital data enables us to analyze large data sets quickly rather than small sampling sizes as used before.
How can a computer use Big Data to make predictions?
Answer: Computers can use smart algorithms, powerful processors, and clever software to make inferences and predictions for solvable questions.
Unit 5. Data Manipulation
Revision Date: Jun 11, 2020 (Version 3.0)Pre-Lesson Preparation
Summary
Students investigate data organization, simulate linear and binary searches, and write pseudocode and Python for linear and binary search methods.
Outcomes
Overview
Session 1
Session 2
Source
Phone book presentation adapted from a lesson taught by Dr. Rheingans in CMSC 201 at the University of Maryland, Baltimore County
Students will:
Student computer usage for this lesson is: required
In Lesson Resources Folder:
Journal: What would be the best way to organize a collection of DVDs so that you could find the one you want very quickly? Would you need a different method for a radio station with thousands of DVDs? Discuss.
As a class, discuss the following questions:
What if you are looking for a specific song. What is the most effective way to look for something if it is in an unordered, unsorted collection?
What are some challenges to organizing large sets of information so they can be processed?
Why does it help to classify data when you are trying to sort it or search through it?
Possible Answers and suggestions for discussion:
Take out a dictionary (or phone book). Ask the class, how would you search for a particular word/name?
Steps for Binary Search in a book of items to demonstrate to the class:
Why would this not work for an unordered list?
Note: Skeleton code (SearchCode.py) is provided in the Lesson Resources Folder.
Think-Pair-Share
Questions in the AP Classroom Question Bank may be used for summative purposes.
Sixty of the 80 questions are restricted to teacher access. The remaining 20 questions are from public resources.
Questions are identified by their initial phrases.
A code segment will be used to swap the values of
A programmer is deciding between using a linear...
A programmer wrote the code segment below to di...
An algorithm will be used to identify the maximum
In the procedure Mystery below, the parameter n...
The program segment below is intended to move a...
The question below uses a robot in a grid of sq...
There are 32 students standing in a classroom. ...
For students that have difficulty understanding the concepts of searching for items in a set of data, pair those students with a student who has a firm grasp of the concept for the activities. Have the pair work together for 1A and then have them keep their own paper secure using the extra game sheet (1A'). Simiilarly for 1B - 1B' and 1C - 1C'.
Correctness of Python functions for linear search and binary search
"Searching Assessment Items.docx" in lesson folder
"Search Comparison Worksheet" in the lesson folder
Unit 5. Data Manipulation
Revision Date: Jul 22, 2019 (Version 3.0)Summary
In this three-session lesson, students explore and confront the difficulties of the problem of sorting data and the difficulties involved in expressing a clear and efficient algorithm for sorting.
Outcomes
Overview
Session 1:
Session 2:
Session 3:
The algorithmic techniques and analysis involved in sorting data are seen in a wide variety of contexts and applications. Sorting numbers in a list is challenging but foundational to many algorithms in computer science.
What makes a "good" algorithm?
What should be taken into consideration when comparing algorithms that complete the same task?
Student computer usage for this lesson is: optional
Journal: Have students respond to the following questions:
Teacher note: Having just finished the lessons on searching, students should recall that searching an ordered list allows using the binary search which is faster than searching an unordered list with a linear or random search.
Teacher note: The focus should be directed more toward the problem-solving technique than nitpicking about the language used. Although students are writing instructions for a human to manipulate a set of playing cards, they still need to be precise, because the assumption is that the person doesn't know what they are doing. This problem is challenging and will require creativity.
Suggest that it could be helpful to break the task down into parts. Using abstraction and collaboration can decrease the size and complexity of the task that each programmer has to solve. Abstraction allows you to build upon existing processes, collaboration allows you to break up the task once you agree on what the strategy is and what the separate tasks are that need to be solved. Example, cards need to be comared and swapped, one person could write the specific steps for how that should be done.
Journal:
Homework: Any pairs that did not finish the activity should complete it as a homework assignment before the next session.
In this session, students review the sorting algorithms they wrote in session 1. Students will follow the algorithms created by their classmates and discover a variety of sorting strategies. By analyzing the various algorithms, students will attempt to find the "best" sorting strategy.
Teacher note: There are two main difficulties in algorithm design to highlight: (1) It is very difficult to be precise with language without some agreement about what terms mean. (2) Solving the problem by determining the strategies and steps required to sort objects correctly, as well as efficiently, presents a second level of difficulty.
Journal: How do you think a sorting algorithm should be "measured" to determine if it is the "best"? Ask for ideas and discuss this during the group activity.
Create groups of four by joining the pairs who previously exchanged algorithms.
Teacher note: This "swapping algorithm" activity works especially well when students exchange algorithms with a group that has a fundamentally different approach. However, as a practical matter, this can be hard to arrange. From your observations during Session 1, you might have a sense of groups with different approaches that you can assign to swap algorithms.
Teacher note: It is possible that the nominated algorithm won't work perfectly. If you encounter any problems with the directions, give them the benefit of the doubt and simulate it as best you can to enable the class to understand the intent.
Teacher note: The students will perform an actual analysis in a later lesson, so it's okay at this point to simply guide the discussion to see how students are thinking. They will re-examine these ideas later.
Remind students of the two main issues in writing effective algorithms:
Homework: Assign students to write a final version of their algorithm, working out any ambiguities or other problems revealed during the activities.
In this session, we end the set of sorting activities by relating sorting to algorithms in the real world. A further exploration of algorithm analysis with some new algorithms will sharpen their intuition about what should and shouldn't be "counted" when analyzing algorithms, what is "hard" for a computer to do, or what takes a "long time."
Journal: discuss ideas and elements from the previous lesson:
Teacher should clarify that in general, we want these things from an algorithm:
Suggestion: If you have a mix of new and advanced students, challenge the advanced students to sort twice as many cards with a parallel processing algorithm of their own design. Each student on the team can perform one action at the same time.
Evaluation of algorithms
Convert actions into an algorithm
Unit 5. Data Manipulation
Revision Date: Jun 11, 2020 (Version 3.0)Pre-lesson Preparation: You should familiarize yourself with www.sorting-algorithms.com paying particular attention to the variety of algorithms and settings along the top of the page. For session 2, you should have the timedsorts.py code and data files (in the lesson folder) readily available for your students.
Summary
In this two-session lesson, students will explore algorithmic efficiency. They will understand the idea through discussion, manual analysis of simple algorithms, and data collection for implemented algorithms.
Outcomes
Students will be able to:
Overview
Session 1:
Session 2:
Student computer usage for this lesson is: required
Sorting:
Think-Pair-Share: Alternate Routes
Briefly discuss with your class the topic: what properties make for a good algorithm? What makes one algorithm better than another? Properties you may want to discuss if your students do not volunteer them:
A good analogy is purchasing a car, where people are concerned about:
Today's session will address the topic of efficiency.
Introduce the concept of algorithmic efficiency to your students by asking them if any can describe what algorithmic efficiency is, or what it means for an algorithm to be efficient. Briefly describe efficiency as how well an algorithm uses two resources, time and space (stored memory), to solve a problem. Some topics you may wish to discuss include:
A central idea of analysis of algorithms is that many algorithms will take more and more resources (time or space) as the size of their input increases. Algorithms can be different yet produce the same result. Algorithm's that require polynomial timesare considered to run in a reasonable amount of time. An algorithm that requires exponential or factorial times are considered unreasonably slow.
When comparing algorithms, time is not measured in seconds but rather in the number of computational steps needed for the algorithm to finish operation on a given input. Great algorithms grow linearly, at the same rate as their input, meaning the time it takes to finish is directly proportional to the size of the problem they are solving (amount of input data). For instance, an algorithm that takes 10 steps for an input of size 10 and 1000 steps for an input of size 1000 is said to be linear in its input. However, most algorithms take longer as their input gets larger. For instance, an algorithm that takes only 25 steps for an input of size 5 may take 100 steps for an input of size 10, 10000 steps for an input of size 100, and one million steps for a size of only 1000 (it is taking quadratically more time as the input gets larger).
When we analyze algorithms, we often talk about the algorithm's computational complexity, which is the order of magnitude of the algorithm's running time. An algorithms efficiency and be estimated by counting the nunber of times the code is executed hoever algorithmic efficiency is calcualted through formal reasoning rather than empirical measures.
Efficiency is typically expressed as a function of the size of the input. For example, if an algorithm finishes with the same number of steps regardless of the size of its input, it is called constant time, which is O(1) in mathematical form (read aloud as "big-oh one"). Constant time algorithms are the fastest in terms of computational efficiency, and any algorithm that takes a constant number of steps is considered O(1). An algorithm that takes 10 steps for an input of size 10 and also takes 10 steps for an input of size 1000 is likely O(1). However, very, very few algorithms are constant time because most algorithms necessarily take longer as the size of their input increases.
An algorithm that can finish by looking at each piece of its input only once is called linear time or linear order, and is written mathematically as O(n), where n stands for "the size of the input." An algorithm that takes 10 steps for an input of size 10 and also takes 1000 steps for an input of size 1000 is likely O(n). Very few algorithms are linear order, especially if they must compare pieces in their input, such as sorting algorithms. The best sorting algorithms are somewhere between linear time and quadratic polynomial time, written as O(n2), where n2 stands for "the size of the input, squared." Any algorithm that is O(n2) typically must compare each piece of its input with every other piece of input at least once. An algorithm that takes 100 steps for input of size 10 and a million steps for input of size 1000 is likely O(n2).
Algorithm's that require polynomial - not exponential or factorial times - are considered to run in a reasonable amount of time.
Most sorting algorithms are of an order between O(n) and O(n2) known as linearithmic time, written as O(n log n), where log is the logarithmic function. In fact, O(n log n) is the fastest possible order for a comparison-based sorting algorithm. It is impossible for such algorithms to be O(n) since they must make at least some comparisons of their input data.
Using the simulation tools at http://www.sorting-algorithms.com/, students will investigate, compare, and contrast sorting algorithms. Notice the grid in the center of the page. Each column is a particular sorting algorithm, and each row is an ordering of horizontal bars (either random, nearly sorted, reversed order, or few unique). Each algorithm will sort the bars in a given cell from top to bottom in increasing order by length.
Ask your students to interact with the website by clicking the green start icons and observing how long it takes each algorithm to sort its bars relative to the other algorithms.
Some questions to have them discuss or record in their journal could include:
Make sure your students understand that the size and order of input data can affect how long an algorithm takes. You should direct or help your students discover that bubble sort is a slow sorting algorithm that can be fairly fast for nearly sorted data. You may wish to discuss that bubble sort is O(n2) in the worst case, explaining why it takes so long for large input, but is O(n) in the best case, which is when input is already (or nearly) sorted. In contrast, selection sort is O(n2) in both the worst and best cases, and merge sort is O(n log n) in both the worst and best cases. In general, most sorting algorithms that we would want to use are O(n log n), since O(n2) is usually too slow. You may also want to mention that bubble sort is considered one of the most inefficient sorting algorithms and that quick sort’s worst performance is on already sorted data, so some quick sort implementations shuffle the inputs before sorting to avoid that situation.
Watch one or more of the available movie clips that compare the performance of sorting algorithms:
Suggested list of videos (Many more are available):
Introduction [5 min]
Journal: Remind your students about the sorting algorithms from the previous session and have them answer the following questions:
The students will measure and analyze the effect of sorting set size on execution time for a given sorting algorithm using Python code. Using the timedsorts.py file in the lesson resources folder as a basis, the students will perform an experimental analysis to compare sorting algorithms by timing them on input data of different sizees. They will hypothesize, design and code their experiment, collect results, and write a report for homework.
Sorting functions available in the Python code include: quick sort, merge sort, selection sort, insertion sort, and bubble sort. For advanced students or classes may, you may wish to have them implement additional sorting algorithms.
The sample code includes helper functions to generate random data, to load data from a file, and to time sorting functions on the data. Example code for invoking these functions is included at the end of the file. You can remove this example code before sharing it with your students if you wish to emphasize the programming and critical thinking required to do this project.
Each student (or pair or group) needs their own copy of the Python code to modify for their experiments.
Students will compare sorting algorithms by timing them with Python code on input data of various sizes. Have your students (individually or in pairs) make a hypothesis about what will happen as the size of data input increases, answering the following questions:
Have your students write out a description of the steps they will take to perform the experiment.
Have students modify their Python sorting code to implement the experimental steps they outlined. Students must:
Discuss the results with another student or group. What patterns can be seen in the relationship between the amount of data and the time to run the program?
Questions in the AP Classroom Question Bank may be used for summative purposes.
Sixty of the 80 questions are restricted to teacher access. The remaining 20 questions are from public resources.
Questions are identified by their initial phrases.
A programmer is writing a program that is inten...
The table below shows the time a computer syste...
Assign as homework, explain the difference between algorithms that run in reasonable time and those that do not. Address how reasonable and unreasonable times are identified and what imapct that difference has on program designmers.
Students complete a short research report on their sorting algorithm research procedure, results, and analysis of the results.
The teacher may decide to have the students choose how they want to organize the empirical analysis effort. Alternatively, scaffolding with a worksheet or checklist could be used to guide the students through the data collection and analysis tasks.
The following "Checks for Understanding" could be used to guide the students towards the three learning objectives:
Objective: SWBAT identify families of correct algorithms that have different efficiencies in their problem solving approach.
Objective: SWBAT demonstrate logical reasoning and metrics is used to describe an algorithm’s efficiency.
Objective: SWBAT to perform empirical analysis of sorting algorithms by running the algorithms on different inputs.
Students will complete a short research report on their sorting algorithm research procedure, results, and analysis of the results.
Unit 5. Data Manipulation
Revision Date: Jun 11, 2020 (Version 3.0)Summary: Students are introduced to the theory of computation, computability, the halting problem, and advanced algorithms. In particular, they will learn about heuristic search used by artificial intelligence (AI) programs to play games.
Objective:
Students will be able to:
Overview:
Session 1
Session 2
Student computer usage for this lesson is: required
Links to videos and online tools as indicated in the lesson plan.
Alternative instruction could include the Towers of Hanoi problem and discuss the algorithm for solving it. Some demonstrations are available here:
Think-Pair-Share: In pairs, think about and try to answer each of the following questions:
Note: just give them a few minutes to try the factoring, but round them up to continue and discuss: which operations were much harder to perform than their inverse? Can you just invert the steps, and why or why not?
Make a connection to the previous lesson by comparing these to sorting algorithms, where some are speedy and efficient like Merge sort and Quick sort, and others are unusably slow, like Bubble sort. Highlight the difference that different problems have different lower bounds on optimal solutions, and that some problems like integer factorization have solutions but take too long to be solved in a practical way.
Discuss the definition of computation (in a theoretical sense) with your students. Computation is input plus processing to get output. A computer is one system that is a "model of computation" since it takes input, processes it, and produces output.
Another model of computation is called a Turing machine, named after Alan Turing (one of the most famous computer scientists). A Turing machine is a theoretical entity that has a tape of symbols (a line of 0s and 1s), a head that can read only one symbol at a time, and an internal state that can change based on instructions as the head reads symbols. Turing and a mathematician called Alonzo Church are responsible for the "Church-Turing" thesis, which says that a Turing machine can compute anything that a digital computer can. This is a fundamental idea of the theory of computation, and has the implication that anything one computer is capable of doing is possible to be computed by another, given enough resources (time and memory).
Parallel computing is a computational model where the program is broken into multiple smaller sequential computing operations, some of which are performed simultaneously. Distributed computing is a computational model in which multiple devices are used to run a program. Comparing efficiency of solutions can be done by comparing the time it takes them to perform the same task.
Now discuss the idea of computability with your students. Ask your students to answer or think-pair-share: are there things it is impossible for a computer to compute? A decision problem that can be solved by an algorithm that halts on all inputs in a finite number of steps is decidable. The most classic "undecidable" (non-computable) question is called the Halting Problem. The Halting Problem is: make a program that can tell if any other program will halt (terminate at some point eventually) or will loop forever and never end. This can be done for specific algorithms (instances of the Halting Problem) but not for the general problem regarding all possible algorithms.
The Halting Problem is impossible for a computer to compute, which you can prove (informally) by paradox. Suppose you did have a program that solved the Halting Problem, called HALT(X), which takes the code for some program X as input and says "yes" if X terminates or "no" if X loops forever. Then you could write a new program that uses HALT inside it, which we will call PARADOX(X). First PARADOX(X) will run HALT(X) and if the result is no, PARADOX will halt, but if the result is yes, then PARADOX will loop forever. But here is the problem: what if we use the code for PARADOX as the input to PARADOX, running PARADOX(PARADOX)? If it says that PARADOX halts, then PARADOX runs forever, and if it says PARADOX runs forever, then PARADOX halts. This problem is a paradox and does not make sense because the premise, that a program called HALT could exist, must be wrong! Therefore, the Halting Problem is impossible for a computer to solve.
Video explanation with optional student simulation
Think-Pair-Share:
This session concerns advanced algorithms, in particular heuristic search, which is commonly used in artificial intelligence. Refresh your students' minds on the definitions of computation, computability, and undecidable problems. Additionally, mention the properties we consider when we compare algorithms:
Introduce the idea of heuristic search, which is a class of algorithms used in many artificial intelligence programs. A heuristic is something that is used to find a good solution in a reasonable time, and a heuristic search algorithm is an algorithm that uses heuristics to determine how to search through some space.
A great way to introduce heuristic search is first to discuss game trees. A game tree is a structure that is used to represent the "space" of a game that an algorithm wants to search through.
Think of a game like chess: you make a move, the opponent makes a move, and the process continues until the ending conditions have been met (one player in checkmate or stalemate). A game tree is a mathematical structure used by AI and heuristic search algorithms to model the moves made in a chess game. At any turn, we can make a "tree" by drawing the root node as representing the current state of the board and drawing one branch under it for every possible move. In Tic-Tac-Toe, if you are the starting player, then the root node represents a blank board, and there will be nine branches, one for each possible move (each space where you could place your mark). Following a branch in the game tree takes you to a new node that represents the configuration of the game that results from having taken that move. In Tic-Tac-Toe, if I am the first player and place my X in the center space, I have "followed" that branch down the tree to a new node that represents the board with an X in the center space. The opponent then uses this node as the root of their game tree, and has a branch for each of their possible moves.
Think-Pair-Share: Have your students pair off and play a game of Tic-Tac-Toe and try to draw the game tree as they play it, drawing the nodes for each move they made and every potential branch from those nodes. Bring them back into discussion and ask them what if they had to draw out every node followed down every branch? Now ask them to imagine the game tree for chess, which has 20 possible moves on the first turn, 400 on the second, and many, many more as the game goes on. How can an artificially intelligent program learn to play chess when there are so many (too many) options? Chess actually has around 35100 nodes in its tree and 1040 legal states.
Heuristic search on game trees is one way AI programs are able to play games like chess. How good are computer game players?
Typically games modelled with game trees are 2-person games, players alternate moves, and they are zero-sum (meaning one player's loss is the other's gain). More complicated elements in such games may have include: hidden information (like other players' hands), chance (dice), or multiple players.
How does an AI program use heuristic search to play a game? Typically in these steps:
The key problems are:
For evaluation, some function is typically coded or learned over time.
Refer to the "Advanced Algorithms" slides in the lesson resources folder for examples of uninformed search. For an activity, you may want to create a game tree for Tic-Tac-Toe and have your students walk through how each of the following algorithms would operate over it.
Uninformed Search are algorithms that work without a heuristic, using no information about the likely "direction" of the goal node. Algorithms include:
For any games with variety and complexity, certainly for chess and even checkers, uninformed search is simply too slow because it is exhaustive. This problem is another example, like with sorting, where the efficiency of our solution matters a great deal. To get programs to play games, we need them to be efficient and intelligent about the number and quality of moves they consider.
Informed Search algorithms each follow some heuristic that uses information about the game to determine smart directions to explore. Examples include:
Advanced classes may wish to discuss local search algorithms, such as hill-climbing and genetic algorithms (in the "Advanced Algorithms" slides in the lesson folder).
Thinking about game trees again, we want to select the branch that takes us to a node with the maximum evaluated state. But there is a catch: the opponent gets to make moves, too. That is, every other branch in our game tree is the opponent's turn. How does the AI program account for the other player?
Perhaps most logically, the way AI programs do so is to assume the other player will play optimally. Just as the AI will take the branch that leads to the state with the greatest evaluation, it assumes the other player takes the branch leading to the state that will maximize their position. In other words, the AI searches through their game tree by following the branch with the maximum value on their turn, and following the branch with the minimum value on the opponent's turn. This algorithm is called minimax and is the basis of nearly all AI that play 2-person zero-sum games.
Questions in the AP Classroom Question Bank may be used for summative purposes.
Sixty of the 80 questions are restricted to teacher access. The remaining 20 questions are from public resources.
Questions are identified by their initial phrases.
A certain computer game is played between a human
Under which of the following conditions is it m...
Which of the following programs is most likely to
Which of the following statements is true?
For the Halting Problem proof, it is important that students can translate the solution that is on the video into a representation that makes (some) sense to them. Acting out the inputs and outputs of the set of machines is an approach worth trying.
The following "Checks for Understanding" could be used to guide the students towards the three learning objectives.
Objective: Students will identify some Advanced Algorithms that Exploit Inverse Operations Efficiency.
Objective: Students will identify some Advanced Algorithmic Techniques.
Objective: SWBAT discuss at least one example of a computing problems that is unsolvable
Students will be able to summarize -- in their own words or with simple models -- the proof of the Halting Problem.
Students will be able to identify the sensitivity of cryptography to the difficulty of factoring large numbers.
Unit 5. Data Manipulation
Revision Date: Jun 24, 2020 (Version 3.0)Summary
Students will define, design and implement a programming project: a miniature version of the Create Performance Task. They will create presentations and share with groups the projects they developed and how their project used abstractions.
Outcomes
Overview
Session 1:
Presentation (5 min) Students are introduced to the Create Task.
Activity (15 min) Students select a small programming project to model the Create Task.
Activity (10 min) Students identify an algorithm to use in their program and share within tabe groups.
Activity (10 min) Students identify an an abstraction to use in their program.
Wrap Up (5 min) Students share the algorithms and abstractions they will use with the class.
Session 2:
1. Journal (2 min) - What is your plan for today for the development of your project? What abstractions do you plan on using in your project?
2. Activity (43 min) - Students complete implementing their projects.
3. Journal (5 min) - Reflection. What abstractions did you use in your project?
Session 3:
1. Getting Started (5 min) - Students individually respond to three prompts about their projects.
2. Activity (20 min) - Students prepare one minute presentations of their projects.
3. Presentations (15 min) - Students present their project to table groups.
4. Wrap Up (5 min) - Students create exit slips with any questions about the Create Task.
Students working in pairs practice choosing a project and planning how to implement it in a fixed time frame.
Students have just two days to plan and implement a project that uses a user created function and makes use of a list or other data strucutre. Since this is a practice task, teachers may provide help with algorithms, functions, data abstraction or other programming concepts. Remind students that during the actual task teachers may not provide this kind of support so as much as possible studtns should rly on the collaborative partners for assistance when needed.Since an algorithm is a list of steps that comes to a conclusion, if students develop pseudocode for their projects they can refer to the pseudocode as their algorithm.
Students may receive most of the credit from an incomplete project if the project demonstrates the required components.
For this practice task, teachers may want to provide program stubs. Stubs could include suggested functions.
Present an overview of the Create Task.
Explain that students will have 12 hours to complete the Create Task later in the course and they will three 50-minute sessions for this practice. The actual Create Task will have a suggested collaborative component and be larger in scope.
Discuss the following guidelines for the full project and the practice project we will be doing.
Three components to create:
General:
One project - individual with collaboration in stages
12 hours of classroom time
Project must use functional and data abstraction.
Report: Written responses (response to all prompts combined must not exceed 750 words, exclusive of the Program Code.):
a. Provide a written response or audio narration in your video that: Identifies the programming language and identifies the purpose of your program.
b. Describe the incremental and iterative development process of your program
c. Describe how a selected algorithm functions.
d. Explain how an abstraction you developed helped manage complexity
For this practice task, students will complete simpler project and a one-minute presentation about it, rather than a video and a report.
Students work individually to select projects.
After completing the project, students will create a one-minute presentation about it. Presentation should address the following.
a. Identify the programming language and the purpose of your program.
b. Describe the incremental and iterative development process of your program
c. Describe how a selected algorithm functions.
d. Explain how an abstraction you developed helped manage complexity
The presentation must address at least points a and b of the above and c or d.
Projects are chosen by the student. If they wish, their projects may be based on the following labs from How to Think Like a Computer Scientist.
Labs
Students select a project and share their ideas with partners.
After collaborating with partners, students submit to their teacher a brief description of the project describing its most important features and how it will work.
Students identify an algorithm and an abstraction to use in their projects. The algorithm should be written as pseudocode and then shared with their partners.
Students should discuss in groups what abstraction they chose and how they think it would be helpful.
Students complete a brief journal entry describing:
Students work to implement and test projects. Teachers may evaluate student performance based on student journal entries and their observations of their effort in implementing the project.
Students reflect on their project and making journal entry of how they used abstraction in the project.
Students begin by individually responding to these prompts about their project:
b. describe the purpose, how your program code works and the most important features and algorithms
d. describe the development process
e. explain an abstraction and how it helped manage complexity
Students prepare one-minute presentation about their projects including their responses to prompts b, d and e.
Students present their project to table groups. Time the presentations so that they do not exceed 1 minute. Students share with table groups what they like about the project, what they learned and any questions they have.
Students create exit slips with any questions they have about the Create Task after viewing and discussing the presentations.
For the practice task, project descriptions and pseudocode for each proposed project should be assessed. Assessment can be done by collaborative partners first. If partners have concerns, they should be brought to the teacher. If student projects are too big or too small in scope, teachers should provide feedback.
The project should be scored using the latest rubric provided by the College Board.
The latest rubric (updated as of June 2016) is in the lesson folder.
Unit 5. Data Manipulation
Revision Date: Jan 12, 2020 (Version 3.0)Summary
Students collaboratively define, design and implement a programming project: a miniature version of the Create Performance Task. They create and share presentations and share with groups (of about six students).
Students present. the project goals, the development process they used, functional and dta abstractions they considered and used.
Outcomes
Overview
Session 1:
Sessions 2 and 3:
Session 4:
Students working in pairs practice choosing a project and planning how to implement it in a fixed time frame.
Students have just two days to plan and implement a project that uses a user created function and makes use of a list or other data structure. Since this is a practice task, teachers may provide help with algorithms, functions, data abstraction or other programming concepts. Remind students that during the actual task teachers may not provide this kind of support so as much as possible students should rely on the collaborative partners for assistance when needed.
Students may receive most or all of the credit from an incomplete project if the project demonstrates the required components.
For this practice task, teachers may want to provide program stubs. Stubs could include a suggested function and data abstraction. Functional abstraction should include a parameter that is used to make a selection in the procedure.
Briefly present an overview of the Create Performance Task. Explain that students will have 12 hours to complete the Create Task later in the course and they will four sessions for the practice version we are beginning today. Explain that the Full Create Performance Task Guidelines are provided as a resource and a guide for students however students are to complete the guidelines for the practice task. Requirementst from the full task that we are not doing are struck though in the lis below. For instance, in the practice Create Task we will not be producing a video or writing responses about the video.
General Requirements
You will be provided with a minimum of 12 hours of class time to complete and submit the following:
Submission Requirements
Your program must demonstrate:
Include comments or acknowledgments for any part of the submitted program code that has been written by someone other than you and/or your collaborative partner(s) including the origin of the code. The acknowledgement should include the origin or original author’s name.
Create a PDF file that contains all of your program code (including comments).
Your video must demonstrate your program running, including:
Your video:
Collaboration is not allowed during the development of your video. Your video must not contain any distinguishing information about yourself. Your video must not be narrated, but text captions are encouraged.
Submit one PDF file that includes your responses to each prompt below. Clearly label your responses 3a–3d in order. Your response to all prompts combined must not exceed 750 words, exclusive of the program code. Collaboration is not allowed when answering the written responses.
3a. Provide a written response that:
3b. Capture and paste two program code segments you developed during the administration of this task which contain a list (or other collection type) being used in your program. The first program code segment must show how data has been stored in the list1. The second program code segment must show the data in the same list being processed, such as creating new data from the existing data. Then, provide a written response that:
3c. Capture and paste a procedure from your program that you developed during the administration of this task which implements an algorithm used in your program. This procedure must:
Then, provide a written response that:
3d. Provide a written response that:
For this practice task, students will complete simpler project and a two to three minute presentation about it, rather than a video and a report. Students work in partners to select and develop projects.
After completing the project, students will create a presentation about it. The presentation should address:.
Projects are chosen by the students. If they wish, projects may be based on the following labs from How to Think Like a Computer Scientist. Before selecting a project students should consider how they might use a data structure (list) in their project.
How to Think Like a Computer Scientist Labs
Students choose and plan a project with partners and complete the project development table.
Project Development Plan |
Team Members: |
Project Name |
|
Project Goals |
|
Key algorithm Describe a selection the algorithm makes and describe how the algorithm uses iteration. |
|
Functional abstraction Describe at least two different tasks the function may perform. |
|
Data abstraction Describe the values that will be stored and how they will be used by the program. |
Students submit the Project Development Plan.
Students reflect on their project and making journal entry of goals for tomorrow.
Students complete a brief journal entry planning their team and individual work for today.
Students work to implement and test projects. Teachers may evaluate student performance based on student journal entries and their observations of student effort in implementing the project. In the Create Performance task, students should direct their questions with their partners and or consult their class notes and examples for help. Teachers may only help resolve technical issues (hardware or software) or provide clarification of the project requirements. In this practice task, students may receive limited help in developing the project.
Closing (2 min)
Students submit the key algorithm code developed so far.
Students make a journal entry about the progress they made and their goals for tomorrow.
Each student prepares a presentation. Partners may collaborate in the report presentation but each partner must prepare their own report.
Getting Started:
Explain the presentation requirements.
Format: A two to three minute presentation with partners taking turns in the presentation,
Required Contents:
Partner Names
Purpose
Data Abstraction
Function in the project
Code showing creation and use.
Functional Abstraction
Function in the project
Code showing definition and calls
Parameter it uses and alternative paths through the procedure
Key Algorithm
Purpose of the algorithm
Code and how the algorithm works (pseudocode can be used)
Use of selection and iteration
Students present their project to table groups. Time the presentations so that they do not exceed 3 minutes. Students discuss with table groups what they like about the project, what they learned and any questions or comments they have.
Closing (2 min)
Students submit their presentations and program code. Students create exit slips with any questions or comments they have about the Create Task.
For the practice task, if student projects are too big or too small in scope, teachers should provide guidance.
For the practice task, project descriptions and pseudocode/algorithm description for each proposed project should be assessed. Assessment can be done by collaborative partners first.
If partners have concerns, they should be brought to the teacher.
The project should be assessed using the latest rubric provided by the College Board.
The latest rubric (updated as of November 2018) is in the lesson folder. The practice project does not ask students to create a video so row 1 should net be used. The assessment can be the basis of a summative grade using the suggested scale below.
Complete presentation submitted 25%
Code with abstractions submitted 25%
Rubric Points (5) 5 * number of rubric points up to 50%
Unit 6. Data Visualization
Revision Date: Sep 08, 2019 (Version 3.0)Summary
EarSketch teaches computer science through music composition and remixing. No prior knowledge of either computer science or music is needed. Students can express their own unique style. EarSketch also lends itself well to student collaboration as well as a discussion on proprietary ownership.
EarSketch is a web-based application, so there is no software to install. You need a current version of Chrome, Safari, Firefox, or Edge running on Mac, Windows, Linux, a ChromeBook, or a tablet with an attached keyboard. You also need headphones or speakers.
EarSketch consists of two components:
Students create an account to get Cloud storage for their files.
Outcomes
Optionally from Section 3.
Overview
The Lesson is divided into three sections.
Section 1 Getting Started with EarSketch is anticipated to take about 5-6 sessions.
Section 2 is anticipated to take about 5 sessions to complete these EarSketch units.
Section 3 is optional and is anticipated to also take about 5-6 sessions to complete these Earsketch units.
Each session will have the following elements.
Sources
EarSketch curriculum is available at https://earsketch.gatech.edu/earsketch2/#. The EarSketch curriculum and teaching materials are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) license.
Student computer usage for this lesson is: required
Students will need earbuds or headphones for these lessons.
EarSketch consists of three components:
The software toolset component includes the EarSketch code editor and digital audio workstation environment to write code and make music. It runs inside a web browser with the latest versions of Chrome, FireFox, or Safari. Internet Explorer is not supported and the digital audio workstation will not load. You must use a browser that supports Web Audio. (Internet Explorer 12 plans to include support for Web Audio.)
Teachers should review the first two modules of the student curriculum to learn the components of EarSketch: Unit 1 (Getting Started) and Unit 2 (Effects and Beats).
Next, teachers should access the teacher curriculum, which is designed to help computer science teachers with little or no music knowledge begin teaching EarSketch in their classrooms. It presents music concepts, rhythms, pattern and variety, and effects as they relate to music programming in EarSketch.
Finally, teachers should complete the student curriculum to get an idea of what students will be learning and doing.
Journal Prompt: What are possible advantages there are to creating and mixing music on a computer?
Responses should be collected from each student and used to create a word cloud. Project the following four benefits to programming music and ask, "Are any of these missing?"
Students should select one of these four points and record throughts and observations as to their meanings.
Direct students to Unit 1: Getting Started with EarSketch (http://earsketch.gatech.edu/uncategorized/unit-1).
Within the first unit, they should explore the section 1.1. Introduction to the DAW (Digital Audio Workstations) (http://earsketch.gatech.edu/uncategorized/unit-1#chap11). Students should research the following definitions and procedures, then share them with a partner.
1. Especially important is the process of creating, opening, running, editing, and saving EarSketch python scripts both on the EarSketch cloud as well as in the classroom. Once students have completed this task, demonstrate the following sections for them:
1.8 Sections of an EarSketch Script
2 All programs process data, even those being developed for personal expression. Demonstrate interactively the use of Python variables to store and retrieve data and to express values. Review the concept of abstraction from previous units in the course (Lessons 2-1, 3-1, 4-7) and have students identify at least one detail that is hidden by each of data representation they review.
Wrap Up (5 min)
It is important that students know how to use the curriculum and the online development environment. Students should reflect on the process of creating, saving and retieving program in EarSketch.
Assignment 1.1
This assignment can be found within the curriculum resources at Unit 6 > Lesson 1 > EarSketch Units > Unit 1.
Journal: Students should open their Assigment 1.1 (homework from the previous section) and discuss what they learned while completing it with their elbow partners. They should record in their journals two observations made either in the previous session or during the completion of the assignment. Any questions remaining after these discussions should be shared by students.
Beats, Effects and Tempo
Program Design and Functions
Students work in pairs through the 8 sections below and add any questions they have to those posted during the getting started session.
Effects in EarSketch: setEffect
Identify and responding to questions students have shared. Use other studetns as a resource to answer as many questions as possible.
Distribute and assign Assignment 2.2.
Collect: Assignments 1.1 and 2.2
Journal: Students should discuss with their elbow partners the first two assignments, reflecting on the lessons learned and identifying any questions that are lingering. Unresolved questions should be posted on the board.
Some time should be used to respond to questions students posted at the beginning of the session. If questions are regarding upcoming material answer these during the next activity.
Students should work together to complete a project for units 1 through 3. This project can be found under Unit 6 Resources > Lesson 01 - Earsketch > Projects > Project Unit 1-3_1.docx. The final product should be one working program per group.
Students should get into pairs and complete Quiz 3.1. Collect an exit slip from students of any questions they need help with. Collect the quiz.
Students should complete Assignment 3.1 for the next session.
Journal: Students should discuss with elbow partners the lessons they learned from session 3 (including the assignment and quiz). Any unresolved questions should be posted to the board.
Before continuing, any questions regarding last session's formative quiz or assignment 3.1 should be answered.
Students again work in pairs to review Program Design and Functions using the following elements in the EarSketch curriculum.
Effects in EarSketch: setEffect
4.1 Using Effects in EarSketch
Students should reflect on how they benefited from cooperating with one another as partners and how they might beneifit from collaboration on the next project.
Students should prepare for the section 1 exam using the assignments, quizzes and EarSketch units 1-3 as resources.
Students should upload their collaborative projects from session 4, including the .wav output of the music they created.
Students will take the section 1 test (units 1-3). The test to be administered can be found at the following location: Unit 6 Resources > Lesson 01 - Earsketch > Section Tests > Unit 1-3 Test.docx.
Time permitting, discuss the current music sharing sight and the ethical issues surrounding public sites. If students require more time to complete their collaborative projects, some could be given here as well.
Going foward, host a version of March Musical Madness. Hold a single elimination tournament to select the class musical section 1 champion. If going on to sections two and three, consider doing just one round of the contest. Each week allow pairs to enter their best product either from something newly created or modified.
Students should brainstorm lessons learned from the first section. They will be working in pairs throughout this entire section so this is a good time to also discuss standards for collaboration and cooperation. Partners/ work groups should be specified here. Notes gathered during this section, along with the EarSketch API documentation, will be allowed for the section 2 exam.
Student work in pairs through the Reusing Code sections below and post any questions they have.
9.6 Automating Effects with Loops
Using students as a resource whenever possible, answer any questions students have identified.
Working in pairs, students should complete Quiz 4. This quiz can be found under resources at the following location: Unit 6 Resources > Lesson 01 - EarSketch > EarSketch Units > Unit 4.
Optional - Time permitting have stuend seletc a project and collaborate in its development.
With partner/work group, select an assignments from the following list (these assignments can be found under the following: Unit 6 Resources > Lesson 01 - EarSketch > EarSketch Units > Unit 4).
Assignment 4.1
Assignment 4.2
Assignment 4.3
Assignment 4.4
Assignment 4.5
Assess student progress from the previous session. Student working groups should identify questions or concerns. It is crucial that major concerns are addressed as soon as possible.
12.2 Beat Patterns with Strings
Using students as a resource whenever possible, answer any questions students have identified.
Working in pairs, students should complete Quiz 5.1. This quiz can be found under resources at the following location: Unit 6 Resources > Lesson 01 - EarSketch > EarSketch Units > Unit 5.
Select and assign one of the following to assignments (these assignments can be found under the following: Unit 6 Resources > Lesson 01 - EarSketch > EarSketch Units > Unit 5):
Assignment 5.1
Assignment 5.2
Assess student progress from the previous session. Student working groups should identify questions or concerns, making sure to share all concerns pertaining covered material before the following session.
Students should work together to complete a project for units 1 through 3. This project can be found under Unit 6 Resources > Lesson 01 - Earsketch > Projects > Project Unit 4-6_1.docx. The final product should be one working program per group.
Time permitting students shoul work individually on assignment 6.1. This assignment can be found within the curriculum resources at Unit 6 Resources > Lesson 01 - EarSketch > EarSketch Units > Unit 6.
Students should identify questions or concerns and share those that they think are most important, supplementing their notes with important comments.
Working in pairs, students should complete Quiz 6.1. This quiz can be found under resources at the following location: Unit 6 Resources > Lesson 01 - EarSketch > EarSketch Units > Unit 6.
Assess student progress from the previous session. Student working groups should identify questions or concerns, making sure to share all concerns pertaining covered material before the following session.
Have your students select and complete (in pairs) one of the following two projects. These projects can be found under Unit 6 Resources > Lesson 01 - EarSketch > Projects:
Project Unit 4-6_1.docx
Project Unit 4-6_2.docx
Students should consolidate their notes and prepare for the section 2 exam next session. REMINDER: It is an open note exam.
Journal: Have students reflect on the ethical concerns raised by digital media innovations such as EarSketch. In their journals, they should write down a specific ethical issue associated with the use of EarSketch. They should also point out one additional piece of online technology that raises digital media related ethical concerns.
Distribute and administer the section 2 exam. This exam can be found at the following location: Unit 6 Resources > Lesson 01 - EarSketch > Section Tests > Unit 4-6 Test.docx.
Host a version of March Musical Madness. Hold a single elimination tournament to select the class musical section 2 champion. If going on to section three, consider doing just one round of the contest. Each week allow pairs to enter their best product. It can be derived from the in-class work or be a completely new, out-of-class creation.
Section 3 is optional and is anticipated to also take about 5 sessions to complete these EarSketch units. Students should be working very independently during this unit in prepartion for the Create Task.
11 EarSketch Unit 7: Teaching Computers [1 session]
12 EarSketch Unit 9: Recursion [1 session]
13 Project 3 [2 sessions]
14 Summative Assessment
Session 11:
Getting Started
Guided Activities
Formative Assessment
Assignment:
Wrap Up:
In pairs. then study groups students identify questions or concerns and share those they think are most important and supplement their notes with important comments.
Session 12:
Getting Started
Assess student progress from Session 11. Groups identify questions or concerns and share any items of concern before day 2 of this section.
Guided Activities
Formative Assessment
Assignment:
Wrap Up:
In pairs. then study groups students identify questions or concerns and share those they think are most important and supplement their notes with important comments.
Session 13 and 14:
Getting Started
Assess student progress from Session 12. Groups identify questions or concerns and share any items of concern before days 3 and 4 of this section.
Guided Activities
Assignment:
Prepare for Section 3 exam.
Wrap Up:
In pairs. then study groups students identify questions or concerns and share those they think are most important and supplement their notes with important comments.
Session 15:
Guided Activities
Wrap Up:
Host a version of March Musical Madness. Hold a single elimination tournament to select the class musical Section 2 champion. If going on to three consider doing just one round of the contest. Each week allow pairs to enter their best product either from somethnnewly created or modified.
Assignment:
None
Section 1:
Quiz 1.4-1, 1.4.2, 2.1-1, 2.1.2, 3.1, 3,2 and 3.3
Section 1:
Quiz 4, 5.1 and 6.1
Section 1:
Quiz 7.1 and 9.1
Section 1:
Project Unit 1-3_1 and Unit 1-3 Test
Section 2:
Project Unit 4-6_1 and Unit 4-6 Test
Section 3:
Project Unit 7-9_1 and Unit 7-9 Test
Unit 6. Data Visualization
Revision Date: Jan 05, 2020 (Version 3.0)Use EarSketch to review the programming topics learned this year and as a final preparation for the Create Performance Task.
Sessions 1 - 6 are required.
Sessions 7 - 10 can be used as a final practice for the Create Performance Task.
Lesson Overview
Say: We will be using EarSketch to review the programming topics we learned this year and as a final preparation for before the Create Performance Task. EarSketch is intended as a tool to teach novice programmers and we are no longer novices.
Activity 1
Explore the EarSketch DAW, IDE, Curriculum, API and Sound Library
EarSketch Teacher Presentation - Lesson 1
Legal and Ethical Issues
Read Unit 1 Lesson 7.
Is it right for people to own the products of their own labor?
Who owns the music you make in EarSketch?
Why would someone give away their rights as an owner?
What provision of law protects the ownership rights of music and software creators?
Activity 2
First MiniTask Assignment - Same Folder
Make a 4 measure piece of music that has 3 sounds. All three sounds should come from the same artist and genre in the sound browser. Use the constants from the sound browser as parameters for your fitMedia() function calls.
Wrap-up: (4 min )
Use the EarSketch API to find the description of these two functions:
Getting Started
Unit 1 Summary (5 min)
Jigsaw the 8 sections of the Unit 1 Summary in EarSketch. Have each group discuss - 1 min- and then share their section in their own words. Each presentation has a 30 second time limit.
Introduction
Say: you have used plenty of functions. However, in EarSketch you aren’t limited to using the functions within the EarSketch API, like fitMedia() and setEffect(). You can make new functions to do anything you want. These custom functions allow you to group together lines of code to form a single instruction for the computer. This process is known as abstraction.
This session focuses on making music using sequence and iteration, and coding large-scale changes in music efficiently. Several measures that express an idea or feeling make up a song section. Songs that contain multiple sections allow for variety and structure, or form. Intros, Verses, Choruses, and Outros are examples of sections that contribute to form.
Edit the script in section 9.2: A-B-A Form.
Say: The code is somewhat messy, and a little confusing. Code is also repeated for the second sectionA, an indication that the program could be written more efficiently. We will improve this code using a custom function.
Consider the following code. Note the definition of the function myFunction and the call of myFunction. We will define and call custom functions to improve the A-B-A form example.
Say: Move Section A code into two functions named sectionA and SectionB. Use parameter startMeasure and endMeasure for each function. Delete the second sectionA code. Call the functions using the arguments in the code snippet below. Note that sectionA is used twice but only written once. Reuse of code is one of the advantages of procedural abstraction.
# Setting up an ABA musical form through function calls
sectionA(1, 5)
sectionB(5, 9)
sectionA(9, 13)
Examine the A-B-A-B form WITHOUT functions and compare it to the A-B-A-B Form WITH functions.
Think pair share: What benefit in addition to code reuse are functions to program development?
These examples have used sequential statements and functions. Next we will use looping but first we need to examine the EarSketch function makeBeat. Watch the first three minutes of this video about makeBeat.
Edit the Multi Beat script in EarSketch lesson 11.3. Run and play the music. Modify the beat strings beat 1 and beat2. Run and play the revised beats.
Remind students about use of the makebeat() function.
Say:
Edit the MultBeat script in Lesson 12.2. Create two additional beat string variables and a second for loop. The second for loop is to use the two new beat strings for tracks 1 and 2 but measures 5 - 8.
Compare the Drum beat (no loops) code in Lesson 12.3 to the Drum beat (with loops) code.
Think-pair-share: Discuss with your elbow partner at least two benefits of using looping to program development.
Say: In this session, we’re going to first review how colors are represented by the computer, then show ways you can create visuals that react to the music you have been composing.
Journal: How would you explain to an elementary school student how pictures are stored on a cell phone?
Activity 1 (15 min)
Say: Visualizations can be created from any data such as music. After these tutorials you will be able to make visuals like the one shown below:
https://earsketch.gatech.edu/earsketch2/videoMedia/028-01-InitialSteps-PY-JS.mp4
Discussion: Which do you think has more impact on the ability to create something of value using data: the capabilities of the user, or the capabilities of the tool they use?
Say: We’ll start by making a basic animation (shown below), that will help us learn the skills to make more complex visuals later on.
https://earsketch.gatech.edu/earsketch2/videoMedia/026-01-RGBColorandHexNotation-PY-JS.mp4
Say: To make computer visuals we need to first learn three concepts. Firstly, how computers understand colors. Then we’ll at how computers understand a position in a visual. Finally we’ll look at how we draw into these colors and positions.
You may already know colors can be created by putting different colors together. This can happen with paint when you combine two colors, such as red and blue to make purple. Computers think of all colors by how much of red, green and blue makes up the color. This is then stored as an RGB (red, green, blue) value. RGB values are between 0 (not used at all) to 255 (full intensity). RGB values do not always have the same results as you might think from using paint, so you may want to check the table below.
RGB Combination |
Name of Color |
Color |
255, 255, 255 |
White |
|
0, 0, 0 |
Black |
|
127, 127, 127 |
Grey |
|
255, 0, 0 |
Red |
|
0, 255, 0 |
Green |
|
0, 0, 255 |
Blue |
|
255, 0, 255 |
Magenta |
|
255, 255, 0 |
Yellow |
|
0, 255, 255 |
Cyan |
The values for yellow can be the hardest to guess. To help choose colors EarSketch has a color picker tool. This lets you choose a color and then gives you the hex value underneath the color. Try moving the slider to see the values change.
Find the hex number for your favorite color.
A hex value is the way the computer represents the numbers, in this case the three RGB values. Hex notation is created by counting differently. Instead of going 0-9, we instead count 0-F, meaning in each space we can represent more numbers. The table below shows some examples.
Hex |
Decimal |
7 |
7 |
A |
10 (A is one greater than 9) |
C |
12 (Counting in hex: 9, A, B, C) |
2D |
45 (2D is equal to 2*16, plus 13) |
F1 |
241 (F1 is equal to 15*16, plus 1) |
The last shows why hex notation is so useful for colors. We can use two digits to show a value that normally takes three digits (in decimal). Below are some more color examples.
Color |
Hex |
Decimal (x3) |
White |
"#FFFFFF" |
255, 255, 255 |
Red |
"#FF0000" |
255, 0, 0 |
Grey |
"#A0A0A0" |
160, 160, 160 |
Yellow |
"#FFFF00" |
255, 255, 0 |
Say: In EarSketch, you can find color number values with the color picker. EarSketch also includes rgbToHex() which changes three numbers to its hex value so your program can define colors.
For the next section we will need some music in our project to generate visuals. If you have a song prepared already, load it up. If not, use this one or quickly make your own:
from earsketch import *
init()
setTempo(120)
fitMedia(EIGHT_BIT_ANALOG_DRUM_LOOP_001,1,1,3)
fitMedia(EIGHT_BIT_ATARI_LEAD_005,2,1,3)
fitMedia(EIGHT_BIT_ATARI_LEAD_008,3,1,3)
fitMedia(EIGHT_BIT_ATARI_LEAD_005,2,3,5)
fitMedia(EIGHT_BIT_ATARI_LEAD_008,3,3,5)
finish()
Near the end of this script (just before finish()), we’re going to add a call to a new function: drawRectangle(). It takes five arguments: x location, y location, width, height, and color.
As you may remember, a function allows us to abstract a more complex process into a single line of code. This is what drawRectangle() does: it takes the information for where and how to draw the shape we want and--"under the hood"--it does the more complex work of actually changing the canvas.
In order to use drawRectangle() to draw, we also need to call it from inside a special function for visualization in EarSketch called onLoop(). onLoop() is a special function that must be included in all EarSketch scripts that use visualization. We’ll learn more about how it works in the next unit.
For now, add the following above finish():
from earsketch import *
init()
setTempo(120)
fitMedia(EIGHT_BIT_ANALOG_DRUM_LOOP_001,1,1,3)
fitMedia(EIGHT_BIT_ATARI_LEAD_005,2,1,3)
fitMedia(EIGHT_BIT_ATARI_LEAD_008,3,1,3)
fitMedia(EIGHT_BIT_ATARI_LEAD_005,2,3,5)
fitMedia(EIGHT_BIT_ATARI_LEAD_008,3,3,5)
def onLoop():
drawRectangle(10,15,50,30,"#FF0000")
finish()
Run the program.
Say: When you hit play, you should see a red rectangle appear near the top-left corner of your canvas. It’s near (but not quite touching) that corner because the x- and y-coordinates we gave it (as the first two arguments) are 10 and 15, respectively.
The x-coordinate represents the shape’s horizontal (left-right) position (in pixels), with greater values corresponding to further locations to the right. The y-coordinate represents the shape’s vertical (up-down) position (in pixels), with greater values corresponding to further locations down.
In other words, x- and y-coordinates increase as you go down and to the right, and 0,0 represents the top-left corner.
Assign the following modifications and predict how the visualization will appear then run your program..
Say:
Let’s now make a major change to our code. Copy the following code sample from EarSketch lesson 26.3. Your code should now look like the code below.
from earsketch import *
init()
setTempo(120)
fitMedia(EIGHT_BIT_ANALOG_DRUM_LOOP_001,1,1,3)
fitMedia(EIGHT_BIT_ATARI_LEAD_005,2,1,3)
fitMedia(EIGHT_BIT_ATARI_LEAD_008,3,1,3)
fitMedia(EIGHT_BIT_ATARI_LEAD_005,2,3,5)
fitMedia(EIGHT_BIT_ATARI_LEAD_008,3,3,5)
def onLoop():
pass #empty function for now
def onMeasure():
drawRectangle(0,0,getCanvasWidth(),getCanvasHeight(),rgbToHex(255,0,0))
finish()
Students run the program.
Ask:
Say: The drawRectangle() call is now inside the onMeasure() function, which is called by EarSketch when your song is playing. It is called automatically at the very beginning of each measure. Press play to see the rectangle appear. Note that this is somewhat different from the behavior of EarSketch that you’ve experienced before using visualization: earlier, all of your code ran when you clicked Run. Now, with functions like onMeasure(), you can write code that executes repeatedly as your song is playing.
While your song is playing with this particular definition of onMeasure(), a new rectangle is actually being re-drawn every measure. However, because it’s being drawn in the same position with the same size and color, there is no change for us to see.
Say: We’ll now adjust our definition of onMeasure() to have a visible change on every measure, in rhythm with the music. In other words, we’re going to create our first animation. and we’re going to do this in EarSketch by using a variable as an argument for our drawRectangle() call. We’ll then change that variable’s value over time so that the information used by drawRectangle() changes and gives us different results.
Assign the following modifications. The revised code should look like the following script. Changes are in bold.
def onLoop():
pass #empty function for now
r = 255
def onMeasure():
global r
drawRectangle(0,0,getCanvasWidth(),getCanvasHeight(),rgbToHex(r,0,0))
finish()
Say:If you ran and played this code, you would see the same result as before because we didn’t change the value of r yet. Let’s make that happen by subtracting 50 from r every measure.
Assign the following modifications to the onMeasure function. Changes are in bold.
def onMeasure():
global r
drawRectangle(0,0,getCanvasWidth(),getCanvasHeight(),rgbToHex(r,0,0))
r = r-50
if (r < 0):
r = 255
Run and play your program.
Say: As your song plays, you should see the red rectangle getting darker on every new measure, until it resets to fully bright red (due to the if-statement in the code above that resets r to 255 if it drops below 0) and begins dimming again.
Add global variables g and b in start them at zero. Increase them each time the onMeasure function is called by 60 and have them reset to 0 whenever either are greater than 255.
Compare your finished code to the last script from EarSketch lesson 26.3.
Explain the purpose of the drawRectangle() and the onMeasure() functions.
Review this list of topics from the previous session. What would you append to the list that we also learned?
View this video showing an animation that changes as the amplitude of the sound changes.
Say: In the previous session, you learned about using onMeasure(), a function that you define which is then called regularly by EarSketch. There are other functions that you can define in a similar way. These are also called regularly, but even more often. Two examples are onHalf() and onQuarter(). onHalf() is called on the 1st and 3rd beat of every measure (at a rate of half notes) and onQuarter() is called on every beat (or at a rate of quarter notes).
Another example is onLoop(), which is called about 60 times per second. Because this is such a rapid rate, it was important for us to begin with the slower onMeasure() so that we could see how things change easily. We can now move on to using the faster onLoop() to create animations appear to move naturally.
Examine the first EarSketch script in lesson 27.1.
Say: We’ve defined onLoop(), which is called nearly 60 times per second. The first three lines of code store the value returned by getAmplitude(). As a song is playing, any getAmplitude() call will retrieve the amplitude (loudness between 0 and 1, 0 being silent) at the current time for the track number given as an argument. Calling getAmplitude() often will allow us to use data that is up-to-date to the fraction of a second.
Load and run the first script in EarSketch lesson 27.2
Say:
First, to give ourselves a fresh canvas each time onLoop() runs we draw a black rectangle that is the size of the entire canvas. By drawing a new, slightly different image on every call of onLoop(), we can create the illusion of fluid motion for whatever else we’re drawing. In this case, we’re drawing bars whose size increases along with the amplitude of their respective track.
We give each rectangle a different y-position, keeping this value relative to the height of the canvas; this allows us to resize the canvas and have our image scale with it correctly. The third argument for each of these drawRectangle() calls is where our data from getAmplitude() (amp values are between 0 and 1) from their corresponding tracks by the width of the canvas. This means that a louder moment from the track will result in a longer bar.
Finally, we give each bar a height relative to the height of the canvas and give each bar a distinct color. Below is a screenshot that also shows the arguments used for each shape (after the math has been done on values like amp1). Discuss with your elbow partner how you would change the code to accomblish each of the following.
Watch this video to see how we will update our animation. https://earsketch.gatech.edu/earsketch2/videoMedia/028-01-InitialSteps-PY-JS.mp4
Say: In order to draw the various circles to the canvas, we’re going to need to keep track of where they should be. To do this we’re going to create lists of x-coordinates and y-coordinates for each color of circle and define a function that will use these lists to set the locations of all of these circles. Examine the first EarSketch script in lesson 28.2.
After students load and preview the EarSketch script in lesson 28.2.
Say:
Lines 13 - 18 create empty lists.
LIne 20 initializes the global variable circlesPerColor as 5.
Lines 21 - 30 define the setCirclePositions() function. The function sets random values for the X and Y values of each circle, so that we get nicely unpredictable results. This means as we don’t have to manually enter all of these values. We do this by looping through the lists we set up earlier, assigning a random value to each element of each list.
To ensure that each circle is not drawn off-screen, we multiply each random value (which is between 0 and 1) by the width or height of the canvas (for the x and y values respectively).
Line 33 calls the setCirclePositions() function at the start of every measure.
Load and run the script in EarSketch lesson 28.3.
Assign the following modifications to the script in EarSketch lesson 28.3.
Student code should look like the following.
from math import *
from earsketch import *
from random import *
init()
setTempo(120)
fitMedia(EIGHT_BIT_ANALOG_DRUM_LOOP_001,1,1,3)
fitMedia(EIGHT_BIT_ATARI_LEAD_005,2,1,3)
fitMedia(EIGHT_BIT_ATARI_LEAD_008,3,1,3)
fitMedia(EIGHT_BIT_ATARI_LEAD_005,2,3,5)
fitMedia(EIGHT_BIT_ATARI_LEAD_008,3,3,5)
fitMedia(EIGHT_BIT_ANALOG_DRUM_LOOP_001,1,4,7)
fitMedia(EIGHT_BIT_ATARI_LEAD_005,2,5,7)
fitMedia(EIGHT_BIT_ATARI_LEAD_008,3,5,7)
fitMedia(EIGHT_BIT_ATARI_LEAD_005,2,7,9)
fitMedia(EIGHT_BIT_ATARI_LEAD_008,3,7,9)
rCircleXs = []
gCircleXs = []
bCircleXs = []
rCircleYs = []
gCircleYs = []
bCircleYs = []
circlesPerColor = 5
def setCirclePositions():
for i in range(0, circlesPerColor):
#set random x positions
rCircleXs.append(random()*getCanvasWidth())
gCircleXs.append(random()*getCanvasWidth())
bCircleXs.append(random()*getCanvasWidth())
#set random y positions
rCircleYs.append(random()*getCanvasWidth())
gCircleYs.append(random()*getCanvasWidth())
bCircleYs.append(random()*getCanvasWidth())
def onMeasure():
setCirclePositions()
def onLoop():
global rCircleXs, rCircleYs, gCircleXs, gCircleYs, bCircleXs, bCircleYs
amp1 = getSmoothAmplitude(1)
amp2 = getSmoothAmplitude(2)
amp3 = getSmoothAmplitude(3)
MAX_CIRCLE_SIZE = getCanvasHeight()
drawRectangle(0,0,getCanvasWidth(), getCanvasHeight(), "#000000")
for i in range(0, len(rCircleXs)):
drawCircle(rCircleXs[i], rCircleYs[i], MAX_CIRCLE_SIZE*amp1, rgbaToHex(255,0,0,28+floor(amp1*227)))
for i in range(0, len(gCircleXs)):
drawCircle(gCircleXs[i], gCircleYs[i], MAX_CIRCLE_SIZE*amp2, rgbaToHex(0,255,0,28+floor(amp2*227)))
for i in range(0, len(bCircleXs)):
drawCircle(bCircleXs[i], bCircleYs[i], MAX_CIRCLE_SIZE*amp3, rgbaToHex(0,0,255,28+floor(amp3*227)))
finish()
Run and play the code that’s been discussed so far, and take a look at the results. Because we used randomness, your canvas probably won’t look exactly like the one in the video, but it will be similar.
Say: Work with your elbow partner to choose and implement at least one of the following changes.
Think-pair-share: Consider doing this project without using the lists.
Say: Soon we will begin the Create Performance Task (Create Task). You do not have to use EarSketch for the Create Task - you may use any tools we have studied or others that you learned elsewhere. You do have to create a project that:
This session will focus on the piece of the Create Task that we have not reviewed so far - using selection and expressing algorithms using sequence, selection and iteration.
Say: Printing to the console allows information to be displayed to the user. Console Input is text-based data taken from the keyboard, giving a program access to information from the user. Together, printing and console input can be used to allow the user to interact with a program.
In EarSketch, the readInput() function is used for console input. This opens a dialog box asking for input and returns the string typed into the dialog box.
Examine the Simple Console Input script in EarSketch lesson 17.1.
Ask: How does the EarSketch readInput() function differ from the Python input statement?
Load and edit the Musical Console Input script at the end of EarSketch lesson 17.1.
Ask: What is the purpose of the int() function used on line 17?
To make decisions - selections - the computer needs to be able to make comparisons and draw logical conclusions. As a reminder these are the comparison and boolean operators used in Python.
Load the Conditionals script from EarSketch lesson 17.3.
Ask:
Examine the Which Comes First script for the end of EarSketch lesson 17.3.
Ask:
To review building algorithms and expressing them in pseudocode read The building blocks of algorithms.
Take the four question quiz comparing your results with your elbow partner’s.
Begin planning an earsketch program that:
This program will be for your own interest. You may do this individually or in collaboration with your elbow partner. You will have the rest of this session to plan the program and all of the next session to implement your plan.
Your plan should include the purpose of the project, identify the procedural and data abstractions you plan to use and include a pseudocode version of at least one algorithm that uses sequence selection and iteration.
Briefly describe your project and submit a copy of your plan either digitally or on paper.
Say: This session you will build the project you described in the previous sessions. You will have most of this session with the last few minutes dedicated to analyzing the progress and decisions you made.will focus on the piece of the Create Task that we have not reviewed so far - using selection and expressing algorithms using sequence, selection and iteration.
Answer these questions.
Discuss any answers or questions with your elbow partner.
The remaining sessions can be used as a final practice for the Create Performance Task.
Introduction
Say: This session we will begin a project we will design and build for others. The project must meet the same requirements we built for ourselves. It is to be collaborative - with an elbow partner or partners. - The project may or may not use EarSketch.
Watch this video about Human Centered Design.
Complete the project development plan.
Identify a project.
Discuss with your group:
People who might benefit from a project you develop.
Brainstorm possible projects.
Select a user or users and a project they would benefit from.
Getto know your users.
Describe who the users are(is) and what the user(s) like or need.
Describe how the user(s) behavior would change if they had your completed project.
Describe the features of your project that would make your project most useful.
Design your project.
Develop user experience goals that align with the desired features and behaviors.
Identify inputs or information your project will require.
Identify outputs the project will produce.
Define a prototype.
Watch this video about prototyping.
Describe a prototype version of your project that seems both something you could do and something you could learn form.
Develop you plan for your prototype.
Identify data structure(s) and function(s) you will use.
For each data structure list:
For each function list:
Identify key algorithm(s) you will implement.
For each algorithm:
Plan prototype development.
Schedule the work to be done.
What order will it be done?
Who will do what parts?
How will the parts be assembled?
When will the prototype testing begin?
Identify any help needed from the teacher.
Submit a copy of the Project Development Plan.
Say: This session is dedicated to the development of your project for others.
The project will be assessed using the latest rubric provided by the College Board. After you complete your project you will also complete a short written report - Project Summary - that includes the following:
Partner Names
Purpose
Data Abstraction
Function in the project
Code showing creation and use.
Explanation of how it helped manage complexity
Functional Abstraction
Function in the project
Code showing definition and calls
Parameter it uses and alternative paths through the procedure.
Explanation of how it helped manage complexity.
Key Algorithm
Purpose of the algorithm
Code and how the algorithm works (pseudocode can be used)
Use of selection and iteration
The latest rubric (updated as of November 2018) is in the lesson folder. The practice project does not ask students to create a video so row 1 should net be used. The assessment will be the basis of a summative grade using the suggested scale below.
Complete presentation submitted 25%
Code with abstractions submitted 25%
Rubric Points (5) 5 * number of rubric points up to 50%
Project Development
As a group, evaluate your progress during this session and identify what still needs to be done.
Say: When we do the Create Task you will have 12 hours of class time to design, develop and write a written report about a computer programming topic of you choice. I will not be giving further guidance during those 12 hours so its important to identify any questions that still need to be answered during ti sessions. We have four goals.
As a group, briefly meet and plan any remaining work needed to complete the prototype.
Complete the development of the prototype.
Session 3 ends with students creating their first EarSketch animation. This script should be formatively assessed as all future EArSketch work depends on the ability to use functions like onMeasure() to produce animations.
Session 4 ends with students implementing a change to a data visulization project they built as a class. Tihs project could be the basis of a formative evaluation - perhaps done wile students are developing their designs in the next sessions.
Session 5 ends with students making a plan for a project they will implement in the next session. This plan could be used for fromative assessement.
Session 6 Creating your own EarSketch script using input and visualization students implement a project to meet te design submitted yesterday. They also make jounal entries after they assess the process. Both the projet and the journal questions can be used for summative evaluation.
Unit 6. Data Visualization
Revision Date: Jan 04, 2020 (Version 3.0)Students learn how to create how to make their own data visualizations.
Student can express the usefulness of data visualization for identifying trends, making connections, and addressing problems.
Students will demonstrate how programs such as spreadsheets help efficiently organize and find trends in information.
Say: This session we will learn to use another data visualization tool named RawGraphs and begin planning a visualization you will make.
As stated on their website, RawGraphs was, “Primarily conceived as a tool for designers and vis geeks, RAW Graphs aims at providing a missing link between spreadsheet applications (e.g. Microsoft Excel, Apple Numbers, OpenRefine) and vector graphics editors (e.g. Adobe Illustrator, Inkscape, Sketch).”
Programs, such as spreadsheets, help efficiently organize and find trends in information.
ACM DL Author-ize serviceRAWGraphs: A Visualisation Platform to Create Open Outputs – PDF file in Green Open Access
Watch this video that introducesRawGraphs and answer the questions:
Visit the RawGraphs gallery and do an online gallery walk with your elbow partner. For at least three of the images complete the following table.
Title |
Visual Interest |
What is the purpose |
What is a question you have. |
Activity 2 (30 min)
Say: Let’s start learning how to make our own visualizations. Visit RawGraphs.io/learning.
Complete the first two video tutorials, How to make a barchart and How to make an alluvial diagram, and then a third you and your elbow partner choose to view.
Plan with your elbow partner a visualization you would like to create. Answer these questions:
Say: Today you will make your own visualization. The data you found to use could have come from a variety of sources including through surveys, user testing, interviews, direct observations or other means. No matter how appealing the visualization it can only be as reliable as the data it is based upon. We will be using an iterative process refining and revising based on your reflections throughout the process. Its okay if you need to make changes in your original plan as you work through the process.
Consider again your answers to these questions:
Part 1: Each student is to create their own visualizations however elbow partners should work together at first. In the first part of class build a prototype. Keep it simple.
Part 2: Discuss the next step with your elbow partner. Elbow partners can work in their own direction t this point. Either refining the prototype or building an entirely new visualization..
Each student is to create/refine their own visualization.
Say: Data and data visualization provide opportunities for:
Thinking back on the visualization gallery you explored in the past discuss with your elbow partner how data visualization can help with each of these three opportunities.
Student expression of the power of data visualization for identifying trends,
making connections, and addressing problems.
Students should explain the iteative nature of this project development and explain the role reflection played in that process.
Unit 6. Data Visualization
Revision Date: Jul 18, 2016 (Version 3.0)Summary
In this lesson, students will be formally introduced to data visualization using Bokeh: an interactive data visualization library in Python. They will go through a guided tour of how to use this library, and then will complete a fun activity that involves gathering data from their classmates for the purposes of visualization.
Outcomes
Students will learn why data visualization is important.
Students will be able to meaningfully visualize data they collect.
Overview
Session 1 (Line/Bar Graphs):
Session 2 (High-level charts):
Student computer usage for this lesson is: required
Come up with 4-5 questions that make sense when visualized with a line graph or bar graph, such as:
Enlist the help of your students in coming up with the questions. Present all questions at the start of this lesson, and solicit answers to each question from each student. These answers will be used later in the lesson, so make sure to collect them in a table-like format such as ".csv"
It is reccommended that you create a Google Form to collect answers to these questions with. You could then ask your entire school to fill out the survey, and have even more data to visualize!
Use the existing iPython Notebook to introduce Bokeh. Explain data visualization. Have the students follow along as you show them how Bokeh line plotting works, have them attempt the exercise at the end of the notebook.
Using the data that was collected at the beginning of class, determine the best way to plot the information collected at the beginning of class. Then, plot it! See if you can come up with cool trends by plotting data on the same chart, etc.
Simple exit slip, ask the students what data visualization is, why it is important, how to construct a line graph in Bokeh, etc.
Gather data in a similar fashion as the last session. Ask questions of your class / school that make for interesting visualizations.
Use the powerpoint provided to briefly discuss the high-level charts available in Bokeh.
Have the students use any of the high-level charts to plot the data that was collected in the warm-up.
Ask a simple question about any of the plotting mechanisms covered.
Unit 6. Data Visualization
Revision Date: Jan 04, 2020 (Version 3.0)Summary
Continuing the focus on data analysis from Unit Five, students will use the browser-based Dataquest learning environment (http://www.dataquest.io) and supplementary materials to explore more ways in which Python can be used to analyze data. For the first week, students will explore Dataquest through the browser-based "missions" on the website. Each lesson begins with a warm-up/journal entry, and students then spend the rest of the time working through the missions at their own pace. For the second part of the lesson, students will design and implement their own data analysis project in order to prepare them to complete a data-focused Create Performance task.
Outcomes
Overview
Week One: Learning Dataquest
Week Two: Data Analysis Project
Student computer usage for this lesson is: required
DataQuest.io website: https://www.dataquest.io/learn
Week One Materials: Unit 6 Resources -> DataQuest.io -> Week One Lesson Materials -> Mission #
Week Two Materials:
Datasets: Unit 6 Resources -> Dataquest.io - > Week Two Project Datasets and Materials -> Datasets
Sample Project: Unit 6 Resources -> Dataquest.io - > Week Two Project Datasets and Materials -> Sample Project
Project Rubric: Unit 6 Resources -> Dataquest.io - > Week Two Project Datasets and Materials -> "Data Analysis Project Rubric"
(Quizzes for Week One and Week Two are in the corresponding teacher-only resource folders)
Note: all worksheets and quizzes can be found in the teacher-only resource folder, Unit Six -> DataQuest.io -> Week One Lesson Materials -> Mission #
Directions for working in Dataquest.io
Quizzes should be done in class, and should take a minimum of 10-20 minutes to complete. It is advisable to not give a quiz out in the last ten minutes of class. If there are only a few minutes left, the student can use the time to add to their notes.
If a student fails one of the quizzes, they may be given the chance to go back and add to their worksheet before attempting the quiz again. (Multiple versions of all coding quizzes are available.)
There are four Missions for the Data Analyst In Python Path. Students are only required to do the first three to review and prepare for the create task they should do the first six missions.
The fourth Mission has worksheets/quizzes for those students who get to it, and can be counted as extra credit/normal grade at the teacher’s discretion. Additional useful courses include data visulization, data cleaning and introductory statisitics.
Show the first two minutes of the introductory video in Mission 1 on the Dataquest.io website. Students will discuss their reactions and thoughts about Data Science.
Pull up d3js.org on the projector. This is the webpage for a data visualization library in Javascript that has many great examples of ways to make connections from data. You can explore by clicking on one of the tiles on the front page. Explore the D3 front page with the class and discuss reactions.
This warm-up time is used for class discussion on progress through the missions. You can use this time to gauge the students' comfort with Python concepts by having students vote with their heads down. If enough students are having trouble, you may want to have a separate review session during the class.
This warm-up time can be used for reviewing a Python concept (such as Dictionaries) or looking at a current news article involving data analysis (any article about a topic of interest to the students that uses statistics would be appropriate). Students should think-pair-share on additional ways in which data could be used.
Students should do a show of hands to see where everyone is in the missions. The class should have a general discussion about progress.
Note: All materials for this section can be found in Unit 6 Resources -> Dataquest.io - > Week Two Project Datasets and Materials
Directions:
For this week, students will be pairing up to create and implement a data analysis program of their own design.
For the rest of the week, students should work on their projects in their groups. At the end, teachers can optionally have them present their PowerPoints to the class, exchange presentations in pairs, or merely turn everything in.
Week two project.
Unit 6. Data Visualization
Revision Date: Jun 11, 2020 (Version 3.0)Pre-lesson preparation
The second session is a programming activity and requires using NetLogo (a tutorial is in the Unit 4 Lesson on Hypothesis Testing with NetLogo) or using Python with Bokeh (for more advanced students).
Summary
Students will be introduced to the topic of diversity and computational problems, learn about and discuss implications of the proliferation of algorithms in society, and reflect on how the quality of input data and small, sometimes unintended biases can lead to low quality solutions.
Outcomes
Overview
Session 1
Session 2
Student computer usage for this lesson is: required
Supplementary articles:
Think-Pair-Share: Artificial intelligence algorithms in daily life?
Ask your students to list discuss what artificial intelligence algorithms they think affect them in daily life and how they are affected. How would it be different if those algorithms did not recognize them or treated them inappropriately? If an algorithm makes the wrong judgement about them, what would they do, who could they go to for help? It is OK if students are unsure about the answers as it leads into the following discussion.
Algorithms have become prominent and common in daily life. In particular, algorithms that use artificial intelligence (AI) or a technique called machine learning are employed to make decisions that affect us, sometimes in ways we aren't aware of and cannot control. For example, machine learning is used by Google, Facebook, Flickr, among other companies to detect faces in photographs, apply labels, or automatically tag images with people they recognize. In general, these algorithms are trained on input data (such as images of people), and are improved iteratively using statistical methods until they learn how to categorize, differentiate, and reach a correct answer. Another example of companies using AI is in personalized marketing or recommendation systems. For instance, Amazon tailors the products they suggest based on an algorithm trained on similar customers' purchase history. Or a company like Netflix will recommend movies to users who rate similar movies similarly.
At the heart of these algorithms is the fact that their solutions all depend on the initial parameters and input data used to train them. What happens when those parameters and data are not sufficiently diverse? Small changes in those parameters, oversights in the training data, implementer bias (both intended and not), and missing distributions or categories can all negatively prejudice algorithms. All this is important to keep in mind as algorithms start determining aspects of our lives and there is less or no control over the input and decisions they make about and for us. Computing innovations can reflect existing human biases because of biases written into the algorithms or biases in the data used by the innovation.
Effective collaboration produces computing innovations that reflect the diversity of talents and perspectives of those who design them. A 2016 article in the New York Times (http://www.nytimes.com/2016/06/26/opinion/sunday/artificial-intelligences-white-guy-problem.html?_r=0) highlights an example problem where lack of diversity among devlopers lead to a lower quality solution. When teams developing various AI and machine learning algorithms lacked diversity they failed to recognize errors from calibrating on too limited a population. This lead to significantly bad results, such as not recognizing people with dark skin tones or tagging them inappropriately. Examples where diversity may greatly influence the quality and real-world implications of algorithms include:
Parable of the Polygons
A hands-on example of how initial parameters, subtle biases, and lack of diversity can greatly affect an algorithm's execution is in the "Parable of the Polygons" (http://ncase.me/polygons/). The Parable of the Polygon is a simulation based on the mathematical model of how segregated communities may arise from small differences preferences, based on the theory of Thomas Schelling, an economist and game theorist who received the Nobel Prize for Economics in 2005.
Guide students through the website and let them explore dragging polygons, changing settings, and see how they can influence (it is best for them to follow along individually or in groups on their own computer).
An alternative version of the final sandbox with three polygon shapes is also available here: http://ncase.me/polygons-pentagons/play/automatic/automatic_sandbox_frame.html
Journal or Homework
Have your students continue to explore the Parable of the Polygons website and answer the following questions using the sandbox at the bottom of the website:
Think-Pair-Share: Algorithms, Diversity, and Solutions [5 min]
Two options: guided programming exploration with NetLogo, or more involved Python programming project for advanced students
Option 1: Using NetLogo
Option 2: Using Python with Bokeh (for advanced students)
Have students re-create the Parable of the Polygons themselves in Python, time with at least four types of polygon shape/colors. The source code for the Parable website is hosted on GitHub here: https://github.com/ncase/polygons/blob/gh-pages/play/automatic/automatic.js It is in JavaScript, but it serves as a good pseudocode basis. Alternatively, students could use the NetLogo code from Option 1 as another reference in creating their simulation.
Journal: Have your students reflect and list 5 examples or ways in which diverse input makes for better solutions.
Questions in the AP Classroom Question Bank may be used for summative purposes.
Sixty of the 80 questions are restricted to teacher access. The remaining 20 questions are from public resources.
Questions are identified by their initial phrases.
A city government is attempting to reduce the d...
Discuss with the school’s AP Testing Coordinator before presenting to students.
Guidance for students in how to take the exam.
Date:
Time:
Location:
Confirm that students have access to the digital portfolio.
Think-pair-share: What is the digital portfolio for?
Share the AP Exam Administration presentation with students.
Unit Create Performance Task
Revision Date: Nov 11, 2019 (Version 3.0)Pre-lesson Preparation
Students should have practice in the following areas before starting on the Create Performance Task:
Summary
In the Create Performance Task (CPT), students bring ideas to life through software development. The CPT requires students to design and iteratively develop a program. The College Board encourages but does not require students to collaborate with a partner, and once students begin the development of the CPT, they may receive help only from the collaborative partner. While not requiring it, this lesson supports a collaborative effort. Even if collaboration is used, each student must independently complete a significant level of planning, designing, and developing the program. Students will have 12 hours of class time to complete, and submit:
The program must:
This lesson plan provides a schedule for 15 50-minute sessions to meet the 12-hour in-class minimum required by the College Board.
Outcomes
Overview
Session 1: Identify performance task requirements and choose a topic to develop.
Session 2: Design the program, identifying both multiple -evel algorithms and multiple abstractions used in their design. Students work with collaborative partners to verify the adequacy of their designs to meet the performance task requirements.
Session 3: Program Development: Code top-level functions.
Session 4: Program Development: Code second-level functions.
Session 5: Program Development Checkpoint: Assess progress and revise design and development strategies.
Session 6: Program Development: Continue revised function development.
Session 7: Program Development: Complete function development.
Session 8: Program Development Checkpoint: Assess progress and make final revision to development strategies.
Session 9: Program Development: Make final revisions to program code.
Session 10: Program Development: Complete program and plan video.
Session 11: Video Development: Record and optionally narrate video.
Session 12: Video Development: Assess video and make final revisions.
Session 13: Written Responses: Respond to prompts 2a, 2b, and 2c.
Session 14: Written Responses: Respond to prompts 2d and 2e.
Session 15: CPT Submission: Submit and share projects.
In the Lesson Resources Folder (Teacher Only)
In the Lesson Resources Folder (Public)
Possible Screen Capture/Recording Tool
VLC Media Player
Dowload: http://www.videolan.org/vlc/index.html
Instructions for screen recording: http://www.wikihow.com/Screen-Capture-to-File-Using-VLC
Objectives:
Tell students: Today you will begin the Create Performance Task. In the CPT, you will be developing a program of your choice. The goal of this task is for you to develop a program to solve a problem, create an innovation, or express a personal interest.
Provide students with a copy of the Create Performance Task (AP Computer Science Principles Performance Task Create–Applications from Ideas) description from the College Board.
Jigsaw the Program Purpose and Development section. Assign each of the written responses a-e to one of five groups. Each group answers the questions below. (2 min)
Written Response a
What must the response explain?
What is the approximate word limit?
Written Response b
In addition to describing the difficulties, what must be described about them?
At least one of the difficulties must have been addressed in what manner?
What is the approximate word limit?
Written Response c
What is to be described?
What is the approximate word limit?
Written Response d
What is to be explained?
What is the approximate word limit?
Written Response e
What is to be marked with an oval?
What is to be marked with a rectangle?
When are comments are required?
Each group shares its results. (5 min)
Assign students collaborative partners. Distribute Preliminary Topic Selection Guide. Students decide on the topic they will address and the form of collaboration they will use. (10 min)
Distribute the CPT rubric and CPT Rubric Assignment.
Objectives:
Tell students:
Today we have four goals. We will commit to a program topic and develop a collaboration strategy, a program design, and an implementation schedule.
Meet with collaborative partners and discuss the CPT rubric assignment. Each individual submits programming topic and purpose.
Each partner group submits a plan for collaboration.
Each individual submits a program design.
Each individual submits a daily program development schedule.
Tell students: Today will be our first program design day.
At the end of class:
Tell students: Today will be our second program design day.
At the end of class:
Tell students: Today we will evaluate program development progress and revise our program development schedules as needed. We will also discuss with partners the difficulties we encountered and the strategies we used to address them.
Note: Partners collaborating in their program development in the first session stages will switch to individual development at this point.
Each individual submits a revised schedule of program development,
Partners discuss the major difficulties they have faced to this point and the strategies they used to overcome them.
At the end of class:
Tell students: Before starting our research we will examine the rubric that readers will use when scoring your computational artifact and written response.
At the end of class:
At the end of class:
Tell students: Today we will evaluate program development progress and revise a program development schedule as needed. We will also once again discuss with partners the difficulties we encountered and the strategies we used to address them.
Note: Partners collaborating in their program development in the second session stages will switch to individual development at this point.
Each individual submits a revised schedule of program development.
Partners discuss the major difficulties they have faced to this point and the strategies they used to overcome them.
At the end of class:
Tell students: Today will be our next to last program development day.
At the end of class:
Tell students: Today will be our last program development day.
At the end of class:
This session is the first of two scheduled to develop the video. It's possible to create the video in a single day, so if students need more time to work on their program implementation, it may be done here with video planning assigned as homework.
Tell students: Today will be our first of two days dedicated to producing the CPT video.
Each individual selects features that demonstrate the programs overall purpose.
Students plan how to show the purpose of the program and the running of related features.
Students record required clips.
Collaborative partners assess the video clips and recommend any additional clips or changes to existing clips.
Students complete the CPT video in mp4, wmv, avi or mov format.
Students write the explanation of the programming language used, their program's purpose, and what the video illustrates.
Objectives:
Tell students: There are three goals for this session.
Students upload both files.
Students set up workstations to show their video and to give access to their program, Students perform a gallery walk to review the programs.
Students respond to these two questions.
Note: Teachers may want to record students making these comments to be used to introduce the project next year.
Students may not receive assistance regarding the content of their CPT documents until after they have been submitted to the College Board.
Students may not receive assistance regarding the content of their CPT documents until after they have been submitted to the College Board. Once the documents have been submitted teachers should use the CPT rubric to assess performance task documents.
To convert the rubric score to a percentage teachers may want to use the following scale:
Program Development Progress: 50 pts
Over 10 days, students submit a project assessment, a program development plan and 6 daily progress reports and complete 2 program checkpoints. Weighted as 5 points for each day:
0 points no progress
1 point sporadic or minimal progress
2 points inconsistent progress
5 points consistent progress
Video Progress: 10 pts
5 points for each day
0 points no progress
1 point sporadic or minimal progress
2 points inconsistent progress
5 points consistent progress
Written Report Progress: 10 pts
5 points for each day
0 points no progress
1 point sporadic progress
2 points inconsistent progress
5 points consistent progress
Rubric score 30 pts
Unit Create Performance Task
Revision Date: Jun 24, 2020 (Version 3.0)Pre Lesson Preparation
Students should have practiced the following before starting on the Create Performance Task.
Video
Capturing program execution in a video
Documentation
Adding comments to code
Input and Output
Obtaining input that can be shown in a video.
Producing output that can be shown in a video.
Algorithms
Use sequence, selection and iteration to implement an algorithm.
Explaining how an algorithm accomplishes it task
Functions
Creating, calling and reusing student developed functions that use parameters.
Use parameters to determine which section of code executes.
Describing what a function does
Explaining what each call to a function tests?
Lists
Storing data in a list (collection)
Processing the data in a list
Explaining how lists help manages complexity by explaining how the program would be different without the list.
The Program must:
Outcomes:
Objectives:
Introduction:
Tell students:
Today’s class will introduce the Create Performance Task. In the CPT, you will develop a program of your choice, create a video displaying a run of the program and create written response to a series of prompts about your program. Tomorrow you will review how the CPT will be scored, select a partner, and choose a program to create.
Once this performance task has been assigned, immediately after this introduction, you are expected to complete the task without assistance from anyone except for your partner(s) and then only when developing the program code.
Provide each student a copy of the Create Performance Task for the Student Handouts of the AP CSP Course and Exam Description.
(5 min) Students read page 189 the Create Performance Task handout and answer the following questions. Use think-pair-share to obtain class consensus of the answers.
(5 min) Students read page 190 of the Create Performance Task handout and answer the following questions about the CPT program code. Use think-pair-share to obtain class consensus of the answers.
(15 min) Jigsaw the six required elements. For each element have students report on the following.
(5 min) Students read page 191 of the Create Performance Task handout and answer the following questions about the CPT video. Use think-pair-share to obtain class consensus of the answers.
(5 min) Students read page 192 of the Create Performance Task handout and answer the following questions about the written responses. Use think-pair-share to obtain class consensus of the answers.
(5 min) Students read pages 193-196 of the Create Performance Task handout and answer the following questions about the written responses. Use think-pair-share to obtain class consensus of the answers.
Objectives:
Tell students:
Today we will review the guidelines on which on your CPT will be evaluated. (Provide each student with a copy of the CPT Scoring Guidelines.) Your program and its corresponding written response will be evaluated using a 6 point rubric. Each row can earn 0-1 points.
(5 minutes) Students read row 1 of the scoring guidelines and answer the following questions:
(5 minutes) Students read row 2 of the scoring guidelines and answer the following questions:
(5 minutes) Students read row 3 of the scoring guidelines and answer the following questions:
(5 minutes) Students read row 4 of the scoring guidelines and answer the following questions:
(5 minutes) Students read row 5 of the scoring guidelines and answer the following questions:
(5 minutes) Students read row 6 of the scoring guidelines and answer the following questions:
Extension/Homework: Provide students link to 2021 Pilot Student Sample Responses. Sample A earns all 6 points. Have students work in pairs to score one sample response other than A and then check their answer.
(10 minutes) Students choose partners or elect to work independently and work on proposal for initial program idea.
NOTE: Students may only receive help from the collaborative partner from this point on until the CPT documents are ready to be submitted. Teachers may collect topics, collaboration and implementation strategies, and designs in order to help manage student progress, but may not provide any feedback to students on the content.
Tell students: Today we have four goals.
Each individual or partnership submits a preliminary program design that answers the following questions.
Describe the program you will create?
What input will it use?
What output will it produce?
What function(s) will you use?
Describe how the program will work and at least one important algorithm it will use.
Describe a plan for collaboration.
Tell students: Today we will evaluate program development progress and revise a program development schedule as needed. All program development should be completed by the end of session 10.
Students are to work individually from this point forward.
Tell students: Today will be dedicated to producing the CPT video.
Students should storyboard and develop captions for their video.
Students should plan and record their video.
Students write responses to prompts 3a and 3b
Students write responses to prompts 3c and 3d
Upload CPT documents
Students upload all three files..
Students respond to these two questions.
Note: Teachers may want to robtain permission to save and share these with next year's classes.
Students may not receive assistance regarding the content of their CPT documents until after they have been submitted to the College Board from nyone other than collaborative partner(s).
Students may not receive assistance regarding the content of their CPT documents until after they have been submitted to the College Board.
Once the documents have been submitted teachers may use the CPT rubric to assess performance task documents. The table below is a suggested weigthing.
Rubric Points | 100 Point scale |
No project submitted | 0 |
1 Component Completed | 20 |
2 Components Completed | 40 |
1 | 50 |
2 | 60 |
3 | 70 |
4 | 80 |
5 | 90 |
6 | 100 |
To obtain a score for the period of time students are developing the CPT, teachers may want to use the following scale:
Project Development Progress: 50 pts
Over 15 days, students submit a project assessment, a program development plan and at least 6 daily progress reports and complete a program checkpoint.
Program Code Development (30 points)
Weighted as 5 points for each day:
0 points no progress
1 point sporadic or minimal progress
2 points inconsistent progress
5 points consistent progress
Video Progress: 10 pts
2 Days of video development
5 points for each day
0 points no progress
1 point sporadic or minimal progress
2 points inconsistent progress
5 points consistent progress
1 Day of video development
10 points for each day
0 points no progress
2 point sporadic or minimal progress
4 points inconsistent progress
10 points consistent progress
Written Report Progress: 10 pts
2 Days of video development
5 points for each day
0 points no progress
1 point sporadic or minimal progress
2 points inconsistent progress
5 points consistent progress
Rubric score 30 pts