Exercise 4: Markov Processes, Cellular Automata and Fuzzy Logic

Similar documents
Cellular automata are idealized models of complex systems Large network of simple components Limited communication among components No central

Lab 6d: Self-Erecting Inverted Pendulum (SEIP)

Introduction to Artificial Life and Cellular Automata. Cellular Automata

Cellular Automata. History. 1-Dimensional CA. 1-Dimensional CA. Ozalp Babaoglu

Modelling with cellular automata

Discrete Tranformation of Output in Cellular Automata

LABORATORY IV OSCILLATIONS

PHYSICS 3266 SPRING 2016

biologically-inspired computing lecture 12 Informatics luis rocha 2015 INDIANA UNIVERSITY biologically Inspired computing

Linear Temporal Logic (LTL)

Vectors a vector is a quantity that has both a magnitude (size) and a direction

Hybrid Control and Switched Systems. Lecture #1 Hybrid systems are everywhere: Examples

Motivation. Evolution has rediscovered several times multicellularity as a way to build complex living systems

Math 2210Q (Roby) Practice Midterm #1 Solutions Fall 2017

ACTIVITY 2: Motion with a Continuous Force

Basic counting techniques. Periklis A. Papakonstantinou Rutgers Business School

AHL 9.1 Energy transformation

Cellular Automata. Jason Frank Mathematical Institute

Phasor mathematics. Resources and methods for learning about these subjects (list a few here, in preparation for your research):

Inverted Pendulum. Objectives

Chapter 1: Logic systems

Mitchell Chapter 10. Living systems are open systems that exchange energy, materials & information

SOLUTIONS TO EXERCISES FOR MATHEMATICS 133 Part 1. I. Topics from linear algebra

Seminaar Abstrakte Wiskunde Seminar in Abstract Mathematics Lecture notes in progress (27 March 2010)

Propositional Logic. Fall () Propositional Logic Fall / 30

1. Introduction to commutative rings and fields

Introduction to Scientific Modeling CS 365, Fall 2011 Cellular Automata

Intelligent Systems:

PHYSICS 220. Lecture 15. Textbook Sections Lecture 15 Purdue University, Physics 220 1

Linearize a non-linear system at an appropriately chosen point to derive an LTI system with A, B,C, D matrices

The fundamental theorem of calculus for definite integration helped us to compute If has an anti-derivative,

Lecture 4: Proposition, Connectives and Truth Tables

Physics Mechanics. Lecture 32 Oscillations II

Semester I lab quiz Study Guide (Mechanics) Physics 135/163

Daba Meshesha Gusu and O.Chandra Sekhara Reddy 1

HW#9: Energy Conversion and Conservation of Energy

arxiv: v1 [cs.fl] 17 May 2017

Chapter 2: Finite Automata

SCIENCE PROGRAM CALCULUS III

C. points X and Y only. D. points O, X and Y only. (Total 1 mark)

Using first-order logic, formalize the following knowledge:

Classification of two-dimensional binary cellular automata with respect to surjectivity

The min cost flow problem Course notes for Optimization Spring 2007

Interactions Between Two Non-Stationary Pendulums

Finish section 3.6 on Determinants and connections to matrix inverses. Use last week's notes. Then if we have time on Tuesday, begin:

STUDY GUIDE 4: Equilibrium, Angular Kinematics, and Dynamics

Balancing and Control of a Freely-Swinging Pendulum Using a Model-Free Reinforcement Learning Algorithm

Cellular Automata CS 591 Complex Adaptive Systems Spring Professor: Melanie Moses 2/02/09

G-GPE Explaining the equation for a circle

Complexity and NP-completeness

Direct Proof MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Direct Proof Fall / 24

Rolling with slipping experiment Virtual Laboratory Guide

A SHORT INTRODUCTION TO ADAMS

Extension of cellular automata by introducing an algorithm of recursive estimation of neighbors

Previous Exam Questions, Chapter 2

Numerical Analysis Lecture Notes

CSCE 750 Final Exam Answer Key Wednesday December 7, 2005

Partial differential equations

II. Cellular Automata 8/27/03 1

CHAPTER 7: OSCILLATORY MOTION REQUIRES A SET OF CONDITIONS

Physics for Scientists and Engineers 4th Edition, 2017

3 : Representation of Undirected GM

New Possibilities for Cellular Automata in Cryptography

SCIENCE PROGRAM CALCULUS III

SC102 Physical Science B

A Simple Model s Best Hope: A Brief Introduction to Universality

A SHORT INTRODUCTION TO ADAMS

AMBIGUITY PROBLEMS WITH POLAR COORDINATES

Mass on a Horizontal Spring

PHYSICS 289 Experiment 1 Fall 2006 SIMPLE HARMONIC MOTION I

Cellular Automata. and beyond. The World of Simple Programs. Christian Jacob

The Quest for Small Universal Cellular Automata Nicolas Ollinger LIP, ENS Lyon, France. 8 july 2002 / ICALP 2002 / Málaga, Spain

Linear Algebra Done Wrong. Sergei Treil. Department of Mathematics, Brown University

The Harmonic Oscillator: Zero Point Energy and Tunneling

#1 Describe substances and their behavior using the definitions and

Follow links Class Use and other Permissions. For more information, send to:

Chaos, Complexity, and Inference (36-462)

28. Pendulum phase portrait Draw the phase portrait for the pendulum (supported by an inextensible rod)

Problem Solver Skill 5. Defines multiple or complex problems and brainstorms a variety of solutions

MATHEMATICS SYLLABUS SECONDARY 6th YEAR

CITS4211 Mid-semester test 2011

Lab 5a: Pole Placement for the Inverted Pendulum

Chaos, Complexity, and Inference (36-462)

UNIVERSITY OF BOLTON SCHOOL OF ENGINEERING BENG (HONS) ELECTRICAL & ELECTRONICS ENGINEERING EXAMINATION SEMESTER /2017

Final Exam, Machine Learning, Spring 2009

Chapter 6. Second order differential equations

ARTIFICIAL NEURAL NETWORK PART I HANIEH BORHANAZAD

Logical design of digital systems

Image Encryption and Decryption Algorithm Using Two Dimensional Cellular Automata Rules In Cryptography

Cellular Automata. ,C ) (t ) ,..., C i +[ K / 2] Cellular Automata. x > N : C x ! N. = C x. x < 1: C x. = C N+ x.

Lecture 1, August 21, 2017

Lecture Notes On THEORY OF COMPUTATION MODULE -1 UNIT - 2

8.012 Physics I: Classical Mechanics Fall 2008

CSE 105 Homework 1 Due: Monday October 9, Instructions. should be on each page of the submission.

Lecture 1: Introduction Introduction

PRACTICE QUESTION PAPER WITH SOLUTION CLASS XI PHYSICS

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science Algorithms For Inference Fall 2014

LMI Methods in Optimal and Robust Control

Discrete Event Systems Exam

Harvard CS 121 and CSCI E-121 Lecture 22: The P vs. NP Question and NP-completeness

Transcription:

Exercise 4: Markov Processes, Cellular Automata and Fuzzy Logic Formal Methods II, Fall Semester 2013 Distributed: 8.11.2013 Due Date: 29.11.2013 Send your solutions to: tobias.klauser@uzh.ch or deliver them in class. Markov Processes Theoretical Exercise 1. A Markov model can be used for a simplified description of the behavior of cows. 1 Assume that a single cow s behavior can always be characterized by one of three states: it is either standing around, lying on the meadow, or eating grass. If it is standing, there is a 0.5 probability it starts eating; otherwise it will lie down with probability 0.3 or remain standing in all other cases. If the cow is lying on the meadow, it will stay that way in 70% of the cases; it will stand up again in 25% of the cases and will start eating in the remaining cases. If the cow is eating, it will change its behavior to just standing around with a probability of 0.2; otherwise it will either continue eating or lie down with equal probabilities. (a) (1 point) Draw a process diagram that shows the states and transition arcs between them labeled with their respective transition probabilities. (b) (2 points) Give the transition matrix and calculate the stationary distribution, i.e. the limiting probabilities of a cow being (standing, lying, eating). Hidden Markov Models Practical exercise 2. (5 points) Extract the T9-like predictive text input system (t9.py) together with the text file (PitPendulum.txt) from FM13 ex4.zip. This program prompts the user to input a sequence of key strokes (e.g. 43556) and prints out the most probable sequence of hidden states corresponding to the observed sequence (in our case, hello) as demonstrated during the lecture. Modify the code in order to obtain an iphone-like predictive text input system: In other words, we would like to input a sequence of key strokes (e.g. whst), and see what the system suggests us (in our case, something like what which sounds more English correcting the s into the letter a which lies next to it on the iphone keyboard). 1 This example is inspired by the winner of the 2013 Ig Nobel Prize in probability, Are Cows More Likely to Lie Down the Longer They Stand?, B. J. Tolkamp, et al., Applied Animal Behaviour Science, vol. 124, nos. 1-2, 2010, pp. 110. - See http://www.improbable.com/ig/winners/#ig2013 for more information. 1

Obviously, only using a Hidden Markov Model will never provide a perfect solution. Convince us however about the potential of your implementation by showing how a particular word (other than what) can still be correctly recognized even though several keys are mistyped! Cellular Automata 3. Given is a one-dimensional binary CA with a neighborhood of r = 1 with Wolfram s rule number 210. Apply periodic boundary condition (roll-over). (a) (1 point) Fill in the rule table (attention to the row order): a t n 1 a t n a t n+1 a t+1 n 1 1 1 1 1 0 1 0 1 1 0 0 0 1 1 0 1 0 0 0 1 0 0 0 2

(b) (2 points) Compute the CA (using cyclic boundary conditions) over 8 generations by hand (fill the grid). (c) (2 bonus points) Which rule number would lead to the inverted version 2 of the pattern above, assuming the CA starts with the inverted initial configuration? Shortly explain your reasoning. 4. (4 points) Mark each of the following statements about Cellular Automata (CA) as either true or false: Each cell of a CA can be looked upon as a Finite State Machine. In 1D CAs, the complexity of the emerging patterns depends mostly on the neighborhood radius r. Given an arbitrary elementary CA (with rule table) and the cell states at iteration i, the initial configuration can always be computed. Given the cell states of a 1D CA at arbitrary iterations i and i + 1 one can in some cases reproduce the rule table. In 2D CAs, the Moore neighborhood consists of a central cell and 4 neighbors whereas the von Neumann neighborhood consists of the central cell and 8 neighbors. The rule table of a 1D CA with fixed boundary conditions contains fewer rules than the rule table of a 1D CA with cyclic boundary conditions. CAs can be used to simulate processes from e.g. physics or biology. A majority of CA rules are capable of universal computation. t f 2 all black cells replaced by white cells and vice versa 3

Fuzzy Logic 5. In the lecture, you will be introduced to the inverted pendulum problem in which a pole mounted on top of a cart has to be balanced at the unstable equilibrium position. Figure 1: The inverted pendulum on the cart. Note: You may want to have a look at section 7.4 of the additional Fuzzy Logic course notes which describe this topic. Also the rather counter-intuitive choice of axes (see Figure 1) is explained there. Another problem with the same plant is the swing-up problem. In this case, the controller has to move the pole from the stable equilibrium to the unstable equilibrium instead of starting in the latter equilibrium and merely keeping the pole there. In physical terms, this is done by pumping energy into the system, leading to an increasingly high amplitude until the pole resides at the desired position. The original pole balancing controller algorithm kicks in at that point. Your task is to design a fuzzy logic controller for the swing-up problem using the variables defined in the lecture notes (in order to get a feeling of what the swing-up controller is supposed to do have a look at any relevant videos like the one shown in class). You do not have to care about the transition to the original balancing algorithm. In particular, you shall: (a) (1 point) Define the membership functions. (b) (2 points) Construct the set of fuzzy rules. Shortly explain your particular choice of rules. (c) (2 points) Using the respective geometric output functions, show how to defuzzyfy the output when, during one cycle, the kinetic energy is maximal and when it is minimal (these are two distinct cases). You can assume θ = 180, θ = 36 s for the case where kinetic energy is maximal and θ = 90, θ = 0 s where kinetic energy is minimal. 4

Hints / Tips Initially the pendulum is at the stable equilibrium position (θ = 180 ) with zero angular velocity. Assume that the boundaries of the input variables (angle and angular velocity) are: θ ( 180, 180 ], θ [ 90 /s, 90 /s] and the boundaries of the output variable (motor voltage) is v [ 10V, 10V ]. The goal of the stabilizing controller that was discussed during the lecture is to make the pendulum maintain its position at the unstable equilibrium point (θ = 0 ). The goal of the swing-up controller that you are supposed to design in this exercise is to pump energy into the system so that the pendulum starts swinging and eventually reaches a position near the equilibrium point (thats when the stabilizing controller is supposed to kick in). Pay attention to the definition of the positive and/or negative values of each variable that is shown in Figure 1 and in the supplemental lecture notes on fuzzy logic. 5