title: Illustrating the LLN (Law of Large Numbers)
body: <p>I have to illustrate the Law of Large Numbers through simulations in R.
  More precisely. 
  I would like to illustrate that the cumulative distribution function of the mean, </p>
  
  <p><a href="https://i.stack.imgur.com/ouWoA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ouWoA.png" alt="enter image description here"></a>  </p>
  
  <p>converges to the function f given by
  f(x) = 0 if x ≤ μ and f(x) = 1 if x > μ.
  In my case, I have to use a dice. That is, each X<sub>i</sub> is the uniformly distributed on {1,2,3,4,5,6}, so μ = 3.5.<br>
  Using R, I have tried to proceed in the following way:</p>
  
  <pre><code>n &lt;- 100
  N &lt;- 10000
  mu &lt;- 3.5
  for(j in 1:N)
  {
  V[j] &lt;- sum(sample(1:6), n, replace = TRUE);
  }
  f &lt;- function(x)
  {
  if (x&lt;=3.5)
  {
  y &lt;-0
  }
  else
  {
  y &lt;- 1
  }
  y
  }
  Vf &lt;- Vectorize(f, "x")
  </code></pre>
  
  <p>So my idea was to compare the cumulative distribution function of the mean with the function f using a plot. How can I implement it in R properly. So I have to plot the cumulative distribution function and the function f in one plot.</p>