Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Random Variable | Learn Crucial Terms
Probability Theory Update
course content

Зміст курсу

Probability Theory Update

Probability Theory Update

1. Probability Basics
2. Statistical Dependence
3. Learn Crucial Terms
4. Probability Functions
5. Distributions

Random Variable

Random event:

A random event is an event whose outcome can not be predicted. Rolling a die or tossing a coin can be examples.

Random variable:

A random variable is a variable whose value is we don't know.

A random variable is used to quantify the output of the random event. We can define a random variable as s capital letter; let it be X in our example.

Example:

We were rolling a die two times and received numbers 3 and 5; so, we can say that a random variable is X = 3 + 5 =8.

Simulating a random variable with Python:

To simulate an experiment in Python we will use the function from the NumPy library: .choice(values, size = size, replace = True)

  • values - a list of possible outcomes of the event.
  • size - the number of times we repeat the experiment.
  • replace = True - it can be equal to False, but in this course, we will not change this parameter.

The experiment of rolling a six-sided die five times.

1234567891011
import numpy as np experiment = np.random.choice(range(1,7), size = 5, replace = True) random_value = sum(experiment) print("The outcomes of the experiment are:", experiment) print("The Random value is equal to:", random_value)
copy

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 3. Розділ 1
toggle bottom row

Random Variable

Random event:

A random event is an event whose outcome can not be predicted. Rolling a die or tossing a coin can be examples.

Random variable:

A random variable is a variable whose value is we don't know.

A random variable is used to quantify the output of the random event. We can define a random variable as s capital letter; let it be X in our example.

Example:

We were rolling a die two times and received numbers 3 and 5; so, we can say that a random variable is X = 3 + 5 =8.

Simulating a random variable with Python:

To simulate an experiment in Python we will use the function from the NumPy library: .choice(values, size = size, replace = True)

  • values - a list of possible outcomes of the event.
  • size - the number of times we repeat the experiment.
  • replace = True - it can be equal to False, but in this course, we will not change this parameter.

The experiment of rolling a six-sided die five times.

1234567891011
import numpy as np experiment = np.random.choice(range(1,7), size = 5, replace = True) random_value = sum(experiment) print("The outcomes of the experiment are:", experiment) print("The Random value is equal to:", random_value)
copy

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Секція 3. Розділ 1
toggle bottom row

Random Variable

Random event:

A random event is an event whose outcome can not be predicted. Rolling a die or tossing a coin can be examples.

Random variable:

A random variable is a variable whose value is we don't know.

A random variable is used to quantify the output of the random event. We can define a random variable as s capital letter; let it be X in our example.

Example:

We were rolling a die two times and received numbers 3 and 5; so, we can say that a random variable is X = 3 + 5 =8.

Simulating a random variable with Python:

To simulate an experiment in Python we will use the function from the NumPy library: .choice(values, size = size, replace = True)

  • values - a list of possible outcomes of the event.
  • size - the number of times we repeat the experiment.
  • replace = True - it can be equal to False, but in this course, we will not change this parameter.

The experiment of rolling a six-sided die five times.

1234567891011
import numpy as np experiment = np.random.choice(range(1,7), size = 5, replace = True) random_value = sum(experiment) print("The outcomes of the experiment are:", experiment) print("The Random value is equal to:", random_value)
copy

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

Все було зрозуміло?

Random event:

A random event is an event whose outcome can not be predicted. Rolling a die or tossing a coin can be examples.

Random variable:

A random variable is a variable whose value is we don't know.

A random variable is used to quantify the output of the random event. We can define a random variable as s capital letter; let it be X in our example.

Example:

We were rolling a die two times and received numbers 3 and 5; so, we can say that a random variable is X = 3 + 5 =8.

Simulating a random variable with Python:

To simulate an experiment in Python we will use the function from the NumPy library: .choice(values, size = size, replace = True)

  • values - a list of possible outcomes of the event.
  • size - the number of times we repeat the experiment.
  • replace = True - it can be equal to False, but in this course, we will not change this parameter.

The experiment of rolling a six-sided die five times.

1234567891011
import numpy as np experiment = np.random.choice(range(1,7), size = 5, replace = True) random_value = sum(experiment) print("The outcomes of the experiment are:", experiment) print("The Random value is equal to:", random_value)
copy

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 3. Розділ 1
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt