% ECE 111 Lecture #1 % Win by 5 series % Team A has a 55% chance of winning a given game tic WINS = 0; for i=1:1e5 A = 0; while(abs(A) < 5) if(rand < 0.55) A = A + 1; else A = A - 1; end end if(A >=5) WINS = WINS + 1; end end WINS/1e5 toc