
Algebra PreAlgebra and Basic Algebra Math Forum 
 LinkBack  Thread Tools  Display Modes 
February 9th, 2014, 06:43 AM  #1 
Newbie Joined: Feb 2014 Posts: 1 Thanks: 0  Homework help  Generating random variable
Hi, I have a problem on the following homework assignment: Suppose that X and Y are discrete random variables with a joint probability mass function p_XY (x, y). Procedure is the following: a. Generate X ? p_X (x). b. Accept X with probability p(yX). c. If X is accepted, terminate and return X. Otherwise go to Step a. Show that this procedure generates a random variable X ? p_XY (xy). I would've been grateful for any help. Tnx 
February 9th, 2014, 11:11 AM  #2 
Newbie Joined: Feb 2014 Posts: 3 Thanks: 0  Re: Homework help  Generating random variable
I am assuming that by "generate some random variable" you mean to generate random outcomes that follow that particular distribution. The idea is to generate first random outcomes from a Uniform Random Variable in (0,1) for which there are plenty libraries. For instance, in java you would do something like: double uniformOutcome; Random rand; uniformOutcome = rand.nextDouble(); The generated number is a "pseudorandom" meaning it is not really random but rather a sequence of numbers that simulate randomness based on a "seed" number. Typically this formulas use modulos. Once you've your uniform random draw you just need to use . In step b), generate similarly a random draw from the distribution and accept if outcome is bigger than a third uniform Outcome Step c), just do as told. To prove this, looks like a consequence of bayes theorem, i.e., p(xy) = p(x) * p(yx) / p(y), the details I leave them to you. 

Tags 
generating, homework, random, variable 
Thread Tools  
Display Modes  

Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Exponential Random Variable  motherh  Advanced Statistics  7  October 30th, 2013 11:26 AM 
random variable!  lawochekel  Algebra  1  April 19th, 2012 12:39 PM 
Probability of generating a repeat random number...  jsulliva83  Algebra  0  May 6th, 2009 08:34 AM 
Help! Distribution of random variable  alfangio  Advanced Statistics  1  March 17th, 2009 01:46 PM 
Discrete random variable.  adbroadband  Algebra  1  January 31st, 2008 09:49 AM 