Author Topic: Looking for old program or help recreating it  (Read 9094 times)

0 Members and 1 Guest are viewing this topic.

Offline random1

  • Newbie
  • Posts: 86
Re: Looking for old program or help recreating it
« Reply #60 on: December 15, 2021, 04:24:15 pm »
Wow, 100 times more productive.  I should have some time tomorrow to update my end.

Many thanks for everything.

R1   



Offline random1

  • Newbie
  • Posts: 86
Re: Looking for old program or help recreating it
« Reply #61 on: December 15, 2021, 04:36:03 pm »
Ran a quick test using real data, amazing!!!
R1.

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
Re: Looking for old program or help recreating it
« Reply #62 on: December 15, 2021, 04:41:22 pm »
Glad it's looking better and better r1!

It's still evolving little by little: today I re-included the order-1 alphabets (so literally just 0 and 1) and this thing's putting game improved yet again. I also improved a few things about how it looks, and it also reports on its best streak now too, cause why not? Anyway, here's the latest and greatest:

Code: QB64: [Select]
  1.  
  2. Screen _NewImage(120, 40)
  3.  
  4. ' Version: 13
  5.  
  6. Type LetterBin
  7.     Signature As String
  8.     Count As Integer
  9.  
  10. Dim Shared Alphabet1(2) As LetterBin ' 0 1
  11. Dim Shared Alphabet2(4) As LetterBin ' 00 01 10 11
  12. Dim Shared Alphabet3(8) As LetterBin ' 000 001 010 011 100 101 110 111
  13. Dim Shared Alphabet4(16) As LetterBin ' etc.
  14. Dim Shared Alphabet5(32) As LetterBin
  15. Dim Shared Alphabet6(64) As LetterBin
  16. Dim Shared Alphabet7(128) As LetterBin
  17. Dim Shared Alphabet8(256) As LetterBin
  18. Dim Shared Alphabet9(512) As LetterBin
  19. Dim Shared Alphabet10(1024) As LetterBin
  20. Dim Shared Alphabet11(2048) As LetterBin
  21. Dim Shared Alphabet12(4096) As LetterBin
  22. Dim Shared Alphabet13(8192) As LetterBin
  23.  
  24. Alphabet1(1).Signature = "0"
  25. Alphabet1(2).Signature = "1"
  26. Call NewAlphabet(Alphabet1(), Alphabet2())
  27. Call NewAlphabet(Alphabet2(), Alphabet3())
  28. Call NewAlphabet(Alphabet3(), Alphabet4())
  29. Call NewAlphabet(Alphabet4(), Alphabet5())
  30. Call NewAlphabet(Alphabet5(), Alphabet6())
  31. Call NewAlphabet(Alphabet6(), Alphabet7())
  32. Call NewAlphabet(Alphabet7(), Alphabet8())
  33. Call NewAlphabet(Alphabet8(), Alphabet9())
  34. Call NewAlphabet(Alphabet9(), Alphabet10())
  35. Call NewAlphabet(Alphabet10(), Alphabet11())
  36. Call NewAlphabet(Alphabet11(), Alphabet12())
  37. Call NewAlphabet(Alphabet12(), Alphabet13())
  38.  
  39. '''
  40. Dim TheString As String
  41.  
  42. Dim predictedGuess As Integer
  43. Dim correctGuesses As Double
  44. Dim totalGuesses As Double
  45. Dim streakGuess As Integer
  46. Dim streakBest As Integer
  47.  
  48. Dim ProgressGraph(1 To _Width) As Double
  49.  
  50. '''
  51. ' Systematic cases:
  52. '''
  53. '                                                                                                                                         Score / Ending
  54. '                                                                                                                                                 Streak:
  55. '                                                                                                                                         ---------------
  56. 'TheString = "111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111" ' (100% / 119)
  57. 'TheString = "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" ' (100% / 119)
  58. 'TheString = "010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101" ' (96%  / 112)
  59. 'TheString = "101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010" ' (96%  / 112)
  60. 'TheString = "001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001" ' (96%  / 108)
  61. 'TheString = "010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010" ' (96%  / 109)
  62. 'TheString = "100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100" ' (93%  / 108)
  63. 'TheString = "110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110" ' (96%  / 108)
  64. 'TheString = "101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101" ' (96%  / 109)
  65. 'TheString = "011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011" ' (93%  / 108)
  66. '
  67. '''
  68. ' Community hand-typed cases:
  69. '''
  70. '            (from Cobalt) (Results in: 48%  -  Claims he made this data hand but behavior in Discord raises doubt.)
  71. 'TheString = "1010001101110110000000011100110100101010111110101001100101110100000111101011011000010101101100000110010010010101010110111111111001000100101011101000011110011000000100111100001100111000111100100000000111010011010011001111101000010011101111000011100011010110101101000111101111100101100100000101111011001101100000111011000001001111000110000001110101100101"
  72. '            (from Loudar) (Results in: 71%)
  73. 'TheString = "1011001010010100100100110010101010101001010101010101011010010101001010101001010010100110101011010101010101011010101101010101010101010010110101010101100101010101010110101101011010010101010010100110101101001010110101011010010101101010110100101111010101010011011011010010110101010010110100101101010100101011010010101001010101010001011101011010010101011100111010010001101011110010011010001011100110101010010011010101001001010010000101010110001"
  74. '            (from Luke) (Results in: 51%  -  I have long suspected Luke to be a computer. The numbers are now in.)
  75. 'TheString = "01100101001010001100001101101111011010010101010110110101001000001111001111110101000101111011010101111101010101101010101001010101011000010101010101001011010100110100110100110011010101010101110101010111111101011010100000001101111000010111000110111001000010100001101010110100000111101011111100001011001010110010110" ' Luke 50
  76. '            (from Sarafromct) (Results in: 64%)
  77. 'TheString = "10101010101011101000011101010111010101010101100111001010100111100001011011110101000001111010101101010000001111110011111110111101110111001110110010000100010101010101010100101011010110101010101010101001000000001111110000011110101010101010100010101110101010101101111111111111111111101010101010101000000" ' 63
  78. '            (from Spriggs) (Results in: 85%)
  79. TheString = "10111010101010101010101001010101010101001010101001010101010101010101010101010101010101010101010101010101001010100100100101010101010101001010100101010101010100101010100101010101010101010101001010010110010101010010101010101010101010101010100101001001001010101010101010101010101001010101001001101010010"
  80. '            (from Spriggs) (Results in: 67%)
  81. 'TheString = "11111011110100101011111111110100000011011110101100111100111111110111101110100111100110011111110101111111010111101111100111110111111111111011100111110111111110010000101011111001110101101010110111110"
  82. '            (from Hotpants) (Results in: 62%)
  83. 'TheString = "01010100011001010010101010101010101000110101010111101010100100011010101010100100101110010010010100001010101001010101010110010001001011000100100110101001001001010000000001010101101111101001010100010101001001010101000100101001100100010011010101010101010111010010101011101011011010110100100010010100100100010010001001" ' Tom
  84. '
  85. '''
  86. ' Known-Random cases:
  87. '''
  88. '            (using RND) (Results in: 45%)
  89. 'TheString = "11100101110011011010110100110011111011010110100100000110000100101001001010011100111101101110000001000000011011100101110000000111100100011101000000101000110100001000000001111010101011000010001110111110001001110101011000010101001111010100100000011100110110110000111010001010000011010000101111101011000"
  90. '            (from Spriggs) (Results in: 52%)
  91. 'TheString = "010101111010111100110000001001100100101100000101110001100101000010001001111101111111111100011110000011011110011000100011100100001101110011001001011001000011110010001000111100011100011110010110011110111010110100001000110000010000111000111011100110011010101111111100100010001111111100010100001011000011"
  92. '            (Wolfrm rule 30, central column) (Results in: 47%)
  93. 'TheString = "110111001100010110010011101011100111010101100001100101011010101111110000111100010101110000010010110001"
  94. '            (using RND) (Results in: 46%)
  95. 'TheString = "111001011100110110101101001100111110110101101001000001100001001010010010100111001111011011100000010000000110111001011100000001111001000111010000001010001101000010000000011110101010110000100011101111100010011101010110000101010011110101001000000111001101101100001110100010100000110100001011111010110000"
  96. '            (using RND) (Results in: 46%)
  97. 'TheString = "111001011100110110101101001100111110110101101001000001100001001010010010100111001111011011100000010000000110111001011100000001111001000111010000001010001101000010000000011110101010110000100011101111100010011101010110000101010011110101001000000111001101101100001110100010100000110100001011111010110000101110111110011100001000110010010001100111101000001101011000010101101011111010010001010010110110011000001001101000011100000011110001110011100010101010111101100100100001001000101101110110101100001111011101000100111110000001110000111011101000110110100111101101001100100110000111110111101001100010011110"
  98. '            (using RND) (Results in: 45%)
  99. 'TheString = "111001011100110110101101001100111110110101101001000001100001001010010010100111001111011011100000010000000110111001011100000001111001000111010000001010001101000010000000011110101010110000100011101111100010011101010110000101010011110101001000000111001101101100001110100010100000110100001011111010110000101110111110011100001000110010010001100111101000001101011000010101101011111010010001010010110110011000001001101000011100000011110001110011100010101010111101100100100001001000101101110110101100001111011101000100111110000001110000111011101000110110100111101101001100100110000111110111101001100010011110111001001100111000110011011000100101100010101010000010000111111010111111011100011100001000011000100100111001100001111010001010000001011100000101110000110010111110010101010110111110011100100001011101010000011011110110100010110111000100000110000001001010001011010000010001111110100100010011100011001000"
  100. '            (using RND) (Results in: 48%)
  101. 'TheString = "111001011100110110101101001100111110110101101001000001100001001010010010100111001111011011100000010000000110111001011100000001111001000111010000001010001101000010000000011110101010110000100011101111100010011101010110000101010011110101001000000111001101101100001110100010100000110100001011111010110000101110111110011100001000110010010001100111101000001101011000010101101011111010010001010010110110011000001001101000011100000011110001110011100010101010111101100100100001001000101101110110101100001111011101000100111110000001110000111011101000110110100111101101001100100110000111110111101001100010011110111001001100111000110011011000100101100010101010000010000111111010111111011100011100001000011000100100111001100001111010001010000001011100000101110000110010111110010101010110111110011100100001011101010000011011110110100010110111000100000110000001001010001011010000010001111110100100010011100011001000011101011010100110110000110010010011110111001001011111011000000100010011011100111110111011111101100011011101001111110100011010000111001001010111011101000001010010010100111010001001010101001000010011100111010101000110010110101111001110000010110110010101001000011000101000001100110100111101000110111101101010011011000101100101001010001100110101000101110000101100110010011010001010101010101101110101110110101100101001111100110110101011001000001100101001011000101100001001000001010111010100010100101011001111001011011100011001110010111011110010111101011101000100100010111010000001010011101010001110110110101011000101010100000001110110101011110101111100100101101000001011000101001110010010010000111001101010100101111101001110010001011000001001000111010001000011000111000000111001110111110011110110101100111011001100101101010101100010100100001010010110010000001100110010010100110011110110000001001000111001001010010000011111110011110010001100011100011010000111100111111010010001010011100100111100111101111110101000010011100011111100010000011111101101010010100000011011001110001100001011111100111000001110111011001111110011011100111000110110110011110000111000010011011000011001111111110010100000111110011111100100001100000000110001111101101011100011111011110001100100001100011100011111000000110011011100110101101001001111101101000000110101101001100011100011001110001000000111111100110101001110100010010010100000010100001010001011011001101010011111001101110110010101000111101100111000011000111001100011011011010100111111001100000100100110000100101001111111100110010111100000111101101001111001010011010011011100101001001001110101110001101010001111010101100101010111000111000011000001010010010101010100001110010001001001110110011100110011111001100111010011110100100110010000100011010001110000000100001100000010000111000111111000111100010001101011000101000010100011100011111000100010101000001001011001000101101111110111110110001101001001011100011110001101100010100101101011001001100111000000111111110110100010111111101000000001111000100001111111011000101001111110010000110101100010000011100110111101011011100110"
  102.  
  103.  
  104.  
  105.  
  106. 'Cls
  107. 'Locate 1, 1
  108. 'Print " Press 0 or 1 as randomly as you can. The longer the string, the better."
  109. 'Input "", TheString
  110.  
  111.  
  112.  
  113.  
  114.  
  115. For j = 1 To Len(TheString)
  116.  
  117.     Cls
  118.     Locate 1, 1
  119.     For k = 1 To _Width
  120.         Print "_";
  121.     Next
  122.     Print
  123.     Print "Analyzing: (string length "; _Trim$(Str$(Len(TheString))); ")"
  124.     Print
  125.     Color 7
  126.     Print Left$(TheString, j);
  127.     Color 8
  128.     Print "["; Right$(TheString, Len(TheString) - j); "]"
  129.     Color 7
  130.     Print
  131.  
  132.     ' Main prediction call
  133.     predictedGuess = Analyze(Left$(TheString, j), 0)
  134.  
  135.     ' Reconciliation
  136.     Print "Prediction: "; _Trim$(Str$(predictedGuess))
  137.     If (j < Len(TheString)) Then
  138.         Print "Actual:     "; _Trim$(Mid$(TheString, j + 1, 1))
  139.         If (predictedGuess = Val(Mid$(TheString, j + 1, 1))) Then
  140.             correctGuesses = correctGuesses + 1
  141.             streakGuess = streakGuess + 1
  142.             If (streakGuess > streakBest) Then streakBest = streakGuess
  143.             Print "I am RIGHT this round."
  144.         Else
  145.             streakGuess = 0
  146.             Print "I am WRONG this round."
  147.         End If
  148.         totalGuesses = totalGuesses + 1
  149.     Else
  150.         Print "Actual:     ?"
  151.     End If
  152.     Print
  153.     Print "I'm on a "; _Trim$(Str$(streakGuess)); "-round winning streak."
  154.     Print "My best streak has been "; _Trim$(Str$(streakBest)); "."
  155.     Print "My correctness rate is "; _Trim$(Str$(Int(100 * correctGuesses / totalGuesses))); "% in "; _Trim$(Str$(totalGuesses)); " guesses."
  156.     If (j = Len(TheString)) Then
  157.         Print
  158.         Print "Complete."
  159.     End If
  160.  
  161.     ' Draw bottom graph
  162.     If (1 = 1) Then
  163.         For k = 1 To _Width
  164.             Locate _Height - 5, k: Print "_"
  165.             Locate _Height - 5 - Int(10), k: Print "_"
  166.         Next
  167.         Locate _Height - 5 + 1, 1: Print "0%"
  168.         Locate _Height - 5 - Int(10) - 1, 1: Print "100%"
  169.         f = (_Width - 1) / Int(Len(TheString))
  170.         If (f > 1) Then f = 1 / f
  171.         ProgressGraph(1 + Int(j * f)) = correctGuesses / totalGuesses
  172.         g = (_Width - 0) / Int(Len(TheString))
  173.         If (g > 1) Then g = 1
  174.         For k = 1 To Int(j * g)
  175.             Locate _Height - 5 - Int(10 * ProgressGraph(1 + Int(k * f))), k: Print "*"
  176.         Next
  177.     End If
  178.  
  179.     _Delay .015
  180.     _Display
  181.  
  182.  
  183. Function Analyze (TheStringIn As String, pswitch As Integer)
  184.     Dim TheReturn As Integer
  185.     Dim As Integer n
  186.     Dim As Double r, j, k, h
  187.     Dim Fingerprint(16) As String
  188.     Dim Partialguess(1 To 10, 2) As Double ' Change the upper bound to a higer number for more accuracy.
  189.  
  190.     ' Create shifted versions of string, i.e. ABCD -> BCDA, CDAB, DABC, ABCD, BCDA, etc.
  191.     Fingerprint(1) = TheStringIn
  192.     For n = 2 To UBound(Fingerprint)
  193.         Fingerprint(n) = Right$(Fingerprint(n - 1), Len(Fingerprint(n - 1)) - 1) + Left$(Fingerprint(n - 1), 1)
  194.     Next
  195.  
  196.     ' Initialize partial results.
  197.     For n = LBound(Partialguess) To UBound(Partialguess)
  198.         Partialguess(n, 1) = -999
  199.     Next
  200.  
  201.     Call CreateHisto(Fingerprint(), Alphabet1(), 1)
  202.     Call CreateHisto(Fingerprint(), Alphabet2(), 2)
  203.     Call CreateHisto(Fingerprint(), Alphabet3(), 3)
  204.     Call CreateHisto(Fingerprint(), Alphabet4(), 4)
  205.     Call CreateHisto(Fingerprint(), Alphabet5(), 5)
  206.     Call CreateHisto(Fingerprint(), Alphabet6(), 6)
  207.     Call CreateHisto(Fingerprint(), Alphabet7(), 7)
  208.     Call CreateHisto(Fingerprint(), Alphabet8(), 8)
  209.     Call CreateHisto(Fingerprint(), Alphabet9(), 9)
  210.     Call CreateHisto(Fingerprint(), Alphabet10(), 10)
  211.     'Call CreateHisto(Fingerprint(), Alphabet11(), 11)
  212.     'Call CreateHisto(Fingerprint(), Alphabet12(), 12)
  213.     'Call CreateHisto(Fingerprint(), Alphabet13(), 13)
  214.  
  215.     If (pswitch = 1) Then
  216.         For n = 1 To _Width
  217.             Print "-";
  218.         Next
  219.         Print
  220.     End If
  221.  
  222.     If (pswitch = 1) Then ' Set the last number >=1 to print stats for that histogram.
  223.         If (Len(TheStringIn) >= 1) Then Call PrintHisto(Alphabet1(), 2)
  224.         If (Len(TheStringIn) >= 2) Then Call PrintHisto(Alphabet2(), 3)
  225.         If (Len(TheStringIn) >= 3) Then Call PrintHisto(Alphabet3(), 3)
  226.         If (Len(TheStringIn) >= 4) Then Call PrintHisto(Alphabet4(), 0)
  227.         If (Len(TheStringIn) >= 5) Then Call PrintHisto(Alphabet5(), 0)
  228.         If (Len(TheStringIn) >= 6) Then Call PrintHisto(Alphabet6(), 0)
  229.         If (Len(TheStringIn) >= 7) Then Call PrintHisto(Alphabet7(), 0)
  230.         If (Len(TheStringIn) >= 8) Then Call PrintHisto(Alphabet8(), 0)
  231.         If (Len(TheStringIn) >= 9) Then Call PrintHisto(Alphabet9(), 0)
  232.         If (Len(TheStringIn) >= 10) Then Call PrintHisto(Alphabet10(), 0)
  233.         'If (Len(TheStringIn) >= 11) Then Call PrintHisto(Alphabet11(), 0)
  234.         'If (Len(TheStringIn) >= 12) Then Call PrintHisto(Alphabet12(), 0)
  235.         'If (Len(TheStringIn) >= 13) Then Call PrintHisto(Alphabet13(), 0)
  236.         Print
  237.     End If
  238.  
  239.     If (Len(TheStringIn) >= 1) Then Call MakeGuess(TheStringIn, Alphabet1(), 1, Partialguess(), pswitch)
  240.     If (Len(TheStringIn) >= 2) Then Call MakeGuess(TheStringIn, Alphabet2(), 2, Partialguess(), pswitch) ' Set the last number =1 to print guess for that histogram.
  241.     If (Len(TheStringIn) >= 3) Then Call MakeGuess(TheStringIn, Alphabet3(), 3, Partialguess(), pswitch)
  242.     If (Len(TheStringIn) >= 4) Then Call MakeGuess(TheStringIn, Alphabet4(), 4, Partialguess(), 0)
  243.     If (Len(TheStringIn) >= 5) Then Call MakeGuess(TheStringIn, Alphabet5(), 5, Partialguess(), 0)
  244.     If (Len(TheStringIn) >= 6) Then Call MakeGuess(TheStringIn, Alphabet6(), 6, Partialguess(), 0)
  245.     If (Len(TheStringIn) >= 7) Then Call MakeGuess(TheStringIn, Alphabet7(), 7, Partialguess(), 0)
  246.     If (Len(TheStringIn) >= 8) Then Call MakeGuess(TheStringIn, Alphabet8(), 8, Partialguess(), 0)
  247.     If (Len(TheStringIn) >= 9) Then Call MakeGuess(TheStringIn, Alphabet9(), 9, Partialguess(), 0)
  248.     If (Len(TheStringIn) >= 10) Then Call MakeGuess(TheStringIn, Alphabet10(), 10, Partialguess(), 0)
  249.     'If (Len(TheStringIn) >= 11) Then Call MakeGuess(TheStringIn, Alphabet11(), 11, Partialguess(), 0)
  250.     'If (Len(TheStringIn) >= 12) Then Call MakeGuess(TheStringIn, Alphabet12(), 12, Partialguess(), 0)
  251.     'If (Len(TheStringIn) >= 13) Then Call MakeGuess(TheStringIn, Alphabet13(), 13, Partialguess(), 0)
  252.     If (pswitch = 1) Then Print
  253.  
  254.     If (pswitch = 1) Then
  255.         Print "Thinking:";
  256.         For k = LBound(Partialguess) To UBound(Partialguess)
  257.             If (Partialguess(k, 1) <> -999) Then
  258.                 Print Partialguess(k, 1);
  259.             Else
  260.                 Print "_ ";
  261.             End If
  262.         Next
  263.         Print
  264.     End If
  265.  
  266.     j = 0
  267.     r = 0
  268.  
  269.     For k = UBound(Partialguess) To LBound(Partialguess) Step -1
  270.         If (Partialguess(k, 1) <> -999) Then
  271.  
  272.             ' This is the made-up part of the model:
  273.             ' The variable r contributes to weighted average.
  274.             ' The variable j is used for normalization.
  275.             ' Scaling factor h influences weighted average calculaton.
  276.             ' The factors multiplying h are totally arbitrary. Notes:
  277.             '   setting o(h^2) means the later alphabets count for more.
  278.             '   Partialguess(k, 1) euqals the calculated guess at frequency k.
  279.             '   Partialguess(k, 2) euqals the peak count of the unscaled histogram.
  280.             '   ...while Partialguess(k, 2) is here, it does not seem to help calculations.
  281.  
  282.             h = 1 + k - LBound(Partialguess)
  283.  
  284.             h = h ^ 2
  285.  
  286.             ' Standard weighted average:
  287.             r = r + h * Partialguess(k, 1)
  288.             j = j + h
  289.  
  290.         End If
  291.     Next
  292.     If (j <> 0) Then
  293.         r = r / j
  294.     End If
  295.  
  296.     If (pswitch = 1) Then Print "Predicting:  "; _Trim$(Str$(r))
  297.  
  298.     If (r > .5) Then
  299.         r = 1
  300.     Else
  301.         r = 0
  302.     End If
  303.  
  304.     If (pswitch = 1) Then
  305.         Print "Rounding to: "; _Trim$(Str$(r))
  306.     End If
  307.  
  308.     If (pswitch = 1) Then
  309.         For n = 1 To _Width
  310.             Print "-";
  311.         Next
  312.         Print: Print
  313.     End If
  314.  
  315.     TheReturn = r
  316.     Analyze = TheReturn
  317.  
  318. Sub MakeGuess (TheStringIn As String, arralpha() As LetterBin, wid As Integer, arrbeta() As Double, pswitch As Integer)
  319.     Dim TheReturn As Double
  320.     Dim As Integer j, k, n
  321.     TheReturn = 0
  322.     j = 1 '0
  323.     k = 0
  324.     For n = 1 To UBound(arralpha)
  325.         If (Left$(arralpha(n).Signature, wid - 1) = Right$(TheStringIn, wid - 1)) Then
  326.             If (arralpha(n).Count >= j) Then
  327.                 If (pswitch = 1) Then Print "Order-"; Right$("0" + _Trim$(Str$(wid)), 2); " guess: "; arralpha(n).Signature; " . "; _Trim$(Str$(arralpha(n).Count))
  328.                 TheReturn = TheReturn + Val(Right$(arralpha(n).Signature, 1))
  329.                 k = k + 1
  330.                 j = arralpha(n).Count
  331.             End If
  332.         End If
  333.     Next
  334.     If (k <> 0) Then
  335.         TheReturn = TheReturn / k
  336.         arrbeta(wid, 1) = TheReturn
  337.         arrbeta(wid, 2) = j
  338.     Else
  339.         TheReturn = .5
  340.         arrbeta(wid, 1) = TheReturn
  341.         arrbeta(wid, 2) = j
  342.     End If
  343.  
  344. Sub CreateHisto (arrfinger() As String, arralpha() As LetterBin, w As Integer)
  345.     Dim As Integer j, k, n
  346.     For n = 1 To UBound(arralpha)
  347.         arralpha(n).Count = 0
  348.     Next
  349.     For j = 1 To w
  350.         For k = 1 To Len(arrfinger(j)) - (Len(arrfinger(j)) Mod w) Step w '- 0 Step 1 'w 'make the 0 a -w? might not matter at all
  351.             For n = 1 To UBound(arralpha)
  352.                 If (Mid$(arrfinger(j), k, w) = arralpha(n).Signature) Then
  353.                     arralpha(n).Count = arralpha(n).Count + 1
  354.                 End If
  355.             Next
  356.         Next
  357.     Next
  358.     Call QuickSort(arralpha(), 1, UBound(arralpha))
  359.  
  360. Sub PrintHisto (arr() As LetterBin, w As Integer)
  361.     Dim As Integer j, n
  362.     If (w > 0) Then
  363.         If (w > UBound(arr)) Then
  364.             j = UBound(arr)
  365.         Else
  366.             j = w
  367.         End If
  368.         Print "Histogram: "; _Trim$(Str$(UBound(arr))); "-letter regroup, showing top "; _Trim$(Str$(w))
  369.         For n = 1 To j
  370.             Print arr(n).Signature; arr(n).Count
  371.         Next
  372.     End If
  373.  
  374. Sub NewAlphabet (arrold() As LetterBin, arrnew() As LetterBin)
  375.     Dim As Integer j, k, n
  376.     n = 0
  377.     For k = 1 To 2
  378.         For j = 1 To UBound(arrold)
  379.             n = n + 1
  380.             arrnew(n).Signature = arrold(j).Signature
  381.         Next
  382.     Next
  383.     For j = 1 To UBound(arrnew)
  384.         If (j <= UBound(arrnew) / 2) Then
  385.             arrnew(j).Signature = "0" + arrnew(j).Signature
  386.         Else
  387.             arrnew(j).Signature = "1" + arrnew(j).Signature
  388.         End If
  389.     Next
  390.  
  391. Sub QuickSort (arr() As LetterBin, LowLimit As Long, HighLimit As Long)
  392.     Dim As Long piv
  393.     If (LowLimit < HighLimit) Then
  394.         piv = Partition(arr(), LowLimit, HighLimit)
  395.         Call QuickSort(arr(), LowLimit, piv - 1)
  396.         Call QuickSort(arr(), piv + 1, HighLimit)
  397.     End If
  398.  
  399. Function Partition (arr() As LetterBin, LowLimit As Long, HighLimit As Long)
  400.     Dim As Long i, j
  401.     Dim As Double pivot, tmp
  402.     pivot = arr(HighLimit).Count
  403.     i = LowLimit - 1
  404.     For j = LowLimit To HighLimit - 1
  405.         tmp = arr(j).Count - pivot
  406.         If (tmp >= 0) Then
  407.             i = i + 1
  408.             Swap arr(i), arr(j)
  409.         End If
  410.     Next
  411.     Swap arr(i + 1), arr(HighLimit)
  412.     Partition = i + 1
  413.  

Looks like this now while running:

  [ You are not allowed to view this attachment ]  
« Last Edit: December 15, 2021, 04:48:54 pm by STxAxTIC »
You're not done when it works, you're done when it's right.

Offline random1

  • Newbie
  • Posts: 86
Re: Looking for old program or help recreating it
« Reply #63 on: December 15, 2021, 07:16:07 pm »
If it gets any better the possibilities will expand exponentially.  I think it's has already
surpassed my expectations but more is better. 

Your quickly becoming my best new friend, LOL.  Can't wait for future improvements.

R1

Offline random1

  • Newbie
  • Posts: 86
Re: Looking for old program or help recreating it
« Reply #64 on: December 15, 2021, 08:10:15 pm »
I am going to add stats for each prediction be it a 0 or 1.  This way I can track the
percentages of correct predictions for each value.

Also in my main program, if a string contains all 0's or all 1's then it skips the predictor
stage and uses the digit that makes up the entire string as the prediction.  Nothing to be
gained by processing a string if there's only one choice.

I have ran several strings that I consider the hardest to predict and while the overall is
lower, high 60's to low 70's, the streaks seem to increase in size. 

R1     


     

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
Re: Looking for old program or help recreating it
« Reply #65 on: December 15, 2021, 08:29:46 pm »
Hey r1,

I have made such a weird discovery, I don't even know its implications yet, but follow me for a minute.

* Suppose I have a string that starts just as a "1". To be definite, call this x$. So x$ = "1".
* Next I feed this through the analyzer, and the analyzer tells me that another "1" is most likely to come next. Ok, so at this stage, lets do the *opposite*.
* Append x$ with a "0", having predicted a 1. So x$ = "10" now.
* Feed this new x$ through the analyzer, and it predicts a "1" should follow the "10". But we're doing the opposite, so I append x$ = "100".

See what I'm doing? Start with a seed, and whatever the predictor says, make a string that's the opposite of whats predicted. The result is hilarious. You wind up with a thing I'll call a "pathological string", where all predictions are WRONG by definition. Look at this result!

  [ You are not allowed to view this attachment ]  

It's flat zeros! Don't do any fretting though, we're out on impossible limb. For real data to behave this way randomly would take longer than the age of the universe. Or, put another way, some system that feeds you such data would be indistinguishable, in that moment, from the program you're looking at now. (Weird.) It turns out I can generate probably infinite of these "pathological strings". But it gets even more interesting. Change even a single digit, such as the first digit, and everything downstream of that shatters like glass, and its back to a usual-looking pattern. Here is the same sequence minus the first character:

  [ You are not allowed to view this attachment ]  

Even though the entire string is meant to "trick" the analyzer, the entire string needs to be intact for the trick to happen. That's super interesting. There is nothing fundamental about the so-called pathological string, I mean in terms of their contents. They are strictly dependent on the model being used, and that is buried in my Analyze function. Their existence will always persist though, regardless of the model. There's got to be some kind of theorem about this... Anyway, thought you'd find this academically interesting. Has very little bearing on the task at hand, but here are what some more patholgical strings look like:

Code: QB64: [Select]
  1.     '''
  2.     ' Pathological cases:
  3.     '''
  4.     n = n + 1: TestData(n) = "011111101111111110101111110011111110110111110111011110111001110111010110111101001111101010111110010111100110111011010110" ' seed 0
  5.     n = n + 1: TestData(n) = "100000010000000001010000001100000001001000001000100001000110001000101001000010110000010101000001101000011001000100101001" ' seed 1
  6.     n = n + 1: TestData(n) = "001111111110111111101011111100111110111011110110111110101011110111100110111111000111111110010111110011101110101101110010" ' seed 00
  7.     n = n + 1: TestData(n) = "011111101111111110101111110011111110110111110111011110111001110111010110111101001111101010111110010111100110111011010110" ' seed 01
  8.     n = n + 1: TestData(n) = "100000010000000001010000001100000001001000001000100001000110001000101001000010110000010101000001101000011001000100101001" ' seed 10
  9.     n = n + 1: TestData(n) = "110000000001000000010100000011000001000100001001000001010100001000011001000000111000000001101000001100010001010010001101" ' seed 11
  10.     n = n + 1: TestData(n) = "000111111111011111101101111101011111110011111110101011101110110110101110011101111011101010011110110011111011110011011110" ' seed 000
  11.     n = n + 1: TestData(n) = "001111111110111111101011111100111110111011110110111110101011110111100110111111000111111110010111110011101110101101110010" ' seed 001
  12.     n = n + 1: TestData(n) = "010111111111011111101101111101011110111011110101011111100111111110010111110111001110111110001111110100111110101101110100" ' seed 010
  13.     n = n + 1: TestData(n) = "011111101111111110101111110011111110110111110111011110111001110111010110111101001111101010111110010111100110111011010110" ' seed 011
  14.     n = n + 1: TestData(n) = "100000010000000001010000001100000001001000001000100001000110001000101001000010110000010101000001101000011001000100101001" ' seed 100
  15.     n = n + 1: TestData(n) = "101000000000100000010010000010100001000100001010100000011000000001101000001000110001000001110000001011000001010010001011" ' seed 101

And those are sensitive - change one thing and the graph explodes like you're taking apart a wristwatch. Full code below:

Code: QB64: [Select]
  1.  
  2. Screen _NewImage(120, 40)
  3.  
  4. ' Version: 14
  5.  
  6. Type LetterBin
  7.     Signature As String
  8.     Count As Integer
  9.  
  10. Dim Shared Alphabet1(2) As LetterBin ' 0 1
  11. Dim Shared Alphabet2(4) As LetterBin ' 00 01 10 11
  12. Dim Shared Alphabet3(8) As LetterBin ' 000 001 010 011 100 101 110 111
  13. Dim Shared Alphabet4(16) As LetterBin ' etc.
  14. Dim Shared Alphabet5(32) As LetterBin
  15. Dim Shared Alphabet6(64) As LetterBin
  16. Dim Shared Alphabet7(128) As LetterBin
  17. Dim Shared Alphabet8(256) As LetterBin
  18. Dim Shared Alphabet9(512) As LetterBin
  19. Dim Shared Alphabet10(1024) As LetterBin
  20. Dim Shared Alphabet11(2048) As LetterBin
  21. Dim Shared Alphabet12(4096) As LetterBin
  22. Dim Shared Alphabet13(8192) As LetterBin
  23.  
  24. Alphabet1(1).Signature = "0"
  25. Alphabet1(2).Signature = "1"
  26. Call NewAlphabet(Alphabet1(), Alphabet2())
  27. Call NewAlphabet(Alphabet2(), Alphabet3())
  28. Call NewAlphabet(Alphabet3(), Alphabet4())
  29. Call NewAlphabet(Alphabet4(), Alphabet5())
  30. Call NewAlphabet(Alphabet5(), Alphabet6())
  31. Call NewAlphabet(Alphabet6(), Alphabet7())
  32. Call NewAlphabet(Alphabet7(), Alphabet8())
  33. Call NewAlphabet(Alphabet8(), Alphabet9())
  34. Call NewAlphabet(Alphabet9(), Alphabet10())
  35. Call NewAlphabet(Alphabet10(), Alphabet11())
  36. Call NewAlphabet(Alphabet11(), Alphabet12())
  37. Call NewAlphabet(Alphabet12(), Alphabet13())
  38.  
  39. '''
  40.  
  41. ReDim Shared TestData(1000) As String
  42. ReDim _Preserve TestData(LoadTestData(0))
  43.  
  44. Dim TheString As String
  45.  
  46. Dim As Integer j, k, n
  47. Dim GuessPredicted As Integer
  48. Dim GuessesCorrect As Double
  49. Dim GuessesTotal As Double
  50. Dim GuessStreak As Integer
  51. Dim GuessStreakBest As Integer
  52.  
  53. Dim ProgressGraph(1 To _Width, 2) As Double
  54.  
  55.  
  56. For n = 1 To UBound(TestData)
  57.  
  58.     TheString = TestData(n)
  59.     GuessesCorrect = 0
  60.     GuessesTotal = 0
  61.     GuessStreak = 0
  62.     GuessStreakBest = 0
  63.  
  64.     ' Uncomment this to manually test one string.
  65.     '''
  66.     '1
  67.     TheString = "00000010000000001010000001100000001001000001000100001000110001000101001000010110000010101000001101000011001000100101001"
  68.  
  69.     '''
  70.     'Cls: Locate 1, 1
  71.     'Input "", TheString
  72.     '''
  73.  
  74.     For j = 1 To Len(TheString)
  75.  
  76.         Cls
  77.         Locate 1, 1
  78.         For k = 1 To _Width
  79.             Print "_";
  80.         Next
  81.         Print
  82.         Print "Analyzing: (test string # "; _Trim$(Str$(n)); ", length "; _Trim$(Str$(Len(TheString))); ")"
  83.         Print
  84.         Color 7
  85.         Print Left$(TheString, j);
  86.         Color 8
  87.         Print "["; Right$(TheString, Len(TheString) - j); "]"
  88.         Color 7
  89.         Print
  90.  
  91.         ' Main prediction call
  92.         GuessPredicted = Analyze(Left$(TheString, j), 0)
  93.  
  94.         ' Reconciliation
  95.         Print "Prediction: "; _Trim$(Str$(GuessPredicted))
  96.         If (j < Len(TheString)) Then
  97.             Print "Actual:     "; _Trim$(Mid$(TheString, j + 1, 1))
  98.             If (GuessPredicted = Val(Mid$(TheString, j + 1, 1))) Then
  99.                 GuessesCorrect = GuessesCorrect + 1
  100.                 GuessStreak = GuessStreak + 1
  101.                 If (GuessStreak > GuessStreakBest) Then GuessStreakBest = GuessStreak
  102.                 Print "I am RIGHT this round."
  103.             Else
  104.                 GuessStreak = 0
  105.                 Print "I am WRONG this round."
  106.             End If
  107.             GuessesTotal = GuessesTotal + 1
  108.         Else
  109.             Print "Actual:     ?"
  110.         End If
  111.         Print
  112.         Print "I'm on a "; _Trim$(Str$(GuessStreak)); "-round winning streak."
  113.         Print "My best streak has been "; _Trim$(Str$(GuessStreakBest)); "."
  114.         Print "My correctness rate is "; _Trim$(Str$(Int(100 * GuessesCorrect / GuessesTotal))); "% in "; _Trim$(Str$(GuessesTotal)); " guesses."
  115.         If (j = Len(TheString)) Then
  116.             Print
  117.             Print "Complete."
  118.         End If
  119.  
  120.         ' Draw bottom graph
  121.         If (1 = 1) Then
  122.             For k = 1 To _Width
  123.                 Locate _Height - 5, k: Print "_"
  124.                 Locate _Height - 5 - Int(10), k: Print "_"
  125.             Next
  126.             Locate _Height - 5 + 1, 1: Print "0%"
  127.             Locate _Height - 5 - Int(10) - 1, 1: Print "100%"
  128.             f = (_Width - 1) / Int(Len(TheString))
  129.             If (f > 1) Then f = 1 / f
  130.             ProgressGraph(1 + Int(j * f), 1) = GuessesCorrect / GuessesTotal
  131.             If (GuessStreak = 0) Then
  132.                 ProgressGraph(1 + Int(j * f), 2) = 120
  133.             Else
  134.                 ProgressGraph(1 + Int(j * f), 2) = 251
  135.             End If
  136.             g = (_Width - 0) / Int(Len(TheString))
  137.             If (g > 1) Then g = 1
  138.             For k = 1 To Int(j * g)
  139.                 Locate _Height - 5 - Int(10 * ProgressGraph(1 + Int(k * f), 1)), k: Print Chr$(ProgressGraph(1 + Int(k * f), 2))
  140.             Next
  141.         End If
  142.  
  143.         _Delay .015
  144.         _Display
  145.     Next
  146.  
  147.     _Delay 3
  148.  
  149.  
  150.  
  151. Function Analyze (TheStringIn As String, pswitch As Integer)
  152.     Dim TheReturn As Integer
  153.     Dim As Integer n
  154.     Dim As Double r, j, k, h
  155.     Dim Fingerprint(16) As String
  156.     Dim Partialguess(1 To 10, 2) As Double ' Change the upper bound to a higer number for more accuracy.
  157.  
  158.     ' Create shifted versions of string, i.e. ABCD -> BCDA, CDAB, DABC, ABCD, BCDA, etc.
  159.     Fingerprint(1) = TheStringIn
  160.     For n = 2 To UBound(Fingerprint)
  161.         Fingerprint(n) = Right$(Fingerprint(n - 1), Len(Fingerprint(n - 1)) - 1) + Left$(Fingerprint(n - 1), 1)
  162.     Next
  163.  
  164.     ' Initialize partial results.
  165.     For n = LBound(Partialguess) To UBound(Partialguess)
  166.         Partialguess(n, 1) = -999
  167.     Next
  168.  
  169.     Call CreateHisto(Fingerprint(), Alphabet1(), 1)
  170.     Call CreateHisto(Fingerprint(), Alphabet2(), 2)
  171.     Call CreateHisto(Fingerprint(), Alphabet3(), 3)
  172.     Call CreateHisto(Fingerprint(), Alphabet4(), 4)
  173.     Call CreateHisto(Fingerprint(), Alphabet5(), 5)
  174.     Call CreateHisto(Fingerprint(), Alphabet6(), 6)
  175.     Call CreateHisto(Fingerprint(), Alphabet7(), 7)
  176.     Call CreateHisto(Fingerprint(), Alphabet8(), 8)
  177.     Call CreateHisto(Fingerprint(), Alphabet9(), 9)
  178.     Call CreateHisto(Fingerprint(), Alphabet10(), 10)
  179.     'Call CreateHisto(Fingerprint(), Alphabet11(), 11)
  180.     'Call CreateHisto(Fingerprint(), Alphabet12(), 12)
  181.     'Call CreateHisto(Fingerprint(), Alphabet13(), 13)
  182.  
  183.     If (pswitch = 1) Then
  184.         For n = 1 To _Width
  185.             Print "-";
  186.         Next
  187.         Print
  188.     End If
  189.  
  190.     If (pswitch = 1) Then ' Set the last number >=1 to print stats for that histogram.
  191.         If (Len(TheStringIn) >= 1) Then Call PrintHisto(Alphabet1(), 2)
  192.         If (Len(TheStringIn) >= 2) Then Call PrintHisto(Alphabet2(), 3)
  193.         If (Len(TheStringIn) >= 3) Then Call PrintHisto(Alphabet3(), 3)
  194.         If (Len(TheStringIn) >= 4) Then Call PrintHisto(Alphabet4(), 0)
  195.         If (Len(TheStringIn) >= 5) Then Call PrintHisto(Alphabet5(), 0)
  196.         If (Len(TheStringIn) >= 6) Then Call PrintHisto(Alphabet6(), 0)
  197.         If (Len(TheStringIn) >= 7) Then Call PrintHisto(Alphabet7(), 0)
  198.         If (Len(TheStringIn) >= 8) Then Call PrintHisto(Alphabet8(), 0)
  199.         If (Len(TheStringIn) >= 9) Then Call PrintHisto(Alphabet9(), 0)
  200.         If (Len(TheStringIn) >= 10) Then Call PrintHisto(Alphabet10(), 0)
  201.         'If (Len(TheStringIn) >= 11) Then Call PrintHisto(Alphabet11(), 0)
  202.         'If (Len(TheStringIn) >= 12) Then Call PrintHisto(Alphabet12(), 0)
  203.         'If (Len(TheStringIn) >= 13) Then Call PrintHisto(Alphabet13(), 0)
  204.         Print
  205.     End If
  206.  
  207.     If (Len(TheStringIn) >= 1) Then Call MakeGuess(TheStringIn, Alphabet1(), 1, Partialguess(), pswitch) ' Set the last number =1 to print guess for that histogram.
  208.     If (Len(TheStringIn) >= 2) Then Call MakeGuess(TheStringIn, Alphabet2(), 2, Partialguess(), pswitch)
  209.     If (Len(TheStringIn) >= 3) Then Call MakeGuess(TheStringIn, Alphabet3(), 3, Partialguess(), pswitch)
  210.     If (Len(TheStringIn) >= 4) Then Call MakeGuess(TheStringIn, Alphabet4(), 4, Partialguess(), 0)
  211.     If (Len(TheStringIn) >= 5) Then Call MakeGuess(TheStringIn, Alphabet5(), 5, Partialguess(), 0)
  212.     If (Len(TheStringIn) >= 6) Then Call MakeGuess(TheStringIn, Alphabet6(), 6, Partialguess(), 0)
  213.     If (Len(TheStringIn) >= 7) Then Call MakeGuess(TheStringIn, Alphabet7(), 7, Partialguess(), 0)
  214.     If (Len(TheStringIn) >= 8) Then Call MakeGuess(TheStringIn, Alphabet8(), 8, Partialguess(), 0)
  215.     If (Len(TheStringIn) >= 9) Then Call MakeGuess(TheStringIn, Alphabet9(), 9, Partialguess(), 0)
  216.     If (Len(TheStringIn) >= 10) Then Call MakeGuess(TheStringIn, Alphabet10(), 10, Partialguess(), 0)
  217.     'If (Len(TheStringIn) >= 11) Then Call MakeGuess(TheStringIn, Alphabet11(), 11, Partialguess(), 0)
  218.     'If (Len(TheStringIn) >= 12) Then Call MakeGuess(TheStringIn, Alphabet12(), 12, Partialguess(), 0)
  219.     'If (Len(TheStringIn) >= 13) Then Call MakeGuess(TheStringIn, Alphabet13(), 13, Partialguess(), 0)
  220.     If (pswitch = 1) Then Print
  221.  
  222.     If (pswitch = 1) Then
  223.         Print "Thinking:";
  224.         For k = LBound(Partialguess) To UBound(Partialguess)
  225.             If (Partialguess(k, 1) <> -999) Then
  226.                 Print Partialguess(k, 1);
  227.             Else
  228.                 Print "_ ";
  229.             End If
  230.         Next
  231.         Print
  232.     End If
  233.  
  234.     j = 0
  235.     r = 0
  236.  
  237.     For k = UBound(Partialguess) To LBound(Partialguess) Step -1
  238.         If (Partialguess(k, 1) <> -999) Then
  239.  
  240.             ' This is the made-up part of the model:
  241.             ' The variable r contributes to weighted average.
  242.             ' The variable j is used for normalization.
  243.             ' Scaling factor h influences weighted average calculaton.
  244.             ' The factors multiplying h are totally arbitrary. Notes:
  245.             '   setting o(h^2) means the later alphabets count for more.
  246.             '   Partialguess(k, 1) euqals the calculated guess at frequency k.
  247.             '   Partialguess(k, 2) euqals the peak count of the unscaled histogram.
  248.             '   ...while Partialguess(k, 2) is here, it does not seem to help calculations.
  249.  
  250.             h = 1 + k - LBound(Partialguess)
  251.  
  252.             h = h ^ 2
  253.  
  254.             ' Standard weighted average:
  255.             r = r + h * Partialguess(k, 1)
  256.             j = j + h
  257.  
  258.         End If
  259.     Next
  260.     If (j <> 0) Then
  261.         r = r / j
  262.     End If
  263.  
  264.     If (pswitch = 1) Then Print "Predicting:  "; _Trim$(Str$(r))
  265.  
  266.     If (r > .5) Then
  267.         r = 1
  268.     Else
  269.         r = 0
  270.     End If
  271.  
  272.     If (pswitch = 1) Then
  273.         Print "Rounding to: "; _Trim$(Str$(r))
  274.     End If
  275.  
  276.     If (pswitch = 1) Then
  277.         For n = 1 To _Width
  278.             Print "-";
  279.         Next
  280.         Print: Print
  281.     End If
  282.  
  283.     TheReturn = r
  284.     Analyze = TheReturn
  285.  
  286. Sub MakeGuess (TheStringIn As String, arralpha() As LetterBin, wid As Integer, arrbeta() As Double, pswitch As Integer)
  287.     Dim TheReturn As Double
  288.     Dim As Integer j, k, n
  289.     TheReturn = 0
  290.     j = 1
  291.     k = 0
  292.     For n = 1 To UBound(arralpha)
  293.         If (Left$(arralpha(n).Signature, wid - 1) = Right$(TheStringIn, wid - 1)) Then
  294.             If (arralpha(n).Count >= j) Then
  295.                 If (pswitch = 1) Then Print "Order-"; Right$("0" + _Trim$(Str$(wid)), 2); " guess: "; arralpha(n).Signature; " . "; _Trim$(Str$(arralpha(n).Count))
  296.                 TheReturn = TheReturn + Val(Right$(arralpha(n).Signature, 1))
  297.                 k = k + 1
  298.                 j = arralpha(n).Count
  299.             End If
  300.         End If
  301.     Next
  302.     If (k <> 0) Then
  303.         TheReturn = TheReturn / k
  304.         arrbeta(wid, 1) = TheReturn
  305.         arrbeta(wid, 2) = j
  306.     Else
  307.         TheReturn = .5
  308.         arrbeta(wid, 1) = TheReturn
  309.         arrbeta(wid, 2) = j
  310.     End If
  311.  
  312. Sub CreateHisto (arrfinger() As String, arralpha() As LetterBin, w As Integer)
  313.     Dim As Integer j, k, n
  314.     For n = 1 To UBound(arralpha)
  315.         arralpha(n).Count = 0
  316.     Next
  317.     For j = 1 To w
  318.         For k = 1 To Len(arrfinger(j)) - (Len(arrfinger(j)) Mod w) Step w '- 0 Step 1 'w 'make the 0 a -w? might not matter at all
  319.             For n = 1 To UBound(arralpha)
  320.                 If (Mid$(arrfinger(j), k, w) = arralpha(n).Signature) Then
  321.                     arralpha(n).Count = arralpha(n).Count + 1
  322.                 End If
  323.             Next
  324.         Next
  325.     Next
  326.     Call QuickSort(arralpha(), 1, UBound(arralpha))
  327.  
  328. Sub PrintHisto (arr() As LetterBin, w As Integer)
  329.     Dim As Integer j, n
  330.     If (w > 0) Then
  331.         If (w > UBound(arr)) Then
  332.             j = UBound(arr)
  333.         Else
  334.             j = w
  335.         End If
  336.         Print "Histogram: "; _Trim$(Str$(UBound(arr))); "-letter regroup, showing top "; _Trim$(Str$(w))
  337.         For n = 1 To j
  338.             Print arr(n).Signature; arr(n).Count
  339.         Next
  340.     End If
  341.  
  342. Sub NewAlphabet (arrold() As LetterBin, arrnew() As LetterBin)
  343.     Dim As Integer j, k, n
  344.     n = 0
  345.     For k = 1 To 2
  346.         For j = 1 To UBound(arrold)
  347.             n = n + 1
  348.             arrnew(n).Signature = arrold(j).Signature
  349.         Next
  350.     Next
  351.     For j = 1 To UBound(arrnew)
  352.         If (j <= UBound(arrnew) / 2) Then
  353.             arrnew(j).Signature = "0" + arrnew(j).Signature
  354.         Else
  355.             arrnew(j).Signature = "1" + arrnew(j).Signature
  356.         End If
  357.     Next
  358.  
  359. Sub QuickSort (arr() As LetterBin, LowLimit As Long, HighLimit As Long)
  360.     Dim As Long piv
  361.     If (LowLimit < HighLimit) Then
  362.         piv = Partition(arr(), LowLimit, HighLimit)
  363.         Call QuickSort(arr(), LowLimit, piv - 1)
  364.         Call QuickSort(arr(), piv + 1, HighLimit)
  365.     End If
  366.  
  367. Function Partition (arr() As LetterBin, LowLimit As Long, HighLimit As Long)
  368.     Dim As Long i, j
  369.     Dim As Double pivot, tmp
  370.     pivot = arr(HighLimit).Count
  371.     i = LowLimit - 1
  372.     For j = LowLimit To HighLimit - 1
  373.         tmp = arr(j).Count - pivot
  374.         If (tmp >= 0) Then
  375.             i = i + 1
  376.             Swap arr(i), arr(j)
  377.         End If
  378.     Next
  379.     Swap arr(i + 1), arr(HighLimit)
  380.     Partition = i + 1
  381.  
  382. Function LoadTestData (alwayszero As Integer)
  383.     Dim n As Integer
  384.     n = alwayszero
  385.     '''
  386.     ' Systematic cases:
  387.     '''
  388.     n = n + 1: TestData(n) = "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
  389.     n = n + 1: TestData(n) = "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
  390.     n = n + 1: TestData(n) = "0101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"
  391.     n = n + 1: TestData(n) = "1010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010"
  392.     n = n + 1: TestData(n) = "0010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010"
  393.     n = n + 1: TestData(n) = "0100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100"
  394.     n = n + 1: TestData(n) = "1001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001"
  395.     n = n + 1: TestData(n) = "1101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101101"
  396.     n = n + 1: TestData(n) = "1011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011011"
  397.     n = n + 1: TestData(n) = "0110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110110"
  398.     '
  399.     '''
  400.     ' Community hand-typed cases:
  401.     '''
  402.     ' (from Cobalt) (Results in: 48%  -  Claims he made this data hand but behavior in Discord raises doubt.)
  403.     n = n + 1: TestData(n) = "1010001101110110000000011100110100101010111110101001100101110100000111101011011000010101101100000110010010010101010110111111111001000100101011101000011110011000000100111100001100111000111100100000000111010011010011001111101000010011101111000011100011010110101101000111101111100101100100000101111011001101100000111011000001001111000110000001110101100101"
  404.     ' (from Keybone) (Results in: 82%)
  405.     n = n + 1: TestData(n) = "101010101010101010101001010101010101001010111001010101010101010101010100010101010101010100101001010101001100101010001010100101010100101010100101010101010101010011011110010101010100100101010110010011001010011001010100010100101010010101010101010010101010101010010101001010101010100110010101010100101010101010011001001010100101010010101010100101010010101001010100101001010010101010111010100110011001010101010100110101001010101010100101001010111010101010101010100101001010101010010101010101001010101001010101001010100101010100101010010101010101001010101001010101010101001010101001010100101010101010010101010010010101010101010101010010100101010101001010100101001010101001111101010101010100101010110011001010101010101010110101010101101010101010100101010010101010010101010101101110010101001010101010110010100101010101001011010101010100110101010100101010010101010100101010101001010101010101001010101010011010101010101110110100101010111010101011011001011001010101001010101010101010101010011001010101010100101010101010101010010100101"
  406.     ' (from Keybone) (Results in: 54%)
  407.     n = n + 1: TestData(n) = "0101110101100011010100101011001110001011001010001110101111010100111011100100101001010011110101101000101010001010101111001010111010101010100001010101000101101100101111101010010101110110111001000101000011010101010001001001001111101011101010100010110101110101100000101010101110111010100100100001110111100101011110101010001010001110010110111110110010101001001011101000101001011100011101000010101010101101010010110100101101000101111010101110111001010011101111010101000010101111100010101011110101011011110100001010110"
  408.     ' (from Loudar) (Results in: 71%)
  409.     n = n + 1: TestData(n) = "1011001010010100100100110010101010101001010101010101011010010101001010101001010010100110101011010101010101011010101101010101010101010010110101010101100101010101010110101101011010010101010010100110101101001010110101011010010101101010110100101111010101010011011011010010110101010010110100101101010100101011010010101001010101010001011101011010010101011100111010010001101011110010011010001011100110101010010011010101001001010010000101010110001"
  410.     ' (from Luke) (Results in: 51%  -  I have long suspected Luke to be a computer. The numbers are now in.)
  411.     n = n + 1: TestData(n) = "01100101001010001100001101101111011010010101010110110101001000001111001111110101000101111011010101111101010101101010101001010101011000010101010101001011010100110100110100110011010101010101110101010111111101011010100000001101111000010111000110111001000010100001101010110100000111101011111100001011001010110010110" ' Luke 50
  412.     ' (from Sarafromct) (Results in: 64%)
  413.     n = n + 1: TestData(n) = "10101010101011101000011101010111010101010101100111001010100111100001011011110101000001111010101101010000001111110011111110111101110111001110110010000100010101010101010100101011010110101010101010101001000000001111110000011110101010101010100010101110101010101101111111111111111111101010101010101000000" ' 63
  414.     ' (from Spriggs) (Results in: 85%)
  415.     n = n + 1: TestData(n) = "10111010101010101010101001010101010101001010101001010101010101010101010101010101010101010101010101010101001010100100100101010101010101001010100101010101010100101010100101010101010101010101001010010110010101010010101010101010101010101010100101001001001010101010101010101010101001010101001001101010010"
  416.     ' (from Spriggs) (Results in: 67%)
  417.     n = n + 1: TestData(n) = "11111011110100101011111111110100000011011110101100111100111111110111101110100111100110011111110101111111010111101111100111110111111111111011100111110111111110010000101011111001110101101010110111110"
  418.     ' (from Hotpants) (Results in: 62%)
  419.     n = n + 1: TestData(n) = "01010100011001010010101010101010101000110101010111101010100100011010101010100100101110010010010100001010101001010101010110010001001011000100100110101001001001010000000001010101101111101001010100010101001001010101000100101001100100010011010101010101010111010010101011101011011010110100100010010100100100010010001001" ' Tom
  420.     '
  421.     '''
  422.     ' Known-Random cases:
  423.     '''
  424.     ' (using RND) (Results in: 45%)
  425.     n = n + 1: TestData(n) = "11100101110011011010110100110011111011010110100100000110000100101001001010011100111101101110000001000000011011100101110000000111100100011101000000101000110100001000000001111010101011000010001110111110001001110101011000010101001111010100100000011100110110110000111010001010000011010000101111101011000"
  426.     ' (from Spriggs) (Results in: 52%)
  427.     n = n + 1: TestData(n) = "010101111010111100110000001001100100101100000101110001100101000010001001111101111111111100011110000011011110011000100011100100001101110011001001011001000011110010001000111100011100011110010110011110111010110100001000110000010000111000111011100110011010101111111100100010001111111100010100001011000011"
  428.     ' (Wolfrm rule 30, central column) (Results in: 47%)
  429.     n = n + 1: TestData(n) = "110111001100010110010011101011100111010101100001100101011010101111110000111100010101110000010010110001"
  430.     ' (using RND) (Results in: 46%)
  431.     n = n + 1: TestData(n) = "111001011100110110101101001100111110110101101001000001100001001010010010100111001111011011100000010000000110111001011100000001111001000111010000001010001101000010000000011110101010110000100011101111100010011101010110000101010011110101001000000111001101101100001110100010100000110100001011111010110000"
  432.     ' (using RND) (Results in: 46%)
  433.     n = n + 1: TestData(n) = "111001011100110110101101001100111110110101101001000001100001001010010010100111001111011011100000010000000110111001011100000001111001000111010000001010001101000010000000011110101010110000100011101111100010011101010110000101010011110101001000000111001101101100001110100010100000110100001011111010110000101110111110011100001000110010010001100111101000001101011000010101101011111010010001010010110110011000001001101000011100000011110001110011100010101010111101100100100001001000101101110110101100001111011101000100111110000001110000111011101000110110100111101101001100100110000111110111101001100010011110"
  434.     ' (using RND) (Results in: 45%)
  435.     n = n + 1: TestData(n) = "111001011100110110101101001100111110110101101001000001100001001010010010100111001111011011100000010000000110111001011100000001111001000111010000001010001101000010000000011110101010110000100011101111100010011101010110000101010011110101001000000111001101101100001110100010100000110100001011111010110000101110111110011100001000110010010001100111101000001101011000010101101011111010010001010010110110011000001001101000011100000011110001110011100010101010111101100100100001001000101101110110101100001111011101000100111110000001110000111011101000110110100111101101001100100110000111110111101001100010011110111001001100111000110011011000100101100010101010000010000111111010111111011100011100001000011000100100111001100001111010001010000001011100000101110000110010111110010101010110111110011100100001011101010000011011110110100010110111000100000110000001001010001011010000010001111110100100010011100011001000"
  436.     ' (using RND) (Results in: 48%)
  437.     n = n + 1: TestData(n) = "111001011100110110101101001100111110110101101001000001100001001010010010100111001111011011100000010000000110111001011100000001111001000111010000001010001101000010000000011110101010110000100011101111100010011101010110000101010011110101001000000111001101101100001110100010100000110100001011111010110000101110111110011100001000110010010001100111101000001101011000010101101011111010010001010010110110011000001001101000011100000011110001110011100010101010111101100100100001001000101101110110101100001111011101000100111110000001110000111011101000110110100111101101001100100110000111110111101001100010011110111001001100111000110011011000100101100010101010000010000111111010111111011100011100001000011000100100111001100001111010001010000001011100000101110000110010111110010101010110111110011100100001011101010000011011110110100010110111000100000110000001001010001011010000010001111110100100010011100011001000011101011010100110110000110010010011110111001001011111011000000100010011011100111110111011111101100011011101001111110100011010000111001001010111011101000001010010010100111010001001010101001000010011100111010101000110010110101111001110000010110110010101001000011000101000001100110100111101000110111101101010011011000101100101001010001100110101000101110000101100110010011010001010101010101101110101110110101100101001111100110110101011001000001100101001011000101100001001000001010111010100010100101011001111001011011100011001110010111011110010111101011101000100100010111010000001010011101010001110110110101011000101010100000001110110101011110101111100100101101000001011000101001110010010010000111001101010100101111101001110010001011000001001000111010001000011000111000000111001110111110011110110101100111011001100101101010101100010100100001010010110010000001100110010010100110011110110000001001000111001001010010000011111110011110010001100011100011010000111100111111010010001010011100100111100111101111110101000010011100011111100010000011111101101010010100000011011001110001100001011111100111000001110111011001111110011011100111000110110110011110000111000010011011000011001111111110010100000111110011111100100001100000000110001111101101011100011111011110001100100001100011100011111000000110011011100110101101001001111101101000000110101101001100011100011001110001000000111111100110101001110100010010010100000010100001010001011011001101010011111001101110110010101000111101100111000011000111001100011011011010100111111001100000100100110000100101001111111100110010111100000111101101001111001010011010011011100101001001001110101110001101010001111010101100101010111000111000011000001010010010101010100001110010001001001110110011100110011111001100111010011110100100110010000100011010001110000000100001100000010000111000111111000111100010001101011000101000010100011100011111000100010101000001001011001000101101111110111110110001101001001011100011110001101100010100101101011001001100111000000111111110110100010111111101000000001111000100001111111011000101001111110010000110101100010000011100110111101011011100110"
  438.     '
  439.     '''
  440.     ' Pathological cases:
  441.     '''
  442.     n = n + 1: TestData(n) = "011111101111111110101111110011111110110111110111011110111001110111010110111101001111101010111110010111100110111011010110" ' seed 0
  443.     n = n + 1: TestData(n) = "100000010000000001010000001100000001001000001000100001000110001000101001000010110000010101000001101000011001000100101001" ' seed 1
  444.     n = n + 1: TestData(n) = "001111111110111111101011111100111110111011110110111110101011110111100110111111000111111110010111110011101110101101110010" ' seed 00
  445.     n = n + 1: TestData(n) = "011111101111111110101111110011111110110111110111011110111001110111010110111101001111101010111110010111100110111011010110" ' seed 01
  446.     n = n + 1: TestData(n) = "100000010000000001010000001100000001001000001000100001000110001000101001000010110000010101000001101000011001000100101001" ' seed 10
  447.     n = n + 1: TestData(n) = "110000000001000000010100000011000001000100001001000001010100001000011001000000111000000001101000001100010001010010001101" ' seed 11
  448.     n = n + 1: TestData(n) = "000111111111011111101101111101011111110011111110101011101110110110101110011101111011101010011110110011111011110011011110" ' seed 000
  449.     n = n + 1: TestData(n) = "001111111110111111101011111100111110111011110110111110101011110111100110111111000111111110010111110011101110101101110010" ' seed 001
  450.     n = n + 1: TestData(n) = "010111111111011111101101111101011110111011110101011111100111111110010111110111001110111110001111110100111110101101110100" ' seed 010
  451.     n = n + 1: TestData(n) = "011111101111111110101111110011111110110111110111011110111001110111010110111101001111101010111110010111100110111011010110" ' seed 011
  452.     n = n + 1: TestData(n) = "100000010000000001010000001100000001001000001000100001000110001000101001000010110000010101000001101000011001000100101001" ' seed 100
  453.     n = n + 1: TestData(n) = "101000000000100000010010000010100001000100001010100000011000000001101000001000110001000001110000001011000001010010001011" ' seed 101
  454.  
  455.     LoadTestData = n
  456.  
  457. ''''''''''
  458. ' Code for creating pathological strings:
  459. 'Dim x$
  460. 'Dim q
  461. 'x$ = "101"
  462. 'Print x$;
  463. 'Do
  464. '    Cls
  465. '    Locate 1, 1
  466. '    q = Analyze(x$, 0)
  467. '    If (q = 1) Then
  468. '        x$ = x$ + "0"
  469. '    Else
  470. '        x$ = x$ + "1"
  471. '    End If
  472. '    Print x$
  473. '    _Display
  474. '    _Delay .015
  475. '    _Limit 120
  476. 'Loop Until Len(x$) = 120
  477. 'Open "nnn.txt" For Output As #1
  478. 'Print #1, x$
  479. 'Close #1
  480. ''''''''''
« Last Edit: December 15, 2021, 08:40:14 pm by STxAxTIC »
You're not done when it works, you're done when it's right.

Offline random1

  • Newbie
  • Posts: 86
Re: Looking for old program or help recreating it
« Reply #66 on: December 15, 2021, 11:05:15 pm »
STxAxTIC

I haven't tested but one string in this manner but the 1 to 0 prediction ratio is 1 in 17.52.
The predictor predicted (0) 473 times vs only 27 (1's) in a string of 500 entries. 

I then looked at the full string of 1422 entries and it shows the overall counts are 916 zeros
vs 506 ones.  This gives us a ratio of 1 in 2.81 for the full string. 

The full string shows (0) makes up 64.4% of the data while (1) makes up 35.5%.  Next I will
test the number predicted (1) guesses to see how many of those were correct.

We might need to step back and reevaluate a few things.

R1

 
     

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
Re: Looking for old program or help recreating it
« Reply #67 on: December 15, 2021, 11:14:31 pm »
Deep breath r1,

The eval core hasn't changed in quite a while, and when it does, all of my metrics improve. Can you paste in a string you find "interesting" so I can do my own analysis?
You're not done when it works, you're done when it's right.

Offline random1

  • Newbie
  • Posts: 86
Re: Looking for old program or help recreating it
« Reply #68 on: December 16, 2021, 07:26:13 am »
STxAxTIC

Here is the string I am using, it's a update of a earlier posted string. Difficultly rating = 7
 
00101000111101101011000010000100001100110110100001100001100000000010011001000101000010001000000111011100000100000000010111010110000000010001110010110111000001011010111100101101010000011101110011010000110010011101011111000001000011001000000010011110011000000010101010011100100000010100010010111100100100100001000010011001101101001101110100011001100000010100000010001000010110100010100011000010001010101011110000000000110000011001000000100001110000100100010000001110000010100000101010100010001101000010

I can provide the full length strings if needed, I will place them in a .bas file so word wrap is not a problem, let me know.

I added counters to show the counts for the number of 0's and the number of 1's the predictor makes.
I also counted the number of correct guesses for each.

Results
The predictor predicted a zero 473 times, of those it correctly predicted a (0) 299 times for  63.2%
The predictor predicted a one 27 times, of those it correctly predicted a (1) 13 times for 48.%1

My concerns center on the total number of 1's the predictor makes.  Some strings tested have a
greater number of 1's with hit rates running in the mid 40's. 

My primal thoughts on this is that maybe a small weight could be added to the ones column but this
might produce unwanted results.  I have a control panel that would allow me to tinker with weight
values, don't know if this would help or not. In past attempts I was able to tweak the results for
the better but not enough to make any real progress.  Like to know your thoughts.
 

R1
« Last Edit: December 16, 2021, 07:34:16 am by random1 »

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
Re: Looking for old program or help recreating it
« Reply #69 on: December 16, 2021, 01:32:14 pm »
Morning R1,

That string looks fine, I'll fix up some comments on it later.

(edit: deleted some crap i decided wasnt true)



Alright, so you raise another point about tweaking the model. This part is subtle, and is frankly the only "human decision" made throughout this entire code. Here's the heart:

Code: QB64: [Select]
  1.     For k = UBound(Partialguess) To LBound(Partialguess) Step -1
  2.         If (Partialguess(k, 1) <> -999) Then
  3.  
  4.             ' This is the made-up part of the model:
  5.             ' The variable r contributes to weighted average.
  6.             ' The variable j is used for normalization.
  7.             ' Scaling factor h influences weighted average calculaton.
  8.             ' The factors multiplying h are totally arbitrary. Notes:
  9.             '   setting o(h^2) means the later alphabets count for more.
  10.             '   Partialguess(k, 1) euqals the calculated guess at frequency k.
  11.             '   Partialguess(k, 2) euqals the peak count of the unscaled histogram.
  12.             '   ...while Partialguess(k, 2) is here, it does not seem to help calculations.
  13.  
  14.             h = 1 + k - LBound(Partialguess)
  15.  
  16.             h = h ^ 2
  17.  
  18.             ' Standard weighted average:
  19.             r = r + h * Partialguess(k, 1)
  20.             j = j + h
  21.  
  22.         End If
  23.     Next
  24.     If (j <> 0) Then
  25.         r = r / j
  26.     End If
  27.  

All you need to pay attention to is the variable h. Right now, the model is set so that h is proportional to the library size we're using, and then I let h -> h^2 so that later, longer guesses count for more. If you want all partial guesses to count the same, let h=1. If you want early guesses to count for more, let h -> sqr(h) or something. I haven't changed this part in quite some time, so beware what you get! (There are probably even better models waiting to be discovered right here but I haven't really needed to yet...)



OH and I almost forgot. Want better accuracy? uncomment alphabets 11,12, and 13. It will look for deeper patterns in trade for a little speed.

« Last Edit: December 16, 2021, 02:18:20 pm by STxAxTIC »
You're not done when it works, you're done when it's right.

Offline random1

  • Newbie
  • Posts: 86
Re: Looking for old program or help recreating it
« Reply #70 on: December 16, 2021, 09:02:46 pm »
STxAxTIC

Un-commenting the alphabets should not present a speed issue on my end.  My mention of the
added weight is to introduce a user defined static value just before the final prediction is made.
Like I said I have a control panel already set up for this sort a thing.  However I would like to
wait until we think the predictor is fully developed before coding the CP into the main program. 
When the predictor is fully developed then it will run in sort of a silent mode so to say with just
a process bar to indicate the overall progress.  I will add the print switch to all the printed stuff
so that it can be blocked when it's no longer needed.

Attached is a picture of the predictors front end showing process bars,  Red is data gathering,
Green = formatting, blue = predictor process, larger pink bar to the right indicates overall
progress.  Picture shows a 10 string run.

Second picture shows the yet unfinished config menu.  This writes any user settings to a .ini file
which is then read just before the predictor is ran. 

R1       

« Last Edit: December 16, 2021, 09:12:17 pm by random1 »

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
Re: Looking for old program or help recreating it
« Reply #71 on: December 17, 2021, 05:15:34 am »
Hey R1,

You mentioned plenty in the above, but I wanted to expound on this part a little:

Quote
My mention of the added weight is to introduce a user defined static value just before the final prediction is made. Like I said I have a control panel already set up for this sort a thing.

Throughout using this program, it occurred to me that my variable "h" explained above does not need to be a single value, but can be an array h() with one "weight" per value, much like you're talking about. The novel idea comes next: This array h() can actually be "trained" by the machine itself using whatever input strings we want, kindof exactly like a real AI project. So far all my code does is a big dumb deterministic calculation, but imagine if it tweaked its own model in order to maximize performance on the full suite of test strings? It's not even that difficult, the way I set things up.

I can't get to work on that yet though, because off to the side I'm trying to document all the progress we've made so far. This code doesn't speak well enough for itself, and certainly doesn't defend itself against... ahem... attacks... so I'm drafting a fake article on this as we speak. This will explain why I'm going to stop using the forum as a dev blog, too, haha.

Keep me posted with your updates, I like the screenshots too!
You're not done when it works, you're done when it's right.

Offline random1

  • Newbie
  • Posts: 86
Re: Looking for old program or help recreating it
« Reply #72 on: December 17, 2021, 04:04:35 pm »
STxAxTIC

I understand and agree.  If even what we have already discussed could be successfully implemented
then it might become very lucrative tool, don't blame you for going undercover so to say.   Please
stay in touch via private message if you have anything more to share.  As I've said I have been
working on this for years using different approaches but find my lack of skill in converting certain
math's into working code a problem.  As you probability already know, most mathematicians kind
of roll their eyes at something like this, some, not all.   

Many thanks for everything.

R1.

P.S.
My program makes a bunch of statistical calculations before the strings are ever presented to the
predictor.  I have not  implemented any of them yet as I need to first streamline your code so
that it integrates perfectly with the main program code.  I will add several controls to the config
menu like the string length, number of calls, weights, threshold, trigger etc... 

Again thanks for your post.             

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
Re: Looking for old program or help recreating it
« Reply #73 on: December 17, 2021, 04:16:24 pm »
Ah hey R1!

So maybe I wasn't a thousand percent clear in my post above - I'm not really going underground with this work as much as I'm getting out of everyone's hair with it. Since the whole idea here isn't so obvious, it deserves a proper explanation rather than just code and forum posts... So that means I'm putting the work elsewhere, namely here:

http://barnes.x10host.com/pages/Binary-Analyzer.php

It's barely a third of the way done as I sit here now, but within the next few days it should be fully drafted. I do this in notepad without spell check cause I'm a madlad, so this page is subject to corrections. Anyway, the full story is now going there ^
You're not done when it works, you're done when it's right.

Offline random1

  • Newbie
  • Posts: 86
Re: Looking for old program or help recreating it
« Reply #74 on: December 17, 2021, 07:36:36 pm »
STxAxTIC

The information in the link has already filled in several blanks I had in understanding your
code, stupid me.  I should be able to adapt it now so that it fits seamlessly into my existing
code.     

Big thumbs up on the link and I look forward to the finished project.  Maybe were on the same
page now.  I admit I've been a bit cryptic in my postings.         

Thanks 

R1