Axis & Allies .org Forums
    • Home
    • Categories
    • Recent
    • Popular
    • Users
    • Register
    • Login
    1. Home
    2. mshih
    M
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 2
    • Best 0
    • Controversial 0
    • Groups 0

    mshih

    @mshih

    0
    Reputation
    5
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined Last Online
    Age 24

    mshih Unfollow Follow

    Latest posts made by mshih

    • RE: Implementation of "true" probability calculator

      Actually fixed order of loss is pretty reasonable assumption for odds calculator…. We have to assume some type of standard order of loss.  It doesn’t have to be strictly decreasing…  For example, if attacker wants to capture at all costs, we can lose fighters and bombers before tanks.  Or if attacker wants to capture with at least 10 ground units, that’s also possible.

      AA guns can be handled by constructing separate tables corresponding to number of AA gun hits.

      So if attacker has 2i, 2a, 2f, and we’re facing AA gun, we need to solve
      F(f, f, a, a, i, i)  ;; 0 AA hits
      F(f, a, a, i, i)  ;; 1 AA hit
      F(a, a, i, i)  ;; 2 AA hits

      Subs only hitting ships can be handled in similar approach…
      Suppose the defending force is 2 fighters, 1 carrier, 1 battleship

      If the attacking force has some subs, then we may need to remove units out of order.  So we need to compute:
      F(B, C, f, f)    ;; 0 naval hits
      F(B, f, f) ;; 1 naval hit
      F(f, f) ;; 2 naval hits

      posted in Software
      M
      mshih
    • RE: Implementation of "true" probability calculator

      This is in response to Dash’s comments about how to compute the probability terms used in his calculator.

      P(n units getting k hits, if p is the probability of 1 unit getting one hit) = (n choose k)p^k(1-p)^(n-k).

      Since axis & allies has non-homogenous forces (i.e. infantry + armor + bombers), these terms need to be further combined with complicated algorithms.

      There’s a simplification to this problem, if we assume fixed order of loss.

      Let p(i) == the probability of the ith unit getting a hit.  (e.g. for attacking inf ==> 1/6, attacking armor 3/6, etc…)
      Let p(i) be defined in the reverse order of loss.  This can be initialized trivially.

      Let P(i, j) == the probability that i units gets j hits.  This is the matrix that we’re trying to fill in.

      The following recurrence relation holds:
        P(i, j) = P(i-1, j-1) * p(i) + P(i-1, j) * (1-p(i))

      We then just need to define the initial conditions:
        P(0, 0) = 1
        P(0, j) = 0 for all j > 0
        P(i, 0) = P(i-1, 0) * (1 - p(i))

      We can now fill in P(i, j) for all i, j and compute all of the probability terms that will be needed for the attackers.

      The beauty of this formulation:

      • No powers
      • No factorials
      • No special logic needed to handle non-homogenous forces.
      • Complexity to compute all probability terms needed is O(n^2) :).
      • All of the subproblems solved are needed and will be used.

      Unfortunately, I believe updating the probabilities themselves is O(n^4).  So the computation of the probability terms themselves shouldn’t really be the bottleneck if they are precomputed.

      • Mitchell
      posted in Software
      M
      mshih