# Assignment 2.1: Ramp Experiment

Practice using types and implicit casting## Goals

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

- Collaborate to understand data
- Understand Implicit Casting

## Computer Science Principles Curriculum

**Big Idea: Creativity:**EU 1.2, LO 1.2.4, EK 1.2.4A, EK 1.2.4B, EK 1.2.4C, EK 1.2.4D, EK 1.2.4E**Big Idea: Abstraction:**EU 2.3, LO 2.3.2, EK 2.3.2A, EK 2.3.2B, EK 2.3.2C,EK 2.3.2C, EK 2.3.2E, EK 2.3.2F**Big Idea: Data and Information:**EU 3.1, LO 3.1.1, LO 3.1.1A, LO 3.1.1D**Big Idea: Data and Information:**EU 3.1, LO 3.1.2, EK 3.1.2A, EK 3.1.2B, EK 3.1.2C, EK 3.1.2D, 3.1.2E, EK 3.1.2F**Big Idea: Programming:**EU 5.3, LO 5.3.1, LO 5.3.1J

## Common Core Standards

**English Language Arts Standards » Science & Technical Subjects:**CCSS.ELA-Literacy.RST.9-10.2, CCSS.ELA-Literacy.RST.9-10.3, CCSS.ELA-Literacy.RST.9-10.4, CCSS.ELA-Literacy.RST.9-10.5, CCSS.ELA-Literacy.RST.9-10.6, CCSS.ELA-Literacy.RST.11-12.2, CCSS.ELA-Literacy.RST.11-12.3, CCSS.ELA-Literacy.RST.9-10.1, CCSS.ELA-Literacy.RST.9-10.2, CCSS.ELA-Literacy.RST.9-10.7, CCSS.ELA-Literacy.RST.9-10.8, CCSS.ELA-Literacy.RST.9-10.9**Standards For Mathmatical Practice:**CCSS.Math.Practice.MP1, CCSS.Math.Practice.MP2, CCSS.Math.Practice.MP5, CCSS.Math.Practice.MP6, CCSS.Math.Practice.MP7, CCSS.Math.Practice.MP8 ,

## Vocabulary

- Average (or Mean)
- Calculation
- Casting
- Data
- Data Analysis
- Experiment
- Explicit Casting
- Face-to-face collaboration
- Hypothesis
- Implicit Casting
- Integer
- Number
- Online collaboration
- Types

## 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:

- Discuss implicit casting in a face-to-face meeting.
- Create a pair of ramps as a team of two or three. The ramps should be in a different configuration of the team's choosing (e.g., size, width, strength, material, angle)
- Develop a hypothesis in regard to which ramp will make the ball roll farther. Write down your team's hypothesis.
- Roll a ball down each ramp 15 times and record how far the ball rolled in a spreadsheet.
- Using the Quorum programming language, write a program that calculates the average distance of the ball’s travel for each ramp. After calculating the average, discuss how implicit casting might impact the calculations.
- In an online collaborative meeting, discuss whether the hypothesis was refuted or confirmed.

## 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
```

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
```

## 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:**

- Ramp 1: Same Length, Smaller slope
- Ramp 2: Same Length, Larger slope

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
```

## 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:

- Setup an online place for students to discuss. This can be in any setting that is convenient, including email, Facebook, Skype, or other venues.
- Students should present the design of their ramps, their hypothesis, data, and results in this online setting.
- Students should present whether their hypothesis was confirmed, inconclusive, or not supported.
- Students should reflect on the results of their experiment and decide whether they have learned any new information.
- 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..