Question: R programming This Week's Questions involve the Fibonacci sequence, which is the series of numbers: 1, 1, 2, 3, 5, 8, 13, 21, 34, ...,
R programming


This Week's Questions involve the Fibonacci sequence, which is the series of numbers: 1, 1, 2, 3, 5, 8, 13, 21, 34, ..., where, if we denote by fx the kth number in this sequence, then fk = fk-1+ fk_2, for k > 3.2. Consider a discrete random variable X such that Pr[X : fk] :pk fork : 1,2,...,n, where fk corresponds to the kth number in the Fibonacci sequence and {131,132, . . . ,Pn} is a sequence of probabilities such that 22:1 pk : 1. Create a function called f-i bo.moments , which satisfies the following properties: 0 It has two arguments: one called n (with no default value), one called probas (with no default value). Again you can assume that n 2 3. o It returns a vector of two values: the first is the expected value ]E[X] and the second is the standard deviation of X (under the assumption that the argument probas is a vector containingp1,p2,. . . ,1)\
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
