IEOR 161 HW 7 PRINTOUTS

# IEOR 161 HW 7 PRINTOUTS - t=1:200 N(t)=ctr i=rand(1 if...

This preview shows pages 1–5. Sign up to view the full content.

IEOR 161 HW 7 PRINTOUTS, Eddie Lo

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
PART A Each of these histograms represents the number of times the population value hits the number at each step. It shows how the number in the population tomorrow depends on the population today, going up with births and down by deaths. Even though it’s more likely for a death, there is still a normal distribution at each step. PART B This shows only half of the histograms I’ve just constructed in part A, suggesting the geometric random variable will give half of the Markov Chain.
MATLAB CODE clear all for k=1:10000 ctr=0; for
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: t=1:200 N(t)=ctr; i=rand(1); if i<=.35 ctr=ctr+1; else if i>.35 & i<=.45 ctr=ctr; else ctr=ctr-1; end N(t)=ctr; end end A(k) = N(5); B(k) = N(10); C(k) = N(20); D(k) = N(50); E(k) = N(75); F(k) = N(100); G(k) = N(200); end hist(A,100) title( 'N(5)' ) figure hist(B,100) title( 'N(10)' ) figure hist(C,100) title( 'N(20)' ) figure hist(D,100) title( 'N(50)' ) figure hist(E,100) title( 'N(75)' ) figure hist(F,100) title( 'N(100)' ) figure hist(G,100) title( 'N(200)' ) for i=1:10000 R(i) = geornd(1-(.35/.55)); end hist(R,50) title('Geometric RV’)...
View Full Document

## This note was uploaded on 09/12/2010 for the course IND ENG 161 taught by Professor Lim,a during the Spring '08 term at Berkeley.

### Page1 / 5

IEOR 161 HW 7 PRINTOUTS - t=1:200 N(t)=ctr i=rand(1 if...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online