Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Guess My Number
#11
Binary Sequence Predictor "game"?
https://qb64forum.alephc.xyz/index.php?t...#msg140722
Reply #29 on: February 17, 2022

shuffle and make sure that number does not take its place
so far without control has array become binomially better

we create an array of numbers in a row
and in 1 pass we rearrange serial number and a random number
and if numbers of rearranged ones match: spinning line is my handwriting

check array and if there are numbers in their places:
we count number and write array as defective
marking matched ones with a minus sign

first and last numbers are displayed on screen but it is possible to write everything to file

how to copy text results from window is unknown therefore:
picture shows: 9 numbers were qualitatively shuffled from 6th attempt
in 0 seconds

next I plan to calculate whether sequence has become truly random
and apparently I will have to switch to index indexes as excel cells

result is visible if saved to disk or ram disk
between cells at least 10%
and number of repeated shuffles: up to 25% of array length


Code: (Select All)
    a = 100: DIM d(a): x=0: k=0: t$=CHR$(9): RANDOMIZE TIMER 'tas_ten.bas
    PRINT ,: FOR i = 1 TO a: d(i)=i: NEXT
    FOR i = 1 TO 5: PRINT d(i);: NEXT: PRINT ,
    FOR i = a-3 TO a: PRINT d(i);: NEXT: z = TIMER
    OPEN "control.txt" FOR OUTPUT AS #1

WHILE x < 1
v = 0: FOR i = 1 TO a

1 m = INT(RND*a)+1: IF ABS(d(i)-d(m)) < .1*a THEN v = v+1: GOTO 1

PRINT #1, ABS(d(i)-d(m)); t$; d(i); t$; d(m); t$; i; t$; m; t$; d(i)/d(m); t$; d(m)/d(i)
t = d(i): d(i) = d(m): d(m) = t
NEXT   
        s = 0: FOR i = 1 TO a
            IF d(i) = i THEN s = s+1
        NEXT

       5 k = k+1: PRINT: PRINT s; v,: IF s=0 THEN x = x+1
     
        FOR i = 1 TO 5
            IF d(i) = i THEN PRINT -d(i); ELSE PRINT d(i);
        NEXT: PRINT ,
        FOR i = a-3 TO a
            IF d(i) = i THEN PRINT -d(i); ELSE PRINT d(i);
        NEXT
WEND

PRINT: PRINT "    = "; k, TIMER-z: END

result control: open control.txt in notepad and search 1.0
as ratio is less than 10% and desired is missing
this means that elements are shuffled at a distance of at least 10% of array from each other

Code: (Select All)
 41     70     29     91     18     2.413793     .4142857
59     24     83     92     38     .2891566     3.458333
14     32     46     93     44     .6956522     1.4375
23     10     33     94     88     .3030303     3.3
29     19     48     95     36     .3958333     2.526316
11     41     30     96     11     1.366667     .7317073
38     1     39     97     21     2.564103E-02     39
60     26     86     98     55     .3023256     3.307692
17     4     21     99     58     .1904762     5.25
26     100     74     100     59     1.351351     .74

I think this mine long-standing development
will help synthesize high-quality random
Write name of program in 1st line to copy & paste & save filename.bas
Insert program pictures: press print-screen-shot button
Open paint & Paste & Save as PNG
Add picture file to program topic

Russia looks world from future. Big data is peace data.
I never recommend anything & always write only about myself
Reply
#12
------
Reply
#13
A = 00
B = 01
C = 10
D = 11

in string

S = 000110110110110001101101101100011011011011

Personally I see couples

Code: (Select All)
00 00 01 11 10 01 11 10 01 11 10 01 ...
A  A  B  D  C  B  D  C  B  D  C  B ...
AABDCBDCBDCB ...


What creates another option for research
but in my visualization I need 3000 pieces of 0 and 1
without letters ABCD
but letters appear in my other wave-like theory

However I will try to read and understand theory
Write name of program in 1st line to copy & paste & save filename.bas
Insert program pictures: press print-screen-shot button
Open paint & Paste & Save as PNG
Add picture file to program topic

Russia looks world from future. Big data is peace data.
I never recommend anything & always write only about myself
Reply
#14
Thumbs Up 
(02-24-2023, 02:33 PM)Sprezzo Wrote: Alright I'll bite on this... just to remind of what's going on...

Consider this "random" sequence:

Code: (Select All)
S = 000110110110110001101101101100011011011011

Is it random? How random is it? One way to proceed is to transform the sequence into something shorter. Define this "alphabet"

A = 00
B = 01
C = 10
D = 11

... And then rewrite the sequence using these letters, replacing pairs of two digits:


Code: (Select All)
S = A B C D B C D A B C D B C D A B C D B C D

Now, the thing should be easier to analyze. Either proceed by eyeball, or proceed by defining yet another alphabet and repeating the previous idea. Either way, I can rewrite the sequence as:

Code: (Select All)
S = ABCDBCD ABCDBCD ABCDBCD

Showing lots of order now. In fact, now someone can see I just copied the string ABCDBCD three times, meaning the original sequence is three copies of: 00011011011011

Anyway, that's how this kind of problem is cracked. It can be generalized like crazy. http://barnes.x10host.com/pages/Binary-A...er-One.php

Thankyou for making total sense of what the heck maybe subject of Danilin reply? 
Seems to me I remember this topic from old forum.

Wish it were under it's own topic instead of hi-jacking Number Guessing thing but that's Danilin's fault.
Then I would bring up another old topic of searching for biggest repeating string then next then next...
So true randomness is least amounts of long repeating patterns, maybe? But then, that's like a pattern of non-patternness, like prime numbers.

But Prime numbers being random is no longer true and for further digression check this out: https://en.wikipedia.org/wiki/Formula_for_primes

Seems like the subject of randomness is loaded with paradoxes ie can there really be better random numbers?
Can there be a formula to rate just how random a sequence is?
b = b + ...
Reply
#15
??? "least amounts of long repeating patterns" ???

This is my BLIP theory

Binomial Logarithmic Integral Pyramidal Distribution
BLIP distribution of Random numbers

https://qb64forum.alephc.xyz/index.php?t...#msg139333
Reply #27 on: December 23, 2021, 05:32:30 pm

And somewhere in beginning of 2019


Synthesizing 3000 random numbers by my program of this page

and figuring out remainder of division by 2 I got 0 and 1
and checked BLIP

Result: it is quite consistent with theoretical
and it is also possible to check any 3000 pieces of 0 and 1

Theory ______ Average
[Image: blip3000.png]

Configuration: inverted ... pyramid

Quantum random observe principles of binomial distribution
Write name of program in 1st line to copy & paste & save filename.bas
Insert program pictures: press print-screen-shot button
Open paint & Paste & Save as PNG
Add picture file to program topic

Russia looks world from future. Big data is peace data.
I never recommend anything & always write only about myself
Reply
#16
(02-24-2023, 04:52 PM)DANILIN Wrote: ??? "least amounts of long repeating patterns" ???

This is my BLIP theory

Binomial Logarithmic Integral Pyramidal Distribution
BLIP distribution of Random numbers

https://qb64forum.alephc.xyz/index.php?t...#msg139333
Reply #27 on: December 23, 2021, 05:32:30 pm

and somewhere in beginning of 2019

Cute name, let me add some more letters

BLIPPED - Binomial Logarithmic Integral Pyramidal Permutation Enlighted Distribution

ponder that mouthful!
b = b + ...
Reply
#17
After translating and reading both pages
_barnes.x10host.com/pages/Binary-Analyzer/Binary-Analyzer-One.php
_barnes.x10host.com/pages/Binary-Analyzer/Binary-Analyzer-Two.php

I doubt proposed methodology

Main thing: how to check?

Has author created a sequence checking program through programs?

My method of decomposition into binomial spectra
accurately recognizes non-random types and 010101 and 00110011 and x0y1
Write name of program in 1st line to copy & paste & save filename.bas
Insert program pictures: press print-screen-shot button
Open paint & Paste & Save as PNG
Add picture file to program topic

Russia looks world from future. Big data is peace data.
I never recommend anything & always write only about myself
Reply
#18
Code: (Select All)
1 SCREEN _NEWIMAGE(1280, 720, 32)
2
3 FOR j = 0 TO 1
   4 CLS
   5 PRINT "Bite MY Lucky Seven"
   6 PRINT "Most games want you to guess from 1 to 100, but I'm smarter than them."
   7 PRINT "Choose any whole number from 0 to 127, and give me 7 guesses."
   8 PRINT "I bet after that time, I can tell you what the number is."
   9 PRINT CHR$(13); "Choose your number and press any key to begin"
   10 junk$ = INPUT$(1)
   11 guess = 64
   12 CLS
   13 FOR i = 5 TO 0 STEP -1
       14 guess = guess + (2 AND a) * 2 ^ (i) - (1 AND a) * 2 ^ (i + 1)
       15 PRINT "For Guess #"; (6 - i); ", my guess is"; guess
       16 PRINT CHR$(13); "Am I:  (0) Correct   (1) High   (2) Low"; CHR$(13)
       17 PRINT "PRESS 0, 1, or 2 please for your answer =>";
       18 a = VAL(INPUT$(1))
       19 PRINT a; CHR$(13); CHR$(13)
       20 i = i - ((a - 1) AND 2) / 2 * i 'answer 0, and we win
   21 NEXT
   22 guess = guess + (2 AND a) * 2 ^ (i) - (1 AND a) * 2 ^ (i +1)
   23 PRINT "Your number is "; guess
   24 PRINT
   25 PRINT "Would you like to:     (1) Try again"
   26 PRINT "                       (2) Run away crying, unable to stop my awesome power"
   27 a = VAL(INPUT$(1))
   28 j = 1 - (1 AND a)
29 NEXT
30 END


Here's a version of this type thing which I did ages ago for one of those QB64 contests.  The rules basically said it had to be a 30 line program, with no use of IF statements or regular decision evaluation routines such as WHILE and such.
Reply
#19
A cell program which is easier to create than to explain

A chain of 0 and 1 is created in array
and how strip are regrouped into segments in table
what is particularly visible: left column is constant

Meaning: to see if there are patterns among random ones

Formula 0 and 1 Int(Sin(i)+Cos(i)+0.5) or Int(rnd+0.5)

So far we see: computer random normal without patterns

Code: (Select All)
n = 1000: Dim d(80,80): Randomize Timer ' kletka.bas
Dim a(n): For i = 1 To n: a(i) = Int(rnd+0.5): Next
' wave ' a(i)=Sin(i)+Cos(i)
For k = 60 To 13 Step -1: s = Int(n/k): Screen 12

    f = 0: For i = 1 To s: For j = 1 To k ' DANILIN
    f = f+1: d(i,j) = a(f): Next: Next: Cls

    For i = 1 To s: For j = 1 To k
        If d(i,j) = 1 Then c = 7 Else c = 0 'color c=(i+j) Mod 5
            For m = 0 To 7:
            Line (i*8,j*8+m)-(i*8+7,j*8+m),c
    Next: Next: Next
_Delay .5: Next: End

Animations are always small 0.1 MB, I hope they are visible
or I will post them on a file sharing site

[Image: kletcos.gif]


[Image: kletrnd.gif]


Nobel Prize will not receive itself
Nobelevskaya premiya sama sebya ne poluchit
Нобелевская премия сама себя не получит
Le prix Nobel ne se recevra pas
Nobelpreis wird sich nicht erhalten
Il Premio Nobel non ricevera se stesso
Write name of program in 1st line to copy & paste & save filename.bas
Insert program pictures: press print-screen-shot button
Open paint & Paste & Save as PNG
Add picture file to program topic

Russia looks world from future. Big data is peace data.
I never recommend anything & always write only about myself
Reply




Users browsing this thread: 2 Guest(s)