To calculate number of on-base events in a baseball game, in which the batter winds up on base. This overestimates the batting average (walks) but isn't the same as the OBP (on-base percentage) that includes sacrifice flies in a weird way. so let probability of getting on base = p. so probability of getting out = (1-p) = q. An inning looks like this, with b for on base and o for out. events: Let n be the number of on-base events n event sequence 0 ooo 1 booo 1 oboo 1 oobo 2 bbooo 2 boboo ... for any n, there are always three outs (one is last event), and before that (n+2)(n+1)/2 possible event sequences: there are 2 outs arranged in n+2 possible ways, or n-choose-2 events. The probability of an event with n b events and 3 o events is p^n*q^3. Here's some matlab: ----- ponbase= .300; %estimated from team's collective batting ave. pout = (1-ponbase); hitsperob = .9; % says that .1 of on-base events are walks aveinnings = 9.1; % some overtime gets played term = 1; % we're going to add up terms until they get small %initialize n = 1; %number of on-base events this inning obsperinning = 0; %on base per inning % begin iteration while term > .001 % not much change after this! bincoef = ((n+2)*(n+1))/2; % n choose 2 prob = pout^3 * ponbase^n; % prob of 3 outs and rest on base term = n*bincoef*prob % expected number of n obe's obsperinning = obsperinning+term; % add to accumulating total n = n+1 end; obs= aveinnings*obsperinning % mpy by expected # of innings hits = obs*hitsperob % estimate hits from obes. ----- This choice of ponbase gives about 10.53 hits/game. The average batting average (would give a lower bound on what I want) in majors is about 260, and the 100th-ranked all-time on-base percentage (OBP) (an upper bound) is .388. The average batting average of the JetHawks is 290.3, I figure, so my ponbase may be a little low.