$30
EE 511 Simulation Methods for Stochastic Systems
Project #1
[A Few Coins]
Three distributions based on Bernoulli trials.
Write a routine to simulate a fair Bernoulli trial in your language of choice. Generate a
histogram for 100 simulated Bernoulli trials.
Write a routine to count the number of successes in 7 fair Bernoulli trials. Generate a histogram
for 100 samples of this success-counting random variable.
Write a routine to count the longest run of heads in 100 Bernoulli samples. Generate a
histogram for this random variable.
Identify and compare the distributions in each of the simulations above.
[Counting Successes]
Take your Bernoulli success-counting random variable (the binomial random variable). Generate and
sum k=5 samples from this routine. Generate 300 such sums and histogram your results. Repeat for
k={10, 30, 50}. Comment on the histograms you observe for the different values of k.
[Networking: part 1]
Given n=20 people in a social network. Imagine that any given unordered pair of two people are
connected at random and independently with success probability p=0.05.
• How many possible edges or connections, N, exist in a group of n=20 people?
• Write a routine to select edges with probability p=0.05 out of the N candidate edges.
(think of the presence or absence of each distinct candidate edge as a Bernoulli trial)
• What is the distribution of the random number of edges selected in this way? Generate
histograms to support your answer.
Turn in:
- A summary of your experiments including plots and statistics
- a brief discussion of the results for each question (max 1 page per problem)
- a print out of your code.