PATTERN RECOGNITION LAB 2 TA : Nouf Al-Harbi::

Slides:



Advertisements
Similar presentations
Lecture 5.
Advertisements

Probability Distributions CSLU 2850.Lo1 Spring 2008 Cameron McInally Fordham University May contain work from the Creative Commons.
Outline/Coverage Terms for reference Introduction
Engineering Statistics ECIV 2305 Chapter 2 Random Variables.
Slide 5-2 Copyright © 2008 Pearson Education, Inc. Chapter 5 Probability and Random Variables.
EXAMPLE 1 Construct a probability distribution
EXAMPLE 1 Construct a probability distribution Let X be a random variable that represents the sum when two six-sided dice are rolled. Make a table and.
Biostatistics Unit 4 Probability.
Biostatistics Unit 4 - Probability.
Some Basic Concepts Schaum's Outline of Elements of Statistics I: Descriptive Statistics & Probability Chuck Tappert and Allen Stix School of Computer.
1 Continuous random variables f(x) x. 2 Continuous random variables A discrete random variable has values that are isolated numbers, e.g.: Number of boys.
Chapter 6 The Normal Distribution and Other Continuous Distributions
QMS 6351 Statistics and Research Methods Probability and Probability distributions Chapter 4, page 161 Chapter 5 (5.1) Chapter 6 (6.2) Prof. Vera Adamchik.
Chapter 5: Continuous Random Variables
Business Statistics: A First Course, 5e © 2009 Prentice-Hall, Inc. Chap 6-1 Chapter 6 The Normal Distribution Business Statistics: A First Course 5 th.
Probability Distributions: Finite Random Variables.
Econ 482 Lecture 1 I. Administration: Introduction Syllabus Thursday, Jan 16 th, “Lab” class is from 5-6pm in Savery 117 II. Material: Start of Statistical.
Chapter 4 Continuous Random Variables and Probability Distributions
Chap 6-1 Copyright ©2013 Pearson Education, Inc. publishing as Prentice Hall Chapter 6 The Normal Distribution Business Statistics: A First Course 6 th.
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 6-1 Chapter 6 The Normal Distribution and Other Continuous Distributions.
Business Statistics: A Decision-Making Approach, 6e © 2005 Prentice-Hall, Inc. Chap 5-1 Introduction to Statistics Chapter 6 Continuous Probability Distributions.
Probability Distributions. Essential Question: What is a probability distribution and how is it displayed?
Chapter 7: Probability Lesson 6: Probability Distributions Mrs. Parziale.
Chapter 5.1 Probability Distributions.  A variable is defined as a characteristic or attribute that can assume different values.  Recall that a variable.
Basic Concepts of Probability Coach Bridges NOTES.
PATTERN RECOGNITION LAB 3 TA : Nouf Al-Harbi::
TOSS a Coin Toss a coin 50 times and record your results in a tally chart ht.
Random Variables an important concept in probability.
Random Variable The outcome of an experiment need not be a number, for example, the outcome when a coin is tossed can be 'heads' or 'tails'. However, we.
CY1B2 Statistics1 (ii) Poisson distribution The Poisson distribution resembles the binomial distribution if the probability of an accident is very small.
13-4 The Sine Function Today’s Objective: I can graph the sine function.
Continuous Random Variables Section Starter A 9-sided die has three faces that show 1, two faces that show 2, and one face each showing 3,
Basic Business Statistics
Probability and Distributions. Deterministic vs. Random Processes In deterministic processes, the outcome can be predicted exactly in advance Eg. Force.
AP STATISTICS Section 7.1 Random Variables. Objective: To be able to recognize discrete and continuous random variables and calculate probabilities using.
Basic Business Statistics, 11e © 2009 Prentice-Hall, Inc. Chap 6-1 The Normal Distribution.
Chapter 4 Continuous Random Variables and Probability Distributions
1 Lecture 5 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
1 Lecture 3 Post-Graduate Students Advanced Programming (Introduction to MATLAB) Code: ENG 505 Dr. Basheer M. Nasef Computers & Systems Dept.
CSE 474 Simulation Modeling | MUSHFIQUR ROUF CSE474:
Ch : Which Values Are Possible? Domain & Range.
Probability Distributions and Expected Value
Statistics for Managers Using Microsoft Excel, 5e © 2008 Pearson Prentice-Hall, Inc.Chap 6-1 Statistics for Managers Using Microsoft® Excel 5th Edition.
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc.. Chap 6-1 Chapter 6 The Normal Distribution and Other Continuous Distributions Basic Business.
Chap 6-1 Chapter 6 The Normal Distribution Statistics for Managers.
Objective – Students will be able to investigate graphs with different viewing windows or viewing screens. Therefore learning how important it is to choose.
Probability Distribution. Probability Distributions: Overview To understand probability distributions, it is important to understand variables and random.
Module 9.4 Random Numbers from Various Distributions -MC requires the use of unbiased random numbers.
Probability & Random Variables
12.SPECIAL PROBABILITY DISTRIBUTIONS
The Normal Model Chapter 6 Density Curves and Normal Distributions.
Copyright © Cengage Learning. All rights reserved. 8 PROBABILITY DISTRIBUTIONS AND STATISTICS.
Theoretical distributions: the Normal distribution.
Chapter 6 The Normal Distribution and Other Continuous Distributions
Chapter 5: Continuous Random Variables
Discrete Random Variables
PROBABILITY.
Communication Theory Lab (1)
The normal distribution
Suppose you roll two dice, and let X be sum of the dice. Then X is
Statistics for Managers Using Microsoft® Excel 5th Edition
AP Statistics Chapter 16 Notes.
Chapter 5: Continuous Random Variables
Chapter 5: Continuous Random Variables
Discrete Uniform distributions
Chapter 6 Continuous Probability Distributions
Uniform Probability Distribution
Electrical and Computer Engineering Department SUNY – New Paltz
The Geometric Distribution
Chapter 11 Probability.
Presentation transcript:

PATTERN RECOGNITION LAB 2 TA : Nouf Al-Harbi::

Lab objective:  Illustrate the uniform distribution of a random variable using Matlab 2

Theoretical Concept Part 1 3

Suppose a die is rolled. What is the probability that the die will land on 5 ? On 4, on 2 ….? Dice Experiment 4

 When a die is rolled  there are 6 possible outcomes  represented by: X = { 1, 2, 3, 4, 5, 6 }.  Each outcome is equally likely to occur  If a die is rolled 1200 times  T hen, each of outcome should occur  1200/6 = 200 times Frequency F(X) Outcome x Frequency distribution 5

Dice Experiment  What’s the probability for occurring each outcome..?  P(X = 6) = 200/1200 =1/6  P(X=3)=P(X=1)=200/1200=1/6  A probability distribution is a table or an equation that links each outcome of a statistical experiment with its probability of occurrence  If each outcome has the same probability then probability density function is called “uniform distribution” Probability P(X=x) Outcome x 1/ probability distribution 6

What’s uniform distribution..?  We obtain a uniform density function when the outcomes of an experiment (random process) are equally likely to occur. 7

Practical Applying Part 2 8

Applying dice experiment by Matlab 1. Generate N random values uniformly distributed in the closed range [1,6]. 2. Find the frequency distribution of each outcome (1-6)  (i.e. how many times each outcome occur?) 3. Find the probability density function p(x) 4. Plot p 9

Generate N random values uniformly distributed in the closed range [1,6]. Step 1 10

rand function rand(1,N)  Generates N random values uniformly distributed in the open range ]0,1[.  Write the following in Matlab & see the result:  r = rand(1,20)  generates 1-D array of one row and 20 columns  Random values range between 0 and 1  To change the period we can use fix function  11

fix function  x = fix( 6 * r ) + 1;  Writing the previous line converts r into random values in the closed period [1,6]  For Dice Experiment, What are the values of vector x represent..? 12

Find the frequency distribution of each outcome (1-6) Step 2 13

Find the frequency distribution of outcome  we’ll make a counter for each outcome Event no …1200 outcome …2 N

Find the probability density function p(x) Step 3 15

Find the probability density function p(x) 16  We can easily calculate t he probability  the outcome frequency divided by the no. of events  P=f/N

Plot the probability density function p(x) Step 4 17

plot p(x) 18  plot function has different forms, depending on input arguments.  If you have two vectors y and x  plot (x,y) produces a graph of y versus x  If you have one vector x  plot(x) produces a graph of columns of x versus their index  To change the axis scale, that is x starts from xmin to xmax and y starts from ymin to ymax use the command: axis([xmin xmax ymin ymax])

plot p(x) 19  If we have more than one graph, we can use figure command to create a new figure window  It’s useful to avoid draw the new graph over the previous one  For more information about plot function and its forms type help plot on command window

1.N = 100; 2.r = rand(1,N); 3.x = fix( 6 * r ) + 1; 4.f = zeros(1,6); 5.for i = 1 : N 6.if x(i) == 1 f(1) = f(1) + 1; 7.elseif x(i) == 2 f(2) = f(2) + 1; 8.elseif x(i) == 3 f(3) = f(3) + 1; 9.elseif x(i) == 4 f(4) = f(4) + 1; 10.elseif x(i) == 5 f(5) = f(5) + 1; 11.else f(6) = f(6) + 1; 12.end 13.end 14.F 15.plot(f) 16.axis([ ]) 17.p = f /N 18.figure, plot(p) 19.axis([ ]) Full code Try larger values of N: (1000,10000) and notice the graph 20

Write a Matlab function to illustrate a uniform distribution of coin experiment. A function should take the number of events N as an argument Exercise 1 21