- Keras Reinforcement Learning Projects
- Giuseppe Ciaburro
- 1152字
- 2021-08-13 15:26:06
Probability calculation
We are interested in calculating the probabilities associated with a stochastic process (Xn). Let's spend a few minutes talking about the basic concepts of probability. If you are already familiar with these concepts, you may want to skip this section; otherwise, it will be in your interest to deepen the basic knowledge needed to understand how probabilities are calculated.
The a priori probability that a given event (E) occurs is the ratio between the number (s) of favorable cases of the event itself and the total number (n) of the possible cases, provided all considered cases are equally probable. This can be summarized in the following formula:
Let's look at a simple example.
What is the probability that a thrown die shows the number 3? The number of possible results is 6—{1, 2, 3, 4, 5, 6}—and the favorable cases are 1{3}. So P(3) =1/6 =0.166 =16.6 %.
The probability of an event (P(E)) is always a number between 0 and 1, as shown in the following formula:
The extreme values are defined as follows:
An event that has a probability of 0 is called an impossible event. Suppose we have six red balls in a bag. What is the probability of picking a black ball? The number of possible cases is 6 and the number of favorable cases is 0 because there are no black balls in the bag. We can summarize this as P(E) = 0/6 = 0.
An event that has a probability of 1 is called a certain event. Suppose we have six red balls in a bag. What is the probability of picking a red ball? The number of possible cases is 6 and the number of favorable cases is 6 because there are only red balls in the bag. We can summarize this as P(E) = 6/6 =1.
So far, we've talked about the likelihood of an event, but what happens when the possible events are more than one? Two random events, A and B, are independent if the probability of the occurrence of event A is not dependent on whether event B has occurred, and vice versa. For example, say that we have two 52-card decks of French playing cards. When extracting a card from each deck, the following two events are independent:
- E1: The card extracted from the first deck is an ace
- E2: The card extracted from the second deck is a club
The two events are independent—each can happen with the same probability independently of the other's occurrence.
Conversely, a random event, A, is dependent on another event, B, if the probability of event A depends on whether event B has occurred or not. Suppose we have a deck of 52 cards. By extracting two cards in succession without putting the first card back in the deck, the following two events are dependent:
- E1: The first extracted card is an ace
- E2: The second extracted card is an ace
To be precise, the probability of E2 depends on whether or not E1 occurs. From this, we can extrapolate the following:
- The probability of E1 is 4/52
- The probability of E2 if the first card was an ace is 3/51
- The probability of E2 if the first card was not an ace is 4/51
Let's now deal with the case of joint probability, both independent and dependent. If two events, A and B, are independent (meaning that the occurrence of one does not affect the probability of the other), then the joint probability of the event is equal to the product of the probabilities of A and B. This can be summarized as follows:
Let's take an example. We have two decks of 52 cards. By extracting a card from each deck, let's consider the two independent events:
- A: The card extracted from the first deck is an ace
- B: The card extracted from the second deck is a clubs card
What is the probability that both of them occur?
- P(A) = 4/52
- P(B) = 13/52
- P(A ∩ B) = 4/52 * 13/52 = 52 /(52 * 52) = 1/52
If the two events are dependent (that is, the occurrence of one affects the probability of the other), then the same rule may apply, provided that P(B|A) is the probability of event B given that event A has occurred. This condition introduces conditional probability, which we are going to dive into. This can be summarized as follows:
Say that a bag contains two white balls and three red balls. Two balls are pulled out from the bag in two successive extractions without reintroducing the first ball that was pulled out of the bag.
Calculate the probability that the two balls extracted are both white given the following facts:
- The probability that the first ball is white is 2/5
- The probability that the second ball is white, provided that the first ball is white, is 1/4
The probability of having two white balls is as follows:
P(two white) = 2/5 * 1/4 = 2/20 = 1/10
As promised, it is now time to introduce the concept of conditional probability. The probability that event B occurs, calculated on the condition that event A occurred, is called conditional probability, and is indicated by P(B | A). It is calculated using the following formula:
Now that we are able to understand the different kinds of probabilities, let's apply them to the stochastic processes. Let's start from the simplest kind of probability, written as P(Xn = i).
This represents the probability of observing at step n the system in state i. In addition to these simple probabilities, we can also be interested in the calculation of more complex probabilities, such as those involving multiple steps at the same time.
For example, it may be interesting to calculate the probability of being in state j at step n + 1 knowing that it is in state i at step n (as you may have noticed, this is the conditional probability defined previously). This can be summarized as follows:
This calculates the transition probability from i to j at step n. Using the conditional probability definition, this rewrites itself to take the following form:
Therefore, for this calculation, it is sufficient that we know the a priori probability and the joint probability. We know that to calculate more complex expressions, it is necessary to know the generic joint probabilities given by the following formula:
Where i0, ..., .in ∈ Z. In a certain sense, these probabilities exhaust all possible information; the stochastic process is completely statistically determined when all the combined (discrete) densities are known—that is, the densities of all the multiple discrete variables (Xl, ..., Xn) to the variation of all the i0, ..., .in ∈ Z. The calculation of these joint probabilities is generally intractable.
- GNU-Linux Rapid Embedded Programming
- Microsoft Power BI Quick Start Guide
- 中文版Photoshop CS5數碼照片處理完全自學一本通
- 基于LabWindows/CVI的虛擬儀器設計與應用
- ServiceNow Cookbook
- 21天學通Java
- 大型數據庫管理系統技術、應用與實例分析:SQL Server 2005
- 21天學通Visual Basic
- 信息物理系統(CPS)測試與評價技術
- Grome Terrain Modeling with Ogre3D,UDK,and Unity3D
- Mastering ServiceNow Scripting
- 網絡管理工具實用詳解
- 電氣控制與PLC原理及應用(歐姆龍機型)
- 數據要素:全球經濟社會發展的新動力
- 步步驚“芯”