Hard-core Lizards! analysis From: jriechel@cc.gatech.edu (James Alan Riechel) Date: Sat, 04 Feb 1995 17:36:15 +0000 Lizards! fans, At the end of this message is a Mathmatic script that will produce plots (and Postscript files of these plots) that may be of interest to you! The various functions are described below in Mathematica comments (text surrounded by "(*" and "*)"), so I won't mention them specifically up here. I offer this useful analysis with the expectation that if any Lizards! fans find them useful, that they will in turn provide me with some of their analysis, too. (Of course, you can take advantage of me by using my information while keeping your information to yourself, but this is certainly not in the spirit of the Internet!) The ad[a, d] and be[b, e] functions are only approximations of averages. The true results are probability functions, but I haven't had the time to work this out yet. Enjoy, And please return the favor if you can, James Riechel jriechel@cc.gatech.edu p.s. Mathematica file begins now: (***** Mathmamatica analysis of Lizards!, James Riechel, jriechel@cc.gatech.edu *****) (* growth[p] describes the population growth in dens Input: percentage p = (current population) / (maximum population) Output: percentage growth[p] = the percentage growth of population *) growth[p_] = 0.6 - p/2 (* growthPlot[] simply makes a nice 2D-plot of the growth[p] function *) growthPlot [] := Plot[growth[p], {p, 0.0, 1.0}, GridLines -> Automatic, Frame -> True, PlotRange -> {0.0, 0.6}, FrameLabel -> {"(current population) / (maximum population)", "Growth percentage"}] (* pop[c, m] describes the number of new lizards created in dens per turn Input: current population (c), and maximum population (m) Output: number of new lizards "popped" pop[c, m] *) pop[c_, m_] = growth[c/m] c (* popPlot[m] simple makes a nice plot of pop[c, m] for all values of c in the range {0, m} *) popPlot[m_] := Plot[pop[c, m], {c, 0.0, m}, GridLines -> Automatic, Frame -> True, PlotRange -> {0.0, pop[3/5 m, m]}, FrameLabel -> {"Current Population", "Pops"}, PlotLabel -> StringJoin ["Maximum Population = ", ToString[m]]] (* ad[a, d] describes the number of attacking lizards remaining after attacking a free den with d defenders. Input: number of attacking lizards (a) and defending lizards (d) Output: average remaining attacking lizards ad[a, d] *) ad[a_, d_] = N[If[a <= 0, 0, If[d <= 0, a, ad[a - 1/4 d, d - 1/8 a]]]] (* be[a, d] is like ad[a, d] except that it returns results based on attacking a number of other player's lizards *not* in a den. Input: number of your lizards (b) and other player's lizards (e) Output: average number of your lizards remaining be[b, e] *) be[b_, e_] = N[If[b <= 0, 0, If[e <= 0, b, be[a - 1/4 d, d - 1/4 a]]]] (* adPlot[d0] simply makes a nice 2D-plot of the ad[a, d] function for a fixed d = d0 and for values of a in the range {0, ad[300, d0]}. Input: number of defending lizards d0 *) adPlot[d0_] := Plot[ad[a0, d0], {a0, 0, 300}, GridLines -> Automatic, Frame -> True, PlotRange -> {0, ad[300, d0]}, FrameLabel -> {"Attackers", "Remaining Attackers"}, PlotLabel -> StringJoin["Free den with ", ToString[d0], " defenders"]] (* I haven't implemented bePlot[] yet, but I'm sure you can based on the above examples. *) (* The following will make various important plots for you using the -Plot functions defined above. It will both displays these plots and place "Mathematica Postscript" versions in your current directory. On my system I had to convert them to print-able Postscript using a command named "psfix." Delete the "(*" and "*)" from the following if you want all the plots displayed and saved to files. *) (* Display["growth.mps", growthPlot[]] Display["pop-50.mps", popPlot[50]] Display["pop-100.mps", popPlot[100]] Display["pop-150.mps", popPlot[150]] Display["pop-200.mps", popPlot[200]] Display["pop-250.mps", popPlot[250]] Display["pop-300.mps", popPlot[300]] Display["ad-15.mps", adPlot[15]] Display["ad-30.mps", adPlot[30]] Display["ad-45.mps", adPlot[45]] Display ["ad-60.mps", adPlot[60]] Display ["ad-75.mps", adPlot[75]] Display ["ad-90.mps", adPlot[90]] *) Up