<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - comments on Post, Maple Baseball</title>
    <link>http://www.mapleprimes.com/posts/43761-Maple-Baseball</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Fri, 12 Jun 2026 14:50:14 GMT</lastBuildDate>
    <pubDate>Fri, 12 Jun 2026 14:50:14 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest comments added to the Post, Maple Baseball</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - comments on Post, Maple Baseball</title>
      <link>http://www.mapleprimes.com/posts/43761-Maple-Baseball</link>
    </image>
    <item>
      <title>Nice!</title>
      <link>http://www.mapleprimes.com/posts/43761-Maple-Baseball?ref=Feed:MaplePrimes:Maple Baseball:Comments#comment80756</link>
      <itunes:summary>Now, that's what I call a blog entry!
____
William Spaetzel
Applications Developer, Maplesoft</itunes:summary>
      <description>The latest comments added to the Post, Maple Baseball</description>
      <guid>80756</guid>
      <pubDate>Tue, 09 Aug 2005 03:26:09 Z</pubDate>
      <itunes:author>Will</itunes:author>
      <author>Will</author>
    </item>
    <item>
      <title>My version of stat</title>
      <link>http://www.mapleprimes.com/posts/43761-Maple-Baseball?ref=Feed:MaplePrimes:Maple Baseball:Comments#comment80755</link>
      <itunes:summary>&lt;pre&gt;s:=proc(L) local n,a,b,i;
n:=nops(L)-1;
a:=add(1/i,i=L);
b:=add(1/i^2,i=L);
((n-1)*(n/2-a)+(a^2-b)/2)*mul(i,i=L)
end;

s([0.5,0.5,0.5,0.5,0.5]);
                             0.5000000000
s([.500,.621,.656,.528,.595]);
                             0.6484707154
s([.500,.621,.656,.528,.595,.111]);
                             0.3398817684&lt;/pre&gt;

</itunes:summary>
      <description>The latest comments added to the Post, Maple Baseball</description>
      <guid>80755</guid>
      <pubDate>Tue, 09 Aug 2005 05:42:32 Z</pubDate>
      <itunes:author>alec</itunes:author>
      <author>alec</author>
    </item>
    <item>
      <title>improving the baseball simulation</title>
      <link>http://www.mapleprimes.com/posts/43761-Maple-Baseball?ref=Feed:MaplePrimes:Maple Baseball:Comments#comment80719</link>
      <itunes:summary>You should probably consider adding slugging percentage to the mix; three hits to score a run seems like a lot.  It is unfortunate (or not) that the usual baseball statistics (on-base percentage, batting average, slugging percentage) do not suffice.  However, if you also keep track of walks and sacrifices you can then make a simple monte-carlo simulator that might be a reasonable approximation.  That is, evaluate a uniform random variable to determine whether each batter (depending on statistics) walks, hits (for so many bases), sacrifices or wastes an out.  Then keep track of total bases and outs.  When bases greater than 4, increment the runs, etc...</itunes:summary>
      <description>The latest comments added to the Post, Maple Baseball</description>
      <guid>80719</guid>
      <pubDate>Tue, 16 Aug 2005 04:58:26 Z</pubDate>
      <itunes:author>Joe
 Riel
</itunes:author>
      <author>Joe
 Riel
</author>
    </item>
    <item>
      <title>Bragan's Brainstorm</title>
      <link>http://www.mapleprimes.com/posts/43761-Maple-Baseball?ref=Feed:MaplePrimes:Maple Baseball:Comments#comment86899</link>
      <itunes:summary>Attached (&lt;a href="http://www.mapleprimes.com/files/36_sim.mpl"&gt;sim.mpl&lt;/a&gt;) is a simple game simulation with data from last years World Series champion Red Sox.  Bump up infolevel to see what's going on during a game (as shown below).  Obviously, as Joe Riel mentioned, the rule of thumb, 3-hits = 1 run is poor at best.  

In the last post I just wanted to see if the number of runs our team was scoring was appropriate.  What I really want to find out is if there is a way to improve our scoring chances.   The standard baseball batting-order uses the following heuristic: 

- lead off with someone with a high on-base percentage (and who can maybe steal a base)
- next 2 are good contact hitters
- batter 4 is your "clean-up" hitter; someone with power
- etc.

In 1957 the Pirates' manager Bobby Bragan claimed that lineups were being ordered foolishly.  Bragan endorsed batting his best hitter first, second-best second, and so on. This idea was dubbed as "Bragan's Brainstorm".  Pitcher Dick Hall even attempted to prove mathematically how many runs this scheme could add to the offence.  The Pirates went 16-24 during the experiment, which was slightly better than their 14-26 record in the forty games before.  The idea was dropped because of the controversy it generated. 

The results of 10x162 games using the Red Sox standard batting order look like this:
&lt;img src="http://www.mapleprimes.com/files/36_redsoxlineup.gif"&gt;.  The standard-deviation of this run was 3.725, mean = 5.93, mode = 6, total runs = 9608.  Note that the Red Sox actually scored 949 runs in 162 games, so the simulation is actually pretty close.

Repeating the experiment with a batting order based on best-average yielded these results: &lt;img src="http://www.mapleprimes.com/files/36_bestavglineup.gif"&gt;.  The standard-deviation was 3.767, mean = 5.817, mode = 5, and total runs = 9423.  

These numbers are really close, so I am hesitant about drawing conclusions from them, even though, repeated experiments seem to give the edge to the traditional ordering.  

The next step is to find the optimal batting order for any given set of players??


score: &amp;nbsp;&amp;nbsp;"------------ inning 1 (runs=0) -----------"
score: &amp;nbsp;&amp;nbsp;J Damon &amp;nbsp;&amp;nbsp;"outs=0,runs=0,bases=[false, false, false]" &amp;nbsp;&amp;nbsp;"walk"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;M Bellhorn &amp;nbsp;&amp;nbsp;"outs=0,runs=0,bases=[true, false, false]" &amp;nbsp;&amp;nbsp;"out"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;M Ramirez &amp;nbsp;&amp;nbsp;"outs=2,runs=0,bases=[false, false, false]" &amp;nbsp;&amp;nbsp;"strikeout"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;"------------ inning 2 (runs=0) -----------"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;D Ortiz &amp;nbsp;&amp;nbsp;"outs=0,runs=0,bases=[false, false, false]" &amp;nbsp;&amp;nbsp;"walk"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;J Varitek &amp;nbsp;&amp;nbsp;"outs=0,runs=0,bases=[true, false, false]" &amp;nbsp;&amp;nbsp;"out"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;T Nixon &amp;nbsp;&amp;nbsp;"outs=1,runs=0,bases=[true, false, false]" &amp;nbsp;&amp;nbsp;"strikeout"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;K Millar &amp;nbsp;&amp;nbsp;"outs=2,runs=0,bases=[true, false, false]" &amp;nbsp;&amp;nbsp;"double"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;B Mueller &amp;nbsp;&amp;nbsp;"outs=2,runs=1,bases=[false, true, false]" &amp;nbsp;&amp;nbsp;"out"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;"------------ inning 3 (runs=1) -----------"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;O Cabrera &amp;nbsp;&amp;nbsp;"outs=0,runs=1,bases=[false, false, false]" &amp;nbsp;&amp;nbsp;"double"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;J Damon &amp;nbsp;&amp;nbsp;"outs=0,runs=1,bases=[false, true, false]" &amp;nbsp;&amp;nbsp;"strikeout"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;M Bellhorn &amp;nbsp;&amp;nbsp;"outs=1,runs=1,bases=[false, true, false]" &amp;nbsp;&amp;nbsp;"walk"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;M Ramirez &amp;nbsp;&amp;nbsp;"outs=1,runs=1,bases=[true, true, false]" &amp;nbsp;&amp;nbsp;"double"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;D Ortiz &amp;nbsp;&amp;nbsp;"outs=1,runs=3,bases=[false, true, false]" &amp;nbsp;&amp;nbsp;"out"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;J Varitek &amp;nbsp;&amp;nbsp;"outs=2,runs=3,bases=[false, true, false]" &amp;nbsp;&amp;nbsp;"out"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;"------------ inning 4 (runs=3) -----------"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;T Nixon &amp;nbsp;&amp;nbsp;"outs=0,runs=3,bases=[false, false, false]" &amp;nbsp;&amp;nbsp;"single"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;K Millar &amp;nbsp;&amp;nbsp;"outs=0,runs=3,bases=[true, false, false]" &amp;nbsp;&amp;nbsp;"out"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;B Mueller &amp;nbsp;&amp;nbsp;"outs=1,runs=3,bases=[true, false, false]" &amp;nbsp;&amp;nbsp;"single"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;O Cabrera &amp;nbsp;&amp;nbsp;"outs=1,runs=3,bases=[true, false, true]" &amp;nbsp;&amp;nbsp;"out"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;J Damon &amp;nbsp;&amp;nbsp;"outs=2,runs=3,bases=[true, false, true]" &amp;nbsp;&amp;nbsp;"out"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;"------------ inning 5 (runs=3) -----------"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;M Bellhorn &amp;nbsp;&amp;nbsp;"outs=0,runs=3,bases=[false, false, false]" &amp;nbsp;&amp;nbsp;"strikeout"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;M Ramirez &amp;nbsp;&amp;nbsp;"outs=1,runs=3,bases=[false, false, false]" &amp;nbsp;&amp;nbsp;"strikeout"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;D Ortiz &amp;nbsp;&amp;nbsp;"outs=2,runs=3,bases=[false, false, false]" &amp;nbsp;&amp;nbsp;"double"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;J Varitek &amp;nbsp;&amp;nbsp;"outs=2,runs=3,bases=[false, true, false]" &amp;nbsp;&amp;nbsp;"single"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;T Nixon &amp;nbsp;&amp;nbsp;"outs=2,runs=4,bases=[true, false, false]" &amp;nbsp;&amp;nbsp;"out"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;"------------ inning 6 (runs=4) -----------"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;K Millar &amp;nbsp;&amp;nbsp;"outs=0,runs=4,bases=[false, false, false]" &amp;nbsp;&amp;nbsp;"out"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;B Mueller &amp;nbsp;&amp;nbsp;"outs=1,runs=4,bases=[false, false, false]" &amp;nbsp;&amp;nbsp;"out"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;O Cabrera &amp;nbsp;&amp;nbsp;"outs=2,runs=4,bases=[false, false, false]" &amp;nbsp;&amp;nbsp;"out"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;"------------ inning 7 (runs=4) -----------"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;J Damon &amp;nbsp;&amp;nbsp;"outs=0,runs=4,bases=[false, false, false]" &amp;nbsp;&amp;nbsp;"double"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;M Bellhorn &amp;nbsp;&amp;nbsp;"outs=0,runs=4,bases=[false, true, false]" &amp;nbsp;&amp;nbsp;"out"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;M Ramirez &amp;nbsp;&amp;nbsp;"outs=1,runs=4,bases=[false, true, false]" &amp;nbsp;&amp;nbsp;"walk"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;D Ortiz &amp;nbsp;&amp;nbsp;"outs=1,runs=4,bases=[true, true, false]" &amp;nbsp;&amp;nbsp;"strikeout"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;J Varitek &amp;nbsp;&amp;nbsp;"outs=2,runs=4,bases=[true, true, false]" &amp;nbsp;&amp;nbsp;"walk"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;T Nixon &amp;nbsp;&amp;nbsp;"outs=2,runs=4,bases=[true, true, true]" &amp;nbsp;&amp;nbsp;"out"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;"------------ inning 8 (runs=4) -----------"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;K Millar &amp;nbsp;&amp;nbsp;"outs=0,runs=4,bases=[false, false, false]" &amp;nbsp;&amp;nbsp;"walk"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;B Mueller &amp;nbsp;&amp;nbsp;"outs=0,runs=4,bases=[true, false, false]" &amp;nbsp;&amp;nbsp;"walk"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;O Cabrera &amp;nbsp;&amp;nbsp;"outs=0,runs=4,bases=[true, true, false]" &amp;nbsp;&amp;nbsp;"out"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;J Damon &amp;nbsp;&amp;nbsp;"outs=1,runs=4,bases=[true, true, false]" &amp;nbsp;&amp;nbsp;"out"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;M Bellhorn &amp;nbsp;&amp;nbsp;"outs=2,runs=4,bases=[true, true, false]" &amp;nbsp;&amp;nbsp;"out"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;"------------ inning 9 (runs=4) -----------"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;M Ramirez &amp;nbsp;&amp;nbsp;"outs=0,runs=4,bases=[false, false, false]" &amp;nbsp;&amp;nbsp;"homer"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;D Ortiz &amp;nbsp;&amp;nbsp;"outs=0,runs=5,bases=[false, false, false]" &amp;nbsp;&amp;nbsp;"strikeout"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;J Varitek &amp;nbsp;&amp;nbsp;"outs=1,runs=5,bases=[false, false, false]" &amp;nbsp;&amp;nbsp;"strikeout"
&lt;br&gt;score: &amp;nbsp;&amp;nbsp;T Nixon &amp;nbsp;&amp;nbsp;"outs=2,runs=5,bases=[false, false, false]" &amp;nbsp;&amp;nbsp;"out"
</itunes:summary>
      <description>The latest comments added to the Post, Maple Baseball</description>
      <guid>86899</guid>
      <pubDate>Tue, 16 Aug 2005 20:59:25 Z</pubDate>
      <itunes:author>Paul</itunes:author>
      <author>Paul</author>
    </item>
    <item>
      <title>Stand alone blog post</title>
      <link>http://www.mapleprimes.com/posts/43761-Maple-Baseball?ref=Feed:MaplePrimes:Maple Baseball:Comments#comment90158</link>
      <itunes:summary>Hey Paul, 

This comment would make a great blog posting by itself. Could you please copy the contents and post it as a blog entry?

____
William Spaetzel
Applications Developer, Maplesoft</itunes:summary>
      <description>The latest comments added to the Post, Maple Baseball</description>
      <guid>90158</guid>
      <pubDate>Tue, 16 Aug 2005 21:02:24 Z</pubDate>
      <itunes:author>Will</itunes:author>
      <author>Will</author>
    </item>
  </channel>
</rss>