Write an accept/reject sampler to generate uniform samples from the unit disk in two dimensions. Recall that the unit disk is characterized by
 s.t. x^2 + y^2 \leq 1\})
. What is the efficiency of your sampler?
Implement any other algorithm for generating uniform samples from the unit disk in two dimensions.
Plot the samples that you generated and visually confirm that they are indeed uniformly distributed.
Write a sampler to generate samples from the density
=\frac{\alpha \beta^\alpha}{x^{\alpha+1}})
for

using the inverse transform.
Download your favorite Shakespear play from
http://openshakespeare.org/ and save it in a text file. Read the file and annotate each line with the line number and write the result back into another text file. You need to skip blank lines. For instance if you input text is
All's Well, that Ends Well
Actus primus. Scoena Prima.
Enter yong Bertram Count of Rossillion, his Mother, and Helena, Lord Lafew, all in blacke.
Your output text must be
1 All's Well, that Ends Well
2 Actus primus. Scoena Prima.
3 Enter yong Bertram Count of Rossillion, his Mother, and Helena, Lord Lafew, all in blacke.
Think about your logic before implementing all programs in this lab.
SOLUTIONS : week7.docx