Highlights
Your lab should be done in R Markdown and knitted as an HTML or PDF document. You’ll need to submit both a .Rmd file which knits as well as your final output file.
1. Fibonacci
The Fibonacci sequence (1, 1, 2, 3, 5, 8, 13, 21, 34, 55, …) is defined as F(1) = 1, F(2) = 1, F(n) = F(n-1) + F(n-2).
a. Write pseudocode to calculate F(n)
b. Write pseudocode to construct a vector of the first n numbers in the Fibonacci sequence.
c. Write a function:
fibo(n = 1){
# Your code here
}
which takes one parameter n and returns the nth Fibonacci number
d. Use the function you wrote to calculate the 58th Fibonacci number. Include your R code in your report.
2. Tic-Tac-Toe
a. Write rules of the game.
b. Write high-level pseudocode for playing one game between two human players.
i. Include pseudocode for what happens before, during, and after the game.
c. Identify which elements of the game need to be tracked.
i. For each element which you will track:
1. Describe the type of object you think is appropriate to store the game element. (e.g. A numeric vector, a character matrix, a data.frame, etc.). Describe in as much detail as possible how you would use each object to store its associated game element.
d. Identify parts of your pseudocode which could be turned into individual functions.
i. For each function you identify:
1. List required function inputs.
2. List desired function output.
3. pseudocode each function.
e. A game of tic-tac-toe has, at most 9 turns, write out the turns of a single game, move by move, in language a (normal) human would use to describe the game. Annotate each turn with an explanation of what the repercussions of each move are with regard to which functions would be called leading up to, during, and after each turn, what their input and output values should be, and list what the game element variables contain after the turn.
f. Discuss what you would need to change or add to create an AI to play tic-tac-toe against you.
i. What would the simplest AI opponent do?
1. pseudocode the simplest AI.
a. List the functions this AI would need to call to take its turn and for each:
i. Describe the required inputs.
ii. Describe the desired output.
ii. What would a sophisticated tic-tac-toe AI do?
1. pseudocode a sophisticated AI.
a. List the functions this AI would need to call to take its turn and for each:
i. Describe the required inputs
ii. Describe the desired output
g. Discuss how you would add the functionality to have two AI (the simple and sophisticated) AI play against each other.
i. Write pseudocode to play one AI vs AI game.
ii. Extend this to allow an arbitrary number of AI games to be played.
h. Put all of your pseudocode together into a comprehensive outline for programming a complete tic-tac-toe game.
This Statistics Assessment has been solved by our Statistics Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our experts are well trained to follow all marking rubrics & referencing style.
Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.
© Copyright 2026 My Uni Papers – Student Hustle Made Hassle Free. All rights reserved.