Presentation is loading. Please wait.

Presentation is loading. Please wait.

Governor’s School for the Sciences Mathematics Day 13.

Similar presentations


Presentation on theme: "Governor’s School for the Sciences Mathematics Day 13."— Presentation transcript:

1 Governor’s School for the Sciences Mathematics Day 13

2 MOTD: John von Neumann 1903 to 1957 Built mathematical framework for quantum mechanics Worked in game theory Developed first modern day computer Developed cellular automata Pioneer of computer science

3 How GSS is like college More freedom and responsibility Some classes of interest; some required Classes tough; pace is fast Work is done outside of class Students better than average HS students

4 How college is not like GSS Freedom to get in big trouble and be completely irresponsible Instructor not always good or caring Classes not designed to be fun or neccesarily interesting Workload can be overwhelming Being smart does still not make you popular

5 Cellular Automata Cells – d-dim’l set of squares (cells): Each cell is in one of k states (or colors) and is a simple computer Each cell runs the same simple ‘program’ called a transition or update rule Rule gives next state depending on state of neighbors

6 Executing a CA Assign initial states to the cell array For each time cycle, execute the rule at each cell (all updates occur at the same time) The results can model physical patterns, generate random numbers and have other applications Group Exercise

7 Examples (d=1)

8 Details for 1D Associate the cells with the integers: …,-4,-3,-2,-1,0,1,2,3,4,… (infinite) State is designated: x(i) or x i Rule based on states of cells in neighborhood: N i = {j : |i-j|   },  is range Example , N i = {i-1, i, i+1} k states means k  different possible neighborhood state combinations Rule specifies future state for each possible combination

9 Simplest Case: d=1,  =1, k=1 Neighborhood of i has states x(i-1), x(i), x(i+1) Call them p, q, r Rules are arithmetic/logical combinations of p, q and r, like (p+r) mod 2 1 – (1-p)(1-q)(1-r) r and q p Or just an explicit set of outputs for each of the 8 possible neighbor state combos

10 Worksheet Start with the pattern and apply these rules 5 times Ex: p + r (mod 2) You Try A: r B: (p or q) or r C: 1-p*q

11 Results

12 (aside) Binary Arithmetic 2 states: denote them 0 and 1 The states of a collection of cells is just a list of 0s and 1s A list of 0s and 1s can be interpreted as the base-2 representation of a positive integer (and vice-versa!) 10110100 2 = 2 7 + 2 5 + 2 4 + 2 2 = 180 10 Use for numbering neighborhoods and rules

13 … and Boolean Algebra 1=on and 0=off or 1=true and 0=false If p and q are two values then not p = 1-p p and q = pq p or q = 1 – (1-p)(1-q) p xor q = p+q (mod 2) Any logical rule using two states can be written as an binary arithmetic expression

14 Naming Rules 8 possible nbhd patterns 2 possible outputs for each pattern 2 8 = 256 possible rules

15 Naming Rules (2) Given any rule, it produces 8 output values, one for each neighborhood Write outputs in order from 7 to 0 and interpret as a binary number Decimal value is the Rule Number Ex: Rule 30: 30 = 00011110 2 Rule 110: 110 = 01111000 2 Remember to read from right to left for states 0-7

16 Classification 4 basic cases for CAs Class 1: tends toward a limit point (like all 0s) Class 2: tends toward a cycle Class 3: chaotic behavior Class 4: more complex; capable of universal computation

17 Other Classification Totalistic: rule only depends on sum of neighboring values (2 4 = 16) Legal: totalistic, plus if sum=0, state must be 0 (2 3 = 8) Reversible: can go forward or back in time (without losing information)

18 #254 (C1) #170 (C2)#30 (C3) #110 (C4)

19 Finite State Machine S = finite set of states I = finite set of inputs O = finite set of outputs f s = a function that takes a state and an input and produces a state f o = a function that takes a state and produces an output Given a starting state and a string of inputs, apply f o and f s repeatedly to produce a string of outputs

20

21 Turing Machines A Turing machine is like a finite state machine, except: It can erase/write on the input It can read input forward or backward A Turing machine is an abstract algorithm and its existence and properties are used to say clever things about the algorithm, e.g. decidability and complexity

22 Universal Turing Machines There is a Turing machine which can simulate the action of any other Turing machine on any input It is called the Universal Turing Machine Basic idea: write a ‘program’ for a Turing machine and encode it on the input tape, the UTM reads the ‘program’ and executes it on the rest of the input; complicated due to lack of memory

23 CA and Turing Machines Rule 110 is a Universal Turing Machine There are CAs which are Universal CAs! (much more complicated than a UTM; serial versus infinitely parallel)

24 Lab Time Classification of all 256 rules for the simple case Each person will do 16 different rules; assignment in Lab Everyone must do their part! When done: work on your project


Download ppt "Governor’s School for the Sciences Mathematics Day 13."

Similar presentations


Ads by Google