Use the function you wrote in problem A) to simulate n = 100-coin toss. Write a program that counts the quantity of simulated coin tosses before the first “crown” occurs. Suggest a “reasonable” value for the case where since “crown” is not observed in the n coin tosses.
A) Create program code for function file “average” which takes as the input vector “v” and uses a for-loop to calculate the average of all the numbers in “v”. Hint: To determine the number of numbers (n) in the vector “v” you can use n = length (v) . Your code must begin with function […]