# Fixing Random: Techniques in C# (Eric Lippert)

Introduction to Fixing Random - Introduction to Discrete Distributions In this lesson, we will introduce discrete distributions. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/6592027682668544). Fixing Random - Discrete Distribution - Singleton Distribution In this lesson, we will explore the singleton distribution and Bernoulli distribution. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/4536167867351040). Fixing Random - Discrete Distribution - Discrete Distribution on C# Objects In this lesson, we will learn how to apply discrete distribution on C# objects, and write a wrapper class for it. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/4623109011275776). Fixing Random - Discrete Distribution - Alias Method In this lesson we will be implementing the Alias method. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/5694733751943168). Introduction to System.Random in C# - Who is This Course For? In this lesson, we point out the prerequisites and intended audience of this course. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/5649122205892608). Introduction to System.Random in C# - Disadvantages of System.Random in C# In this lesson, we introduce the System.Random in C# and highlight some of the problems with it. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/5466127775825920). Introduction to Fixing Random - Fix the Trivial Problems In this lesson, we will begin redesigning the Random library and have a look at the performance issues. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/5609291216060416). Introduction to Fixing Random - Introduction to Continuous Probability Distributions In this lesson, we give an introduction to continuous probability distribution. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/5244392270987264). Fixing Random - Continuous Distribution - Correct Implementation of Importance Sampling In this lesson, we will correct our implementation of Importance Sampling by removing the effect of the constant factor error. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/6744007549911040). Appendix - Definitions This lesson covers the definitions for continuous distribution, discrete distribution, and the probability mass function. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/6036779259920384). Fixing Random - Discrete Distribution - Non-uniform Discrete Distribution In this lesson, we are going to extend the Bernoulli distribution to more than two possible outcomes, and discuss some mechanisms for efficiently implementing the Sample() method on this distribution. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/5438380642926592). Fixing Random - Discrete Distribution - Likelihood Functions In this lesson, we will have a look at Conditional Probabilities as well as Joint Probability. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/6032751637561344). Fixing Random - Discrete Distribution - Converting to Ordinary C# 7 In this lesson, we will convert the code from the previous lesson, to ordinary C# 7. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/5827112227307520). Fixing Random - Discrete Distribution - Problems with Discrete Probability Distributions In this lesson, we will discuss some of the issues with discrete probability distributions. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/5055157689647104). Fixing Random - Continuous Distribution - Techniques for Sampling In this lesson, we will try modifying Sample() and implement rejection sampling. We will also explore the effieciency of rejection sampling and its pros and cons. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/6561549789429760). Fixing Random - Continuous Distribution - Metropolis Algorithm In this lesson, we will learn about the Metropolis Algorithm, and its implementation. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/6286209871511552). Fixing Random - Continuous Distribution - Further Improvements In this lesson, we will determine what the parameters to Stretch.Distribution should be to get a good result. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/6374318843887616). Appendix - Generating Random Non-Uniform Data in C# This lesson goes over uniform distribution, histograms, and cauchy distribution. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/5276082662014976). Fixing Random - Discrete Distribution - Non-uniform Discrete Distribution (Continued) In this lesson, we will continue modifying our non-uniform discrete distribution and also learn about rejection sampling. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/6530799669084160). Fixing Random - Discrete Distribution - Conditional Probabilistic Reasoning In this lesson, we will learn how to express probabilities with extra conditions. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/6132558154694656). Fixing Random - Discrete Distribution - Probability Distribution Monad In this lesson, we will discuss probability distribution using monads in C#. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/4611931090452480). Fixing Random - Continuous Distribution - Posterior Distributions In this lesson, we will introduce Posterior Distributions using an example. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/5864377443942400). Fixing Random - Continuous Distribution - Attacking the Final Problem In this lesson, we will solve the problem of finding a good helper distribution `q`. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/5112211364118528). Fixing Random - Discrete Distribution - Discrete Probability Distribution Type as a Monad In this lesson, we will learn about additive monads. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/5174881043873792). Fixing Random - Discrete Distribution - Probability Distribution Monad with Round Numbers In this lesson, we will learn an example of probability distribution monads by using rounded numbers. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/5006659187376128). Fixing Random - Discrete Distribution - Solve Problems in Bayesian Inference In this lesson, we will review concepts learned so far and learn how to solve problems using Bayesian Inference. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/6451290194313216). Fixing Random - Discrete Distribution - Monty Hall Problem In this lesson, we will be discussing an interesting problem called the Monty Hall Problem. It can be solved using the stochastic workflow technology. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/5569608201273344). Fixing Random - Discrete Distribution - Empty Distribution In this lesson, we will implement the empty distribution. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/5945652284489728). Fixing Random - Discrete Distribution - Musings about Language Design In this lesson we’ve got no code for you; instead, here are some musings about language design informed by our discussion so far. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/6695509047640064). Fixing Random - Discrete Distribution - Proposed Stripped-Down C# In this lesson we are going to propose a stripped-down version of C# and introduce a new operator. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/5131783798521856). Fixing Random - Discrete Distribution - Challenges for Improving Imperative Probabilistic Workflows Have questions about Challenges for Improving Imperative Probabilistic Workflows? Go for it! View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/4583721812361216). Fixing Random - Discrete Distribution - Model Markov Processes In this lesson, we will be discussing the Model Markov Process, which is a completely different kind of distribution. It is neither completely discrete nor continuous. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/4738477537099776). Fixing Random - Discrete Distribution - An Application of Markov Model In this lesson, let's have a look at an application of Markov Model: Randomized Text Generation. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/5811368890466304). Fixing Random - Discrete Distribution - Efficiently Sampling a Conditioned Distribution In this lesson we will learn how to implement the conditioned distribution from the previous lesson without using rejection sampling; we want to avoid the possibly-long-running loop. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/6185658445987840). Fixing Random - Discrete Distribution - Probability Distribution Monad (Continued) In this lesson, we will continue our discussion on probability distribution using monads in C# and implement the weight functionality. We will also highlight the advantages of probability distribution monad. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/6725055000084480). Fixing Random - Continuous Distribution - Probability Distribution Function In this lesson, we will begin with an overview of probability distribution functions and then move on to discussing continuous distributions. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/4549261410697216). Fixing Random - Continuous Distribution - Expected Value of a Discrete Distribution In this lesson, we will learn how to compute the expected value of a discrete distribution. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/5544852680867840). Fixing Random - Continuous Distribution - Better Estimation of the Expected Value In this lesson, we will try to find a better estimate of the expected value in the continuous case. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/6595701590982656). Fixing Random - Continuous Distribution - Reviewing Expected Value In this lesson, we are going to do the derivation all over again. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/5301427490521088). Conclusion - A Final Word In this lesson, we will first summarize all the concepts we learned, then describe a whole lot of interesting stuff that we did not get to and lastly, mention a few reference papers and further reading that inspired this course. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/5730280428011520). Fixing Random - Continuous Distribution - Computing Continuous Posterior Distribution In this lesson we will try answering the question: what is the continuous posterior when we are given an observation of the discrete result? View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/5644049513971712). Fixing Random - Continuous Distribution - What is the Average Value as the Number of Samples Increases In this lesson, we will learn how to calculate the average value as the number of samples increases. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/5186058964697088). Fixing Random - Continuous Distribution - Better Estimation of the Expected Value (Continued) In this lesson, we are going to stick to the restriction to distributions with support over 0.0 to 1.0 for pedagogic reasons, but our aim is to find a technique that gets us back to sampling over arbitrary distributions. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/5857862347653120). Conclusion - More on Fixing Random In this lesson, we sum up some of the content we have covered in this course and provide more food for thought regarding fixing random. View the lesson [here](https://www.educative.io/collection/page/10370001/6248540122644480/6037619714555904).