Diversity prediction theorem: Difference between revisions

m
→‎{{header|R}}: Syntax highlighting.
(→‎{{header|Haskell}}: added solution)
m (→‎{{header|R}}: Syntax highlighting.)
Line 1,328:
=={{header|R}}==
R's vectorisation shines here. The hardest part of this task was giving each estimate its own numbered column, which is little more than a printing luxury. The actual mathematics was trivial, with each part done in essentially one line.
<lang Rrsplus>diversityStats<-function(trueValue, estimates)
{
collectivePrediction<-mean(estimates)
331

edits