Creating new worlds inside the computer COS 116: 2/14/2008 Sanjeev Arora.

Slides:



Advertisements
Similar presentations
Time averages and ensemble averages
Advertisements

Whats the use of chaos? Chris Budd. Is life predictable or unpredictable? Can we tell what is going to happen In the next second? In the next hour? In.
College of Information Technology & Design
Game of Life Rules and Games Linh Tran ECE 573. What is Life? Life is just one example of a cellular automaton, which is any system in which rules are.
Slides for Parallel Programming Techniques & Applications Using Networked Workstations & Parallel Computers 2nd ed., by B. Wilkinson & M
1 The Game of Life Supplement 2. 2 Background The Game of Life was devised by the British mathematician John Horton Conway in More sophisticated.
Week 9: Methods 1.  We have written lots of code so far  It has all been inside of the main() method  What about a big program?  The main() method.
1 Chapter 13 Artificial Life: Learning through Emergent Behavior.
1 Module 2: Fundamental Concepts Problems Programs –Programming languages.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 20 Instructor: Paul Beame.
CELLULAR AUTOMATON Presented by Rajini Singh.
Lecture 2: Fundamental Concepts
1 Module 2: Fundamental Concepts Problems Programs –Programming languages.
1 Lecture 1: Course Overview Course: CSE 360 Instructor: Dr. Eric Torng TA: Huamin Chen.
Animation and Rendering of Complex Water Surfaces Douglas Enright Stephen Marschner Ronald Fedkiw.
“It ain’t no good if it ain’t snappy enough.” (Efficient Computations) COS 116: 2/19/2008 Sanjeev Arora.
Program Design and Development
CS Summer 2005 Final class - July 1st Assorted fun topics in computability and complexity.
What computers just cannot do. (Part II) COS 116: 3/5/2008 Sanjeev Arora.
CS305j Introduction to Computing Two Dimensional Arrays 1 Topic 22 Two Dimensional Arrays "Computer Science is a science of abstraction -creating the right.
What computers just cannot do. COS 116: 2/28/2008 Sanjeev Arora.
1 GEM2505M Frederick H. Willeboordse Taming Chaos.
04/25/13 Halting Problem Discrete Structures (CS 173) Derek Hoiem, University of Illinois 1
Nawaf M Albadia Introduction. Components. Behavior & Characteristics. Classes & Rules. Grid Dimensions. Evolving Cellular Automata using Genetic.
General Purpose 3D Cellular Automata Modeller. A Regular Lattice of Cells, each obeying the same set of rules Simple rules for individual cells can produce.
Parallelization: Conway’s Game of Life. Cellular automata: Important for science Biology – Mapping brain tumor growth Ecology – Interactions of species.
Creating new worlds inside the computer COS 116: 2/10/2011 Sanjeev Arora.
Creating new worlds inside the computer COS 116, Spring 2012 Adam Finkelstein.
1a-1.1 Parallel Computing Demand for High Performance ITCS 4/5145 Parallel Programming UNC-Charlotte, B. Wilkinson Dec 27, 2012 slides1a-1.
Control Engineering Lecture #2 15 th March,2008. Introduction to control systems Reference: Phillips and Habor The first applications of feedback control.
CITS4403 Computational Modelling Fractals. A fractal is a mathematical set that typically displays self-similar patterns. Fractals may be exactly the.
Chapter 12: Simulation and Modeling
Lecture 8 – Stencil Pattern Stencil Pattern Parallel Computing CIS 410/510 Department of Computer and Information Science.
Discrete Mathematics Algorithms. Introduction  An algorithm is a finite set of instructions with the following characteristics:  Precision: steps are.
COMPUTATIONAL FLUID DYNAMICS IN REAL-TIME An Introduction to Simulation and Animation of Liquids and Gases.
CS559: Computer Graphics Lecture 38: Animation Li Zhang Spring 2008 Slides from Brian Curless at U of Washington.
STAT115 STAT225 BIST512 BIO298 - Intro to Computational Biology Python Tutorial II Monty Python, Game of Life and Sequence Alignment Feb 1, 2011 Daniel.
More Accurate Rate Estimation CS 170: Computing for the Sciences and Mathematics.
CS 484 – Artificial Intelligence1 Announcements Lab 4 due today, November 8 Homework 8 due Tuesday, November 13 ½ to 1 page description of final project.
9/10-11 DNA (Do Now Activity) 1.turn in the syllabus (last sheet only) 2.Turn in the safety sheet 3.have your binder out 4.Have your name card out Class.
“It ain’t no good if it ain’t snappy enough.” (Efficient Computations) COS 116, Spring 2010 Adam Finkelstein.
Hybrid Systems Concurrent Models of Computation EEN 417 Fall 2013.
Course material – G. Tempesti Course material will generally be available the day before the lecture Includes.
1 Chapter 13 Artificial Life: Learning through Emergent Behavior.
The Game of Life A simulation of "life". From simple rules, complex behavior arises Rules –A cell that is alive and has fewer than two live neighbors dies.
Topic 26 Two Dimensional Arrays "Computer Science is a science of abstraction -creating the right model for a problem and devising the appropriate mechanizable.
Cellular Automata. The Game The Game of Life is not your typical computer game. It is a 'cellular automation', and was invented by the Cambridge mathematician.
The Game of Life Erik Amelia Amy. What is the “Game of Life?” The “Game of Life” (often referred to as Life) is not your typical game. There are no actual.
Programming Principles Chapter 1. Objectives Discuss the program design process. Introduce the Game of Life. Discuss object oriented design. – Information.
“It ain’t no good if it ain’t snappy enough.” (Efficient Computations) COS 116, Spring 2011 Sanjeev Arora.
Finite State Machines (FSMs) and RAMs and CPUs COS 116, Spring 2011 Sanjeev Arora.
Design Issues. How to parallelize  Task decomposition  Data decomposition  Dataflow decomposition Jaruloj Chongstitvatana 2 Parallel Programming: Parallelization.
1 Section 2.1 Algorithms. 2 Algorithm A finite set of precise instructions for performing a computation or for solving a problem.
What computers just cannot do. (Part II) COS 116: 3/1/2011 Sanjeev Arora.
EARLY SCIENTISTS Early scientists did not know about the three states of matter so they believed that all elements were made from earth, air, fire and.
Cellular Automata Introduction  Cellular Automata originally devised in the late 1940s by Stan Ulam (a mathematician) and John von Neumann.  Originally.
An Agent Epidemic Model Toward a general model. Objectives n An epidemic is any attribute that is passed from one person to others in society è disease,
TRU-COMP3710 Artificial Life and Emergent Behavior1 Course Outline Part I – Introduction to Artificial Intelligence Part II – Classical Artificial Intelligence.
Cellular Respiration Unit 3. Cell Growth Review 1.Cells grow and divide by mitosis and meiosis (more cells made).  In order to grow and do work, cells.
Conway’s Game of Life Jess Barak Game Theory. History Invented by John Conway in 1970 Wanted to simplify problem from 1940s presented by John von Neumann.
Flowcharts C++ Lab. Algorithm An informal definition of an algorithm is: a step-by-step method for solving a problem or doing a task. Input data A step-by-step.
1 Structured Programming Arab Academy for Science and Technology CC112 Dr. Sherif Mohamed Tawfik The Course.
Modelling & Simulation of Semiconductor Devices Lecture 1 & 2 Introduction to Modelling & Simulation.
Technology on the Cutting Edge of Weather Research and Forecasting
Overview of Deterministic Computer Models
Illustrations of Simple Cellular Automata
CS 583 Fall 2006 Analysis of Algorithms
Basic Chemistry Chapter 11 Gases Chapter 11 Lecture
Stencil Pattern ITCS 4/5145 Parallel computing, UNC-Charlotte, B. Wilkinson Jan 28,
Presentation transcript:

Creating new worlds inside the computer COS 116: 2/14/2008 Sanjeev Arora

Pseudocode Simple instructions: involve +, -, ×, ÷ Compound instructions  Conditionals  Loops No need to sweat over exact wording during exams (unless it changes meaning!)

Discussion Time Did you figure out how to express the selection sort algorithm in pseudocode? Do for i= 1 to n-1 { find minimum element of the numbers in positions from i to n; swap that number with the i’th number; } Full pseudocode appears in Example 2 of Handout on pseudocode.

Algorithm defn; revisited “Pseudocode for turning a set of inputs into outputs in a finite amount of time” Questions to think about:  What class of computational tasks can be solved by algorithms?  How dependent is this class on the exact definition of pseudocode?

Today’s topic: Creating new worlds inside the computer. “simulation”

Conway’s Game of life Rules: At each step, in each cell  Survival: Critter survives if it has 2 or 3 neighbors.  Death: Critter dies if it has 1 or fewer neighbors, or more than 3.  Birth: New critter is born if cell is currently empty and 3 neighboring cells have critters. Example

Should use: n x n array A (for desired n) A[i, j] = 1 means critter lives in square, 0 means empty square Discussion Time How would you write pseudocode that simulates Game of Life?

Pseudocode for each step Do for i = 1 to n { Do for j = 1 to n { neighbors  A[i – 1, j - 1] + A[i – 1, j] + A[i – 1,j + 1] + A[i, j – 1] + A[i, j + 1] + A[i + 1, j – 1] + A[i + 1, j] + A[i + 1, j + 1] if ( neighbors = 2 OR neighbors = 3 ) then { B[i, j]  1 } else if ( neighbors = 1 … ) …etc. //see handout; Example 3// } Do for i = 1 to n { Do for j = 1 to n { A[i,j]  B[i,j] } }

Moral of the Game of Life? Simple local behavior can lead to complex global behavior (cf. Brian Hayes article; also handed out)

Next..

Twister simulation Divide region into 3D grid Identify laws of physics for air Navier Stokes equations: How does a block of air move when certain pressure, temperature and velocity differentials exist on its boundary?

Simulator pseudocode Initialize Grid using data from observations: surface and aircraft measurements, radar (NEXRAD) readings, etc. Do for i = 1 to n { Do for j = 1 to n { Do for k = 1 to n { Update state of Grid[i, j, k] } } 10ºC, 15 psi, 20% humidity 11ºC, 15 psi, 23% humidity etc.

Other examples of simulation [Turk 91] following: Weather forecasting Protein folding How patterns arise in plants and animals Animation

Display Q: How to display result of simulation? A: Computer graphics (later in course) [Enright and Fedkiw 02]

Physics of snow crystals “Cooling” – reduce amount of molecular motion Crystal growth: capture of nearby floating molecules Water vaporWater Snow crystals cooling further cooling

Bigger questions Can computer simulation be replaced by a “theory of weather”? A “theory of tornadoes”? Is there a “theory” that answers this type of problem:  Given: A starting configuration in the game of life  Output: “Yes” if the cell at position (100, 100) is ever occupied, “No” otherwise Alan TuringAlbert Einstein

Actually, reverse trend: “theory of matter” (particle physics) is becoming computational. Hayes (reading this week): The universe as a “cellular automaton” 1670 F = ma Today

Peeking ahead: Game of life is actually a “computer.” Readings for this week: (i) Brian Hayes article; first 5 pages (also on blackboard) (ii) Brooks pp and HW 1 Due next Thurs. A computer can simulate another computer (e.g., a Classic Mac simulator on a PC). Will explore the implications of this in a future lecture.