In 2007 the Mars Company claimed that Original Milk Chocolate M&M’s should contain 24% blue, 14% brown, 16% green, 20% orange, 13% red, and 14% yellow M&M’s
Red | Yellow | Blue | Brown | Green | Orange |
? | ? | ? | ? | ? | ? |
Joe Chang is awesome lol jk
Red | Yellow | Blue | Brown | Green | Orange |
6 | 3 | 6 | 0 | 4 | 2 |
Eugene Choi is NOT
Red | Yellow | Blue | Brown | Green | Orange |
9 | 6 | 0 | 0 | 2 | 4 |
Dan Chu (Not Natalie Portman's husband Q.Q)
Red | Yellow | Blue | Brown | Green | Orange |
4 | 3 | 7 | 1 | 1 | 5 |
Tomas Dabsys
Red | Yellow | Blue | Brown | Green | Orange |
5 | 3 | 6 | 0 | 2 | 6 |
Nick De Cesare (Little Ceasar) *caesar
Red | Yellow | Blue | Brown | Green | Orange |
5 | 4 | 5 | 1 | 3 | 4 |
Ryuta Eguchi durrrrrrrrrrrr
Red | Yellow | Blue | Brown | Green | Orange |
7 | 1 | 2 | 0 | 7 | 6 |
Nick Ferraro
Red | Yellow | Blue | Brown | Green | Orange |
10 | 3 | 2 | 1 | 4 | 2 |
Dan Gonnnnnnnnnnng
Red | Yellow | Blue | Brown | Green | Orange |
12 | 3 | 4 | 0 | 2 | 1 |
Alex Hurtado (Can we just go another day or something?)
Red | Yellow | Blue | Brown | Green | Orange |
? | ? | ? | ? | ? | ? |
Jonathan Wang Kim
Red | Yellow | Blue | Brown | Green | Orange |
5 | 5 | 7 | 3 | 2 | 2 |
Ethan Liwanag
Red | Yellow | Blue | Brown | Green | Orange |
6 | 2 | 5 | 0 | 6 | 2 |
Joe Love in this club
Red | Yellow | Blue | Brown | Green | Orange |
9 | 1 | 6 | 0 | 4 | 2 |
Russell Mays (Lamblet)
Red | Yellow | Blue | Brown | Green | Orange |
9 | 0 | 4 | 1 | 5 | 2 |
David Oh (AP is better)
Red | Yellow | Blue | Brown | Green | Orange |
9 | 4 | 4 | 1 | 1 | 2 |
Greg Paksun
Red | Yellow | Blue | Brown | Green | Orange |
5 | 2 | 5 | 0 | 4 | 5 |
Christian Romo
Red | Yellow | Blue | Brown | Green | Orange |
2 | 5 | 5 | 1 | 9 | 0 |
<<<<<<<
Alex Sercel (Math-magician)
Red | Yellow | Blue | Brown | Green | Orange |
8 | 2 | 1 | 3 | 3 | 5 |
Steve Shushnar (Professional Statistics Student)
Red | Yellow | Blue | Brown | Green | Orange |
8 | 2 | 7 | 0 | 2 | 2 |
Armen Ter-Zakarian
Red | Yellow | Blue | Brown | Green | Orange |
9 | 1 | 3 | 1 | 5 | 1 |
Eric Verso Supastar
Red | Yellow | Blue | Brown | Green | Orange |
7 | 1 | 5 | 2 | 4 | 3 |
Ted Williams
Red | Yellow | Blue | Brown | Green | Orange |
7 | 3 | 3 | 1 | 7 | 1 |
Some Java code to visualize your outcomes:
Sample.java
public class Sample
{
private int x;
private int n;
private String name;
public Sample(String name, int x, int n){
this.name=name;
this.setX(x);
this.setN(n);
}
public void setX(int x) {
this.x = x;
}
public int getX() {
return x;
}
public void setN(int n) {
this.n = n;
}
public int getN() {
return n;
}
public double lower(double z){
return pHat()-z*Math.sqrt(pHat()*(1-pHat())/n);
}
public double upper(double z){
return pHat()+z*Math.sqrt(pHat()*(1-pHat())/n);
}
public double pHat(){
return (double)x/n;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return name;
}
}
MMIntervals.java
import java.applet.Applet;
import java.awt.Color;
import java.awt.Graphics;
import java.util.ArrayList;
public class BlueMMIntervals extends Applet {
ArrayList<Sample> observations;
double z=1.64485363; //90% ci
double p=.24;
public void init(){
observations = new ArrayList<Sample>();
observations.add(new Sample ("Joe",19,75));
observations.add(new Sample ("Eugene",17,72));
observations.add(new Sample ("Tomas",21,76));
observations.add(new Sample ("Nick D",22,71));
observations.add(new Sample ("Ryuta",25,65));
}
public void paint(Graphics g){
int count=0;
for (int i=0;i<observations.size();i++){
Sample obs = observations.get(i);
int left=(int)(1000*obs.lower(z));
int right=(int)(1000*obs.upper(z));
int y=50+i*20;
g.drawLine(left,y,right,y);
g.drawString(observations.get(i).getName(), left, y);
if (p>obs.lower(z) && p< obs.upper(z))
count++;
}
g.setColor(Color.RED);
int expectedP=(int)Math.round(1000*p);
g.drawLine(expectedP, 40, expectedP, 20*observations.size()+50);
String message=count+" out of "+observations.size()+" intervals contain "+p;
message+=" ("+Math.round(100.0*(double)count/observations.size())+"% of the observations)";
g.setColor(Color.BLUE);
g.drawString(message, 20, 20);
}
}