Data Project
* math project1. Table & Graph
| Wingspan(cm) | Free throws(out of 20) |
|---|---|
| 148 | 9 |
| 161 | 8 |
| 176 | 6 |
| 153 | 2 |
| 162.5 | 2 |
| 800.5 | 27 |
1.1. my best fit line
2. People
2.1. TODO Measure everybody [4/5]
[X]Ariel[X]Zohar[X]Micah[-]Jeremy, used placeholder
`- [X] Emma
3. Mean, Median, and Mode.
Code to calculate them. Takes a space seperated list of numbers to find mean, median, and mode of them.
#!/usr/bin/perl use strict; use warnings; my $sum = 0; my %counts; foreach (@numbers) { $sum += $_; $counts{$_}++; } my $mean = $sum / @numbers; print "Mean: ($sum / " . scalar(@numbers) . ") = $mean\n"; print "Median: ", median(\@numbers), "\n"; print "Mode: ", mode(\@numbers), "\n"; sub median { my $arr = shift; my @sorted = sort {$a <=> $b} @$arr; my $len = @sorted; return $len % 2 ? $sorted[$len/2] : ($sorted[$len/2 - 1] + $sorted[$len/2]) / 2; } sub mode { my $arr = shift; my %counts; foreach (@$arr) { $counts{$_}++ } my $max_count = 0; my $mode; foreach (keys %counts) { if ($counts{$_} > $max_count) { $max_count = $counts{$_}; $mode = $_; } } return $mode; }
3.1. Wingspan
my @numbers = split ' ', '148 161 176 153 162.5'; <<mmm>>
Mean: (800.5 / 5) = 160.1 Median: 161 Mode: 148
3.2. Made free throws
my @numbers = split ' ', '9 8 6 2 2'; <<mmm>>
Mean: (27 / 5) = 5.4 Median: 6 Mode: 2
4. 1-6
- A sample is a subset of a population. It represents the population. A population is the entire group you're analyzing. .Sample: Randomly selected group of 5 students. Population: Entire grade 8 class.
- Primary data is data you collect yourself and secondary data is data that has already been collected and made available for researchers to use. Primary data collected through measuring independent variable. Secondary data(Made free throws) collected by Mr.Ray and used in project.
- A census is when you ask the whole population. Sample, not census. Only \(5/14\) students were selected.
- Discrete data for free throws and wingspan is continuous. Discrete data is countable.Continuous data is uncountable because of decimals in between.
- A randomly selected sample was chosen, this helps minimize bias by giving every member of the population an equal chance of being selected.
- The independent variable is the x axis and the dependent is the y axis. In this case the independent variable was the wingspan and the dependent variable was made free throws.
5. Elsewhere
5.1. References
5.2. In my garden
Notes that link to this note (AKA backlinks).
