Since there are 3 bases and runners can be any or all of them there are 8 possible combinations possible. As the inning proceeds, various base runner and out configurations will occur. A common progression will be from no one on and 0 outs to no one on and 1 out and finally no one on and 2 outs. The third out ends the inning and does not count as a separate configuration. If runners get on base the probability of scoring increases.
Configurations can repeat.
A home run with no outs causes the no outs no one on base inning starting configuration to repeat. Similarly, a bases loaded walk will not change the base runner and outs configuration. Subtract this number from the number of runs scored in the inning. Repeated configurations are recorded each time they occur. Finally, for each configuration divide the total runs by the number of time the configuration occurred.