%TAM 202, spring 2003
%Here is the raw quiz score data for the class
clear;  %clear everything

%qscores is an array of quiz and homeword scores.
%One row for each student, one column for each quiz or homework
%Shown are the first 12 quiz scores and first 12 hw scores.
%You can find your row by looking up your quiz scores.

scores=[
7	10	7	10	7	10	6	9	0	5	0	9	30	30	30	30	30	30	30	30	30	30	30	30
7	10	7	10	5.5	10	7	10	6	10	0	4	30	30	30	30	29	30	30	25	30	30	30	28
7	10	7	10	7	10	5	10	0	7	0	8	0	28	30	30	30	26	28	28	26	22	28	30
7	10	3	6	6	9.5	6	10	4	7	5	4	30	27	27	30	23	26	26	22	0	19	24	22
7	10	0	0	7	10	7	10	6	9	5	3	30	28	30	30	28	30	30	30	30	30	30	30
7	9.5	7	10	6	9.5	7	9	3.5	9	0	7	30	30	27	30	30	28	30	30	30	29	30	30
7	9	7	9	7	8	6	10	6.5	0	7	0	30	29	30	30	27	29	30	27	27	30	29	27
7	9	7	5	7	10	7	10	0	7	0	4	30	30	30	30	30	30	30	30	30	30	30	30
7	9	6	7	6	2	0	0	3	1	4	0	0	16	0	25	25	24	0	30	0	30	0	29
7	9	3	8	5	9	4	9	3	2	5	5	0	30	29	29	30	26	30	29	30	30	29	30
7	9	3	3	7	3	6.5	9.5	3	4	4.5	7	30	28	26	30	30	30	30	30	30	30	30	30
7	8	7	10	7	10	0	10	0	7	0	5	30	24	30	30	0	28	30	0	0	0	0	0
7	8	7	10	7	10	5	8.5	4	6	5	8	23	19	28	28	28	30	30	30	27	30	30	30
7	8	7	5	6	6	5	7	4	7	4	4	20	29	29	23	25	28	30	30	27	30	30	30
7	8	7	5	7	10	4	10	0	10	0	7	30	30	28	30	30	27	30	30	30	25	30	18
7	8	7	4	7	10	5	10	4	10	0	9	30	24	26	30	30	30	30	30	30	30	30	30
7	8	3	4	7	2	5.5	6	3	1	2	3	30	29	30	28	29	27	30	30	30	30	30	30
7	8	3	6	6	9	7	6	6.5	4	3	3	30	30	30	30	30	30	30	30	30	30	30	30
7	8	3	5	5	9	6.5	6	1	0	5	6	23	25	16	21	24	26	25	26	25	30	30	28
7	8	0	0	6	6	1	8.5	3.5	3	0	0	27	24	28	27	30	30	30	30	26	30	30	30
7	7	7	5	7	4	5.5	7	0	0	1	8	30	30	28	30	28	27	30	0	24	29	24	30
7	7	7	5	5	5	6	8	6	7	5	3	20	29	30	30	30	30	30	30	28	30	30	30
7	7	7	7	5	10	6	9	0	5	4.5	4	30	29	20	28	26	30	27	30	24	27	30	29
7	7	7	5	7	5	5	6	6	1	0	4	30	29	30	29	28	30	28	30	30	30	30	30
7	7	7	10	7	10	5	8	5	7	0	0	20	30	30	30	30	28	30	30	30	30	30	28
7	7	7	6	6	10	0	0	0	0	6	4	30	18	20	30	30	30	0	30	0	20	30	0
7	7	7	6	6.5	9	5	9.5	6.5	5	4	4	30	28	26	30	30	30	30	30	28	30	30	25
7	7	7	10	6.5	10	0	9.5	0	2	0	5	30	30	27	26	30	30	30	25	30	30	30	30
7	7	0	0	5	10	4	10	3	9	3	4	30	29	30	0	30	30	30	24	21	30	30	28
7	7	0	0	0	0	6	9	0	0	3	3	30	29	30	28	28	20	30	30	30	30	30	30
7	6	7	6	7	9.5	3	10	0	8	0	7	30	30	30	30	30	30	30	30	30	30	30	30
7	6	7	5	5	2	5	9.5	1	9	4	2	20	29	30	30	28	28	30	30	30	30	30	30
7	6	7	4	6	4	7	9.5	0	10	5	4	30	24	30	30	30	30	30	30	30	30	30	26
7	6	7	7	7	7	6.5	8	5	7	5	7	30	30	26	30	0	25	20	23	0	30	30	0
7	5	7	7	0	0	6.5	10	0	0	4	6	30	30	26	28	30	0	30	30	30	30	30	20
7	4	7	4	0	1	6.5	6	0	0	3	3	30	28	30	30	23	30	30	29	30	30	30	30
7	3	7	5	6	3	1	8.5	6	2	2	4	30	29	30	30	20	28	0	20	20	30	0	30
7	3	7	5	6.5	6	7	10	0	9	0	7	30	0	30	30	15	23	30	28	25	30	30	25
7	2	7	10	7	8	7	10	6	10	3	5	28	30	30	30	28	30	30	30	30	30	30	30
7	2	3	7	7	10	2	9.5	0	8	0	2	30	20	30	30	30	30	30	30	30	30	30	30
7	2	0	0	7	1	4	8	0	0	0	0	27	29	0	16	23	30	30	30	0	0	0	0
7	1	7	7	7	10	7	8.5	0	2	0	6	30	30	26	25	30	30	30	30	30	30	30	30
7	0	7	3	7	9.5	0	10	0	9	0	4	30	30	29	30	28	30	30	30	30	30	30	28
7	0	7	5	7	5	0	0	1	4	4	2	30	22	24	28	30	30	30	30	28	30	30	29
7	0	3	10	7	2	2	4	0	0	3	2	25	22	22	30	30	30	30	30	0	30	30	0
7	0	3	5	4.5	2	7	9.5	4	5	1	4	30	29	24	30	30	30	30	0	30	0	30	26
6.5	10	7	5	6.5	10	6.5	8	6.5	8	2	6	30	29	30	26	30	30	30	30	27	30	30	30
6.5	10	7	8	7	10	5	8	0	9	0	3	30	30	20	30	25	30	30	30	12	30	30	29
6.5	10	3	6	7	10	7	9.5	5	2	6	8	25	27	26	30	30	28	30	25	21	0	30	25
6.5	9.5	7	7	6	10	6.5	10	1	2	6	5	30	30	29	30	25	30	28	27	30	28	30	30
6.5	9.5	7	6	7	8	7	9	2	3	5	4	30	28	30	30	23	30	30	30	28	30	30	30
6.5	9.5	7	5	7	10	6	10	6.5	8	5	6	30	30	28	30	25	20	28	0	30	25	30	27
6.5	9	7	6	5.5	5	0	10	0	1	0	4	30	30	30	30	30	30	30	30	30	30	30	30
6.5	9	7	5	6	10	7	10	1	7	4	6	30	29	30	29	28	30	30	30	30	30	30	30
6.5	9	7	5	6	8	6.5	10	3	0	6	5	30	24	23	30	28	30	30	30	19	29	30	25
6.5	9	7	5	7	8.5	6.5	10	1	0	5	0	30	18	26	28	30	30	30	30	15	30	30	18
6.5	9	3	7	6	9.5	7	10	0	10	0	1	30	24	30	30	30	30	30	28	28	30	30	25
6.5	8	3	7	6	3	6	10	4	0	2	5	30	26	30	30	30	30	30	30	30	30	30	30
6.5	7	3	2	4	3	3	10	1	0	3	3	30	29	0	30	20	14	30	30	29	30	18	30
6.5	6	7	7	4	9	4	9	4.5	9	6	7	30	27	20	27	30	25	30	22	27	26	26	29
6.5	6	3	5	7	10	7	10	0	2	0	5	30	30	26	30	30	30	30	25	30	30	30	26
6.5	4	7	5	7	5	4.5	4	1	1	5	5	30	30	29	30	30	30	30	30	20	30	30	28
6.5	1	7	5	6.5	9.5	7	9	3	1	6	5	28	28	30	30	20	28	30	25	30	29	26	27
6.5	0	7	5	7	9.5	6	9	4	6	4	3	30	18	30	30	30	30	30	30	30	30	30	30
6.5	0	7	6	6.5	8	0	0	0	0	2	3	23	29	30	30	30	29	30	30	0	30	30	28
6.5	0	3	6	7	1	3.5	7	1	1	4.5	6	30	30	30	29	29	30	30	30	30	30	30	30
6	9.5	3	6	5.5	8	6.5	5	4	1	6	7	18	21	26	25	30	27	30	25	24	27	30	29
6	9	7	10	7	8	6.5	10	0	5.5	0	0	30	24	30	30	0	29	30	20	0	30	30	29
6	9	7	10	5.5	10	7	5	4	5	5.5	4	30	30	30	28	25	20	30	0	29	27	0	30
6	9	7	8	5	9.5	0	8.5	1	2	0	3	30	26	26	30	30	27	30	30	30	25	30	26
6	8	7	5	4	9	6	9	4	7	3	3	27	28	30	30	30	30	30	0	30	30	0	30
6	8	7	6	7	10	7	10	4	7	5	6	30	28	28	26	30	22	30	0	26	28	30	25
6	8	7	5	7	10	0	10	0	2	0	4	30	29	30	28	26	30	30	30	30	30	29	30
6	8	7	2	5	6	4	5	4	2	4.5	3	25	18	25	30	25	25	30	30	30	30	30	30
6	8	4	4	4	5	4	9	3.5	2	2	8	28	29	27	22	0	30	30	27	24	30	30	30
6	8	0	0	7	6	1.5	5	6	1	4	4	30	30	30	27	17	30	30	0	0	30	0	30
6	7	7	9	6	10	3	10	4	6	0	0	29	30	30	28	30	28	30	30	30	29	30	30
6	7	7	4	4	5	4	9	0	1	3	5	30	26	28	30	30	30	30	30	0	30	30	26
6	5	7	6	7	10	6	10	3	1	5	4	30	28	25	30	25	30	30	30	29	30	30	26
6	4	7	7	3	2	3	8	0	2	2	4	30	30	27	30	25	27	30	30	0	30	30	26
6	2	7	8	6	8	4	6	4	0	5	6	30	26	30	30	30	30	30	30	30	30	30	15
6	0	7	6	5.5	8	4	9	0	5	1	5	30	28	30	30	23	30	30	30	30	30	30	30
6	0	7	6	6	10	3	10	0	2	3	4	30	30	30	28	30	28	30	30	30	30	30	30
6	0	7	5	5	2	3	0	0	0	4	5	30	30	30	30	20	30	30	30	28	30	30	30
6	0	7	3	7	0	2	1	0	0	5	1	0	28	26	30	30	30	30	30	24	30	30	30
6	0	0	0	4	0	3	2	1	0	0	0	27	30	14	27	0	30	30	30	15	30	30	28
5	9.5	7	6	5.5	10	3	9	0	9	0	6	27	29	30	30	30	26	30	30	30	30	30	29
5	8	7	4	7	9	6	7	0	0	6	4	30	30	26	30	0	25	30	0	0	30	15	30
5	8	7	7	4	9	6	10	1	8	0	7	30	30	26	30	30	30	30	30	30	30	30	27
5	7	7	5	6.5	5	4.5	9.5	2	4	4	3	24	28	30	27	28	25	28	30	30	30	28	30
5	7	7	5	7	1	3.5	6	3	3	6	4	24	29	30	30	29	28	30	26	30	30	30	30
5	6	7	5	7	9.5	5	8	7	3	5	6	30	29	30	28	26	30	30	30	24	30	30	28
5	6	7	8	5	8	6.5	9	3	3	3	4	30	30	30	30	30	30	30	29	18	30	30	30
5	0	7	4	7	8	4	9	5	6	3	5	30	18	29	30	27	29	30	30	27	30	30	30
5	0	3	3	7	1	4	4.5	4.5	0	2	3	20	29	25	30	28	28	30	30	23	30	30	30
4	7	7	10	7	9.5	6.5	9	3	0	5	3	28	28	30	30	30	30	30	30	28	30	26	0
4	5	7	10	7	0	3	9	0	0	6	2	30	26	26	28	12	27	30	21	0	30	13	0
4	4	3	10	7	5	5	9.5	0	0	3	7	25	29	30	27	27	0	30	30	0	30	30	30
4	3	7	4	6	6	1	5	1	1	3	3	20	30	30	30	30	29	30	0	28	30	30	30
4	2	7	5	3	6	5.5	10	5.5	6	4	5	20	29	21	28	23	22	29	26	25	29	30	28
3	8	0	0	6.5	8	0	0	4	5	6	6	30	29	28	29	23	30	30	0	0	30	20	30
3	5	3	5	7	10	4.5	10	6	8	0	4	30	18	26	30	30	30	30	30	30	30	30	30
3	2	7	4	4	10	6.5	6	3	7	3	6	30	28	27	30	30	0	30	30	30	30	30	30
2	0	3	4	5	2	3	3	2	3	3	2	29	27	28	30	30	25	0	30	27	30	30	30
0	6	3	3	3	1	2	3	0	0	5	3	27	29	30	28	28	30	30	30	28	30	0	30
0	5	7	8	7	10	4.5	9	5	3	4	7	30	30	30	30	30	28	30	29	30	30	30	30
0	1	3	2	4	1	2	2	0	0	3	2	0	0	23	26	0	27	30	27	0	30	30	30
0	0	7	6	7	10	5.5	10	3	3	5	2	20	30	24	28	7	0	30	20	24	21	24	29
0	0	7	5	4	10	3	0	1	2	2	7	0	26	14	26	29	27	30	30	28	30	30	30
0	0	7	6	3	4	4	9.5	5	1	2	4	20	24	22	28	27	28	30	29	25	30	30	28
0	0	3	5	7	5	4	5	3	0	4	4	30	29	30	29	30	25	30	30	15	29	30	30];

%Make a homework score for each student.  If the 8 of 10 best HW
%scores are 30 than this score will be 10.
HW=scores(:,13:24);           %homeworks are the 10 columns 11-20 of scores
HW = sort(HW');               %Sort the scores from worst to best
HW = sum(HW(3:12,:))/(10*3);   % best 10 HW scores summed and divided by 6*3

%Make a new set of scores made up of the quizes and the single hw score counted twice
%for each student.  Thus each student has 12 scores.

%Matrix of 8 scores and one cumulative homework for each student.
scores = [scores(:,1:12) HW' HW'];

% For each student sort their scores from worst to best
scoressorted = sort(scores'); 
bestsix = sum(scoressorted(9:14,:))/6;

%Sort from lowest to highest
bestsixsorted = sort(bestsix');

Average6 = mean(bestsixsorted)
Median4=median(bestsixsorted)

n=length(bestsixsorted);

plot(bestsixsorted,1:n)
title('Cumulative distribution plot for best four scores, the integral of the bell curve')
xlabel('Score')
ylabel('Number of students with less than that score.')

figure(2)
hist(bestsixsorted)
