For this assignment you will be replicating the game of Roshambo (aka rock, paper, scissors). answer both parts a and b of the following question below. Show the R code in your answer and annotate all parts of the code. a.) First, you need to come up with a strategy to win the game. Write a function in R that takes in a vector of past plays for your opponent (each play should be represented as “R”, “P”, or “S”) and outputs the next move (“R”, “P”, or “S”). Your strategy should at least depend on the last two moves used, but you should return a random move if there is not enough past history to use the strategy. b.) Now, play your strategy against a random player who uses rock, paper, or scissors with 1/3 probability each. Who wins the most rounds after 100 rounds of play? Write a function in R.
https://helpmewriteessay.xyz/wp-content/uploads/2021/08/whatsapp-logo-300x115.jpeg 0 0 First class essays https://helpmewriteessay.xyz/wp-content/uploads/2021/08/whatsapp-logo-300x115.jpeg First class essays2022-04-21 06:53:362022-04-21 06:53:36For this assignment you will be replicating the game of Roshambo (aka rock, paper, scissors). answer both parts a and b of the following question