I didnt learn R code before. How do I solve this question?
Part E. Consider the problem and solution given at : http / / www cut – the -knot orE / Probability / Coin Tossing SurprisE 1. Shtml . The question is repeated here "A fair coin is tossed repeatedly!1. What is the Expected number of tosses before HT shows up for the first time ?"2. What is the Expected number of tosses before IT shows up for the first time ?"3. What is the probability that HT shows up before IT ?"Imagine that you are unable to answer this problem using mathematics ( the solutions are given so don’tUSE them! and must instead answer it using a computer . USE the same methodology as in Part A, brutefororCE, to answer the question . The function should be called CTS with input , IT , the number of iterationsLEames ) and output a vector with the ( 1 ), 12 ) and 13 ) in this order .CIS = Function /n )IFEnd Function