March Madness Bracket Picker

by

 

Tell MATLAB to make your March Madness picks for you!

MarchMadness
function picks = MarchMadness

odds = [1 0.96 0.85 0.78 0.69 0.69 0.61 0.5 0.5 0.39 0.31 0.31 0.22 0.15 0.04 0]';
p = 2;

r1 = [1 16 8 9 5 12 4 13 6 11 3 14 7 10 2 15]';
r2 = zeros(8,1);
r3 = zeros(4,1);
r4 = zeros(2,1);
r5 = 0;

for i = 1:8
    R = rand;
    if R < odds(r1(i*2-1))
        r2(i) = r1(i*2-1);
    else
        r2(i) = r1(i*2);
    end
end

for i = 1:4
    R = rand;
    o1 = odds(r2(i*2-1))^p / (odds(r2(i*2-1))^p + odds(r2(i*2))^p);
    o2 = odds(r2(i*2))^p / (odds(r2(i*2-1))^p + odds(r2(i*2))^p);
    if R < o1
        r3(i) = r2(i*2-1);
    else
        r3(i) = r2(i*2);
    end
end

for i = 1:2
    R = rand;
    o1 = odds(r3(i*2-1))^p / (odds(r3(i*2-1))^p + odds(r3(i*2))^p);
    o2 = odds(r3(i*2))^p / (odds(r3(i*2-1))^p + odds(r3(i*2))^p);
    if R < o1
        r4(i) = r3(i*2-1);
    else
        r4(i) = r3(i*2);
    end
end

R = rand;
o1 = odds(r4(1))^p / (odds(r4(1))^p + odds(r4(2))^p);
o2 = odds(r4(2))^p / (odds(r4(1))^p + odds(r4(2))^p);
if R < o1
    r5 = r4(1);
else
    r5 = r4(2);
end

r1
r2
r3
r4
r5

bp = 4;



Contact us