# Week 1-Sampling from a Distribution

I get confused here. What are the y-axis and x-axis shown to us on the graph on the left? And What are the y-axis and x-axis shown to us on the graph on the right ?

1 Like

I am not sure about this lesson but it might be just any range of values, the main point is to understand the nature of such distribution ie. how values change!

The ‘x-axis’ values are some hypothetical feature.

The ‘y-axis’ values are either the probability density, or the cumulative probability.

Hello, I don’t understand how generating random numbers from a Uniform (0,1) could replicate the original pdf of the Normal Distrubution
(i.e. in the slide we have N(0,1), if we keep selecting from Uniform, how could it replicate x=0 as the highest frequency number ?)
Thanks.
aborucu

@aborucu, can you give a specific reference to your question? For example, a video title and time mark?

Hi @aborucu,

I don’t mentor this course, but if you were indeed asking about the slide shared by the OP:

then, when it generates a number between 0.0 to 0.1 uniformly, which has 0.1-0.0=10% of probability, it maps to a normal distribution sample between -inf to -1.28, which spans -1.28-(-inf) → inf. Repeating the above process and we get the following table

Uniform sample range Total probability mass Normal sample range Span
0.00 to 0.10 10.0% -inf to -1.28 inf
0.10 to 0.20 10.0% -1.28 to -0.84 0.44
0.20 to 0.30 10.0% -0.84 to -0.52 0.32
0.30 to 0.40 10.0% -0.52 to -0.25 0.27
0.40 to 0.50 10.0% -0.25 to 0.00 0.25
0.50 to 0.60 10.0% 0.00 to 0.25 0.25
0.60 to 0.70 10.0% 0.25 to 0.52 0.27
0.70 to 0.80 10.0% 0.52 to 0.84 0.32
0.80 to 0.90 10.0% 0.84 to 1.28 0.44
0.90 to 1.00 10.0% 1.28 to inf inf

Now, here is the key - CHANGE OF PERSPECTIVE. Let’s add nothing new but just rearrange the table:

Normal sample range Span Total probability mass
-inf to -1.28 inf 10.0%
-1.28 to -0.84 0.44 10.0%
-0.84 to -0.52 0.32 10.0%
-0.52 to -0.25 0.27 10.0%
-0.25 to 0.00 0.25 10.0%
0.00 to 0.25 0.25 10.0%
0.25 to 0.52 0.27 10.0%
0.52 to 0.84 0.32 10.0%
0.84 to 1.28 0.44 10.0%
1.28 to inf inf 10.0%

Here, you can repeat the following for every row, but I want to focus on the 5th and 6th row combined: "the probability of generating a number between -0.25 to 0.25, which spans 0.5, is 20%.

Do repeat yourself for some other rows to push yourself into the NEW PERSPECTIVE, because I am going to answer your question in such perspective:

We can get a number between -0.25 to 0.25 for 20% of time, but as we move to the left into the negative range, such as -0.84 to -0.25, it takes the same 20% probability mass but starts to span more (0.59 vs. 0.5), in other words, the range of -0.75 to -0.25 will see less than 20%. Now, “-0.25 to 0.25” and “-0.75 to -0.25” span the same because they are both 0.5, but the former has 20% while the latter has only less than 20%.

This concludes that the generated samples will peak in -0.25 to 0.25.

If we repeat everything above with a finer uniform sample range, such as 0.0001 (vs. 0.1 that I have used), then our last conclusion will become that the generated samples will peak in an even smaller range around 0. Therefore, as the uniform sample range limits to zero, we conclude that the normal sample frequency will peak at 0.

Cheers,
Raymond

Hello @TMosh, am referring to the screean shot instant of the original post by [Asyafa_Ditra_Al_Haun] up at the top. Lesson on [Week 1-Sampling from a Distribution] :, Thank you

Hello @rmwkwok, bulls eye just what I was asking for, thank you for your elaborate answer, have to go thorugh it couple of times before it sinks into me
cheers
aborucu

That’s great, @aborucu