Archived

This topic is now archived and is closed to further replies.

vaneger

AI that guesses better

Recommended Posts

ok my dilema is this::::
/*
i have 8 element arrays that i combine in the following fashion
new array element = element[x] + element[x +1] / 2

[2]   [5]  [7]    [132]   [135]     [256]  [76]     [243]

  [3.5]      [69.5]           [195.5]         [159.5]

       [36.5]                      [177.5]

                    [107]

*/
im not sure which form of ai would best be suited to going backwards from 107 to the 2 5 7 132 135 256 76 243 array. currently the only thing i can think of is to just brute force every combination which results in 4096 possiblites or so if i calculated that right per 8 element array. any ideas?

Share this post


Link to post
Share on other sites
You can''t go backwards as easy as all that. You won''t know if you''ve got the right answer or not unless you can compare it to the original 8 values, in which case you didn''t need to go backwards. Alternatively you will have many different ways of coming to that 107 value and which is the right one? eg. All your initial 8 values could be 107 and the end result would also be 107. So going backwards, would you get 107,107,107,107,107,107,107,107, or 2,5,7,132,135,256,76,243? There''s no way of choosing.

[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]

Share this post


Link to post
Share on other sites
verifying the choices ive already got CRC values for, its generating the sources that i need help with. i want to know how to generate that array from 107, i can work on absolute verification later.

Share this post


Link to post
Share on other sites
If you allow fractional values - and it appears that you do - then there are going to be almost infinite combinations of values that could average out at 107. If you don''t, then you still have billions of possible combinations to check. You can cull large amounts of the possibilities but there''s still far more than the 4096 you mentioned.

[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]

Share this post


Link to post
Share on other sites
This is somewhere between uncomputable and intractable.

What in the world makes you think you can magically get this particular array from the last value?

Why is this array better than

[103][104][105][106][108][109][110][111]
?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Assuming that at least each initial value is an int on range [1, 256], then you can have 256^8 initial conditions and the result numbers are on range [1, 256] with step 0.125, not evenly distributed though. But a crude estimate is that you''d need to check 256^8 / (256*8) = 9 007 199 254 740 992 initial conditions (less towards ends 0 and 256, about twice more towards middle numbers like the given 107). If you can test a billion per second, it''ll only take you 2.2 years. It''s easy to come up with some array that produces the required average, but finding the particular one is impossible. No AI could help you here.

Share this post


Link to post
Share on other sites