Falsification of randomness and transformation by sorting of pseudorandom sequences. Priority of Russia
Tags: rng, probability, logarithm, integral
Published: 2020-03-27 15:55:10

Falsification of randomness and transformation by sorting of pseudorandom sequences. Priority of Russia

Objective: to prove possibility of falsification of chance and reality of overcoming rigged chance. 

Accident natural, divided by integral of logarithmic spectra, predictable shows short range of repetitions and distance of repeats massively long absent, but sorting sequences results in spectra separation in view of theoretical. 

Gap of Education of Russia and USSR and CIS: integral and logarithm in lower grades do not study and subsequently consider simplest ostensibly difficult. 

![Danilin Formula 11](https://habrastorage.org/webt/08/l1/fp/08l1fp4ytxhytzfen4x9lkdm7ww.gif)

Designations should be understood literally: randomness is natural — natural, created without a computer. 

Program "Fake accident 1"

In sequence increases number of same in a row. 

		' dafalse11.bas qbasic
		OPEN "da11.txt" FOR OUTPUT AS #1
		FOR d = 1 TO 5: FOR s = 1 TO 100
		FOR i = 1 TO s: PRINT #1, 1: NEXT
		FOR i = 1 TO s: PRINT #1, 0: NEXT
		NEXT: NEXT: CLOSE

![Danilin Table 11](https://habrastorage.org/webt/oj/cu/2t/ojcu2tuhgskyxezyuvhxa6kadgq.png)

Column G shows absurd distribution with average 0.5.
Column A – name of experiment; 
B1 =average(C1:C50000) is mean value of sequence; 
Columns C...F – study of quantities in succession; 
Column J – random permutations; 
Column K – sequence after rearrangement; 
M1 =average(N1:N50000) is mean value of sequence;
Columns N...R – study number in a row. 

Exploring other criteria — it is possible to use other formulas, but illuminated technique available for understanding in elementary school. 

Up 500 cells before permutation of cells: unsatisfactory 

![Danilin Graph 11](https://habrastorage.org/webt/-p/hp/l1/-phpl1cyzlqsmbphrg7a6bjaaey.png)

Up 500 cells after permutation of cells: normal.

![Danilin Graph 22](https://habrastorage.org/webt/_f/yp/xs/_fypxsm_q9lmauodhbjh-m_fyg0.png)

Conclusion: identified an obvious forgery of form: equal to number of same in a row and converted. 

Program "False randomness 2"

In sequence increases number of same in a row, especially given algorithm validation. 

		' dafalse22.bas qbasic
		OPEN "da22.txt" FOR OUTPUT AS #1
		FOR k = 1 TO 100: FOR s = 1 TO 7
		FOR d = 1 TO 2^(7-s)
		FOR i = 1 TO s: PRINT #1, 1: NEXT
		FOR i = 1 TO s: PRINT #1, 0: NEXT
		NEXT: NEXT: NEXT: CLOSE

![Danilin Table 22](https://habrastorage.org/webt/ms/to/qh/mstoqh9sthio-aclrarhmqak82m.png)

Up 500 cells before permutation of cells: unsatisfactory 

![Danilin Graph 33](https://habrastorage.org/webt/wd/0m/li/wd0mliuttaglnudzh2zu-kloduo.png)

Up 500 cells after permutation of cells: normal 

![Danilin Graph 44](https://habrastorage.org/webt/fp/aj/b5/fpajb5xke-ea4tsafiztcfndjz0.png)

Conclusion: it was found a clever fake, it's not programmed all possible options and see bias because of synthesis algorithm. 

False shuffled sequence becomes a sequence of random. 

Conclusion: to identify a fake sequence really. 

Programs datasov.bas and datasov.cs is a permutation of elements of original array by sorting array inverted. 

Program changes in language qbasic 

		' datasov.bas
		DIM a(55000), d(55000)
		OPEN "aa.txt" FOR INPUT AS #1
		OPEN "dd.txt" FOR OUTPUT AS #2
		FOR i = 1 TO 55000
		    INPUT #1, a(i): d(55000 - i + 1) = a(i):NEXT
		FOR i = 1 TO 54999: FOR j = i TO 55000
		        IF d(i) > d(j) THEN SWAP d(i), d(j): SWAP a(i), a(j)
		NEXT: NEXT
		FOR i = 1 TO 55000: PRINT #2, a(i): NEXT: CLOSE

Program permutations in C#

		// datasov.cs
		using System; using System.Linq;
		using System.Collections.Generic;
		using System.Text; using System.IO;
		namespace tasov
		{ class Program
			{ static long[] a; static long[] d;
		        static void Main(string[] args)
		        { a = new long[55500]; d = new long[55500]; 
		var inpFile = new StreamReader("aa.txt");
		for (int i = 1; i <= 55000; i++) 
			{ a[i] = Convert.ToInt64(inpFile.ReadLine());
			d[55000-i+1] = a[i]; }
		for (int i = 1; i <= 54999; i++) 
		for (int j = i; j <= 55000; j++) 
			if (d[i] > d[j])
				{ var temp = d[i]; d[i] = d[j]; d[j] = temp;
				temp = a[i]; a[i] = a[j]; a[j] = temp; }
			var outFile = new StreamWriter("vv.txt");
		for (int i = 1; i <= 55000; i++) 
			outFile.WriteLine(a[i]);
		Console.ReadKey();}}}

Algorithm without built-in RNG reads array from source and creates array inverted and then sort reverse array shuffles original array and result is a normal sequence. 

Conclusion: reliable accident – a 2-sided integral accident. 

{% youtube YIJmgOTnkTU %}

![Danilin Formula 22](https://habrastorage.org/getpro/habr/comment_images/adf/f3c/0f0/adff3c0f01b8668ef0c386e6541ae368.gif)

My original formula N=LOG(1-C)/LOG(1-p) 
is too difficult so many years ago 
I found a simple formula 
for a reliability c=0.99=99% N=7+(5*(1/p-2)) 
confirmed graphically 

![Danilin Graf 55](https://habrastorage.org/getpro/habr/comment_images/9c5/eeb/56b/9c5eeb56b9b3a9acd9a5dafd7f6730db.png)

What we wanted to prove.