|John Grieve: Number Theory Game|
12 comments14 Jun 2010 @ 07:11 by swanny @188.8.131.52 : Average
I wonder if there would be an average that one might reach but I suppose that would depend on how many times it was done, but say do it 100 times what would the average be for that process done 100 times? Just curious.
14 Jun 2010 @ 08:31 by johnjoseph : Averages
As you may know, averages are important in linear and non-linear maths and dynamics,but to do it a significant number of times you would have to give up the calculator and program it.To help do this there is an interesting Applesoft Emulator at http://www.calormen.com/applesoft/
14 Jun 2010 @ 11:15 by johnjoseph : moving averages
hi ed,here's something on averages. The more relevant non-linear moving average (NMA) is not easy to find on the web:http://www.physforum.com/index.php?showtopic=12502&st=510
Incidentally i used to have an apple ii plus and programme in 6502 machine language and Assembler.Anyone interested in writing fast number theory programs might find this interesting:http://www.6502asm.com/
14 Jun 2010 @ 20:30 by johnjoseph : Programme for calculating averages
I've just written an APPLESOFT BASIC programme which can calculate the averages mentioned earlier. I will Copy and Paste it into a comment, when less tired ,and if you do the same into the Emulator you will see the results generated.
14 Jun 2010 @ 20:54 by swanny @184.108.40.206 : wow
wow thanks john and that was fast,
yea take a break you deserve it
I myself can't do programing except maybe a little HTML
which doesn't count so thanks again
be curious to see the results of a 100x sample
15 Jun 2010 @ 06:24 by johnjoseph : Chaos Game: Averages Programme
Hi Ed,here's the program i mentioned. The emulator is slower than a real APPLE but it gets there in the end. I'm not sure if this is non-linear etc. and also the Average may be non-linear but I'll leave that to someone more expert than me in Statistics.
5 REM Number Theory Game
6 REM Average of 100 Tries
15 DIM M$(9):X=2:D=100:CO=0:N=0
20 GOSUB 600
45 PRINT "The Value of N is ";N: PRINT "The Average is ";CO/D
400 X2 = SQR(X)
410 X2$ = STR$(X2)
500 REM Reverse Character
502 PRINT TAB(10) X2$
510 FOR Y= 6 TO 0 STEP -1
515 M$(Y+1)= MID$((X2$),ABS(Y-7),1)
517 NEXT Y
522 FOR T= 1 TO 6: P$=P$+M$(T):PRINTP$:NEXT T
535 REM SWITCH
540 X2=VAL(P$):P$ = ""
542 X=X2:GOSUB 400
600 REM MAIN S/R
612 IF N=0 THEN GOSUB 400
620 PRINT N
645 GOSUB 500
648 IF N=D THEN RETURN
660 GOTO 615
15 Jun 2010 @ 06:47 by swanny @220.127.116.11 : hmmm
hmmmmm when I try to run the program it doesn't seem to come up with the 100 th time and just goes to 99 and gives me this error message
" Syntax error: Expected: ')', saw [NUMBER: 5 ], line: 45 "
and then my firewall program (clam win) kicked in and started downloading some software files?
whats going on ? hmmm its got me stumped...
15 Jun 2010 @ 07:28 by johnjoseph : Sorry technical problem
It should run alright now, I was trying to get a better display at the end but now you will need to scroll to the bottom when the program finishes, to see the results
15 Jun 2010 @ 08:09 by swanny @18.104.22.168 : great
great it worked thanks and youre not to bad at this
for the 100th run I got an average of 1.21443593
which is a finite number any way
I'm going to run it again an see if I get the same number
the second time too.
hmmm yes why would it give the same number each time you run it?
the second time it gave the same number
but I wonder if thats normal or not
I get an error or note at the end of
" Break, line: 50 "
what would you need to change in the program to get it to run 200 times
but good work none the less
15 Jun 2010 @ 08:31 by johnjoseph : Averages in longer runs
Hi,to get a longer run change the value of the variable D in line 15, e.g. to 200. But it is worth noting that the emulator slows down the longer it runs. I may write a version of this programme for 6502 Assembler when it would be possible to do very long runs reasonably quickly
15 Jun 2010 @ 09:26 by swanny @22.214.171.124 : Lower Number
thanks again john and youre up late to I see
running it 200 times gives a different lower number
ie 1.21076837 im just going to run it twice thus to see
if its the same each time.
yes apparently and now thus I wonder if the trend is the more times you run
will the average go lower or higher or is there a correlation, trend or is it random. hmm running it 300 times gave ie 1.2125513 higher than 200 times but not as high as 100 times
100 times = 1.21443593
200 times = 1.21076837
300 times = 1.2125513
400 times = 1.21108105
okay so but what the initial or root number we're squaring
it gives us an average of 1.21 and
1.21 x 1.21 = 1.4641
6 Jul 2016 @ 03:27 by king king @126.96.36.199 : king
Other entries in Articles
26 Feb 2017 @ 20:56: Trump versus the Media
26 Jan 2017 @ 18:53: Women's Marches the beginning of the Fightback
7 Jan 2017 @ 20:11: Now's the End Times
15 Nov 2016 @ 22:48: Theory of Civilization-- Part 3
15 Nov 2016 @ 22:20: Theory of Civilization-- Part 2
15 Nov 2016 @ 21:52: Theory of Civilization-- Part 1
14 Nov 2016 @ 22:11: Global march of the right in the context of the dynamics of civilization
12 May 2016 @ 21:47: SuperCivilization, The Second Axial Age and not-so-enlightened Despots Cont.
12 May 2016 @ 21:20: SuperCivilization, The Second Axial Age and not-so-enlightened Despots
28 Feb 2016 @ 18:55: Economic Evolution