Complete.Org: Mailing Lists: Archives: freeciv-ai: April 2002:
[freeciv-ai] Re: Approximate win_chance
Home

[freeciv-ai] Re: Approximate win_chance

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Cc: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>, Raahul Kumar <raahul_da_man@xxxxxxxxx>, freeciv-ai@xxxxxxxxxxx
Subject: [freeciv-ai] Re: Approximate win_chance
From: Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 23 Apr 2002 21:41:53 +0200
Reply-to: rf13@xxxxxxxxxxxxxxxxxxxxxx

On Fri, Apr 19, 2002 at 04:28:35PM -0400, Ross W. Wetmore wrote:
> At 12:57 PM 02/04/19 +0100, Gregory Berkolaiko wrote:
> >On Thu, 18 Apr 2002, Raahul Kumar wrote:
> >
> >> > Power 5 works best (better than 4 or 6).  Not very often.  You can 
> >> > experiment with the code I attached.
> >> 
> >> That's what I don't understand. I assume higher powers should always work
> >> better. More precision, less errors. Yet your results show differently.
> I am
> >> suspicious. I demand an explanation.
> >
> >I have no explanation.  This is the way things are.  In principle it is 
> >possible to play with the win_chance formula (which is essentially 
> >hypergeometric function) and maybe do some expansions and show why 5 is 
> >the best, but I'm not interested in doing it.
> 
> I suspect you will find that most battles are decided in multiples of 5 
> rounds, i.e. 10, 20, 30 hitpoints with firepower of 1 or 2. On a wild
> hunch, this may make the 5th power term of any full expression dominant.
> 
> If you restrict cases used to fp = 3, you might find 20 hp and 6/7 power, 
> or generally an ~3rd power multiple shows up slightly better.
> 
> That might at least indicate whether the number of rounds has something 
> to do with it.

I have done some changes and factor (10.0 in the original test.c) is
indeed important. I have attached another version which shows the
quality of the approximation for various factors.

It turns out that the power of 5 minimized the error for the factor
8. A power of 6 prefers the factor 12. A power of 5.5 really make the
factor 10 the one with the minimum error.

Bottom line for me: the proposed approximation is much to fragile.
Bottom line 2: we have to carefully select the set of values we test
the approximation against. Best would be the whole possible set of
values. Or a real (not by simulation) mathematical calculation of the
errors we have to expect.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "When C++ is your hammer, everything looks like a thumb."
    -- Steven M. Haflich

Attachment: test.c
Description: Text document


[Prev in Thread] Current Thread [Next in Thread]