You are on page 1of 2

STAT340 - Winter 2013 - Tutorial/Assignment 1

Due Date: Jan 23, 2013 Process: During your weekly tutorial, the TA will give you some questions to work on. S/he will take them up with you during the tutorial period. You will be given a grade for handing in the correct tutorial answers at the end of the period. Also, at the end of the tutorial you will be given additional questions to be handed in by the next tutorial period. These questions will be your assignment. Assignment questions will be handed in in two ways. 1. Online. In this case students are asked to submit notepad (i.e. TXT) les to learn by the start of the next tutorial. 2. Paper. In this case the assignments are due at the start of the next tutorial. Finally, you will have an online quiz, posted in mapleta.uwaterloo.ca. Group work: It is ok to get help from another student, but NOT ok to submit work which is indistinguishable from that of a colleague. Should you work with another person, please state it clearly on any work submitted for grades. Tutorial Questions: 1. Let the random variable X be continuous with p.d.f f (x) = 2=x3 , 1 < x < 1; zero elsewhere. What is the distribution function of X? 2. Determine the moment generating function of the random variable X having p.d.f f (x) = 1=3; 1 < x < 2; and zero elsewhere. 3. Show that M (0) = 1 for any moment generating function. 4. Evaluate: R e ln x a) 1 ex2 dx Re b) 1 ln x dx Assignment Questions: Notes: Not all assignment questions will be marked every week. Please put your name at the top of your assignment. Marks are allocated for clarity. Questions 1-2 are handed in at the start of the next tutorial, on paper. Question 3 is handed in online in the dropbox.

1. Find the rst moment of the distribution that has moment generating function MX (t) = (1 t) 3 : 2. Assuming that X is a continuous random variable, show that the rth moment of X with moment generating function MX (t), is derived using the formula M (r) (0) = E (X r ) : Hint: You will want to consider a proof technique you learned in MATH 135. 3. Using R, write a function SHIFT (all capital letters) that works as follows: Function name: SHIFT Inputs: a vector of size 7 (numbers) Outputs: A random number. How? Shift Register Generators are an example of a random number generator. The steps of the method are as follows: i) Choose a binary seed. Seed=(1,0,0,1,1,0,1) ii) Shift the Seed to the right 2 bits. Seed = (0,0,1,0,0,1,1) iii) Perform an exclusive or addition of lines i and ii. Seed = (1,0,1,1,1,1,0) iv) Shift the sum to the left 3 bits. Seed = (1,1,1,0,0,0,0) v) Perform an exclusive or addition of lines iii and iv. Seed = (0,1,0,1,1,1,0) vi) The answer is: 0*20 +1*2+0*22 +1*23 +1*24 +1*25 +0*26 = 58 Your code should look like: SHIFT = function(Seed) { ...lines of code... return(_something to output_) } SHIFT(c(0,1,1,0,1,1,0))

You might also like