formalization of normal random variables - osman...

21
Formalization of Normal Random Variables M. Qasim, O. Hasan, M. Elleuch, S. Tahar Hardware Verification Group ECE Department, Concordia University, Montreal, Canada CICM 16 July 28, 2016

Upload: vantu

Post on 10-May-2018

225 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Formalization of Normal Random Variables - Osman …ohasan.seecs.nust.edu.pk/talks/CICM_2016_NORMAL.pdfECE Department, Concordia University ... of a random variable x is used to define

Formalization of Normal Random Variables

M. Qasim, O. Hasan, M. Elleuch, S. Tahar

Hardware Verification Group

ECE Department, Concordia University, Montreal, Canada

CICM 16 July 28, 2016

Page 2: Formalization of Normal Random Variables - Osman …ohasan.seecs.nust.edu.pk/talks/CICM_2016_NORMAL.pdfECE Department, Concordia University ... of a random variable x is used to define

O. Hasan 2 Formalization of Normal Random Variables

Outline

n Introduction and Motivation

n Formalization

n Case Study: Clock Synchronization in WSNs

n Conclusions

Page 3: Formalization of Normal Random Variables - Osman …ohasan.seecs.nust.edu.pk/talks/CICM_2016_NORMAL.pdfECE Department, Concordia University ... of a random variable x is used to define

O. Hasan 3 Formalization of Normal Random Variables

Motivation

Environmental Conditions

Aging Phenomena

Unpredictable Inputs

Noise

Page 4: Formalization of Normal Random Variables - Osman …ohasan.seecs.nust.edu.pk/talks/CICM_2016_NORMAL.pdfECE Department, Concordia University ... of a random variable x is used to define

O. Hasan 4 Formalization of Normal Random Variables

Probabilistic Analysis

Hardware Software

System Model

Property Satisfied?

Random Components

Probabilistic and Statistical Properties

Computer Based Analysis Framework

R andom  Variables(Discrete/

C ontinuous)

Page 5: Formalization of Normal Random Variables - Osman …ohasan.seecs.nust.edu.pk/talks/CICM_2016_NORMAL.pdfECE Department, Concordia University ... of a random variable x is used to define

O. Hasan 5 Formalization of Normal Random Variables

Probabilistic Analysis Basics – Random Variables

n Discrete Random Variables n Attain a countable number of values

n Example n  Dice[1, 6]

n Continuous Random Variables n Attain an uncountable number of values

n Examples n  Uniform (all real numbers in an interval [a,b])

Page 6: Formalization of Normal Random Variables - Osman …ohasan.seecs.nust.edu.pk/talks/CICM_2016_NORMAL.pdfECE Department, Concordia University ... of a random variable x is used to define

O. Hasan 6 Formalization of Normal Random Variables

Probabilistic Analysis Basics – Probabilistic Properties

Property Description Examples

Discrete Continuous

Probability Mass Function (PMF)

Probability that the random variable is equal to some number n

Cumulative Distribution Function (CDF)

Probability that the random variable is less than or equal to some number n

Probability Density Function (PDF)

Slope of CDF for continuous random variables

Page 7: Formalization of Normal Random Variables - Osman …ohasan.seecs.nust.edu.pk/talks/CICM_2016_NORMAL.pdfECE Department, Concordia University ... of a random variable x is used to define

O. Hasan 7 Formalization of Normal Random Variables

Probabilistic Analysis Basics – Statistical Properties

Property Description Illustration

Expectation

Long-run average value of a random variable

Variance Measure of dispersion of a random variable

Page 8: Formalization of Normal Random Variables - Osman …ohasan.seecs.nust.edu.pk/talks/CICM_2016_NORMAL.pdfECE Department, Concordia University ... of a random variable x is used to define

O. Hasan 8 Formalization of Normal Random Variables

Probabilistic Analysis Approaches

Simulation Formal Methods

Model Checking Theorem Proving

Random Components

Probabilistic State Machine

dgsd

Analysis

Accuracy

Expressiveness

Automation

Maturity

Approximate random variable

functions

Observing some test cases

û

ü

ü

ü

Probabilistic State Machine

Exhaustive Verification

ü

û

ü

û

Random variable functions

Mathematical Reasoning

ü

ü

û

û

Page 9: Formalization of Normal Random Variables - Osman …ohasan.seecs.nust.edu.pk/talks/CICM_2016_NORMAL.pdfECE Department, Concordia University ... of a random variable x is used to define

O. Hasan 9 Formalization of Normal Random Variables

Probabilistic Analysis using Theorem Proving

System Description

Sys

tem

Pro

pert

ies

(Dis

cret

e R

ando

m V

aria

bles

)

Sys

tem

Pro

pert

ies

(Con

tinuo

us R

ando

m V

aria

bles

)

System Model

Probabilistic Analysis

Proof Goals

Discrete Random Variables

Continuous Random Variables

Random Components

Probabilistic Properties

Statistical Properties

PMF

CDF

Expectation

Variance

Probabilistic Properties

Statistical Properties

CDF

PDF

Expectation

Variance

Theorem Prover

Formal Proofs of Properties

Higher-order logic Formalization of Probability Theory

•  [Hurd, 2002]: Probability Theory, Discrete Random Variables (RVs), PMF •  [Hasan, 2007]: Statistical Properties for Discrete RVs, CDF, Continuous RVs •  [Mhamdi, 2011] Probability (Arbitrary space) Lebesgue Integration, Multiple Continuous RVs Statistical Properties •  [Hölzl, 2012] Isabelle/HOL: Probability, Measure and Lebesgue Integration, Markov, Central Limit Theorem

Page 10: Formalization of Normal Random Variables - Osman …ohasan.seecs.nust.edu.pk/talks/CICM_2016_NORMAL.pdfECE Department, Concordia University ... of a random variable x is used to define

O. Hasan 10 Formalization of Normal Random Variables

Paper Contributions

n Formalization of Probability Density Function (PDF)

n Formalization of Normal Random Variable

n Enormous Applications

n Sample mean of most distributions can be treated as Normally Distributed

n Case Study: Clock Synchronization in WSNs

Page 11: Formalization of Normal Random Variables - Osman …ohasan.seecs.nust.edu.pk/talks/CICM_2016_NORMAL.pdfECE Department, Concordia University ... of a random variable x is used to define

O. Hasan

Probability Density Function

n  PDF p(x) of a random variable x is used to define its distribution

n  The PDF of a random variable is formally defined as the Radon-Nikodym (RN) derivative of the probability measure with respect to the Lebesgue-Borel measure n  RN derivative and probability measure was available in HOL4

n  Lebesgue-Borel measure n  Ported from Isabelle/HOL [Hölzl, 2012] n  Some theorems and tactics (e.g. SET_TAC) also ported from the Lebesgue

measure theory of HOL-Light [Harrison, 2013]

11 Formalization of Normal Random Variables

Page 12: Formalization of Normal Random Variables - Osman …ohasan.seecs.nust.edu.pk/talks/CICM_2016_NORMAL.pdfECE Department, Concordia University ... of a random variable x is used to define

O. Hasan

Probability Density Function

n  The PDF of a random variable is formally defined as the Radon-Nikodym (RN) derivative of the probability measure with respect to the Lebesgue-Borel measure

12 Formalization of Normal Random Variables

Definition: Probability Density Function

Page 13: Formalization of Normal Random Variables - Osman …ohasan.seecs.nust.edu.pk/talks/CICM_2016_NORMAL.pdfECE Department, Concordia University ... of a random variable x is used to define

O. Hasan

Normal Random Variable

n Normal PDF

n  X is a real random variable, i.e., it is measurable from the probability space (p) to Borel space

n  The distribution of X is that of the Normal random variable 13 Formalization of Normal Random Variables

Definition: Normal Random Variable

Page 14: Formalization of Normal Random Variables - Osman …ohasan.seecs.nust.edu.pk/talks/CICM_2016_NORMAL.pdfECE Department, Concordia University ... of a random variable x is used to define

O. Hasan

Normal Random Variable – Properties

14 Formalization of Normal Random Variables

Theorem: PDF of a Normal random variable is non-negative

Theorem: PDF over the whole space is 1

Page 15: Formalization of Normal Random Variables - Osman …ohasan.seecs.nust.edu.pk/talks/CICM_2016_NORMAL.pdfECE Department, Concordia University ... of a random variable x is used to define

O. Hasan

Normal Random Variable – Properties

15 Formalization of Normal Random Variables

Theorem: PDF of a Normal random variable is symmetric around its mean

Theorem: PDF of a Normal random variable is symmetric around its mean

Page 16: Formalization of Normal Random Variables - Osman …ohasan.seecs.nust.edu.pk/talks/CICM_2016_NORMAL.pdfECE Department, Concordia University ... of a random variable x is used to define

O. Hasan

Normal Random Variable – Properties

16 Formalization of Normal Random Variables

Theorem: Summation of Normal Random Variables

n  The proofs of these properties not only ensure the correctness of our definitions but also facilitate the formal reasoning process about the Normal Random Variable

Page 17: Formalization of Normal Random Variables - Osman …ohasan.seecs.nust.edu.pk/talks/CICM_2016_NORMAL.pdfECE Department, Concordia University ... of a random variable x is used to define

O. Hasan

Wireless Sensor Network

Application: Probabilistic Clock Synchronization in WSNs

n Synchronizing receivers with one another n  Randomness in

Message delivery latency

n  Probabilistic bounds on clock synchronization error

n  single hop n  & multi-hop networks

17 Formalization of Normal Random Variables

Page 18: Formalization of Normal Random Variables - Osman …ohasan.seecs.nust.edu.pk/talks/CICM_2016_NORMAL.pdfECE Department, Concordia University ... of a random variable x is used to define

O. Hasan

Capturing the Randomness in the Latency

n Multiple pulses are sent from the sender to the set of receivers

n The difference in reception time at the receivers is plotted

18 Formalization of Normal Random Variables

Pairwise difference in packet reception time – Normally Distributed with mean = 0

S

R1 R2

R3

R4

R5 R3 – R4

Page 19: Formalization of Normal Random Variables - Osman …ohasan.seecs.nust.edu.pk/talks/CICM_2016_NORMAL.pdfECE Department, Concordia University ... of a random variable x is used to define

O. Hasan

Error Bounds – Single Hop

19 Formalization of Normal Random Variables

Theorem: Probability of synchronization error for single hop network

Page 20: Formalization of Normal Random Variables - Osman …ohasan.seecs.nust.edu.pk/talks/CICM_2016_NORMAL.pdfECE Department, Concordia University ... of a random variable x is used to define

O. Hasan 20 Formalization of Normal Random Variables

Conclusions

n Probabilistic Theorem Proving n  Exact Answers n  Useful for the analysis of Safety critical application

n Our Contributions n  Formalization of Probability Density Functions and

Normal random variables n  Case Study

n  Clock Synchronization in WSNs

n Future Work n  More Applications – Probabilistic Round off Error

Bounds in Computer Arithmetic

Page 21: Formalization of Normal Random Variables - Osman …ohasan.seecs.nust.edu.pk/talks/CICM_2016_NORMAL.pdfECE Department, Concordia University ... of a random variable x is used to define

O. Hasan 21 Formalization of Normal Random Variables

Thank you!