CSC 110 – Fluency in Information Technology Chapter 20: The random function and Chaos Dr. Curry Guinn.

Slides:



Advertisements
Similar presentations
Virtual Host: John Morales Revised: September 21, 2011 Project 4: Multi-media Lesson.
Advertisements

Generating Random Numbers
Random variables 1. Note  there is no chapter in the textbook that corresponds to this topic 2.
Mathematics and the Game of Poker
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 19 Scheduling IV.
CHAOS THEORY and the butterfly effect English presentation By: Assaad Moawad.
© 2003 School of Computing, University of Leeds SY32 Secure Computing, Lecture 15 Implementation Flaws Part 3: Randomness and Timing Issues.
Intro to Probability & Games
JokerStars: Online Card Playing William Sanville Milestone 4.
Jerad Hobgood.  24/7 Accessibility  Fast Games  No tipping  No travel  Find table in your price range  Play in more than one table at a time.
AJITESH VERMA 1.  Dictionary meaning of chaos- state of confusion lack of any order or control.  Chaos theory is a branch of mathematics which studies.
MOM! Phineas and Ferb are … Aims:
Chaos, Communication and Consciousness Module PH19510 Lecture 16 Chaos.
Monte Carlo Methods Versatile methods for analyzing the behavior of some activity, plan or process that involves uncertainty.
The challenge of poker NDHU CSIE AI Lab 羅仲耘. 2004/11/04the challenge of poker2 Outline Introduction Texas Hold’em rules Poki’s architecture Betting Strategy.
Some figures adapted from a 2004 Lecture by Larry Liebovitch, Ph.D. Chaos BIOL/CMSC 361: Emergence 1/29/08.
Lecture 14 Page 1 CS 236 Online Race Conditions A common cause of security bugs Usually involve multiprogramming or multithreaded programs Caused by different.
GamblingGambling What are the odds? Jessica Judd.
Chapter 12 Sections 1-3. Bell Ringer 6.The Excite Poll is an online poll at poll.excite.com. You click on an answer to become part of the sample. One.
Artificial Neural Networks And Texas Hold’em ECE 539 Final Project December 19, 2003 Andy Schultz.
By: John Cook 11/06/2009 PTTE John Cook 3/4/2016.
Chance We will base on the frequency theory to study chances (or probability).
Chapter 3 Generating Uniform Random Variables. In any kind of simulation, we need data, or we have to produce them. Especially in Monte Marco simulation.
Key Wrap Algorithm.
Money and Banking Lecture 10. Review of the Previous Lecture Application of Present Value Concept Compound Annual Rate Interest Rates vs Discount Rate.
Intro to Data Structures Concepts ● We've been working with classes and structures to form linked lists – a linked list is an example of something known.
Arrangements and Selections (and how they may be counted)
Section 5.5 Application: The Card Game of War. 5.5 Application: The Card Game of War A deck of cards is shuffled and dealt to two players The players.
Section 5.1 and 5.2 Probability
Mathematics for GCSE Science
Counting Principles Ex. Eight pieces of paper are numbered 1 to 8 and placed in a box. One piece of paper is drawn from the box, its number is written.
Collision Theory and Logic

Model Initialization Spring 2016 Kyle Imhoff.
Difference Between Chaos and Randomness
HOW SMALL PROBABILITIES AFFECT OUR LIFE?
Unit 1 Day 6: Simulations.
CSc 110, Spring 2017 Lecture 12: Random Numbers
Bell Ringer Damian thinks he can beat Mr. Haupt in a game of 5 card draw poker. Damian is dealt a full house, so he doesn’t discard any of his cards.
Game Theory Just last week:
Discrete Structures for Computer Science
Collision Theory and Logic
Python Random numbers Peter Wad Sackett.
The study of randomness
Day 6: Simulations Unit 1: Statistics.
Introduction to Programmng in Python
CSc 110, Autumn 2016 Lecture 13: Random Numbers
Understanding Randomness
JavaScript Functions.
CHAPTER 6 PROBABILITY & SIMULATION
Introduction CSE 1310 – Introduction to Computers and Programming
Problem Solving (design of programs) CS140: Introduction to Computing 1 8/26/13.
3.7 Simulations Unit 1: Statistics.
Random numbers Taken from notes by Dr. Neil Moore
Random Number Generation
Chapter 17 Thinking about Chance.
Lecture 2 – Monte Carlo method in finance
Variables and Data Types
Chapter 14 – From Randomness to Probability
Data types, assignment statements, and math functions allow you to compute You write a sequence of statements that tell the computer what needs to be done.
Python Random numbers Peter Wad Sackett.
Homework #5 — Monte Carlo Simulation
Blackjack: Counting Hands and Counting Cards
Day 6: Simulations Unit 1: Statistics.
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
Applications of Stacks and Queues
CHEMISTRY LABORATORY. CHEMISTRY LABORATORY … how the scientist goes about solving problems.
Computational Thinking
Presentation transcript:

CSC 110 – Fluency in Information Technology Chapter 20: The random function and Chaos Dr. Curry Guinn

Today’s Class Random Number Generation Randomness and Chaos Theory

Math.random() A common operation we want to perform with computers is to generate a random number We use this for Games (random shuffle, random throw of dice) Running simulations Having our programs (like games) behave in ways we haven’t seen before HiLo.java

How can a deterministic machine generate a random number? Remember: Computers are deterministic Given the same instructions, they perform the same thing every time So what’s random? Random numbers are generated using a pseudo-random number generator (PNG). The numbers aren’t really random but the sequence is so complex, humans can’t see the patterns. random_seed = random_seed * 1103515245 +12345; random_number = (random_seed / 65536) % 32768 Random.htm

Seeding a pseudo-random number generator The PNGs that computers use will generate the exact same “random” series of numbers given the same initial input (called the seed) Some common seeds that computers use Number of seconds since 1900 Number of milliseconds since the machine was booted Scientist often control the seed so they can run exactly the same “random” experiment again

Case Study: Online Poker Room The Link: http://www.cigital.com/papers/download/developer_gambling.pdf The Setting 1999 PlanetPoker internet card room Texas Hold’Em PlanetPoker published their random shuffling algorithm to demonstrate their integrity Common practice among internet card rooms

How many possible shuffles in Poker? There are 52 cards so … 52 possibilities for the top card 51 possibilities for the 2nd card 50 possibilities for the 3rd card … 52*51*50*…*2*1 = 52! 2^226 … a really, really big number Approximately 10^68

PlanetPoker’s PNG Randomize() uses the number of milliseconds since midnight There are only 86,400,000 milliseconds in a day Therefore, they can only generate 86,400,000 possible shuffles (much less than 10^68) Further, by synchronizing with their clock, you can get very close to guessing their time

Texas Hold’Em In Texas Hold’Em, each player gets two down cards and then all the players will share five up cards After an initial round of betting, where the players only see their hole cards, the first 3 shared cards are turned face up (called the flop)

At the time of the flop At the flop, a player knows a sequence of 5 cards in the shuffle. What is the likelihood of seeing those 5 cards in a shuffle? 52*51*50*49*48 1 in 311,875,200 These odds are such that we can find the “random” shuffle out of the set of 86,000,000 possible decks Once we find it, we know the all the cards dealt (and to be dealt) (Further, we also know what seed they used for that shuffle making it easier to synchronize our clocks)

What Poker Rooms Do Now Seed is modified by PokerStars User input: mouse movements, timing events True hardware random number generators (Intel’s for instance uses thermal “noise”) Other hardware solutions: quantum mechanics PokerStars

What is Chaos Theory? Traditional notion of chaos – unorganized, disorderly, random etc. But Chaos Theory has little to do with that traditional notion On the contrary, it actually tells you that not all that ‘chaos’ you see is due to chance, or random or caused by unknown factors Oxymoron term coined “Deterministic Randomness” Chaos Theory – It’s about the deterministic factors (non-linear relationships) that cause things to look random

A Simple Equation Xt = Xt-12 + c Chaos.zip If c = -1.1

C = -1.9

Chaotic Systems are Extremely Vulnerable to Initial Conditions The Butterfly Effect

Initial Conditions X(t0), Y(t0), Z(t0)... Clockwork Universe determimistic non-chaotic Initial Conditions X(t0), Y(t0), Z(t0)... Can compute all future X(t), Y(t), Z(t)... Equations

Initial Conditions X(t0), Y(t0), Z(t0)... Chaotic Universe determimistic chaotic Initial Conditions X(t0), Y(t0), Z(t0)... sensitivity to initial conditions Can not compute all future X(t), Y(t), Z(t)... Equations

Why Should You Care? Any complex process is vulnerable to chaotic behavior Weather Financial systems Economic theory Stock market Population models Physics Biology Chemistry