Question: Consider the problem of generating a random sample Iron, a specified distribution on a single variable. You can assume that a random number generator is

Consider the problem of generating a random sample Iron, a specified distribution on a single variable. You can assume that a random number generator is available that returns a random number uniformly distributed between 0 and 1.

(a). Let X be a discrete variable with P (X = xi) = pi for I Є {1,..., k}. The cumulative distribution of X gives the probability that X Є {x1… x j} for each possible j. Explain how to calculate the cumulative distribution in O (k) time and how to generate a single sample of X from it. Can the latter be done in less than O (k) time?

b. Now suppose we want to generate N samples of X, where N > k. Explain how to do this with an expected runtime per sample that is constant (i.e., independent of k).

c. Now consider a continuous-valued variable with a parameterized distribution (e.g., Gaussian). How can samples be generated from such a distribution?

d. Suppose you want to query a continuous-valued variable and you are using a sampling algorithm such as LIKELIHOOD WEIGHTING to do the inference. How would you have to modify the query answering process?

Step by Step Solution

3.47 Rating (160 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Then we loop through i adding up the pi values as we go along and setting P to the run... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (1 attachment)

Word file Icon

21-C-S-A-I (220).docx

120 KBs Word File

Students Have Also Explored These Related Artificial Intelligence Questions!