Minds On

Analyzing data

Think about a time when you used information about numbers to make a decision.

For example, did you decide to wear a winter jacket when the temperature outside was less than 5 degrees Celsius?

Decorative no alt tag needed

As another example, have you left your house at a certain time to ensure you got to school when the bell rings?

Decorative no alt tag needed.

In math, we use data in the form of numbers to help make decisions.

When we look at data closely and perform calculations on it, we are analyzing data.

Almost every career requires decisions about numerical data at some point.

For example, a medical doctor makes decisions about medicine dosage depending on the mass of the patient.

A painter might need to calculate the area of a wall to determine how many cans of paint to purchase.

Brainstorm

Brainstorm

Think of three careers that interest you and indicate how a person in each of these careers might use numerical data to make a decision. Record your ideas digitally, orally, or in print.

Analyzing data with computers

Computer applications can help us to analyze data and to make decisions.

Examples of applications that help to make decisions in various sectors include:

  • mortgage calculators
  • postal price calculators
  • wind direction and speed in aviation
  • precipitation data in agriculture
  • route calculations for efficient package delivery
  • and many more!

Action

Making decisions with Scratch

Let’s take a look at three Scratch programs that look closely at data to help communicate and inform decisions.

Program 1

Press Scratch Program 1(Opens in a new window) to access the Program 1 code.

Program 1

When the flag is pressed to start the program, the sprite will ask ‘What is the patient’s temperature in degrees Fahrenheit?’ and wait. Then, the temperature will be set to the patient's temperature in degrees Fahrenheit. If the temperature is greater than 100, then the sprite will say "fever" for 2 seconds. If it is lower than 100, the sprite will say "No fever" for 2 seconds.

Brainstorm

Brainstorm

What do you think is the purpose of this program?

What types of careers would need to analyze data like this?

Task

Can you alter the code in Program 1 so that it asks for the patient’s temperature in degrees Celsius instead of degrees Fahrenheit?

If you don’t know what is considered a fever in degrees Celsius, you can use 38° C.

You will need to adjust the value after the less than sign and change the information in the ask block.

The following screenshots display the sections of the Scratch code that you need to change.

A block that reads “ask: ‘What is the patient’s temperature in degrees Fahrenheit?’ and wait.” A Scratch block that reads: ““temperature  100.”

Program 2

Press Scratch Program 2(Opens in a new window) to access the Program 2 code.

Program 2

When the flag is pressed to start the program, the moneyAvailable variable will be set to 10 and the taxRate variable will be set to 1.13. The sprite will ask "What is the price before taxes?" and wait. The price variable will be set to the answer given to the question and the total variable will be set to the price times the tax rate. If the total is greater than money available, then the sprite will say "Sorry - you don't have enough to purchase this" for 2 seconds. If the total is less than money available, the sprite will say say "Yes - you have enough to purchase this item" for 2 seconds.

Program 2 asks the user for the price before the sales tax is applied. It assumes the customer has $10 available to spend and that the sales tax rate is 13 %.

Task

Go to Program 2 again and complete the following tasks. You can record your thinking using a method of your choice.

  1. Press the flag button and type 8.50. Does the customer have enough money to purchase the item when sales tax is applied?
  2. Press the flag button again and type 9.00. Does the customer have enough money to purchase the item when the sales tax is applied?
  3. Assume the customer now has $12.00 available to spend and the tax rate is raised to 14 %.

Change the value of the ‘moneyAvailable’ variable to 12. The following screenshot displays the block that needs to be changed.

A Scratch block that reads: “set ‘moneyAvailable’ to 10’”

Change the value of the ‘taxRate variable’ to 1.14. The following screenshot displays the block that needs to be changed.

A Scratch block that reads: “set ‘taxRate’ to 1.13’”
  1. Press the flag button and type 11.00 for the price of the item. Does the customer have enough money to purchase the item when the new sales tax is applied?
  2. Change the tax rate and money available variables to values of your choice and try out the program with a new price. Does the program work as anticipated? If it doesn’t, why do you think that is? What can you change so that it does work as expected?

Program 3

Let’s explore a Scratch program that calculates the average daily high temperature for a northern Ontario town over the course of ten days in the springtime.

Press Scratch Program 3(Opens in a new window) to access the Program 3 code.

Program 3

When the flag is pressed to start the program, the sunTemps variable will be set to 0, the meanTemp variable will be set to 0, and the reading variable will be set to 0. The following actions will be repeated 10 times: the reading variable will be changed by 1 and the sumTemps variable will be changed by the reading of the temperatures. Then, the mean temperature variable will be set to summary of temperature divided by 10. The sprite will say "Mean temperature is" and whatever the mean temperature variable is, for 10 seconds.

Task

Go to Program 3 again and complete the following tasks. You can record your thinking using a method of your choice.

  1. Press the flag button to run the program. What is the mean temperature with the current values in the list?
  2. Let’s assume 10 daily low temperature values were collected over the same period of 10 days for a nearby town. Change the values in the list to the following:
Original list of temperature values New list of temperature values
5 7
2 5
1 5
3 4
7 6
8 5
5 3
9 3
8 2
1 1
  1. Press the flag button to determine the mean temperature for the nearby town.
  2. Which town had the higher mean daily low temperature?

Consolidation

Practice with code

Activity 1

Press Scratch Program 4(Opens in a new window) to access the Program 4 code.

Program 4

When the flag is pressed to start the program, the heart rate summary variable will be set to 0, the mean heart rate variable will be set to 0, and the reading variable will be set to 0. The following actions will then be repeated 6 times: the reading variable will be changed to 1 and the heart rate summary variable will be changed by the reading of the heart rates. Then, the mean heart rate variable will be set to the heart rate summary divided by 10. Finally, the sprite will say "mean heart rate is [whatever the mean heart rate variable is]" for 10 seconds.

Answer the following questions. You can record your thinking using a method of your choice.

  1. What is the purpose of this program and what information does it provide?
  2. When you press the flag button to run the program, does it calculate the correct totals? If not, how could you alter the code so that it calculates the correct totals?
  3. With the heart rate values given in the table, what should the sumHR and meanHR totals be?
  4. Change the values in the list to new heart rates (you could consider taking your own heart rate every ten minutes for one hour, if possible). What is the mean heart rate with the new values?

Activity 2: Altering code

Answer the following questions. You can record your thinking using a method of your choice.

  • How might you alter the code and the list in this program to include 15 heart rates?
  • Alter the code to calculate the mean height in centimeters for a class of 20 students.

Reflection

As you read the following descriptions, select the one that best describes your current understanding of the learning in this activity. Press the corresponding button once you have made your choice.

I feel…

Now, expand on your ideas by recording your thoughts using a voice recorder, speech-to-text, or writing tool.

When you review your notes on this learning activity later, reflect on whether you would select a different description based on your further review of the material in this learning activity.