Probability Basics
Learn Probability Basics (Foundations, Data Structures & Algorithms) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Probability Basics for Algorithms Probability = favourable outcomes รท total outcomes (when all are equally likely), a number from 0 to 1. The expected value of a random quantity is the sum of each value times its probability: for a fair die it is (1+2+...+6)/6 = 3.5 . Expectation is what randomized algorithms such as quicksort with a random pivot are analysed with.