MATLAB CONTEST by the numbers

I like when random factoids are called out in an interesting way. As a quick pass at the Visualization contest, take a look at this:

Contents

Semicolon use

When in doubt, speed up and quiet down your code by putting a semicolon at the end. What percentage of the unique lines of code had semicolons?

numEndsInSemi = 0;
numLines = numel(allLineList);

for i = 1:numLines
    if allLineList{i}(end) == ';'
        numEndsInSemi = numEndsInSemi + 1;
    end
end

figure(1)
pie([         numEndsInSemi, (numLines - numEndsInSemi)], ...
    {'Ends with semicolon;', 'No semicolon'})
title ('Semicolon use')
colormap spring
text(-2,0,'78%','fontsize',200)

Try, Try, Again...

If at first you do not suceed, try, try again. It seems like 78% of the time people would get their submitted code to work.

numPassed = sum([d(:).passed]);
numEntries = numel(d);
figure(2)
pie([ numPassed, (numEntries - numPassed)] , ...
    {    'Pass', 'Fail'})
title('Entry status')
colormap spring
text(-2,0,'88%','fontsize',200)

Bimodal distribution

It seems there are two standard sizes for entries. I bet someone could explore this phenomenon to explain why... hint

numLines = zeros(1,numEntries);
for i = 1:numEntries
    numLines(i) = numel(d(i).lines);
end

meanNumLines = mean(numLines);

figure(3)
hist(numLines,1:50:1000)
colormap spring
line([meanNumLines meanNumLines],ylim,'linewidth',6)
title ('Number of lines per entry')
text(-200,500,num2str(round(meanNumLines)),'fontsize',200)
text(-200,890,'Mean number of lines','fontsize',34)

Timing is everything

Are people just entering their code whenever they want? Looking at the second that they submit the code, it does look random.

hour = zeros(1,numEntries);
mint  = zeros(1,numEntries);
sec  = zeros(1,numEntries);
for i = 1:numEntries
    foo = datevec(d(i).timestamp);
    hour(i) = foo(4);
    mint(i)  = foo(5);
    sec(i)  = foo(6);
end

figure(4)
hist(sec,0:59)
colormap spring
xlim([-0.5, 59.5])
title('Entry second')
text(0.15,0.1,'Random','fontsize',34,'units','normalized')

However, is there more to this story? Looking at the minute that they submit the code, there does seem to be an anomoly. People are entering more at the end of the hour...

figure(5)
hist(mint,0:59)
colormap spring
xlim([-0.5, 59.5])
title('Entry minute')
text(0.15,0.1,'Random?','fontsize',34,'units','normalized')

Of course! Look at the noon deadline for each phase of the contest. People are holding out to the last minute of the last hour. It just seems they are not holding out to the last second of the last minute of the...

figure(6)
hist(hour,0:23)
line([11.5 11.5],[0 600],'linewidth',6)
colormap spring
xlim([-0.5, 23.5])
title('Entry hour (EST)')
text(0.15,0.1,'Noon deadline','fontsize',34,'units','normalized')