Presentation on theme: "SM2220 – Class 10 Finite Automata. SM2220 – Class 10 Finite Automata Computation theory Formal language."— Presentation transcript:
SM2220 – Class 10 Finite Automata
SM2220 – Class 10 Finite Automata Computation theory Formal language
SM2220 – Class 10 Finite Automata Provides an easy method for the design of interactive artworks. Relates to generative art through the use of regular grammar.
SM2220 – Class 10 From a functional point of view, computation can be considered as a black box which takes in symbols and produces symbols. Computation Input symbolsOutput symbols
SM2220 – Class 10 Using the year 1 Pd or Director program you have done, the same logic applies. VJ software Keyboard inputsVideo clips
SM2220 – Class 10 Imagine this strange Boolean algebra formula, ANDNOT A (1 or 0)
SM2220 – Class 10 The feedback loop introduces the element of time and most importantly, memory. ANDNOT A
SM2220 – Class 10 The current formula is not very stable. It can perform better with in introduction of another input. ANDNOT A
SM2220 – Class 10 ANDNOT A ANDNOT B The following is a more stable memory logic.
SM2220 – Class 10 The memory gives you the state (status) of the computing device. The previous one can only remember two states (1 bit information).
SM2220 – Class 10 Finite Automata is an abstract computing device capable of remembering finite number of states.
SM2220 – Class 10 A less abstract description? Nonlinear description of how an object can change its state over time, possibly in response to events in its environment. The Ultimate Guide to FSMs in Games – Dan Fu and Ryan Houlette
SM2220 – Class 10 It starts at an initial state. By accepting different inputs, it changes to different states. Eventually, it stops at an ending state.
SM2220 – Class 10 S0 S1 S2 a b b Simple example
SM2220 – Class 10 The diagram is known as a Graph in Mathematics. Each state is a node and each input symbol is a directed link. A graph is different from a tree that it can contain a loop.
SM2220 – Class 10 State transition table Current stateInputNext state S0aS1 S0bS2 S1bS2
SM2220 – Class 10 If you consider the input symbol sequence, you can notice the valid ones are, ab b All the other input symbol sequences are invalid.
SM2220 – Class 10 Essentially this simple finite automata defines a simple language which has only 2 alphabets: a, b. And the valid syntax for the language are the 2 sentences: ab and b.
SM2220 – Class 10 Such language is known as, Regular language Regular grammar Regular expression
SM2220 – Class 10 S0 S1 S3 S2 a a b b a b a, b More complicated example
SM2220 – Class 10 Exercise time Try to draw the transition table for the finite automata. Try to identify the regular language pattern.
SM2220 – Class 10 Current stateInputNext state
SM2220 – Class 10 Current stateInputNext state S0aS1 S0b(S2) S1aS3 S1b(S2) S2b(S2) S2aS1 S3a b
SM2220 – Class 10 To determine the language that the previous finite automata generates, we can trace the patterns, (ab)*b* b(ab)*b*
SM2220 – Class 10 Applications of Finite Automata
SM2220 – Class 10 If you start replacing the a, b symbols with sentences, plots, etc., you can end up with a piece of text like the Oulipo experiments.
SM2220 – Class 10 Gather Treasure Flee Fight Monster in sight Monster dead Simple application in game Cornered Monster away
SM2220 – Class 10 If you start replacing the states: S0, S1, etc. with scenes, movie clips or frames, you will end up with an interactive movie. The symbols: a, b will become your participants’ input, such as sensor values or keyboard inputs.
SM2220 – Class 10 Now, go back to our job assignment. See if the idea of Finite Automata can help you out.
SM2220 – Class 10 First, you determine how many states the artwork requires.
SM2220 – Class 10 Second, for each state, design what actions will be needed, e.g. to play a video or to stop a video.
SM2220 – Class 10 Next, you need to figure out for each state, what type of inputs will lead it to the next state. Note that each sensor/key has two status, i.e. from off to on and from on to off.
SM2220 – Class 10 We have 3 sensors (a, b, c in keyboard), which will be all of our inputs.
SM2220 – Class 10 We have 3 sensors (a, b, c in keyboard), which will be all of our inputs. We have 3 outputs (video 1, 2, 3).
SM2220 – Class 10 Start +a S1S2S3S4S5 -a +b -b -a +a +c -c -b +b
SM2220 – Class 10 Current stateInputNext state S0+aS1 -aS0 S1+bS2 -bS1 S2-aS3 +aS2 S3+cS4 -cS3 S4-bS5 +bS4
SM2220 – Class 10 InputCurrent stateNext state +aS0S1 S3S2 -aS1S0 S2S3 +bS1S2 S5S4 -bS2S1 S4S5 +cS3S4 -cS4S3
SM2220 – Class 10 Current stateVideo playing S0- S1Video 1 S2Video 1, 2 S3Video 2 S4Video 1, 2, 3 S5Video 3