Goals

In this lab, we will learn the following computer science concepts:

Computer Science Principles Curriculum

Common Core Standards

Vocabulary

Overview

In this lab, we will work on understanding the big idea of data and information. In doing so, we will collaborate to test a hypothesis in the field of physics, completing the following activities:

Goal 1: Have a face-to-face meeting about implicit Casting

To begin the lesson, students should try to understand the concept of implicit casting as a group, which is related to the broader concept of types. In this first part of the lab, we will break into teams and meet face-to-face for discussion of these two concepts.

In them, discuss what it means to be a "type "in a programming language. During this discussion, reference at least integer and number, using the variables and types reference page as a guide. Here is a code example of the integer and number types written in Quorum:


Example: Code for integers and numbers

//This example shows Quorum code for integers and numbers
integer alice = 5
number bob = 10.3

Assign the value of 7 to the Dividend and 2 to the value for the Divisor

Discuss both the reference page for types and the example code in teams. Mention what each symbol does in the line of code and what the computer will do when the code is run.

Next, we will use test calculations to examine the rules of implicit casting. We will do this by examining the "division" operator (e.g., A / B). Build a program as a team that covers all patterns listed in the table below - assigning the "Type" for each variables that becomes Dividend and Divisor.

integer / integer = integer. Example : 7 / 2 = 3

integer / number = integer. Example : 7 / 2.0 = ERROR

integer / number = number. Example : 7 / 2.0 = 3.5

number / number = number. Example : 7.0 / 2.0 = 3.5

number / integer = integer. Example : 7.0 / 2 = ERROR

number / number = integer. Example : 7 / 2 = ERROR

number / number = integer. Example : 7 / 2 = 3.0

number / integer = number. Example : 7.0 / 2 = 3.5


Example: division using integers

//In quorum, the 7 and the 2 are implicitly chosen as integers
//An integer divided by an integer is allowed.
//In this case, 2 goes into 7 three times with a remainder of 1
//Therefore, the answer is 3
integer a = 7 / 2
output "a is " + a

//Notice that this code would not compile
//So I better comment it out
//integer b = 7 / 2.0
//output "b is " + b

As a team, write the rest of the code examples for the table above

Goal 2: Build Two Ramps

In this next task, we will build a pair of ramps with configurations that fits in our setting, room, table, etc. The purpose of building these ramps is to design an experiment where we will hypothesize about how far a ball will roll when run off of them. These ramps can be in any configuration, i.e., different lengths, shapes, sizes, or slopes. As an example of the ramps we could build, we could choose slope, as seen below:


Ramps:

Use any material that is easy and available to construct the ramps (e.g, cardboard, playing cards, wood, chairs). If a team would like to choose different kinds of ramps to build, this is ok (so long as it is safe). In the next section, we will take an educated guess, called a hypothesis, about what the result of our experiment will be.

Goal 3: Create a hypothesis

In science, a hypothesis is an educated guess about what we think the result of an experiment will be or what we think might be true about the natural world. Often times, scientists construct hypotheses with the direct purpose of proving them to be false. In our case, we want to know which ramp will allow a ball rolling off of it to go farther. Here's an example:

Example: An example hypothesis about ramp slopes

Hypothesis: The ramp with the higher slope will cause a rolling ball to travel farther.

State explicitly which ramp you think will cause the ball to roll further. Remember, in science, it is perfectly ok if our hypothesis turns out to be incorrect. Our goal is to claim what we initially believe to be true and then to test that belief rigorously with experiments. Write the hypothesis down so it can be referred to later.

Goal 4: Run the experiment

In this part of the lab, we will test our hypothesis in an experiment. To do this, we are going to need a spreadsheet application, examples of which are Microsoft Excel, Google Sheets, Apple Numbers, or Open Office's Calc.

Once we open a spreadsheet, roll a ball 15 times down each ramp. In each case, try to roll the ball in a consistent way to reduce measurement error. After each ball has been rolled, enter the distance into the spreadsheet to be used later.

Goal 5: Calculate the average

Measure the distance of the ball’s travel from the end of the ramp to where it naturally stops, then record the data in your spreadsheet. Do not touch the ball as it is rolling, as we are testing the ramp, not our own ability to manipulate the ball.

Pro Tip: Scientists conduct experiments to test their assumptions.

Example:

//Type in data for the first ramp
number ramp1a = 5.5
number ramp1b = 6.2
number ramp1c = 9.4

//Type in data for the second ramp
number ramp2a = 2.2
number ramp2b = 7.4
number ramp2c = 1.1

//Manually compute the average
number ramp1Average = (ramp1a + ramp1b + ramp1c) / 3
number ramp2Average = (ramp2a + ramp2b + ramp2c) / 3
output ramp1Average
output ramp2Average

Write a program that calculates the averages for your team's ramp

Goal 6: Conduct an Online Meeting about the Results of our Experiment

Now that we have run our experiment, we need to think carefully about our data and decide whether we have confirmed our hypothesis, refuted it, or if our data is too inconclusive to tell. Once we have done so, we will share our results with others, which is an important part of the scientific process. In this section, we will do this by holding an online collaborative meeting. In this meeting, the team should discuss their results with the broader class in the following steps:

  1. Setup an online place for students to discuss. This can be in any setting that is convenient, including email, Facebook, Skype, or other venues.
  2. Students should present the design of their ramps, their hypothesis, data, and results in this online setting.
  3. Students should present whether their hypothesis was confirmed, inconclusive, or not supported.
  4. Students should reflect on the results of their experiment and decide whether they have learned any new information.
  5. As a class, students should discuss whether working in groups helped speed up the process of designing the experiment and writing the software.

Next Tutorial

In the next tutorial, we will discuss Assignment 2.2, which describes how work Math in Quorum..