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
2 Outline n Introduction and Motivation n Formalization n Case Study: Clock Synchronization in WSNs n Conclusions
3 Motivation Noise Aging Phenomena Environmental Conditions Unpredictable Inputs
4 Probabilistic Analysis Random Components R andom Variables (Dis crete/ C ontinuous) Hardware Software System Model Probabilistic and Statistical Properties Computer Based Analysis Framework Property Satisfied?
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]) 5
6 Probabilistic Analysis Basics Probabilistic Properties Property Description Examples Discrete Continuous Probability Mass Function (PMF) Cumulative Distribution Function (CDF) Probability Density Function (PDF) Probability that the random variable is equal to some number n Probability that the random variable is less than or equal to some number n Slope of CDF for continuous random variables
7 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
8 Probabilistic Analysis Approaches Random Components Analysis Accuracy Expressiveness Simulation Approximate Probabilistic random State Machine variable functions dgsd Observing some test cases û ü Model Checking Probabilistic State Machine Exhaustive Verification ü û Formal Methods Theorem Proving Random variable functions Mathematical Reasoning ü ü Automation ü ü û Maturity ü û û
Probabilistic Analysis using Theorem Proving System Properties (Discrete Random Variables) Higher-order logic Formalization of Probability Theory Discrete Random Variables Probabilistic Properties PMF CDF Statistical Properties Expectation Variance System Description Random Components System Model Probabilistic Analysis Proof Goals Theorem Prover Continuous Random Variables Probabilistic Properties Statistical Properties 9 CDF PDF Expectation Variance Formal Proofs of Properties [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 System Properties (Continuous 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 10
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] O. Hasan Formalization of Normal Random Variables 11
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 Definition: Probability Density Function O. Hasan Formalization of Normal Random Variables 12
Normal Random Variable n Normal PDF Definition: Normal Random Variable 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 O. Hasan Formalization of Normal Random Variables 13
Normal Random Variable Properties Theorem: PDF of a Normal random variable is non-negative Theorem: PDF over the whole space is 1 O. Hasan Formalization of Normal Random Variables 14
Normal Random Variable Properties Theorem: PDF of a Normal random variable is symmetric around its mean Theorem: PDF of a Normal random variable is symmetric around its mean O. Hasan Formalization of Normal Random Variables 15
Normal Random Variable Properties 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 O. Hasan Formalization of Normal Random Variables 16
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 Wireless Sensor Network O. Hasan Formalization of Normal Random Variables 17
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 R1 S R2 R3 R5 R3 R4 R4 Pairwise difference in packet reception time Normally Distributed with mean = 0 O. Hasan Formalization of Normal Random Variables 18
Error Bounds Single Hop Theorem: Probability of synchronization error for single hop network O. Hasan Formalization of Normal Random Variables 19
20 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
Thank you! 21