Genome Sciences 373 Genome Informatics Quiz Section 9 May 26 2015.

Slides:



Advertisements
Similar presentations
Generating Random Numbers
Advertisements

Intro to Simulation (using Excel) DSC340 Mike Pangburn.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. Chapter 18 Sampling Distribution Models.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. Chapter 18 Sampling Distribution Models.
Random Number Generation Graham Netherton Logan Stelly.
Random variables 1. Note  there is no chapter in the textbook that corresponds to this topic 2.
October 1999 Statistical Methods for Computer Science Marie desJardins CMSC 601 April 9, 2012 Material adapted.
Chapter 12 Probability © 2008 Pearson Addison-Wesley. All rights reserved.
The Estimation Problem How would we select parameters in the limiting case where we had ALL the data? k → l  l’ k→ l’ Intuitively, the actual frequencies.
Session 7a. Decision Models -- Prof. Juran2 Overview Monte Carlo Simulation –Basic concepts and history Excel Tricks –RAND(), IF, Boolean Crystal Ball.
Chapter 5 Understanding Randomness
AP Statistics Section 6.2 A Probability Models
The Geometric Distributions Section Starter Fred Funk hits his tee shots straight most of the time. In fact, last year he put 78% of his.
Statistical Tests How to tell if something (or somethings) is different from something else.
Discrete Event Simulation How to generate RV according to a specified distribution? geometric Poisson etc. Example of a DEVS: repair problem.
1 Random numbers Random  completely unpredictable. No way to determine in advance what value will be chosen from a set of equally probable elements. Impossible.
Random numbers in Python Nobody knows what’s next...
Simple Random Sample How to make sure your sample is good... or hopefully good... maybe...
Computer Security CS 426 Lecture 3
Simulation.
Genome Sciences 373 Genome Informatics Quiz Section 4 April 21, 2015.
Binomial PDF and CDF Section Starter Five marbles are on a table. Two of them are going to be painted with a “W” and the rest will be painted.
Introduction to Computing Using Python Chapter 6  Encoding of String Characters  Randomness and Random Sampling.
Binomial & Geometric Random Variables §6-3. Goals: Binomial settings and binomial random variables Binomial probabilities Mean and standard deviation.
Probability Models Chapter 17.
Random Number Generators CISC/QCSE 810. What is random? Flip 10 coins: how many do you expect will be heads? Measure 100 people: how are their heights.
MTH 161: Introduction To Statistics
Random Numbers CSE 331 Section 2 James Daly. Randomness Most algorithms we’ve talked about have been deterministic The same inputs always give the same.
Chapter 11 – Understanding Randomness 1. What is a random event? Nobody can guess the outcome before it happens. Let’s try an experiment. On the next page.
Warm-up Grab a die and roll it 10 times and record how many times you roll a 5. Repeat this 7 times and record results. This time roll the die until you.
Understanding Randomness Chapter 11. Why Be Random? What is it about chance outcomes being random that makes random selection seem fair? Two things: –
Random Number Generators 1. Random number generation is a method of producing a sequence of numbers that lack any discernible pattern. Random Number Generators.
CIS 2033 based on Dekking et al. A Modern Introduction to Probability and Statistics Michael Baron. Probability and Statistics for Computer Scientists,
Your mail-order company advertises that it ships 90% of its orders within three working days. You select an SRS of 100 of the 5000 orders received in.
Week 7 - Wednesday.  What did we talk about last time?  scanf()  Memory allocation  malloc()  free()
Copyright © 2010, 2007, 2004 Pearson Education, Inc. Chapter 11 Understanding Randomness.
AP STATISTICS Objective: Understanding Randomness Do Now: Take out any completed contracts, personal profiles, as well as your written design study. HW:
Chapter 11 Understanding Randomness. What is Randomness? Some things that are random: Rolling dice Shuffling cards Lotteries Bingo Flipping a coin.
Loops Wrap Up 10/21/13. Topics *Sentinel Loops *Nested Loops *Random Numbers.
Slide Understanding Randomness.  What is it about chance outcomes being random that makes random selection seem fair? Two things:  Nobody can.
1 Chapter 4, Part 1 Repeated Observations Independent Events The Multiplication Rule Conditional Probability.
Understanding Randomness.  Many phenomena in the world are random: ◦ Nobody can guess the outcome before it happens. ◦ When we want things to be fair,
Hypothesis Testing and the T Test. First: Lets Remember Z Scores So: you received a 75 on a test. How did you do? If I said the mean was 72 what do you.
Section 5.1.  Three ways to answer this question: 1. Actually carry out an experiment 2. Develop a probability model 3. Start with a model, and then.
Chapter 12 Section 1 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.
Random numbers in C++ Nobody knows what’s next....
Random Numbers RANDOM VS PSEUDO RANDOM. Truly Random numbers  From Wolfram: “A random number is a number chosen as if by chance from some specified distribution.
September 7, 2004ICP: Chapter 3: Control Structures1 Introduction to Computer Programming Chapter 3: Control Structures Michael Scherger Department of.
Probability Statistics Introduction This stuff can be a bit hard, but don’t be afraid We use probability for our purposes, so it will be a tool,
Simulations with Binomials Mean and S.D. of Binomials Section
Copyright © 2010, 2007, 2004 Pearson Education, Inc. Chapter 18 Sampling Distribution Models.
CS 115 Lecture 9 Augmented assignment; Boolean logic; random numbers Taken from notes by Dr. Neil Moore.
Statistics 11 Understanding Randomness. Example If you had a coin from someone, that they said ended up heads more often than tails, how would you test.
Stats 8/26/13 1. Check homework C11 #2-9 Ch 11 Practice
CS 115 Lecture 5 Math library; building a project Taken from notes by Dr. Neil Moore.
Chapter 8: The Binomial and Geometric Distributions 8.2 – The Geometric Distributions.
Key Wrap Algorithm.
Your friend has a hobby of generating random bit strings, and finding patterns in them. One day she come to you, excited and says: I found the strangest.
Introduction to programming in java Lecture 16 Random.
CS 115 Lecture Augmented assignment; Boolean logic; random numbers
Recap: If, elif, else If <True condition>:
Why they aren't really random
Continuous Random Variables
Python Random numbers Peter Wad Sackett.
What Stops Social Epidemics?
Random numbers Taken from notes by Dr. Neil Moore
PEDNA Notes Mon, Oct 27, 2008 Marc L. Smith
CS 115 Lecture 7 Augmented assignment; Boolean logic; random numbers
Python Random numbers Peter Wad Sackett.
Chapter 11 Probability.
Presentation transcript:

Genome Sciences 373 Genome Informatics Quiz Section 9 May

Random numbers: so intuitive but yet…

xkcd.com/221/ People don’t necessarily “get” randomness very well “Why does my iTunes shuffle play the same band twice in a row?” “Why did Solitaire put all of the aces at the bottom? That’s not very random.”

Random numbers: so intuitive but yet… There is no “test” to determine if a number is really random Most computer-generated random numbers are actually pseudo-random But, most pseudo-random numbers are “random enough” In fact, as we’ll see, sometimes we want the predictability

Random numbers: so intuitive but yet… True random number generators Come from physical processes like atmospheric or thermal noise Do not repeat periodically Not predictable Conceptually simple but usually hard to obtain Generated by algorithms Have periods, which may be arbitrarily long Can be more or less predictable, depending Can be initialized with a particular seed to yield a predictable outcome Pseudo-random number generators

Random numbers: so intuitive but yet… True random number generators Pseudo-random number generators source: Bo Allen [boallen.com] random.orgphp rand() function

Random numbers: so intuitive but yet… Defining a “seed” a seed lets us initialize the random number generator: sort of a “starting point” for the algorithm if you know the seed, the sequence of numbers is predictable if you don’t know the seed, the sequence is hopefully unpredictable (but still fixed)

Random numbers: so intuitive but yet… Defining a “seed” a seed lets us initialize the random number generator: sort of a “starting point” for the algorithm if you know the seed, the sequence of numbers is predictable if you don’t know the seed, the sequence is hopefully unpredictable (but still fixed)

Why would I not want predictable numbers? You’re sending a secret message and you need a code that’s really hard to crack You could set the seed to the current time (milliseconds) – hard to guess and maybe “random enough”

Why would I want predictable numbers? Let’s say you’re working on a program and you keep hitting a bug that you need to fix. Let’s say you’re submitting a paper involving simulations, and you want your work to be reproducible

Random numbers in python In python, we can import random and then set the seed using random.seed(my_seed)

Random numbers in python The pseudo-random number generator and its seed applies to all of the functions we’ve looked at: random roll of a die random float between 0 and 1 random column from an alignment for bootstrapping

Random numbers in python We can generate numbers from non-uniform distributions Normal distribution

Random numbers in python Other probability distributions (exponential, gamma, etc) have built-in generators in python What if our distribution of interest doesn’t have a built-in function (like binomial)?

Where do I set the seed if I want to make this reproducible?