I am going to use Mathematica to create a table of statistics from a trivia tournament that happened in December.

Teams consist of 4-5 players. On each question, a player can either get +10 points (a “ten”), or -5 points (a “neg”), or nothing.

There are 20 questions in each game, and each team (although not each individual player) played 12 games.

This is the list of players in the tournament, with their total numbers of tens, negs, and games played.

jay = {65,18,12}
huma={33,6,12}
joe={21,4,12}
paul2={15,4,12}
aaron={35,13,7}
erik={22,7,12}
paul1={20,5,12}
ian={12,4,12}
nathan={9,1,12}
jordan={57,19,12}
aayush={55,18,12}
luka={8,1,12}
cam={5,1,11}
pat={54,19,12}
adam={42,7,12}
mingho={12,2,12}
christine={10,0,12}
empty={0,0,12}

Here are some functions I’ve created to calculate more advanced statistics.

points[{tens_,negs_,gp_}]:=10*tens-5*negs
ppg[{tens_,negs_,gp_}]:=N[points[{tens,negs,gp}]/gp,4]
pptu[{tens_,negs_,gp_}]:=ppg[{tens,negs,gp}]/20
tensperneg[{tens_,negs_,gp_}]:=If[negs==0,"inf",N[tens/negs,4]]

This is a list of the teams in the tournament, with their players. Below are some functions created to calculate team statistics.

becausetheyrebig={jay,huma,joe,paul2,empty}
nonbosco={aaron,erik,paul1,ian,nathan}
angelamerkelsbones={jordan,aayush,luka,cam,empty}
taqbwfp={pat,adam,mingho,christine,empty}

teampoints[{p1_,p2_,p3_,p4_,p5_}]:=points[p1]+points[p2]+points[p3]+points[p4]+points[p5]
teamppg[team_]:=N[teampoints[team]/12,4]
teampptu[team_]:=N[teampoints[team]/240,4]
teamtensperneg[team_]:=N[(Sum[team[[i]][[1]],{i,5}])/(Sum[team[[i]][[2]],{i,5}]),4]

This is a list of the players, so I can call this list later.

playerlist={jay,aaron,jordan,aayush,pat,adam,huma,joe,erik,paul1,paul2,mingho,ian,christine,nathan,luka,cam}

To make sure our final table is formatted nicely, here are some functions to call certain strings of players’ names as well as team names.

getname[1]="Jay"
getname[2]="Aaron"
getname[3]="Jordan"
getname[4]="Aayush"
getname[5]="Pat"
getname[6]="Adam"
getname[7]="Huma"
getname[8]="Joe"
getname[9]="Erik"
getname[10]="Paul K"
getname[11]="Paul Z"
getname[12]="Ming-Ho"
getname[13]="Ian"
getname[14]="Christine"
getname[15]="Nathan"
getname[16]="Luka"
getname[17]="Cam"

getteam[n_]:=If[n==1||n==7||n==8||n==11,"Because They're Big",If[n==2||n==9||n==10||n==13||n==15,"Non Bosco",If[n==3||n==4||n==16||n==17,"Angela Merkel's Bones",If[n==5||n==6||n==12||n==14,"TAQB:WFP"]]]]

gridrow[n_]:={getname[n],getteam[n],playerlist[[n]][[1]],playerlist[[n]][[2]],playerlist[[n]][[3]],points[playerlist[[n]]],ppg[playerlist[[n]]],pptu[playerlist[[n]]],tensperneg[playerlist[[n]]]}

Grid[{
{"Player","Team","Tens","Negs","Games","Points","PPG","PPTU","TPN"},
gridrow[1],gridrow[2],gridrow[3],gridrow[4],gridrow[5],gridrow[6],gridrow[7],gridrow[8],gridrow[9],gridrow[10],gridrow[11],gridrow[12],gridrow[13],gridrow[14],gridrow[15],gridrow[16],gridrow[17]

}]

And finally, we can see all of the statistics, arranged in this table.