Once you have finished the test:
SAS-lastname-STUDENTNUMBER
(eg. SAS-Knight-123456) and call the file for the R code: R-lastname-STUDENTNUMBER
(eg. R-Knight-123456).Using both SAS and R (in other words attempt this question using SAS and then using R):
Create a data set with two variables: "Week" and "Ranking". For every week of the MAT013 course (1-5 including this class test) give a ranking of your enjoyment of each week of the course (1 being the best). Write some code (in both SAS and R) to sort this data set in descending order of the enjoyment ranking.
[10]
Using SAS:
Solve the following optimisation problem:
Maximize
\[x+3y-z+max(x,y)+2z\]
Subject to:
\[x-3y\leq 20\] \[x-7y\geq 5\] \[y+z\leq 25\] \[y\geq 0\] \[z\geq \max(x,y)\]
[25]
Using R:
Create a function that will give all numbers less than \(k\) (an input), not divisible by \(3,7\) or \(13\). Furthermore let your function take as input the name of a file and write those numbers to a csv file with that name.
Demonstrate this with \(k=2341\) and the file name "classtest".
[25]
Using either SAS or R:
The files Game_1.csv, Game_2.csv, Game_3.csv, Game_4.csv, Game_5.csv, Game_6.csv contains data for guesses of the game "2/3rds of the average":
"All individuals must guess a number between 0 and 100 (inclusive). The winner of the game is the guess that is closest to two thirds of the average of all guesses."