Goals

In this assignment you will practice the following computer science concepts:

Computer Science Principles Curriculum

Common Core Standards

Vocabulary

Overview

In this lab, we will learn how to use a large data set for analyzing the data, or finding out what the data means.

Working with large data sets can be challenging if we just look at the raw data, which typically consists of a large list of numbers. In order to find out what the data means, you need to use a computer program with mathematical calculation to find out the connection and trends in the data set.

In this exercise, we will use data on atmospheric carbon dioxide levels from NASA. First, you will conduct some Internet research. Second, you will learn how to organize data so that it makes more sense. Third, you will learn how to make a growth rate calculator using a program you write. Through building this computer program, we will also learn how mathematical formula(s) help in analyzing large data sets.

Goal 1: Calling Actions on Objects

In this section, we will research the data set for "atmospheric carbon dioxide level," using the Internet. Type the phrase in a search engine (e.g., Google, Bing) and see if you can find raw data. Raw data will consist of a list of numbers, instead of a graph.

The following are sites you can use, if your search is unsuccessful:

Atmospheric Carbon Dioxide Level

Goal 2: Create a customized calculator to analyze large data sets

When you look at the raw data page on "atmospheric carbon dioxide level" from NASA (the file starts with "USE OF NOAA ESRL DATA"), you may find that this data set is very complicated or even intimidating. The page consists of the explanation of how to read the data at the beginning part, then it shows you rows and columns of numbers.

We will focus on the numbers in middle column titled "average." The numbers in this column tell you how much CO2 is in the air (expressed as parts per million (ppm)) in average for each month from March 1959 to June 2015.

When looking at the raw data from the middle column "average," you see the number increases from past to present. The data has an increasing trend. We would like to find out more about this trend. Does the rate of increase consistently from decade to decade? Or does it change in some decades?

The traditional pen and paper method for finding this trend data is:

  1. Adding the number in the calculator one by one from January of the year one of the decade to December of the same year.
  2. Writing down the sum on the paper.
  3. Dividing the sum by 12 to get the average for the year one of the decade.
  4. Writing down the quotient on the paper for year one.
  5. Adding the number in the calculator one by one from January of the year ten of the decade to December of the same year.
  6. Writing down the sum on the paper.
  7. Dividing the sum by 12 to get the average for the year ten of the decade.
  8. Writing down the quotient on the paper for year ten.
  9. Subtracting the year one's average from year ten's average.
  10. Writing down the difference on the paper.
  11. Dividing the deference by year one's average, and multiplying the quotient by 100 to get the increase rate in percentage.
  12. Rounding the percentage to manageable decimal place.
  13. Since you are comparing the increase rate by different decades, you need to do this whole process repeatedly for the decade you choose.

You can write a computer program, or customized calculator, to make this process much easier. Once you write the program, you will just need to input the raw data, and the calculator will do the rest. No more multiple calculations, no more pen and paper.


Example: Write input statements to enter raw data

// You will need the use statement for the Math class from Quorum Libraries, and to instantiate a Math object to be used later
use Libraries.Compute.Math
Math math

// These lines ask the user for information on the month of January
text jan = input("Enter the number for January for the year one of the decade.")
text jan10  = input("Enter the number for January for the year ten of the decade.")

Activity:

Write the input statements for the rest of the months.


You now have all the data you need from the user input, with one small problem. The input command stores information as text, we need numbers to be able to analyze the information. To do this, we cast the information as a number. This action passes the parameter of (variable type, variable name). So we put in the variable type we want, in this case number, and then the name of the variable we want to change. We also have to make new number variables for this to work.

Example: Cast the text input statements to numbers.

 // These lines create two new number variables to hold our January input, and cast that text input as numbers
number janN = cast(number, jan)
number jan10N = cast(number, jan10)

Activity:

Cast the rest of the input statements to numbers.


We are now ready to find the averages of our data. To find the average of a set of data, add all the data points, and then divde by the number of points in the set. In this case, there are 12 points.

Example: Calculate of the average for the year one data

number avg1 = (janN + febN + marN + aprN + mayN + junN + julN + augN + septN + octN + novN + decN) / 12	

Activity:

Calculate the average of the year 10 data.


You can now round averages. To do this, we will use the Round action from the Math library. Notice that the math object starts with a lower case "m." The Round action passes the parameters (variable, number of decimal points). We want to round to the nearest hundredth, so we put a 2 after the comma.

Example: Rounding the average of the year one data.

number roundedAvg1 = math:Round(avg1, 2)

Activity:

Round the average of the year 10 data.


To find the percent increase between two numbers, subtract the smaller number from the larger number, divide the answer by the larger number. This will give you a decimal answer. To make it a percent, multiply by 100.

Example: Calculate percent increase

number percentIncrease = ((higherAvg - lowerAvg) / higherAvg) * 100

Activity:

Write the code to find the percent increase.

Use your rounded averages. Then round the percent increase. Finally, write a concatenated output statement to display the answer.


Example: Sample Output

"In this decade, the carbon dioxide level in the Earth's atmosphere increased by 2.43 percent."


Example: Extract information from the data and explain the connections, patterns, and trends

Use the program to find out the increase rate in multiple different decade periods, such as the rate in the 1960's and the rate in the 2000's. Write down each finding in a separate sheet of paper.

In the data set, there are numbers in some month listed as -99.99. This simply means that the researcher could not obtain a valid data on that month. In that case, just use the data from the previous month for the input for your program.

Goal 3: Data analysis – Interpreting and analyzing the processed data

The increase rate that you acquire from your program is a percentage. 3 percent increase means that the CO2 level in the air has increased 3/100 measures from the year 1 of the decade to year 10 of the decade. If the year 1 measurement is 100.00, the 3 percent increase means that you have 103.00 in the year 10 of the decade. Thus, the larger the number of increase rate, the more CO2 molecule has emitted into the Earth's atmosphere during that period (decade).

Does your finding show a consistent increase? If it shows the fluctuation, which decade has higher rate or lower rate?

Now we have an understanding of the trend and the pattern in the increase of atmospheric carbon dioxide level. The next question should be what is causing this trend and the pattern? Is it a naturally occurring phenomena? Or is it caused by some other factors? Is it maybe by the increase of human population on Earth, decrease of forestation on Earth, increase in the use of motor vehicle on Earth?

Is there any other data set that shows a proportional relationship with the data analysis that you acquired from this data analysis exercise? You can tell the two data sets have a proportional relationship if the two data sets have a matching increasing trend and pattern with the similar rate, or the two data sets have inverse proportionate relationship – one data set increases and one data sets decreases in a similar trend and pattern with a similar rate.

Within a small group, discuss and hypothesize (making an educated estimation) in regard to what is causing the increase in atmospheric carbon dioxide level on Earth. Then try to find the data that support your group's hypothesis.

Activity:

Try to find the data

Next Tutorial

In the next tutorial, we will discuss Challenge 2.1, which describes how a Musical Piece works in Quorum..