WeixiangYan/CodeTransOcean huggingface dataset:
Task: ABC problem






PHP: <?php
$words = array("A", "BARK", "BOOK", "TREAT", "COMMON", "SQUAD", "Confuse");

function canMakeWord($word) {
    $word = strtoupper($word);
    $blocks = array(
            "BO", "XK", "DQ", "CP", "NA",
            "GT", "RE", "TG", "QD", "FS",
            "JW", "HU", "VI", "AN", "OB",
            "ER", "FS", "LY", "PC", "ZM",
    );

    foreach (str_split($word) as $char) {
        foreach ($blocks as $k => $block) {
            if (strpos($block, $char) !== FALSE) {
                unset($blocks[$k]);
                continue(2);
            }
        }
        return false;
    }
    return true;
}

foreach ($words as $word) {
    echo $word.': ';
    echo canMakeWord($word) ? "True" : "False";
    echo "\r\n";
}






Ada: with Ada.Characters.Handling;
use Ada.Characters.Handling;


package Abc is
    type Block_Faces is array(1..2) of Character;
    type Block_List is array(positive range <>) of Block_Faces;
    function Can_Make_Word(W: String; Blocks: Block_List) return Boolean;
end Abc;


package body Abc is

function Can_Make_Word(W: String; Blocks: Block_List) return Boolean is
    Used : array(Blocks'Range) of Boolean := (Others => False);
    subtype wIndex is Integer range W'First..W'Last;
    wPos : wIndex;
begin
    if W'Length = 0 then
        return True;
    end if;
    wPos := W'First;
    while True loop
        declare
            C : Character := To_Upper(W(wPos));
            X : constant wIndex := wPos;
        begin
            for I in Blocks'Range loop
                if (not Used(I)) then
                    if C = To_Upper(Blocks(I)(1)) or C = To_Upper(Blocks(I)(2)) then
                        Used(I) := True;
                        if wPos = W'Last then
                            return True;
                        end if;
                        wPos := wIndex'Succ(wPos);
                        exit;
                    end if;
                end if;
            end loop;
            if X = wPos then
                return False;
            end if;
        end;
    end loop;
    return False;
end Can_Make_Word;

end Abc;

with Ada.Text_IO, Ada.Strings.Unbounded, Abc;
use Ada.Text_IO, Ada.Strings.Unbounded, Abc;

procedure Abc_Problem is
    Blocks : Block_List := (
          ('B','O'), ('X','K'), ('D','Q'), ('C','P')
        , ('N','A'), ('G','T'), ('R','E'), ('T','G')
        , ('Q','D'), ('F','S'), ('J','W'), ('H','U')
        , ('V','I'), ('A','N'), ('O','B'), ('E','R')
        , ('F','S'), ('L','Y'), ('P','C'), ('Z','M')
    );
    function "+" (S : String) return Unbounded_String renames To_Unbounded_String;
    words : array(positive range <>) of Unbounded_String := (
          +"A"
        , +"BARK"
        , +"BOOK"
        , +"TREAT"
        , +"COMMON"
        , +"SQUAD"
        , +"CONFUSE"
        
        
        
    );
begin
    for I in words'Range loop
        Put_Line ( To_String(words(I)) & ": " & Boolean'Image(Can_Make_Word(To_String(words(I)),Blocks)) );
    end loop;
end Abc_Problem;
Task: ABC problem








VB: dim Blocks as string
dim InWord as string

Function CanMakeWord (FInWord as string, FBlocks as string) as integer
    dim WIndex as integer, BIndex as integer
    
    FBlocks = UCase$(FBlocks) - " " - ","
    FInWord = UCase$(FInWord)
    
    for WIndex = 1 to len(FInWord)
        BIndex = instr(FBlocks, FInWord[WIndex])
        
        if BIndex then
            FBlocks = Replace$(FBlocks,"**",iif(BIndex mod 2,BIndex,BIndex-1))
        else
            Result = 0
            exit function
        end if
    next
    
    Result = 1            
end function 

InWord = "Confuse"
Blocks = "BO, XK, DQ, CP, NA, GT, RE, TG, QD, FS, JW, HU, VI, AN, OB, ER, FS, LY, PC, ZM"
showmessage "Can make: " + InWord + " = " + iif(CanMakeWord(InWord, Blocks), "True", "False")
Task: Diversity prediction theorem



C#: using System;
using System.Linq;
using System.Collections.Generic;

public class MainClass {
    static double Square(double x) => x * x;

    static double AverageSquareDiff(double a, IEnumerable<double> predictions)
        => predictions.Select(x => Square(x - a)).Average();

    static void DiversityTheorem(double truth, IEnumerable<double> predictions)
    {
        var average = predictions.Average();
        Console.WriteLine($@"average-error: {AverageSquareDiff(truth, predictions)}
crowd-error: {Square(truth - average)}
diversity: {AverageSquareDiff(average, predictions)}");
    }
	
    public static void Main() {
	DiversityTheorem(49, new []{48d,47,51});
    	DiversityTheorem(49, new []{48d,47,51,42});
    }
}









Ada: with Ada.Text_IO;
with Ada.Command_Line;

procedure Diversity_Prediction is

   type Real is new Float;
   type Real_Array is array (Positive range <>) of Real;

   package Real_IO is new Ada.Text_Io.Float_IO (Real);
   use Ada.Text_IO, Ada.Command_Line, Real_IO;

   function Mean (Data : Real_Array) return Real is
      Sum : Real := 0.0;
   begin
      for V of Data loop
         Sum := Sum + V;
      end loop;
      return Sum / Real (Data'Length);
   end Mean;

   function Variance (Reference : Real; Data : Real_Array) return Real is
      Res : Real_Array (Data'Range);
   begin
      for A in Data'Range loop
         Res (A) := (Reference - Data (A)) ** 2;
      end loop;
      return Mean (Res);
   end Variance;

   procedure Diversity (Truth : Real; Estimates : Real_Array)
   is
      Average       : constant Real := Mean (Estimates);
      Average_Error : constant Real := Variance (Truth, Estimates);
      Crowd_Error   : constant Real := (Truth - Average) ** 2;
      Diversity     : constant Real := Variance (Average, Estimates);
   begin
      Real_IO.Default_Exp := 0;
      Real_IO.Default_Aft := 5;
      Put ("average-error : "); Put (Average_Error);  New_Line;
      Put ("crowd-error   : "); Put (Crowd_Error);    New_Line;
      Put ("diversity     : "); Put (Diversity);      New_Line;
   end Diversity;

begin
   if Argument_Count <= 1 then
      Put_Line ("Usage: diversity_prediction <truth> <data_1> <data_2> ...");
      return;
   end if;

   declare
      Truth     : constant Real := Real'Value (Argument (1));
      Estimates : Real_Array (2 .. Argument_Count);
   begin
      for A in 2 .. Argument_Count loop
         Estimates (A) := Real'Value (Argument (A));
      end loop;

      Diversity (Truth, Estimates);
   end;
end Diversity_Prediction;
Task: Diversity prediction theorem

C: #include<string.h>
#include<stdlib.h>
#include<stdio.h>

float mean(float* arr,int size){
	int i = 0;
	float sum = 0;
	
	while(i != size)
		sum += arr[i++];
	
	return sum/size;
}

float variance(float reference,float* arr, int size){
	int i=0;
	float* newArr = (float*)malloc(size*sizeof(float));
	
	for(;i<size;i++)
		newArr[i] = (reference - arr[i])*(reference - arr[i]);
	
	return mean(newArr,size);
}

float* extractData(char* str, int *len){
	float* arr;
	int i=0,count = 1;
	char* token;
	
	while(str[i]!=00){
		if(str[i++]==',')
			count++;
	}
	
	arr = (float*)malloc(count*sizeof(float));
	*len = count;
	
	token = strtok(str,",");
	
	i = 0;
	
	while(token!=NULL){
		arr[i++] = atof(token);
		token = strtok(NULL,",");
	}
	
	return arr;
}

int main(int argC,char* argV[])
{
	float* arr,reference,meanVal;
	int len;
	if(argC!=3)
		printf("Usage : %s <reference value> <observations separated by commas>");
	else{
		arr = extractData(argV[2],&len);
		
		reference = atof(argV[1]);
		
		meanVal = mean(arr,len);

		printf("Average Error : %.9f\n",variance(reference,arr,len));
		printf("Crowd Error : %.9f\n",(reference - meanVal)*(reference - meanVal));
		printf("Diversity : %.9f",variance(meanVal,arr,len));
	}
	
	return 0;
}











Ada: with Ada.Text_IO;
with Ada.Command_Line;

procedure Diversity_Prediction is

   type Real is new Float;
   type Real_Array is array (Positive range <>) of Real;

   package Real_IO is new Ada.Text_Io.Float_IO (Real);
   use Ada.Text_IO, Ada.Command_Line, Real_IO;

   function Mean (Data : Real_Array) return Real is
      Sum : Real := 0.0;
   begin
      for V of Data loop
         Sum := Sum + V;
      end loop;
      return Sum / Real (Data'Length);
   end Mean;

   function Variance (Reference : Real; Data : Real_Array) return Real is
      Res : Real_Array (Data'Range);
   begin
      for A in Data'Range loop
         Res (A) := (Reference - Data (A)) ** 2;
      end loop;
      return Mean (Res);
   end Variance;

   procedure Diversity (Truth : Real; Estimates : Real_Array)
   is
      Average       : constant Real := Mean (Estimates);
      Average_Error : constant Real := Variance (Truth, Estimates);
      Crowd_Error   : constant Real := (Truth - Average) ** 2;
      Diversity     : constant Real := Variance (Average, Estimates);
   begin
      Real_IO.Default_Exp := 0;
      Real_IO.Default_Aft := 5;
      Put ("average-error : "); Put (Average_Error);  New_Line;
      Put ("crowd-error   : "); Put (Crowd_Error);    New_Line;
      Put ("diversity     : "); Put (Diversity);      New_Line;
   end Diversity;

begin
   if Argument_Count <= 1 then
      Put_Line ("Usage: diversity_prediction <truth> <data_1> <data_2> ...");
      return;
   end if;

   declare
      Truth     : constant Real := Real'Value (Argument (1));
      Estimates : Real_Array (2 .. Argument_Count);
   begin
      for A in 2 .. Argument_Count loop
         Estimates (A) := Real'Value (Argument (A));
      end loop;

      Diversity (Truth, Estimates);
   end;
end Diversity_Prediction;
Task: Diversity prediction theorem


C++: #include <iostream>
#include <vector>
#include <numeric>

float sum(const std::vector<float> &array)
{
    return std::accumulate(array.begin(), array.end(), 0.0);
}

float square(float x)
{
    return x * x;
}

float mean(const std::vector<float> &array)
{
    return sum(array) / array.size();
}

float averageSquareDiff(float a, const std::vector<float> &predictions)
{
    std::vector<float> results;
    for (float x : predictions)
        results.push_back(square(x - a));
    return mean(results);
}

void diversityTheorem(float truth, const std::vector<float> &predictions)
{
    float average = mean(predictions);
    std::cout
        << "average-error: " << averageSquareDiff(truth, predictions) << "\n"
        << "crowd-error: " << square(truth - average) << "\n"
        << "diversity: " << averageSquareDiff(average, predictions) << std::endl;
}

int main() {
    diversityTheorem(49, {48,47,51});
    diversityTheorem(49, {48,47,51,42});
    return 0;
}










Ada: with Ada.Text_IO;
with Ada.Command_Line;

procedure Diversity_Prediction is

   type Real is new Float;
   type Real_Array is array (Positive range <>) of Real;

   package Real_IO is new Ada.Text_Io.Float_IO (Real);
   use Ada.Text_IO, Ada.Command_Line, Real_IO;

   function Mean (Data : Real_Array) return Real is
      Sum : Real := 0.0;
   begin
      for V of Data loop
         Sum := Sum + V;
      end loop;
      return Sum / Real (Data'Length);
   end Mean;

   function Variance (Reference : Real; Data : Real_Array) return Real is
      Res : Real_Array (Data'Range);
   begin
      for A in Data'Range loop
         Res (A) := (Reference - Data (A)) ** 2;
      end loop;
      return Mean (Res);
   end Variance;

   procedure Diversity (Truth : Real; Estimates : Real_Array)
   is
      Average       : constant Real := Mean (Estimates);
      Average_Error : constant Real := Variance (Truth, Estimates);
      Crowd_Error   : constant Real := (Truth - Average) ** 2;
      Diversity     : constant Real := Variance (Average, Estimates);
   begin
      Real_IO.Default_Exp := 0;
      Real_IO.Default_Aft := 5;
      Put ("average-error : "); Put (Average_Error);  New_Line;
      Put ("crowd-error   : "); Put (Crowd_Error);    New_Line;
      Put ("diversity     : "); Put (Diversity);      New_Line;
   end Diversity;

begin
   if Argument_Count <= 1 then
      Put_Line ("Usage: diversity_prediction <truth> <data_1> <data_2> ...");
      return;
   end if;

   declare
      Truth     : constant Real := Real'Value (Argument (1));
      Estimates : Real_Array (2 .. Argument_Count);
   begin
      for A in 2 .. Argument_Count loop
         Estimates (A) := Real'Value (Argument (A));
      end loop;

      Diversity (Truth, Estimates);
   end;
end Diversity_Prediction;
Task: Diversity prediction theorem




Go: package main

import "fmt"

func averageSquareDiff(f float64, preds []float64) (av float64) {
    for _, pred := range preds {
        av += (pred - f) * (pred - f)
    }
    av /= float64(len(preds))
    return
}

func diversityTheorem(truth float64, preds []float64) (float64, float64, float64) {
    av := 0.0
    for _, pred := range preds {
        av += pred
    }
    av /= float64(len(preds))
    avErr := averageSquareDiff(truth, preds)
    crowdErr := (truth - av) * (truth - av)
    div := averageSquareDiff(av, preds)
    return avErr, crowdErr, div
}

func main() {
    predsArray := [2][]float64{{48, 47, 51}, {48, 47, 51, 42}}
    truth := 49.0
    for _, preds := range predsArray {
        avErr, crowdErr, div := diversityTheorem(truth, preds)
        fmt.Printf("Average-error : %6.3f\n", avErr)
        fmt.Printf("Crowd-error   : %6.3f\n", crowdErr)
        fmt.Printf("Diversity     : %6.3f\n\n", div)
    }
}








Ada: with Ada.Text_IO;
with Ada.Command_Line;

procedure Diversity_Prediction is

   type Real is new Float;
   type Real_Array is array (Positive range <>) of Real;

   package Real_IO is new Ada.Text_Io.Float_IO (Real);
   use Ada.Text_IO, Ada.Command_Line, Real_IO;

   function Mean (Data : Real_Array) return Real is
      Sum : Real := 0.0;
   begin
      for V of Data loop
         Sum := Sum + V;
      end loop;
      return Sum / Real (Data'Length);
   end Mean;

   function Variance (Reference : Real; Data : Real_Array) return Real is
      Res : Real_Array (Data'Range);
   begin
      for A in Data'Range loop
         Res (A) := (Reference - Data (A)) ** 2;
      end loop;
      return Mean (Res);
   end Variance;

   procedure Diversity (Truth : Real; Estimates : Real_Array)
   is
      Average       : constant Real := Mean (Estimates);
      Average_Error : constant Real := Variance (Truth, Estimates);
      Crowd_Error   : constant Real := (Truth - Average) ** 2;
      Diversity     : constant Real := Variance (Average, Estimates);
   begin
      Real_IO.Default_Exp := 0;
      Real_IO.Default_Aft := 5;
      Put ("average-error : "); Put (Average_Error);  New_Line;
      Put ("crowd-error   : "); Put (Crowd_Error);    New_Line;
      Put ("diversity     : "); Put (Diversity);      New_Line;
   end Diversity;

begin
   if Argument_Count <= 1 then
      Put_Line ("Usage: diversity_prediction <truth> <data_1> <data_2> ...");
      return;
   end if;

   declare
      Truth     : constant Real := Real'Value (Argument (1));
      Estimates : Real_Array (2 .. Argument_Count);
   begin
      for A in 2 .. Argument_Count loop
         Estimates (A) := Real'Value (Argument (A));
      end loop;

      Diversity (Truth, Estimates);
   end;
end Diversity_Prediction;
Task: Diversity prediction theorem





Java: import java.util.Arrays;

public class DiversityPredictionTheorem {
    private static double square(double d) {
        return d * d;
    }

    private static double averageSquareDiff(double d, double[] predictions) {
        return Arrays.stream(predictions)
            .map(it -> square(it - d))
            .average()
            .orElseThrow();
    }

    private static String diversityTheorem(double truth, double[] predictions) {
        double average = Arrays.stream(predictions)
            .average()
            .orElseThrow();
        return String.format("average-error : %6.3f%n", averageSquareDiff(truth, predictions))
            + String.format("crowd-error   : %6.3f%n", square(truth - average))
            + String.format("diversity     : %6.3f%n", averageSquareDiff(average, predictions));
    }

    public static void main(String[] args) {
        System.out.println(diversityTheorem(49.0, new double[]{48.0, 47.0, 51.0}));
        System.out.println(diversityTheorem(49.0, new double[]{48.0, 47.0, 51.0, 42.0}));
    }
}







Ada: with Ada.Text_IO;
with Ada.Command_Line;

procedure Diversity_Prediction is

   type Real is new Float;
   type Real_Array is array (Positive range <>) of Real;

   package Real_IO is new Ada.Text_Io.Float_IO (Real);
   use Ada.Text_IO, Ada.Command_Line, Real_IO;

   function Mean (Data : Real_Array) return Real is
      Sum : Real := 0.0;
   begin
      for V of Data loop
         Sum := Sum + V;
      end loop;
      return Sum / Real (Data'Length);
   end Mean;

   function Variance (Reference : Real; Data : Real_Array) return Real is
      Res : Real_Array (Data'Range);
   begin
      for A in Data'Range loop
         Res (A) := (Reference - Data (A)) ** 2;
      end loop;
      return Mean (Res);
   end Variance;

   procedure Diversity (Truth : Real; Estimates : Real_Array)
   is
      Average       : constant Real := Mean (Estimates);
      Average_Error : constant Real := Variance (Truth, Estimates);
      Crowd_Error   : constant Real := (Truth - Average) ** 2;
      Diversity     : constant Real := Variance (Average, Estimates);
   begin
      Real_IO.Default_Exp := 0;
      Real_IO.Default_Aft := 5;
      Put ("average-error : "); Put (Average_Error);  New_Line;
      Put ("crowd-error   : "); Put (Crowd_Error);    New_Line;
      Put ("diversity     : "); Put (Diversity);      New_Line;
   end Diversity;

begin
   if Argument_Count <= 1 then
      Put_Line ("Usage: diversity_prediction <truth> <data_1> <data_2> ...");
      return;
   end if;

   declare
      Truth     : constant Real := Real'Value (Argument (1));
      Estimates : Real_Array (2 .. Argument_Count);
   begin
      for A in 2 .. Argument_Count loop
         Estimates (A) := Real'Value (Argument (A));
      end loop;

      Diversity (Truth, Estimates);
   end;
end Diversity_Prediction;
Task: Diversity prediction theorem








VB: Module Module1

    Function Square(x As Double) As Double
        Return x * x
    End Function

    Function AverageSquareDiff(a As Double, predictions As IEnumerable(Of Double)) As Double
        Return predictions.Select(Function(x) Square(x - a)).Average()
    End Function

    Sub DiversityTheorem(truth As Double, predictions As IEnumerable(Of Double))
        Dim average = predictions.Average()
        Console.WriteLine("average-error: {0}", AverageSquareDiff(truth, predictions))
        Console.WriteLine("crowd-error: {0}", Square(truth - average))
        Console.WriteLine("diversity: {0}", AverageSquareDiff(average, predictions))
    End Sub

    Sub Main()
        DiversityTheorem(49.0, {48.0, 47.0, 51.0})
        DiversityTheorem(49.0, {48.0, 47.0, 51.0, 42.0})
    End Sub

End Module




Ada: with Ada.Text_IO;
with Ada.Command_Line;

procedure Diversity_Prediction is

   type Real is new Float;
   type Real_Array is array (Positive range <>) of Real;

   package Real_IO is new Ada.Text_Io.Float_IO (Real);
   use Ada.Text_IO, Ada.Command_Line, Real_IO;

   function Mean (Data : Real_Array) return Real is
      Sum : Real := 0.0;
   begin
      for V of Data loop
         Sum := Sum + V;
      end loop;
      return Sum / Real (Data'Length);
   end Mean;

   function Variance (Reference : Real; Data : Real_Array) return Real is
      Res : Real_Array (Data'Range);
   begin
      for A in Data'Range loop
         Res (A) := (Reference - Data (A)) ** 2;
      end loop;
      return Mean (Res);
   end Variance;

   procedure Diversity (Truth : Real; Estimates : Real_Array)
   is
      Average       : constant Real := Mean (Estimates);
      Average_Error : constant Real := Variance (Truth, Estimates);
      Crowd_Error   : constant Real := (Truth - Average) ** 2;
      Diversity     : constant Real := Variance (Average, Estimates);
   begin
      Real_IO.Default_Exp := 0;
      Real_IO.Default_Aft := 5;
      Put ("average-error : "); Put (Average_Error);  New_Line;
      Put ("crowd-error   : "); Put (Crowd_Error);    New_Line;
      Put ("diversity     : "); Put (Diversity);      New_Line;
   end Diversity;

begin
   if Argument_Count <= 1 then
      Put_Line ("Usage: diversity_prediction <truth> <data_1> <data_2> ...");
      return;
   end if;

   declare
      Truth     : constant Real := Real'Value (Argument (1));
      Estimates : Real_Array (2 .. Argument_Count);
   begin
      for A in 2 .. Argument_Count loop
         Estimates (A) := Real'Value (Argument (A));
      end loop;

      Diversity (Truth, Estimates);
   end;
end Diversity_Prediction;
Task: Diversity prediction theorem

C: #include<string.h>
#include<stdlib.h>
#include<stdio.h>

float mean(float* arr,int size){
	int i = 0;
	float sum = 0;
	
	while(i != size)
		sum += arr[i++];
	
	return sum/size;
}

float variance(float reference,float* arr, int size){
	int i=0;
	float* newArr = (float*)malloc(size*sizeof(float));
	
	for(;i<size;i++)
		newArr[i] = (reference - arr[i])*(reference - arr[i]);
	
	return mean(newArr,size);
}

float* extractData(char* str, int *len){
	float* arr;
	int i=0,count = 1;
	char* token;
	
	while(str[i]!=00){
		if(str[i++]==',')
			count++;
	}
	
	arr = (float*)malloc(count*sizeof(float));
	*len = count;
	
	token = strtok(str,",");
	
	i = 0;
	
	while(token!=NULL){
		arr[i++] = atof(token);
		token = strtok(NULL,",");
	}
	
	return arr;
}

int main(int argC,char* argV[])
{
	float* arr,reference,meanVal;
	int len;
	if(argC!=3)
		printf("Usage : %s <reference value> <observations separated by commas>");
	else{
		arr = extractData(argV[2],&len);
		
		reference = atof(argV[1]);
		
		meanVal = mean(arr,len);

		printf("Average Error : %.9f\n",variance(reference,arr,len));
		printf("Crowd Error : %.9f\n",(reference - meanVal)*(reference - meanVal));
		printf("Diversity : %.9f",variance(meanVal,arr,len));
	}
	
	return 0;
}
Task: Diversity prediction theorem



C#: using System;
using System.Linq;
using System.Collections.Generic;

public class MainClass {
    static double Square(double x) => x * x;

    static double AverageSquareDiff(double a, IEnumerable<double> predictions)
        => predictions.Select(x => Square(x - a)).Average();

    static void DiversityTheorem(double truth, IEnumerable<double> predictions)
    {
        var average = predictions.Average();
        Console.WriteLine($@"average-error: {AverageSquareDiff(truth, predictions)}
crowd-error: {Square(truth - average)}
diversity: {AverageSquareDiff(average, predictions)}");
    }
	
    public static void Main() {
	DiversityTheorem(49, new []{48d,47,51});
    	DiversityTheorem(49, new []{48d,47,51,42});
    }
}
Task: Diversity prediction theorem


C++: #include <iostream>
#include <vector>
#include <numeric>

float sum(const std::vector<float> &array)
{
    return std::accumulate(array.begin(), array.end(), 0.0);
}

float square(float x)
{
    return x * x;
}

float mean(const std::vector<float> &array)
{
    return sum(array) / array.size();
}

float averageSquareDiff(float a, const std::vector<float> &predictions)
{
    std::vector<float> results;
    for (float x : predictions)
        results.push_back(square(x - a));
    return mean(results);
}

void diversityTheorem(float truth, const std::vector<float> &predictions)
{
    float average = mean(predictions);
    std::cout
        << "average-error: " << averageSquareDiff(truth, predictions) << "\n"
        << "crowd-error: " << square(truth - average) << "\n"
        << "diversity: " << averageSquareDiff(average, predictions) << std::endl;
}

int main() {
    diversityTheorem(49, {48,47,51});
    diversityTheorem(49, {48,47,51,42});
    return 0;
}