# 161HW8 - D(k)= X1(100); D2(k)= X2(100); E(k)= X1(200);...

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

clear all lam=1; mew1=2; mew2=3; X1(1)=0; X2(1)=0; ctr1=0; ctr2=0; for k=1:20000 for t=1:200 i=rand(1); ctr1=ctr1+1; ctr2=ctr2; ctr1=ctr1+1; ctr2=ctr2; ctr1=ctr1-1; ctr2=ctr2+1; ctr1=ctr1+1; ctr2=ctr2; ctr1=0; ctr2=0; else if i<=mew2/(mew1+mew2+lam) ctr1=ctr1; ctr2=ctr2-1; if ctr2<0 ctr2=0; end (mew1+mew2+lam) ctr1=ctr1-1; ctr2=ctr2+1; if ctr1<0 ctr1=0; end else ctr1=ctr1+1; ctr2=ctr2; if ctr1<0 ctr1=0; end end end X1(t+1)=ctr1; X2(t+1)=ctr2; end A(k)= X1(5); A2(k)=X2(5); B(k)= X1(10); B2(k)=X2(10); C(k)= X1(50); C2(k)=X2(50);

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: D(k)= X1(100); D2(k)= X2(100); E(k)= X1(200); E2(k)=X2(200); end e hist(A) title('X1(5)') figure hist(A2) title('X2(5)') figure hist(B) title('X1(10)') figure hist(B2) title('X2(10)') figure hist(C) title('X1(50)') figure hist(C2) title('X2(50)') figure hist(D) title('X1(100)') figure hist(D2) title('X2(100)') figure hist(E) title('X1(200)') figure hist(E2) title('X2(200)') figure %---------------------------p = 1-lam/mew1; y = geornd(p,10000,1); [n,yout] = hist(y,50); n_norm=n/sum(n); bar(yout, n_norm); title('Limitting distribution station 1- Geometric'); t p2 = 1-lam/mew2; y = geornd(p2,10000,1); [n,yout] = hist(y,50); n_norm=n/sum(n); figure bar(yout, n_norm); title('Limitting distribution station 2 - Geometric');...
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 University of California, Berkeley.

### Page1 / 2

161HW8 - D(k)= X1(100); D2(k)= X2(100); E(k)= X1(200);...

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

View Full Document
Ask a homework question - tutors are online