0% found this document useful (0 votes)
6 views2 pages

Random Seq Gen

This document outlines an assignment for a course on Scientific Computing, focusing on generating pseudo-random numbers using cellular automata, specifically Rule 30. Students are required to program a Python script to evolve Rule 30 and analyze the results for randomness through a histogram. The assignment emphasizes the importance of clear and justified solutions, with a submission deadline of March 02, 2024.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Random Seq Gen

This document outlines an assignment for a course on Scientific Computing, focusing on generating pseudo-random numbers using cellular automata, specifically Rule 30. Students are required to program a Python script to evolve Rule 30 and analyze the results for randomness through a histogram. The assignment emphasizes the importance of clear and justified solutions, with a submission deadline of March 02, 2024.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

RANDOM SEQUENCE GENERATION BY CELLULAR AUTOMATA

Scientific Computing II
Fundación Universitaria Konrad Lorenz
February 24, 2024

You are expected to communicate accurately the solution of the exercises in this as-
signment. Full score will only be given to correct and completely justified answers.
Miraculous, obtuse and unnecessarily complex solutions will receive partial or null
score. You can ask any question of this assignment during class or through email:
[email protected].
The deadline to submit this assignment is March 02, 2024, 8.15am.
This assignment aims to guide you to understand how pseudo-random numbers are
generated.
Note: This homework is based on Wolfram’s article on how to generate pseudo-random
numbers using cellular automata.

Random numbers are extremely important for pure and applied math. Nevertheless, its
generation is hard. In order to generate consistent random numbers, the algorithm doing that
has to pass many randomness tests in order to be applicable. Nevertheless, computers cannot
generate random numbers from the void: all algorithms require a seed that initializes the
generator, so that if the seed we use is the same, we will retrieve the same random numbers.
That’s why generated random numbers are usually called pseudo-random numbers.
A way to generate random numbers is using rule 30, which is a 1D cellular automata
model (see Figure 1). In this assignment, you are expected to program a Python script
able to generate pseudo-random numbers and then test that they are ”random” using a
histogram.
1. (0/20) Let a be a 1-dimensional array containing 1 or 0, such that cell i is alive (dead)
at time t if ai (t) = 1 (or 0, respectively). Show that the set of rules of Rule 30 is equivalent
to the following discrete dynamical system.

ai (t + 1) = ai−1 (t) XOR (ai (t) OR ai+1 (t))


(1)
= (ai−1 (t) + ai (t) + ai+1 (t) + ai (t)ai+1 (t)) mod 2.

2. (0/20) Write a Python script that evolves Rule 30 for a single alive cell at t = 0 till
t = 1e6 (one million steps). You are expected to vectorize your code and it should run
smoothly and fast (optimize your code!).
3. (0/10) From the previous item, you should have the values of the central column (where
was the alive cell at t = 0). It is said that this column is chaotic. Use it to generate random
numbers from 0 to 7, and then graph a histogram to study if the appearance of these numbers
is uniform.
1
Figure 1. The upper row of this figure represents how this rule works. For
example, the first rule implies that three alive cells will lead to a central dead
cell (overpopulation). On the other hand, the grid below the rules represents
how the system evolves, starting from the first row, and ending in the last row,
for a single initial alive cell.

You might also like