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

0 Members and 1 Guest are viewing this topic.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: Looking for old program or help recreating it
« Reply #30 on: December 09, 2021, 12:50:13 pm »
Yeah Steve's link was what I was trying to get at, now that I've seen it, I see how poorly I coded my attempt.

Offline random1

  • Newbie
  • Posts: 86
    • View Profile
Re: Looking for old program or help recreating it
« Reply #31 on: December 09, 2021, 01:03:26 pm »
The idea is to predict the next event using a algorithm similar to the one in the program
I mentioned at the start of the topic.

In the posted video, notice the bets; penny, dollar and 100 dollars.  The bets seems to be
based on a confidence level, this alone sums up what I am trying to do.  We could think
of the 1's and 0,s as heads and tails if it makes it easier to understand.  Predicting a (0)
is as important as predicting a (1), just need accurate predictions.

My goal is to find 20 to 25 of the 800+ strings that have a very high confidence level and
skip the rest, keep the $100.00 bets so to say and pass on the others. 

One does not need to process the entire string, in the video the $100 bet is made on the
20th of 20 predictions.  The strings length and the amount of data used will be different
depending on the method used.   

I have a couple new ideas and will start coding them in the next day or two.   

Hope this helps

R1 


   

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: Looking for old program or help recreating it
« Reply #32 on: December 09, 2021, 01:18:10 pm »
Okay last reply, I promise - I can't believe what I'm seeing here!

Quote
The strings you show do not have any random elements

Irrelevant point anyway, but if your method works, it will work on that data set.

Quote
The idea is to predict the next event using a algorithm similar to the one in the program
I mentioned at the start of the topic
.

I claim to have solved the bold part of the statement you made. Why insist on the italic part then?

Quote
One does not need to process the entire string

I disagree with this, a fully-informed answer should use all of the data available. Use the whole string, not just recent characters.

Quote
The main goal is to produce a universal prediction tool.

I'm not sure how I feel about this, but the thing I'm using is very close to, or maybe simple *is* - universal. I've publicly tested this method on numbers, strings, etc etc. I honestly can't believe Steve and/or bplus haven't openly remembered this study, or maybe the implications of it were stronger to me than they were to the average reader.

You'll prolly skip right over this encounter in the long run, just remember you have a solution laying around when you care to look into what I'm doing.


You're not done when it works, you're done when it's right.

Offline random1

  • Newbie
  • Posts: 86
    • View Profile
Re: Looking for old program or help recreating it
« Reply #33 on: December 09, 2021, 01:37:29 pm »
"" Yeah, I kinda figured this would happen.

random1, my method works on random strings also - of course - we need to TEST things with regularized input before we give the algorithm true unknowns.

IF you can't run your stuff on my test data, or won't, the way it really sounds, then Im considering this issue closed and you guys have some reading to do!

Please, let's see how your attempt handles the data I provided. No speculation about it, let's see a test."


See the picture below.  I will fully test your code against all 800+strings but can't do it right now
as I am in the middle of a rewrite.  Like I said I don't ignore anything people post but that does not
mean I can jump on it right now.  I detect a bit of ass-hole in your last post.  You don't have to post
anything and it's not my responsibility to work on your time.  People like you are the main reason
I do very little posting.  On second thought, I may not even give your code another look. 
       


https://i.postimg.cc/yYMz0Bc2/stat.png

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: Looking for old program or help recreating it
« Reply #34 on: December 09, 2021, 01:49:11 pm »
Alright man, we can be past the issue of my code. I know it works, the world can see it works. But let's forget about that - pretend I never worked on this problem. Let me start afresh, do a big re-set, and only see things your way, and I mean it.

This will mean:
Quote
I will fully test your code against all 800+strings but can't do it right now

...can go away.

So let's re-begin: I don't need you to test my algorithm, I need you to test my data set. Just run those strings through what you've got and show me how it does. Ya?
You're not done when it works, you're done when it's right.

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: Looking for old program or help recreating it
« Reply #35 on: December 09, 2021, 01:50:15 pm »
@random1 Welcome to the forum! I don't think I've seen you on here before (but I've been less active recently). Glad to see you are wanting to deal in mathematical programs! @STxAxTIC is our resident mathematician and provides great examples so I hope you can use them to your benefit. Good luck with your program and I wish you the best!
Shuwatch!

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Looking for old program or help recreating it
« Reply #36 on: December 09, 2021, 01:58:58 pm »
I think the biggest problem with this type of program is simply getting a valid data set to test against. 

Asking QB64 to give you a list of 20 heads or tail results is worthless.  You're not trying to test if the computer is random; you're trying to make a prediction based on human psychology with random numbers.  It's like telling folks to, "Give me a random number between 1 and 10."

Go ahead.   Do it.    Before you read any more of this post, pause and think of a random number between one and ten.

.
.
.
.
.

Got it?

.
.
.
.
.


It's 7.

.
.
.
.
.

Or, at least for 47% of you, it's seven, according to various studies done when people were asked to generate a value from 1 to 10.  If it's not 7, chances are, it's 3.

WHY??

Because both are midways off-center, making them seem "random" to our brain, and both are prime numbers, making them stand out as less divisible and "special" to us.  They just "seem" random, when, in fact, they're anything but that!

Ask yourself, "Why don't people choose 1 or 10, when given a choice to choose any value between those numbers?"

Various theories exist on answering that question, but the one I tend to like is simply, "Told to guess between one and ten, our brains simply remove those numbers from the pool to begin with."  That leaves two through nine to be the real range of values that most people might choose from.  (Minus a very few extremes who fall onto the end of our bell curve of human psychology.)

From two to nine, most people don't want to be on the extremes, as that "just doesn't feel random", so they shoot for somewhere near the center of that range...   But, you don't want to go for the EXACT center; it's "not really random" to the human brain either -- after all, it's the exact center!  So that leaves us with 3, 4, 6, 7, 8 as a value that most people will choose from...

Of those, there's only two prime numbers, which seem "odd" to us by their unique nature, and as such, we realize that they're not "normal numbers."  An "abnormal number" HAS to be more random than a plain old "normal number".   Right??

At least, it is as far as the human mind is concerned for the vast portion of humanity!!

BUT, the problem comes that once you tell this to someone, and then you tell them to "Guess a number from one to ten", they'll react upon the information I just gave you.  Three and Seven are no longer viable numbers, as that person now things of them as "AHA!  He's going to trap me into being normal and thinking of one of those values!"  Chances are, they're now going to go to an extreme and think of "something random, outside the pattern"!

They'll choose one or ten, as I emphasized that people don't choose those values normally!!

And that's why it's so hard to get a valid set of random numbers from people...  The moment you mention it, they instantly start to think, "What's this guy doing?  How can I *BEAT* him at his process?  How do I prove I'm not an *average* bear??"

Suddenly you're not testing human behavior for guessing random numbers -- instead you're now trying to see if you can predict human behavior for people trying to beat your algorithm for prediction!

Which makes this type of project one that is incredibly hard to do, just because it's hard to actually get a valid data set to run it against.
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Looking for old program or help recreating it
« Reply #37 on: December 09, 2021, 02:03:30 pm »
I detect a bit of ass-hole in your last post. 

Don't worry.  I often detect a LOT of asshole when STxATxIC posts.  Feel free to tune him out completely if you want.   I certainly don't do much more than glance quickly over his crap anymore and pay very little attention to whatever he's spouting off over at the moment. 

But, I have to admit, it's nice to see I'm not the only one who feels this way, as far as he's concerned.  LOL!  ;)
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: Looking for old program or help recreating it
« Reply #38 on: December 09, 2021, 02:05:54 pm »
Quote
Which makes this type of project one that is incredibly hard to do, just because it's hard to actually get a valid data set to run it against.

I agree, hence why I chose these strings for testing:

Code: [Select]
string = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": nextdigit = "0"
'
string = "01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101": nextdigit = "0"
string = "10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010": nextdigit = "1"
'
string = "00100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100": nextdigit = "1"
string = "01001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001": nextdigit = "0"
string = "10010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010": nextdigit = "0"
'
string = "00010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001": nextdigit = "0"
string = "00100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010": nextdigit = "0"
string = "01000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100": nextdigit = "0"
string = "10001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000": nextdigit = "1"
'
string = "00001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000": nextdigit = "0"
string = "00010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000": nextdigit = "1"
string = "00100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001": nextdigit = "0"
string = "01000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010": nextdigit = "0"
string = "10000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100": nextdigit = "0"
'
string = "00000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100": nextdigit = "0"
string = "00001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000": nextdigit = "0"
string = "00010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000": nextdigit = "0"
string = "00100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000": nextdigit = "1"
string = "01000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001": nextdigit = "0"
string = "10000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010": nextdigit = "0"
'
string = "00000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000100": nextdigit = "0"
string = "00100000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000": nextdigit = "1"
'
string = "00000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001": nextdigit = "0"
string = "10000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000": nextdigit = "1"
'
string = "00110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011": nextdigit = "0"
string = "01100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110": nextdigit = "0"
string = "11001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100": nextdigit = "1"
string = "10011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001": nextdigit = "1"
'
string = "00011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100": nextdigit = "0"
string = "00111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000": nextdigit = "1"
string = "01110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001": nextdigit = "1"
string = "11100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011": nextdigit = "1"
string = "11000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111": nextdigit = "0"
string = "10001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110": nextdigit = "0"
'
string = "01001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100": nextdigit = "0"
string = "10011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000": nextdigit = "1"
string = "00110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001": nextdigit = "1"
string = "01100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011": nextdigit = "1"
string = "11000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111": nextdigit = "0"
string = "10001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110": nextdigit = "1"
string = "00011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101": nextdigit = "0"
'
string = "01001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001": nextdigit = "0"
string = "10010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010": nextdigit = "1"
string = "00101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101": nextdigit = "0"
string = "01010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010": nextdigit = "1"
string = "10101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101": nextdigit = "0"
string = "01010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010": nextdigit = "1"
string = "10101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101": nextdigit = "0"
string = "01010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010": nextdigit = "0"
string = "10101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100": nextdigit = "0"
string = "01010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000": nextdigit = "1"
string = "10100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001": nextdigit = "1"

And everything else Steve just went on about only concretizes why it's critical that the algorithm being used is completely robotic, completely unbiased, completely systematic, completely uninformed by a human. (That's the reason reason my code, which I swore I wouldn't mention anymore, is so small.)
« Last Edit: December 09, 2021, 02:16:35 pm by STxAxTIC »
You're not done when it works, you're done when it's right.

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: Looking for old program or help recreating it
« Reply #39 on: December 09, 2021, 02:09:20 pm »
Yup, as usual Steve wants to go all ad-hominem when he feels a certain way. Why, man? I wasn't even coming after you. Go wait for me in a calculus thread where I can pants you in the proper arena.
You're not done when it works, you're done when it's right.

Offline random1

  • Newbie
  • Posts: 86
    • View Profile
Re: Looking for old program or help recreating it
« Reply #40 on: December 09, 2021, 04:01:14 pm »
STxAxTIC

Here is a challenge that will prove rather your program works or not.
I only have a hour or so each day to work on this project. 

Attached is a plain text file that contains 44 strings updated a few
minutes ago.  It should be easy for you to add the code to input
the strings directly into your program and then record and post the
predicted value for each string. 

Each line contains 500 values which should be enough.  Post your
predicted values for 1 through 44, if for some reason your predictor
cannot make a prediction for a string then just add a "*" for that value. 

This way it will make testing the predictions easier.  Each prediction
should be a 0,1 or *.  Some of the strings contain all or mostly zeros. 

Anyone else that wants to run a test can have at it.  But I need your
results before the end of the day which is when I run the next update

P.S.
I never said anything one way or the other as to rather or not your
program had any merit, here's your way to prove it.

R1

Offline cfalcon030

  • Newbie
  • Posts: 6
    • View Profile
Re: Looking for old program or help recreating it
« Reply #41 on: December 09, 2021, 05:27:42 pm »
Does this match what you are looking for

https://archive.org/details/gameeven.qb64

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: Looking for old program or help recreating it
« Reply #42 on: December 09, 2021, 07:52:52 pm »
Hello r1

I'm willing to play the game using the file you've provided, and I'll do you a little better: I refined my prediction calculation a little bit, so when it's not sure what to do, the answer will be a decimal between 0 and 1. If you see something like 0.25, it means I'm leaning more towards 0. A true coin-on-its-side result would be 0.5, call this your "asterisk" case.. A 0.75 means it's leaning toward 1. Because I've started to tweak and bugfix my estimator equation thingy, I'm quietly adding version numbers to this code for the time being, in case we have to refer back to something very specific.

Before I spill any beans here, another remark: I really really really think we should be starting this analysis using data that has semi-regularity to it, but not trivial regularity, for the sole - and very important - reason that we need an actual truth table to compare our predictions with. With no actual standard, it's a pissing contest in high winds. So because I'm doing this for you without an argument, I beg, I plead with you, PLEASE return the favor to me and run your algorithm on the sample data I cooked up.

Anyway, here are the predictions. Labeling the strings starting with 1 and ending with 40-something:

Code: [Select]
01: 0
02: 0
03: 0
04: .125
05: 0
06: .125
07: .875
08: 0
09: 0
10: 0
11: 0
12: .875
13: 0
14: .5
15: .125
16: 0
17: 0
18: 0
19: 0
20: 1
21: 0
22: .25
23: .125
24: .75
25: 0
26: 0
27: .125
28: .125
29: 0
30: 0
31: 1
32: .75
33: 0
34: 0
35: 0
36: .125
37: 0
38: .75
39: .125
40: 0
41: 0
42: .75
43: .125
44: 0

Full code right here, still making it pretty:
Code: QB64: [Select]
  1.  
  2. ' Version: 4
  3.  
  4. Type Letter
  5.     Signature As String
  6.     Count As Integer
  7.  
  8. Dim Shared TheInput(1000, 2) As String
  9.  
  10. Dim Shared FingerPrint(16) As String
  11.  
  12. Dim Shared Alphabet1(2) As Letter
  13. Alphabet1(1).Signature = "0"
  14. Alphabet1(2).Signature = "1"
  15. Alphabet1(1).Count = 0
  16. Alphabet1(2).Count = 0
  17.  
  18. Dim Shared Alphabet2(4) As Letter
  19. Dim Shared Alphabet3(8) As Letter
  20. Dim Shared Alphabet4(16) As Letter
  21. Dim Shared Alphabet5(32) As Letter
  22. Dim Shared Alphabet6(64) As Letter
  23. Dim Shared Alphabet7(128) As Letter
  24. Dim Shared Alphabet8(256) As Letter
  25. Dim Shared Alphabet9(512) As Letter
  26. Dim Shared Alphabet10(1024) As Letter
  27. Dim Shared Alphabet11(2048) As Letter
  28. Dim Shared Alphabet12(4096) As Letter
  29. Dim Shared Alphabet13(8192) As Letter
  30.  
  31. Call NewAlphabet(Alphabet1(), Alphabet2())
  32. Call NewAlphabet(Alphabet2(), Alphabet3())
  33. Call NewAlphabet(Alphabet3(), Alphabet4())
  34. Call NewAlphabet(Alphabet4(), Alphabet5())
  35. Call NewAlphabet(Alphabet5(), Alphabet6())
  36. Call NewAlphabet(Alphabet6(), Alphabet7())
  37. Call NewAlphabet(Alphabet7(), Alphabet8())
  38. Call NewAlphabet(Alphabet8(), Alphabet9())
  39. Call NewAlphabet(Alphabet9(), Alphabet10())
  40. Call NewAlphabet(Alphabet10(), Alphabet11())
  41. Call NewAlphabet(Alphabet11(), Alphabet12())
  42. Call NewAlphabet(Alphabet12(), Alphabet13())
  43.  
  44. Call LoadInput
  45.  
  46.  
  47. m = 1
  48.  
  49.     Cls
  50.     Call Analyze(m)
  51.     Print
  52.  
  53.     _Display
  54.     _KeyClear
  55.     Do: k = _KeyHit: Loop Until k
  56.  
  57.     Select Case k
  58.         Case 19712
  59.             m = m + 1
  60.         Case 19200
  61.             m = m - 1
  62.         Case Else
  63.             Cls: _Display
  64.     End Select
  65.     _KeyClear
  66.  
  67.     _Limit 30
  68.  
  69.  
  70. Sub LoadInput
  71.     Dim n As Integer
  72.     '''
  73.     n = 0
  74.     '''
  75.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "0"
  76.     n = n + 1: TheInput(n, 1) = "01010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101": TheInput(n, 2) = "0"
  77.     n = n + 1: TheInput(n, 1) = "10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010": TheInput(n, 2) = "1"
  78.     n = n + 1: TheInput(n, 1) = "00100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100100": TheInput(n, 2) = "1"
  79.     n = n + 1: TheInput(n, 1) = "01001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001001": TheInput(n, 2) = "0"
  80.     n = n + 1: TheInput(n, 1) = "10010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010010": TheInput(n, 2) = "0"
  81.     n = n + 1: TheInput(n, 1) = "00010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001": TheInput(n, 2) = "0"
  82.     n = n + 1: TheInput(n, 1) = "00100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010": TheInput(n, 2) = "0"
  83.     n = n + 1: TheInput(n, 1) = "01000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100": TheInput(n, 2) = "0"
  84.     n = n + 1: TheInput(n, 1) = "10001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000100010001000": TheInput(n, 2) = "1"
  85.     n = n + 1: TheInput(n, 1) = "00001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000": TheInput(n, 2) = "0"
  86.     n = n + 1: TheInput(n, 1) = "00010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000": TheInput(n, 2) = "1"
  87.     n = n + 1: TheInput(n, 1) = "00100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001": TheInput(n, 2) = "0"
  88.     n = n + 1: TheInput(n, 1) = "01000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010": TheInput(n, 2) = "0"
  89.     n = n + 1: TheInput(n, 1) = "10000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100001000010000100": TheInput(n, 2) = "0"
  90.     n = n + 1: TheInput(n, 1) = "00000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100": TheInput(n, 2) = "0"
  91.     n = n + 1: TheInput(n, 1) = "00001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000": TheInput(n, 2) = "0"
  92.     n = n + 1: TheInput(n, 1) = "00010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000": TheInput(n, 2) = "0"
  93.     n = n + 1: TheInput(n, 1) = "00100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000100000": TheInput(n, 2) = "1"
  94.     n = n + 1: TheInput(n, 1) = "01000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001000001": TheInput(n, 2) = "0"
  95.     n = n + 1: TheInput(n, 1) = "10000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010000010": TheInput(n, 2) = "0"
  96.     n = n + 1: TheInput(n, 1) = "00000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000100": TheInput(n, 2) = "0"
  97.     n = n + 1: TheInput(n, 1) = "00100000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000100000010000001000000": TheInput(n, 2) = "1"
  98.     n = n + 1: TheInput(n, 1) = "00000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001": TheInput(n, 2) = "0"
  99.     n = n + 1: TheInput(n, 1) = "10000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000100000001000000010000000": TheInput(n, 2) = "1"
  100.     n = n + 1: TheInput(n, 1) = "00110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011": TheInput(n, 2) = "0"
  101.     n = n + 1: TheInput(n, 1) = "01100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110": TheInput(n, 2) = "0"
  102.     n = n + 1: TheInput(n, 1) = "11001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100": TheInput(n, 2) = "1"
  103.     n = n + 1: TheInput(n, 1) = "10011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001100110011001": TheInput(n, 2) = "1"
  104.     n = n + 1: TheInput(n, 1) = "00011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100": TheInput(n, 2) = "0"
  105.     n = n + 1: TheInput(n, 1) = "00111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000": TheInput(n, 2) = "1"
  106.     n = n + 1: TheInput(n, 1) = "01110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001": TheInput(n, 2) = "1"
  107.     n = n + 1: TheInput(n, 1) = "11100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011100011": TheInput(n, 2) = "1"
  108.     n = n + 1: TheInput(n, 1) = "11000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111000111": TheInput(n, 2) = "0"
  109.     n = n + 1: TheInput(n, 1) = "10001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110001110": TheInput(n, 2) = "0"
  110.     n = n + 1: TheInput(n, 1) = "01001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100": TheInput(n, 2) = "0"
  111.     n = n + 1: TheInput(n, 1) = "10011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000": TheInput(n, 2) = "1"
  112.     n = n + 1: TheInput(n, 1) = "00110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001": TheInput(n, 2) = "1"
  113.     n = n + 1: TheInput(n, 1) = "01100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011": TheInput(n, 2) = "1"
  114.     n = n + 1: TheInput(n, 1) = "11000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111010011000111": TheInput(n, 2) = "0"
  115.     n = n + 1: TheInput(n, 1) = "10001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110100110001110": TheInput(n, 2) = "1"
  116.     n = n + 1: TheInput(n, 1) = "00011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101001100011101": TheInput(n, 2) = "0"
  117.     n = n + 1: TheInput(n, 1) = "01001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001": TheInput(n, 2) = "0"
  118.     n = n + 1: TheInput(n, 1) = "10010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010": TheInput(n, 2) = "1"
  119.     n = n + 1: TheInput(n, 1) = "00101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101": TheInput(n, 2) = "0"
  120.     n = n + 1: TheInput(n, 1) = "01010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010": TheInput(n, 2) = "1"
  121.     n = n + 1: TheInput(n, 1) = "10101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101": TheInput(n, 2) = "0"
  122.     n = n + 1: TheInput(n, 1) = "01010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010": TheInput(n, 2) = "1"
  123.     n = n + 1: TheInput(n, 1) = "10101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101": TheInput(n, 2) = "0"
  124.     n = n + 1: TheInput(n, 1) = "01010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010": TheInput(n, 2) = "0"
  125.     n = n + 1: TheInput(n, 1) = "10101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100": TheInput(n, 2) = "0"
  126.     n = n + 1: TheInput(n, 1) = "01010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001110100101010101001010101000": TheInput(n, 2) = "1"
  127.     n = n + 1: TheInput(n, 1) = "10100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001": TheInput(n, 2) = "1"
  128.     n = n + 1: TheInput(n, 1) = "10100101010100011101001010101010010101010001110100101010101001010101000111010010101010100101010100011101001010101010010101010001": TheInput(n, 2) = "?"
  129.     n = n + 1: TheInput(n, 1) = "0001000001011100000011000100011000010010000000000000000011000000000000000001110010000000000001111000000001001110000000000000100000000011110000000000000000000000000000010100000000000000000100000000000000110001111000010001000000000000000000011010000000000000000010001101100000100001000000110011000011010010000000000000000000100001000011000110001010000000100000000000000000000000000000000000010000000000100000000000000010100000100000000000000000000000000000000000100001000000000000000010110100000000000010010000000000000000000100000000001100000011000000000000000000000000000000110010000110000100000": TheInput(n, 2) = "?"
  130.     '''
  131.     'n = 0
  132.     '''
  133.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  134.     n = n + 1: TheInput(n, 1) = "00000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  135.     n = n + 1: TheInput(n, 1) = "00000100000101110000001100010001100001001000000000000000001100000000000000000111001000000000000111100000000100111000000000000010000000001111000000000000000000000000000001010000000000000000010000000000000011000111100001000100000000000000000001101000000000000000001000110110000010000100000011001100001101001000000000000000000010000100001100011000101000000010000000000000000000000000000000000001000000000010000000000000001010000010000000000000000000000000000000000010000100000000000000001011010000000000": TheInput(n, 2) = "?"
  136.     n = n + 1: TheInput(n, 1) = "00011101100000000001011100001011101000100111101100011000000011001010101000101000111111011000111000100000000000000110110000000001001001110110100001011011101100000011001010001111111110101100001101100001100011000111101100110000000101101101110000001110110111000011000110000000001101111000110000000011111100110001111000011101111101010011111111101111010011011001111101100010001100101101001011000010100111111101111010111111010110001100011000000100010001100111111001101101111000000010110111110000001011010011": TheInput(n, 2) = "?"
  137.     n = n + 1: TheInput(n, 1) = "00000000100000000000110000000000000000010000000000000000010000000000000000001000000000000000000000000000000001000000010000000000000000000000000000000000000000000000000000011000000000000000001000000001000000000000000000000000000000000000000001001011001000000000000110000000000000000000000000000000000100010000000000000000000000000000000000001100000000000000000000000000000000100000000000000000001000000000000000000000000000000000000000000000100000000000000000100000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  138.     n = n + 1: TheInput(n, 1) = "01111011010110000100001000011001101101000011000011000000000100110010001010000100010000001110111000001000000000101110101100000000100011100101101110000010110101111001011010100000111011100110100001100100111010111110000010000110010000000100111100110000000101010100111001000000101000100101111001001001000010000100110011011010011011101000110011000000101000000100010000101101000101000110000100010101010111100000000001100000110010000001000011100001001000100000011100000101000001010101000100011010000100010011": TheInput(n, 2) = "?"
  139.     n = n + 1: TheInput(n, 1) = "11000110011000111000001101000010001000001110001001110010000110000111010001010001100010101100001111100000111100101100000011000111101101110010101101010000101010000001111100000111110101010000000011011100100110101100111101000000100100101000011010000000010110101010011001110011111000010001100110001111111001100010011100010101001100000101010101100000000001001010000011011100010011001000001001110111100110010010000010000111111101100011010101010101000111010110101000000010001001001011011011100101111110110010": TheInput(n, 2) = "?"
  140.     n = n + 1: TheInput(n, 1) = "10101101010001010110010110011111011111111101110100010011101110000000100011010000100111111001110110100011011110011101110001110011110000111011011110111011101100000010100111100010000010100111110010100100010001010101111000111010011101010111001110110000101101110001110010011101010110101110001111000101011001001101001011111101110010110101001100110010111101010111010010000010110100010001101110110101101110000101101010001001101101011000111110100000011101110010101111011110111110100110101001111101110001010110": TheInput(n, 2) = "?"
  141.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  142.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000001000000000000000000000000000100000000000000000000000000000000000000000000000100000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000": TheInput(n, 2) = "?"
  143.     n = n + 1: TheInput(n, 1) = "00000110110101110000001100100101000001001111101111100000011000000000001001000100011000000000100011100000100000001001000001000010000000010111001101000001100000010101100011010011111000100111010000000000001010001011101110010100000000000010001011101000010000100000101100110100000011111000000001110000010101010000111111110000000110000100111110011000100000010001010100000000000110000000011000100000000111110011110010000100001010000010011100000000010001101010000000000110010000000110000000110011000000000000": TheInput(n, 2) = "?"
  144.     n = n + 1: TheInput(n, 1) = "11011001010011000110101011011010000110001001010001001111100111001011110110111010001111010110010100100101011010110010010100111010111001101011100100001010011111111010011100101101000011011011000111011011010110111100110011100010100001101010110101110101110111010111010010011001110100011010011010101111101110100100100111101101001011100001001100100111010101100100101000111111111001001111100111010110111100001000000111101000111000001101011001001110001000010100110011111001001010101001110111010101111001100001": TheInput(n, 2) = "?"
  145.     n = n + 1: TheInput(n, 1) = "00000000000000000000010000000001100000000000000000000001010000000000110010000000000000000000000000000000000000000000000000001100000000000111000101000000000000000000000000000100010001000000000000000000000000000000001100010010000000000000000001100000000000000000000000000001000000000000000000000000000000000010000011000000000000010000000000000001000000001000000000000000000000000000000000000100100000000000100000000000000000000000000000000000100000000000000000000000000000000000000000100000000000000000": TheInput(n, 2) = "?"
  146.     n = n + 1: TheInput(n, 1) = "11101000011011010000101000100000010001001000000110011110001011010001001101101010001100111000000101001000011000001010010100010011100110101000101000000000010100111001010100010010101010100011000011000001011010000000010000000001011110110111000010000001011011100000000111001110100000110000000011000101100000001001000100110011000100100000100001001000000011010010100000000100100000101001100000110001001001110101010001000000011000000010101000110010000100001011000001101000101010011011001110010110000010000000": TheInput(n, 2) = "?"
  147.     n = n + 1: TheInput(n, 1) = "00000010100110101001001000100000010100100100101101010010000001001100000000001011001110011011000010000111111001100010110011000010100110110000000000011010011010010100100011011011001100110001101001110000101001001100100010001101001000001011111100011011100000011001001010111000000000111101111001111001111111101000000000101100011001001011011010010000100001100010011110010000001011000001010111010010011111001001001110111100110010000110100111101000000101110100101010001111001111101100010101001001010101000101": TheInput(n, 2) = "?"
  148.     n = n + 1: TheInput(n, 1) = "00111100000000000111001001100000111010010010010011100010001100001100000011011000100010000101110010110100110110011100010001111110011011000110010000001001101111111000011000010001101110011101111010100110100110000111011101001111110011011111100110111000001101101110001001001000011110100110000111110111010000001100100100100111110110100001001011100110111000100011110100100100110010011110011011100011101111010010000110000011101100000111001011000110000010001101111011111011001100000010000101000000000000101110": TheInput(n, 2) = "?"
  149.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  150.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000100000000000000000000000010000000000000001000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000": TheInput(n, 2) = "?"
  151.     n = n + 1: TheInput(n, 1) = "00000000010111101100110000001011000001001011001100000001001100001001000001001100010000111111000011100001000000001111010010000100001000000010001101001011101011011010000101010011110110110001100001000010000010100011000000110001000000011101110001000000000000110000100000101100000001011010000101000000100100011000111111110010110101010100011110100110110000010001101000000000101001000010100110000100010100111000010010100100001000110000000100010100010000000010000100011100010010110100010000010010001001000010": TheInput(n, 2) = "?"
  152.     n = n + 1: TheInput(n, 1) = "11111111011001010010001100000100110110101110100011010010111011110100101000100000000101100000000100110010111110111000110101101010111111011101101010011111100100110100010011011001100000001110111110000101000000001100110101011110011111101100001110011101111100111100011100010010110111100001010000010001101001001111000000000101001000100100000110011000101011100100000100111011010110100000010001011010101011010010100111011000100011001000001010001011101010000100001011001011100001001011101110100110110010111100": TheInput(n, 2) = "?"
  153.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000010000000000000000000000000000000100000000100000000000000000000011100000000000000000000000000001000000000000000000000000000011001000000000000100000000000000000000000000010010000000000000000000000000000000000000000000000000000000000000000000000000000010001000000000000000000000000000000000000010000000000000000000000010000000000000000000000000000000000000000000000001001000000000011100000000000000001000000000000000000100000000100010000110100000000000000000000000000000000000": TheInput(n, 2) = "?"
  154.     n = n + 1: TheInput(n, 1) = "01011000100010001000011010000010010010000100100101000100011001000010000010110110010110001100010001000010110110000011010100000100100010010011111101111100110010101100000001000000100111010000010000100000000111100110000101110001100100000001000001001100100100010000001001000110000000000100011100110110000101100011100010110100000011001001011000010001001000101010010010000001000000100101100101001110110010010000100010100010000000100111001100000000001000111111010100001000001010000010101010110101101000001100": TheInput(n, 2) = "?"
  155.     n = n + 1: TheInput(n, 1) = "00000101000010010110000110001101111110010001110010000010101001111111010000011011100000110000010101101110101111110101001100000100000000100110001000000000000001110011101011011110000001000110101001000000000000010100010010110110000010001100100010011001010011111011001110110000110100010010000010010110011000010110110010101000111000000100000001101100100110010100110111001110110101010001101100000000110010100010000001000101011100000000000111101110101011001011001100100000001101110000001001101010000000111011": TheInput(n, 2) = "?"
  156.     n = n + 1: TheInput(n, 1) = "10100010000111100111110001101101100001100111001010011110011001101110100111000111001010100111100010110010101010100100100000101010111100100000010111001000101110010010111000001100011011001011010100101101101110001001111100110000001011100000010110011010001000001101101111001000011101001000110010110111100011111011001100011110100110100111001110000101010001010001101001101001011001111010011001101010000001111010110011100001010100011100110100011011110011100101000001110010010111100111110011001110011111001010": TheInput(n, 2) = "?"
  157.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  158.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000100000000000001100000000000000000000000000000000000000000010000000000000000000000000000000001000000000000000000000000000000000001000000000000100000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  159.     n = n + 1: TheInput(n, 1) = "00100000011101101100000000000000000000001010001010001010010000000011101000010100001000000110000110100000000010001000111100100100001010110000011000001010110100110011000010001000110101001001100001011000001000000000000010110000100000110000001001000000100000110100100100100001010011000000010101010010100101000000001011100010000000001100000110100010100010000001110000000100000001110010100100001110000001100110000100001000001000000000010000001000001000000001001100000000010011110100000000001010100001111111": TheInput(n, 2) = "?"
  160.     n = n + 1: TheInput(n, 1) = "01010110100011101001111011101011111111101001100000010100001001111110010111100011101100011111110001101101111000110011010011010011110000101111110110010001000001010100100100110011010010010110101011100000111111111101111110110011111101010011110000111101000010010011010000011100001000011011000011001101100011011101000101010101111011000100001111010100111001011100011100011011011000000010011010010100110010011001111011010010110011111000101110010111111100100100111110111010101001101011010100000001011010010000": TheInput(n, 2) = "?"
  161.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000100000001000000000000000000000000000000000000000001000000000000000000000000000000000000000010000000000000010010100000000000001000000000001000100000000000000000000001000000000000000000000000000000010000000010000000000000000000000001000000010000000000000000000000000000000000000000010000000110000000000000000000000001000000000010000100000000000000000100000001000000010000000000000000000000010000000000000000001000000000000000": TheInput(n, 2) = "?"
  162.     n = n + 1: TheInput(n, 1) = "00000001100010111010101010001001000011001100000000000000010011000111001101001010110010010010010100101010000001001000111000000010110000010001001110100000000101101001110100010100000101000100000101000000010000110000010011010000100101001111000000011110001000001101101100000001000101000000011001011001110111100010010001000011110011110010010001000001110100100010101001110000010100000010010100000000101001000100101000011000000001001010111010110100000011001100101010000000100100100111111001110101000100000001": TheInput(n, 2) = "?"
  163.     n = n + 1: TheInput(n, 1) = "11010010010101000010000011010000101110111010011001101000101111011101001110000001011110100101101111000100000010110001010101000110100001100000111000111100011110110011101101101111101010100100011101000000010010101110000011011100010010101110101010000001110001001111110011011101000010110000101111000000101100011100101100001001100001111110000101110000010010000001001010000000011011000001000101000100000111101100110011000111010000001000010000000000100101010001100001011000001010001000111111110110101000011111": TheInput(n, 2) = "?"
  164.     n = n + 1: TheInput(n, 1) = "11011111000111100000010011111111101111001100100010111010010000011000110100111010011000111101000111010000110110101010011010101011100110011101000001011011111110011100110100001001010000001000010010100101111011000101001000000011110011110001100100100011011001010000101101111110101011011100000111000111000011110101111011101000101010000111011110000111111101011101110110001000011000111011011011111100110000001011011010110101101111011001011000111100101100111010011100110111101100110110100110000010011111110101": TheInput(n, 2) = "?"
  165.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  166.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  167.     n = n + 1: TheInput(n, 1) = "00100000000000000011000000000000000000000110000010011111100000000000000001000000001000000000000000010110000110000001100010000000000011110000000001100000000000110011000011000000010000001110000000011000001000010000110100000010000000111101000000000000000000100000000001100000100011000000000100000000000101000000000011010000001100010100000110110010100001010000110000001000000001100000110000001100000000011010000000000000101001100000000000000000100000011010100000000010010000100100010000000000000001111000": TheInput(n, 2) = "?"
  168.     n = n + 1: TheInput(n, 1) = "00010100011101010101100000101000001100111001101101000000011001111001100110110111010111111011110001100000000001100000011001111000111001000110011010001110100110011001110111100000101000110001100110100111000111001000001001110101101110000000110000000000011001010101000110011101011001100011001001011001101100011110000101101001100011001010011000001100110000101000001111110110000000001100001100010010101111100101001101010000000110011011111100011111010000000101000000100101100111010110001101111010101010000110": TheInput(n, 2) = "?"
  169.     n = n + 1: TheInput(n, 1) = "00000010000000000001100000000000000001000000000000000000000000000000000000000000000001001000000000000000000100000000000000000000010000000000000000100100000101000001000000100001100000000000000000000000000010110000000000000000100001000000000000001000000001100010000000010000010000000000000110000000001000000000001000010000000000010000000000000000000000000000000000000100001000000000000100001000000000000000000100000000000100000000000000000000000001001000000000000000000001000010000000000010000011000000": TheInput(n, 2) = "?"
  170.     n = n + 1: TheInput(n, 1) = "11010000111110000000000011000001011000010011010100100000000000110011011101010010100100000000000000010001101001000001001010011000100101101000111011000001000010010000010000010100001000100110100001100100001001001001100011110010011000110111000011000000011000000000100110001000101101100000001000000000000100000000000001001110001110100000010100001011101010110100001001001000000010010100001010100111011111000100001010000011010001000011001101110001101110000011010101101001010100110100010001011100110100110111": TheInput(n, 2) = "?"
  171.     n = n + 1: TheInput(n, 1) = "00000000110110001000000011001000100000001110011010100010101101111100101100101000001010000000101101010100101011010000010001001110001001100001110101011010111010000100001011001010010100011001011000010000100001000000000100001111001000101011111110100001110010011000100001101000101001101011110001011111000110111010010101000001001011101101110000001011110000011001100011111001010100010101110011000100110000101101010010110000000000010011001001101101000010000010001110000011111100111101100100110000001000110000": TheInput(n, 2) = "?"
  172.     n = n + 1: TheInput(n, 1) = "00101101111001100011001000011101001000000001100000101001000010110101000011001101110010110011000010101100111010101111100101100111000010110111010100000000001010000111111011001000111011100100011111101010010101011111111010010110010001101010100101010110111010111000101111001101001101101111010101010010110001000110110110101000010100001000010011101010011110001000001111001100110001011010100011101011100000100000111001000111001010101111010010010100110111001000100011010110100011111011101001101010111101101010": TheInput(n, 2) = "?"
  173.     n = n + 1: TheInput(n, 1) = "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000": TheInput(n, 2) = "?"
  174.     n = n + 1: TheInput(n, 1) = "10000000100000000000000001001001000000100011010001010100000100000000010101100110101000000000000100000101010000000101000000000101100000000000010000001000001011000110100110100010010100010111000100000100001010000000101010001000111001000000010000100100000000000000100000001001000000110001010001001010010000000010101001000111011000100100100000010010000100100000000000001000010010000110010110000110100000000000101001010100000110010001110000111000000110000000000000000000000100101100001010000100000101100010": TheInput(n, 2) = "?"
  175.     n = n + 1: TheInput(n, 1) = "00001101011011101101111110010000011011010000101110101011001001111000101010010001010111100001110011011010100011011010101010111010001010100110101100000110110100101001011001010000001010100000111010111011100100110111010101010100000010000010101110001011010011001111011110110000110010001010001000110100101111101100000110111000000000000010001111101001011011010111110110000100101000111000101001110001010011110100010100100011110000001100001011000100100000011110111111100011000011000011100101111010111010010101": TheInput(n, 2) = "?"
  176.     n = n + 1: TheInput(n, 1) = "01110011000100111110101110110110101110011100101000000011111010011111101010001000000000111110011010111010001110111000111111010010011101111101100111110001000000011000001000001101101001001000010001011000010001111100010001100111000100111111100011010001101101110110000001010110001111000100101110010001101101010001010110110000100111011001010100101101110000001111001111110111100101101001001001111001011111111011000010101001001001101010001111000011011001111111001011111101111001010010110000100001010000011000": TheInput(n, 2) = "?"
  177.     '''
  178.  
  179.  
  180.  
  181. Sub Analyze (TheIndex As Integer)
  182.     Dim actual As String
  183.     Dim k As Integer
  184.     Dim As Double p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13
  185.  
  186.     FingerPrint(1) = TheInput(TheIndex, 1)
  187.     actual = TheInput(TheIndex, 2)
  188.  
  189.     For k = 2 To UBound(FingerPrint)
  190.         FingerPrint(k) = Right$(FingerPrint(k - 1), Len(FingerPrint(k - 1)) - 1) + Left$(FingerPrint(k - 1), 1)
  191.     Next
  192.  
  193.     Call CreateHisto(Alphabet2(), 2)
  194.     Call CreateHisto(Alphabet3(), 3)
  195.     Call CreateHisto(Alphabet4(), 4)
  196.     Call CreateHisto(Alphabet5(), 5)
  197.     Call CreateHisto(Alphabet6(), 6)
  198.     Call CreateHisto(Alphabet7(), 7)
  199.     Call CreateHisto(Alphabet8(), 8)
  200.     Call CreateHisto(Alphabet9(), 9)
  201.     Call CreateHisto(Alphabet10(), 10)
  202.     Call CreateHisto(Alphabet11(), 11)
  203.     Call CreateHisto(Alphabet12(), 12)
  204.     Call CreateHisto(Alphabet13(), 13)
  205.  
  206.     Call PrintHisto(Alphabet2(), 0)
  207.     Call PrintHisto(Alphabet3(), 0)
  208.     Call PrintHisto(Alphabet4(), 0)
  209.     Call PrintHisto(Alphabet5(), 0)
  210.     Call PrintHisto(Alphabet6(), 0)
  211.     Call PrintHisto(Alphabet7(), 0)
  212.     Call PrintHisto(Alphabet8(), 0)
  213.     Call PrintHisto(Alphabet9(), 0)
  214.     Call PrintHisto(Alphabet10(), 0)
  215.     Call PrintHisto(Alphabet11(), 0)
  216.     Call PrintHisto(Alphabet12(), 0)
  217.     Call PrintHisto(Alphabet13(), 0)
  218.  
  219.     p2 = MakeGuess(Alphabet2(), 2)
  220.     p3 = MakeGuess(Alphabet3(), 3)
  221.     p4 = MakeGuess(Alphabet4(), 4)
  222.     p5 = MakeGuess(Alphabet5(), 5)
  223.     p6 = MakeGuess(Alphabet6(), 6)
  224.     p7 = MakeGuess(Alphabet7(), 7)
  225.     p8 = MakeGuess(Alphabet8(), 8)
  226.     p9 = MakeGuess(Alphabet9(), 9)
  227.     p10 = MakeGuess(Alphabet10(), 10)
  228.     p11 = MakeGuess(Alphabet11(), 11)
  229.     p12 = MakeGuess(Alphabet12(), 12)
  230.     p13 = MakeGuess(Alphabet13(), 13)
  231.  
  232.     Print
  233.     Print "String ID:"; TheIndex
  234.     Print FingerPrint(1)
  235.     Print
  236.     Print "Thinking:  "; p2; p3; p4; p5; p6; p7; p8; p9; p10; p11; p12; p13
  237.     Print
  238.     Print "Prediction:"; (1 / 4) * (p10 + p11 + p12 + p13)
  239.     Print "Actual:     "; actual
  240.  
  241. Function MakeGuess (arr() As Letter, w As Integer)
  242.     Dim TheReturn As Double
  243.     Dim As Integer k
  244.     For k = 1 To UBound(arr)
  245.         If (Left$(arr(k).Signature, w - 1) = Right$(FingerPrint(1), w - 1)) Then
  246.             Print "..."; arr(k).Signature; arr(k).Count
  247.             TheReturn = Val(Right$(arr(k).Signature, 1))
  248.             If (arr(k).Count = 0) Then TheReturn = .5
  249.             Exit For
  250.         End If
  251.     Next
  252.     MakeGuess = TheReturn
  253.  
  254. Sub CreateHisto (arr() As Letter, w As Integer)
  255.     Dim As Integer m, n, k
  256.     For n = 1 To UBound(arr)
  257.         arr(n).Count = 0
  258.     Next
  259.     For m = 1 To w
  260.         For n = 1 To Len(FingerPrint(m)) - w Step w 'added the -w
  261.             For k = 1 To UBound(arr)
  262.                 If (Mid$(FingerPrint(m), n, w) = arr(k).Signature) Then
  263.                     arr(k).Count = arr(k).Count + 1
  264.                 End If
  265.             Next
  266.         Next
  267.     Next
  268.     Call BubbleSort(arr())
  269.  
  270. Sub NewAlphabet (arrold() As Letter, arrnew() As Letter)
  271.     Dim As Integer n, j, k
  272.     n = 0
  273.     For j = 1 To 2
  274.         For k = 1 To UBound(arrold)
  275.             n = n + 1
  276.             arrnew(n).Signature = arrold(k).Signature
  277.         Next
  278.     Next
  279.     For k = 1 To UBound(arrnew)
  280.         If (k <= UBound(arrnew) / 2) Then
  281.             arrnew(k).Signature = "0" + arrnew(k).Signature
  282.         Else
  283.             arrnew(k).Signature = "1" + arrnew(k).Signature
  284.         End If
  285.     Next
  286.  
  287. Sub PrintHisto (arr() As Letter, w As Integer)
  288.     Dim As Integer n
  289.     If (w > 0) Then
  290.         For n = 1 To w
  291.             Print arr(n).Signature; arr(n).Count
  292.         Next
  293.     End If
  294.  
  295. Sub BubbleSort (arr() As Letter)
  296.     Dim As Integer i, j
  297.     Dim As Integer u, v
  298.     For j = UBound(arr) To 1 Step -1
  299.         For i = 2 To UBound(arr)
  300.             u = arr(i - 1).Count
  301.             v = arr(i).Count
  302.             If (u < v) Then
  303.                 Swap arr(i - 1), arr(i)
  304.             End If
  305.         Next
  306.     Next
« Last Edit: December 09, 2021, 08:33:46 pm by STxAxTIC »
You're not done when it works, you're done when it's right.

Offline STxAxTIC

  • Library Staff
  • Forum Resident
  • Posts: 1091
  • he lives
    • View Profile
Re: Looking for old program or help recreating it
« Reply #43 on: December 09, 2021, 08:39:55 pm »
While this reply is still fresh I want to break down a case that my algo did the absolute worst on, and even this is corrected for in the next stroke of precision, so to speak. The screenshot below has everything. Look how ugly and "random" (everyone contain yourselves, i'm using the word colloquially) that string is! My code will eventually decide the answer is 0, but after a long time thinking it was 1. Too much time in this case, leading to a 50/50 result. Oh, I know the "actual" answer to be 0 because there IS a pattern in this string, just a really long one. This is the only uncertain case among the 50-something cases I cooked up originally.

  [ You are not allowed to view this attachment ]  
« Last Edit: December 09, 2021, 08:50:12 pm by STxAxTIC »
You're not done when it works, you're done when it's right.

Offline random1

  • Newbie
  • Posts: 86
    • View Profile
Re: Looking for old program or help recreating it
« Reply #44 on: December 10, 2021, 12:08:05 am »
Results

Hit 34 of 44 for a hit rate of 77%, all values rounded < .5 = 0, >=.5 = 1

Values to the right are the actual values that showed.   

(+) equals a match, (x) = miss
 
01: 0         0 +
02: 0         0 +
03: 0         0 +
04: .125    0 +
05: 0         0 +
06: .125    0 +
07: .875    0 x
08: 0         1 x
09: 0        0 +
10: 0        0 +
11: 0        0 +
12: .875   0 x
13: 0        0 +
14: .5       0 x
15: .125   0 +
16: 0       0 +
17: 0       0 +
18: 0       0 +
19: 0       0 +
20: 1       1 +
21: 0       0 +
22: .25    0 +
23: .125   0 +
24: .75     1 +
25: 0        0 +
26: 0        0 +
27: .125   0 +
28: .125   1 x
29: 0        0 +
30: 0        0 +
31: 1        0 x
32: .75     0 x
33: 0        0 +
34: 0        0 +
35: 0        0 +
36: .125   1 x
37: 0        0 +
38: .75     1 +
39: .125   0 +
40: 0       0 +
41: 0       0 +
42: .75    0 x
43: .125   1 x
44: 0       0 +

R1