Afrikaans
Akan
Albanian
Amharic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Vietnamese
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
- Many business cases,
analyze events that are not equally likely.
Some products are more popular than others
and your website gets more visitors
in certain parts of the day and less than others.
In this movie, I will show you
how to generate random values
when all of the events are equally likely.
Such as in a random drawing.
This is called the uniform distribution.
And if there are four possible outcomes,
values 1 through 4, then in the uniform distribution,
the probability of each would be 25%.
Now over time, it is very unlikely
that you will have the same number of values exactly.
However, they will be close.
And here is one case,
where I did a random generation of numbers from 1 to 4.
And here you see the actual results.
So as with most things in life,
theory and practice are often close, but do diverge.
Now switch over to Excel and I will show you
how to work with values that are uniformly distributed.
The Excel workbook that I'm using is 04_02_Uniform.
And you can find it in the chapter four folder
of the exercise files collection.
And for this, I have laid out a spreadsheet
and I will perform a number of calculations.
Let's say that I want to have a minimum value of 1.
So I'll type that in cell B3. Then enter.
And a maximum value of 6.
So type 6. And enter.
And our number of values I know is 6,
but if I want to calculate it,
I can do equal,
B4 minus B3 plus 1.
And that's because I am subtracting the value in B3,
which in this case is 1.
So I need to add 1 back, otherwise I would get 5.
So I'll press enter.
And enter again to move down to cell B7.
If I want to generate a random number
that is a random whole number or integer,
between 1 and 6,
then I can use the function RANDBETWEEN.
In B7, I will type equal.
And then the function is RANDBETWEEN.
And the bottom value is in B3. Comma.
Top value in B4.
Right parenthesis and enter.
And I get the value of 3.
Now for 'Value 2', I will do the same thing.
So I'll do equal,
RANDBETWEEN.
Excuse me. I started typing in the numbers directly
but it's better to use a cell reference
so you can change the values
without having to edit a formula.
So that's B3 for the bottom value.
And then comma. Top value's in B4.
Right parenthesis and enter.
And my worksheet recalculated,
so I have both 4 and 3.
Now I can calculate the probability of getting 'Value 1'.
So I will go over to cell E3.
And here because I know that I have a uniform distribution,
that every value is equally likely.
So I will and cell E3, type an equal sign then 1,
because I'm only looking for one value
and divide that by the number of values.
Which is in cell B5.
Enter.
And I get a probability of 0.166 repeating.
So 1/6th of the time.
Which matches our six possible values.
If I want to calculate
the probability of 'Value 1' or 'Value 2',
then that would be equal, 1,
divided by the number of values,
which again is in B5.
Plus 1, divided by B5 again.
'Cause I'm looking at two distinct values.
Enter and I get 0.33.
And yes it is possible that the randomly generated values
in cells B7 and B8 could be the same.
In which case the probability of 'value 1' or 'value 2'
would be the same as getting a single value.
But I'm working in the abstract here,
as opposed to, with the specific value in B7 and B8.
If you want to calculate the probability of getting
neither 'Value 1' or Value 2',
then you would subtract the probability
of the positive outcome, from 1.
So, in cell E7, I'll type equal.
And it'll be 1 minus, the value in E5.
Enter.
And we get 0.666,
repeating.
So about 2/3rds of the time, which makes sense.
Four out of six times,
you will not get one or two distinct values.
And that will happen about 2/3rds of the time.
So our value is correct.
And I have saved cell B10 for last,
because I want to show you another way
to generate random numbers between 0 and 1.
And this is a 16 digit decimal.
So in B10, I'll type, equal,
and then rand.
Followed by an open and closed parentheses.
And this value will be a random number,
a decimal number between zero and one.
So enter. And there we get 0.81534.
And the number is actually larger than that.
So if I click cell B10.
And go to the home tab and click increase decimal,
you can see that the value increases.
So what is the probability
of generating this specific value?
It is effectively zero.
There are so many decimal points here.
And I'm just estimating,
let's say there are 12 digits there.
If we look at 12 digits or 13 that would be in the billions.
So the probability of getting
exactly this value, is extremely low.
And if I press F9 to recalculate, I get a different value.
And again.
And the probability of those values repeating,
is so small, it's not worth worrying about.
So I hope that this movie has given you an introduction
to working with random numbers,
both as integers and as decimal values between, 0 and 1.
Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.