Jumat, 26 Mei 2023

9. Information complexity and notion of randomness 10. Pseudo-random numbers

 Middle-Square Algorithm


- Algorithm:

1.Start with a number called the seed.
  (Mulailah dengan angka yang disebut benih)

2.Square it and extract the middle four digits. If the square has less than 8 digits, pad it with leading zeros until it’s eight digits long.

3.Repeat the process.

- Starting with a four digit seed, the middle square algorithm generates a sequence of random-looking numbers between 0 and 9,999. Xn+1 = middle four digits of (Xn ) 2

Tidak ada komentar:

Posting Komentar

Algoritma Depth First Search (DFS)

Algoritma Depth First Search (DFS) adalah salah satu algoritma pencarian graf yang digunakan untuk menjelajahi atau mencari semua simpul dal...