Branching with Random Numbers

Slides:



Advertisements
Similar presentations
Re-Exam 1 Practice Problems
Advertisements

This – that / these – those. This dog is jumping!
Exercise Exercise3.1 8 Exercise3.1 9 Exercise
Mean for sample of n=10 n = 10: t = 1.361df = 9Critical value = Conclusion: accept the null hypothesis; no difference between this sample.
Exercise Exercise Exercise Exercise
MAE 552 – Heuristic Optimization Lecture 26 April 1, 2002 Topic:Branch and Bound.
Exercise Exercise Exercise Exercise
Exercise Exercise6.1 7 Exercise6.1 8 Exercise6.1 9.
CS161 Introduction to Computer Science Character Data.
1 CS150 Introduction to Computer Science 1 Exponents & Output page & Section 3.8.
1 9/26/07CS150 Introduction to Computer Science 1 Exponents & Output page & Section 3.8.
1 Lab Session-VI CS121 Fall 2000 l HW#2 Assigned l Multiple Choice Selectors l The While Loop l Switch-Case-Break Exercise l The Counter Controlled Loops.
Chapter 4: Looping CSCI-UA 0002 – Introduction to Computer Programming Mr. Joel Kemp.
Fundamentals of Python: From First Programs Through Data Structures
Fundamentals of Python: First Programs
Rounding Off Whole Numbers © Math As A Second Language All Rights Reserved next #5 Taking the Fear out of Math.
Branching and Looping Examples, cont’d. Remember the generic triple jump world…
Shorter of two objects and changing color V2 Functions, events and setting the color in sequence and randomly This is a modification of the Changing Color.
computer
Alphabet Arch Power Point Slide Show Slides 1 and 2 are mainly for printing and using at a table/desk (unless you are fortunate enough to have a Promethean.
WEEK 4 Class Activities Lecturer’s slides.
Summer Computing Workshop. Introduction  Boolean Expressions – In programming, a Boolean expression is an expression that is either true or false. In.
Returning Students You registered last year. If you remember your , type it in at the top of the screen Click on “Password Help”
© Jalal Kawash Programming Peeking into Computer Science 1.
The Median of a Continuous Distribution
Working on exercises (a few notes first)‏. Comments Sometimes you want to make a comment in the Python code, to remind you what’s going on. Python ignores.
Summer Computing Workshop. Session 3 Conditional Branching  Conditional branching is used to alter the normal flow of execution depending on the value.
Effective C# Item 10 and 11. Understand the Pitfalls of GetHashCode Item 10.
Lecture 3 Types of Probability Distributions Dr Peter Wheale.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 11 So Many Paths … So Little Time.
Tips & Techniques 6 Random Numbers and Random Motion Alice.
For Loop GCSE Computer Science – Python. For Loop The for loop iterates over the items in a sequence, which can be a string or a list (we will discuss.
Testing It is much better to have a plan when testing your programs than it is to just randomly try values in a haphazard fashion. Testing Strategies:
2.3 Output Formatting. Outputting Format Specify the number of spaces, “c”, used to print an integer value with specifier %cd, e.g., %3d, %4d. E.g. printf.
Presentation Title Subheading goes here.
Functional testing, Equivalence class testing
Welcome to Simple Bowling
More on Problem Solving
Chapter 1 Introduction to Java
Chapter 3: Decisions and Loops
5. Function (2) and Exercises
Integration Finding the Area Under a Curve & the Area Between Two Lines AS Maths with Liz.
Top 6 Strategies of Digital Marketing.
Random Testing.
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Random Another fun module.
Visual Basic .NET BASICS
String Manipulation Part 2
More Loops.
Intro to Computer Science CS1510 Dr. Sarah Diesburg
Приложение 2 The Cheshire Cat Слайд
Multiple Selections (ELIF Statements)
In-Class Exercises: Interpretations of Probability
Topic 1: Problem Solving
flow charts and system diagrams
Using Functions
Microsoft Visual Basic 2005: Reloaded Second Edition
Input Repeat until Concatenation
Arrays.
By: Cara Edenfield groupbygroup.wordpress.com
CHAPTER 3: String And Numeric Data In Python
String Processing 1 MIS 3406 Department of MIS Fox School of Business
Cat.
CSE 1020:Software Development
Modified at -
We have the following incomplete B&B tree:
Primary School Computing
UNIT-4 BLACKBOX AND WHITEBOX TESTING
Welcome to Simple Bowling
Presentation transcript:

Branching with Random Numbers

Branching with Random Numbers In the previous version of this world, we asked the user for input to determine who would jump. In this exercise, you will have the computer randomly select who will jump.

Random numbers in Alice Alice has a world function that will return a random number in a specified range. The numbers it returns are six-digit numbers The numbers are >= to the lower bound specified and < the upper bound specified.

Random numbers returned Alice will return numbers such as: 1.83475 0.41257 2.89175 0 <= X < 3

Modify our If/Else If the random number is < 1, Alice jumps If > 1 but < 2, the White Rabbit jumps If >= 2 but < 3, the Cheshire Cat jumps

What goes here?

?

Alternate strategy