Page 3 of 7 <12345>Last »
Topic Options
#69795 - 2002-09-16 06:07 PM Re: KiXtart Golf V: Game24
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
aha! The game is afoot. Now to trim some more...

Richard, do you have the proper out?

[ 16. September 2002, 18:08: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#69796 - 2002-09-16 07:43 PM Re: KiXtart Golf V: Game24
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
KixGolf v3.0.3 score = 413, running under KiXtart v4.10
KixGolf v3.0.3 score = 401, running under KiXtart v4.10
KixGolf v3.0.3 score = 377, running under KiXtart v4.10
KixGolf v3.0.3 score = 367, running under KiXtart v4.10

[ 16. September 2002, 21:36: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#69797 - 2002-09-16 10:42 PM Re: KiXtart Golf V: Game24
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
I think the validation script has a bug. I got a solution for

3,3,8,8

Game24= 8 / ( 3 - 8 / 3 )

My score is 990 - I think I have a long way to go.

[ 16. September 2002, 23:01: Message edited by: Jack Lothian ]
_________________________
Jack

Top
#69798 - 2002-09-16 11:06 PM Re: KiXtart Golf V: Game24
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Jack:

You're right. I'll correct the test script.
_________________________
There are two types of vessels, submarines and targets.

Top
#69799 - 2002-09-16 11:08 PM Re: KiXtart Golf V: Game24
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Jens, That invalidates my "first to post". I still have not found that combination. [Frown]

[ 16. September 2002, 23:08: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#69800 - 2002-09-16 11:11 PM Re: KiXtart Golf V: Game24
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
I think, Jack is the first one to find this particular solution. I've checked it using one of those online Game 24 things and that one didn't find a solution either.

Never trust a computer [Wink]

This will also mean that Richard Howarth is currently recipiend of the First Scorer Award provided that his script passes the updated and corrected test script.

[ 16. September 2002, 23:13: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#69801 - 2002-09-16 11:22 PM Re: KiXtart Golf V: Game24
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
I also get another inconsistency with Madruga's test script. His script gives:

In => 3, 3, 7, 7; Out => ( 3 + 3 / 7 ) * 7 = 21 => WRONG!!

Which is clearly incorrect.

You know, I have been playing with the math in Kixtart for almost 2 days non stop & I don't believe "execute", "val", "decimalnumber", "join", or "cdbl" generate consistent answers when you feed them various mixes of floating point numbers & integers. All seem to have some type of internal house cleaning rountines that convert all floating points that are integer values to integer values. Sometimes the results are downright bizarre & unpredicatable.

It is frustrating as hell & I had to fudge the math to make the routine work consistently.

Also, isn't adding zeros to output numbers inconsistent with the game's overall approach of dealing only with integers? My solution doesn't add zeros.

[ 16. September 2002, 23:25: Message edited by: Jack Lothian ]
_________________________
Jack

Top
#69802 - 2002-09-16 11:52 PM Re: KiXtart Golf V: Game24
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Although it appears that

$s = execute("$$v = 8.0/(3.0-8.0/3.0)") equals 24 try this:
code:
$s = execute("$$v = 8.0/(3.0-8.0/3.0)") 
? $v
if $v=24
? "hey this equals 24"
else
? "wait a minute - this does not equal 24"
endif

My code found this combination but did not see it as the correct answer.

[ 16. September 2002, 23:57: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#69803 - 2002-09-17 12:08 AM Re: KiXtart Golf V: Game24
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Hmm, it seems KiX has problems comparing Doubles with Longs....

Give this a try:
code:
Break on

$s = Execute("$$v = 8.0/(3.0-8.0/3.0)")
If $v=24
? "hey this equals 24"
Else
? "wait a minute - this does not equal 24"
EndIf
? ?
? " V - " $v " - " VarTypeName($v)
$v = Val($v)
? " Val V - " $v " - " VarTypeName($v)
$x = 24
? " X - " $x " - " VarTypeName($x)
$x = Val($x)
? " Val X - " $x " - " VarTypeName($x)


Get $x

Exit (0)

_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#69804 - 2002-09-17 12:10 AM Re: KiXtart Golf V: Game24
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
Howard, Patrick,

This is exactly the type of problem that I have been having & there seemed to be no reason for the failures. The calculations are very unstable. I try to get around this by using 2 fudge factors - 1 that I use to enforce floating point but which perturbs the accuracy. I compensate by a second fudge factor that catches values in a very narrow interval. After hours of testing it was the only consistent method that I could find. I can increase the accuracy indefinitely but at the cost of 2 characters per decimal place.

I think all of the above mentioned functions are wonky & totally unreliable with floating point. They are not even predictable.

Patrick,

You might be right Patrick but I get the sense the problem is deeper & more serious than that. For instances, there are about 5 functions for effectively executing a constructed string. If you feed them exactly the same string they give different results on occasions.

Howard,

Add 0.000001 to all your numbers & then check for a narrow range say + or - 0.0001 about 24. I bet it will work. Absolutely everything must be floating point though. Even the 24 must be written as 24.0.

This is kind of like practicing voodoo in my opinion but it does give consistent results.

Jens,

I think your challange may have pushed kixtart beyond its capabilities.

[ 17. September 2002, 00:21: Message edited by: Jack Lothian ]
_________________________
Jack

Top
#69805 - 2002-09-17 12:20 AM Re: KiXtart Golf V: Game24
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Not sure why this works:

code:
$s = Execute("$$v = 8.0/(3.0-8.0/3.0)")
If cint($v)=24
? "hey this equals 24"
Else
? "wait a minute - this does not equal 24"
EndIf

and this does not:
code:
$s = Execute("$$v = 8.0/(3.0-8.0/3.0)")
If $v=cdbl(24)
? "hey this equals 24"
Else
? "wait a minute - this does not equal 24"
EndIf

I guess changing to an INT just plain easier to do..

[ 17. September 2002, 00:36: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#69806 - 2002-09-17 12:36 AM Re: KiXtart Golf V: Game24
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
Howard,

My experience is that with out the fudge factors you get trade offs. You can increase the prediction of correct responses but only at the cost of lossing reliability at predicting non-solutions. Many times in the last 48 hours, I thought I had found the answer only to discover the new solution didn't work with other solutions.

To be truthful, I am not sure my algorithm is 100% accurate but it worked on the several dozen examples that I had on hand. I though of exporting all the permutations to excel so I could test the forumala in an environment that is reliable but I haven't had time to test that idea yet.
_________________________
Jack

Top
#69807 - 2002-09-17 12:44 AM Re: KiXtart Golf V: Game24
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yep, ran this little test script to find the leak:
code:
$s = Execute("$$v = 8.0/(3.0-8.0/3.0)")
$=cdbl(24)
if $<$v
$diff=$v-$ "24 is smaller by:"
else
$diff=$-$v "24 is bigger by:"
endif
$diff=$diff*1000000
$diff=$diff*1000000
$diff
" / 1000 000 000 000"

get $

and it did not suprise me at all.

{edit}
I quess I might add the output of it too:
24 is bigger by:0,0106581410364015 / 1000 000 000 000

[ 17. September 2002, 00:46: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#69808 - 2002-09-17 01:22 AM Re: KiXtart Golf V: Game24
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
Lonkero,

I think we are running into 2 problems. Fist as you say there is a leak but also Ruud's string parsing functions for math strings probably has other holes. His routines seem to convert floating point into integer in very caprious ways. Both Join & Execute strip all unnecessary zeros from your code so it is very hard to force either function to do floating point math. My experiments seem to indicate that execute & join are actually more bullet proof than formatdecimal or cdbl. These results that come out of these functions are really weird. These holes in these parsing routines even effect more mundane functions like the if statement.

The combination of these various problems seems to create a version of the Heisenburg uncertainy principle in kix. Very accurate matches can only be identified in a probabilistic sense.
_________________________
Jack

Top
#69809 - 2002-09-17 01:31 AM Re: KiXtart Golf V: Game24
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
Damn, I think I know what it is. Has anybody every heard of EPS?

EPS = Floating point relative accuracy. EPS is a permanent variable whose value is initially the distance from 1.0 to the next largest floating point number.

Basically, in order to display any give number in a discreet numbering system, it has to be converted into that numering system. And based on the number of bits used in that system you end up with a specific number which is the smallest number that can be displayed.

For example, assuming an integer numbering system, EPS equals 1 since the next higher number from 1 is 2. Any number in beweeen 1 and 2 that is to be converted to the integer system will thus end up being either 1 or 2. Which one it is, is being governed by conventions, e.g. IEEE definitions.

Another example, in Matlab, a mathematical scripting language, EPS=2.2204e-016 for floating point math. This means any number smaller than EPS cannot be displayed, it will either be rounded down to 0 or up to EPS. It also means that certain numbers cannot be displayed without some (small) loss. Thus, if I calculate 0.0001*3 - 0.0003 in discreet floating point math I will get a result of 5.4210e-020 and not '0'.

I hope everybody is still with me on this?

Anyway, I don't think there's anything we can do about this since it's a limitation of the underlying number conversion system.
_________________________
There are two types of vessels, submarines and targets.

Top
#69810 - 2002-09-17 01:38 AM Re: KiXtart Golf V: Game24
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Now that this behavior has been defined, should we defined that the calculated value of the input be close to 24 within some specified range?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#69811 - 2002-09-17 01:53 AM Re: KiXtart Golf V: Game24
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
If you put a CINT around the resulting value, then that should go back to an integer 24.

Also, I just ran this little script and it works fine.
code:
Break on

$a='(cdbl(3)+cdbl(3)/cdbl(7))*cdbl(7)'

$rc=execute('$$b='+$a)

? 'Result = '+$b

? 'Result = '+($b=24)

? 'Result = '+vartypename($b)

with output
code:
Result = 24
Result = 1
Result = Double

_________________________
There are two types of vessels, submarines and targets.

Top
#69812 - 2002-09-17 02:02 AM Re: KiXtart Golf V: Game24
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
This fails:
code:
$a='cdbl(8)/(cdbl(3)-cdbl(8)/cdbl(3))'
$rc=execute('$$b='+$a)
? 'Result = '+$b
? 'Result = '+($b=24)
? 'Result = '+vartypename($b)

This works (in this case):
code:
? 'Result = '+(cint($b)=24)  



[ 17. September 2002, 02:04: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#69813 - 2002-09-17 02:07 AM Re: KiXtart Golf V: Game24
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
This is obviously wrong but with CINT is passes:
code:
$a='(cdbl(3)/cdbl(8))+cdbl(8)*cdbl(3)'

$rc=execute('$$b='+$a)
? 'Result = '+$b
? 'Result = '+(cint($b)=24)
? 'Result = '+vartypename($b)



[ 17. September 2002, 02:08: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#69814 - 2002-09-17 02:07 AM Re: KiXtart Golf V: Game24
Fernando Madruga Offline
Starting to like KiXtart

Registered: 2002-08-21
Posts: 149
Loc: Coimbra.Portugal.Europe.Earth....
Jack, I don't quite get it when you say:
quote:

I also get another inconsistency with Madruga's test script. His script gives:

In => 3, 3, 7, 7; Out => ( 3 + 3 / 7 ) * 7 = 21 => WRONG!!

Which is clearly incorrect.

Why is that incorrect? If I use integer math, then 3 / 7 = 0, + 3 = 3, * 7 = 21... Have I forgotten something from school?
Surelly that is not the intended result!
You may be induced in error by the "WRONG!" part: it does not mean that the expression is wrong, it only means that that expression does not evaluate to the expected result of 24...

P.S.: I'm still trying to figure out a decent algorithm... When I do, I'll sure as hell post the results here... [Smile]

[ 17. September 2002, 02:08: Message edited by: Fernando Madruga ]
_________________________
Later,   [b]Mad[/b]ruga

Top
Page 3 of 7 <12345>Last »


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 248 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.138 seconds in which 0.069 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org