User Tools

Site Tools


tanszek:oktatas:techcomm:statistical_properties

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tanszek:oktatas:techcomm:statistical_properties [2024/09/30 10:29] kneheztanszek:oktatas:techcomm:statistical_properties [2025/09/30 05:33] (current) – [Frequency of Events] knehez
Line 1: Line 1:
-====== Statistical properties ======+====== Statistical properties of Information ======
  
 ==== Event Space ==== ==== Event Space ====
  
-The outcome of //experiments//, the //results of observations// and the //status of systems// form a so-called '**event space**', where finite or infinite cardinality elementary events may occur. In probability theory, an __event space__ encompasses (includes) all possible outcomes of an experiment, such as flipping a coin, rolling a dice, or measuring the temperature of a system.+The outcome of //experiments//, the //results of observations//and the //status of systems// form a so-called '**event space**', where finite or infinite cardinality elementary events may occur. In probability theory, an __event space__ encompasses (includes) all possible outcomes of an experiment, such as flipping a coin, rolling a dice, or measuring the temperature of a system.
  
-These events may form sets. Because they can be sets, we may perform standard //set operations// (union, intersection, complements, etc.) on them. For example, the union of two events in an experiment may represent the occurrence of either event, while the intersection represents the simultaneous occurrence of both. When these operations occur, the event will carry information.+These events may form sets. Because they can be sets, we may perform standard //set operations// (union, intersection, complements, etc.) on them. 
  
-The __value of information__ related to these events can vary significantly based on everyday experienceFor instanceknowing that a rare event has occurred (such as a lottery win) typically provides more valuable information than learning about an event that occurs frequently or predictably.+For example: the __union of two events__ in an experiment may represent the //occurrence of either event//, while the __intersection__ represents the //simultaneous occurrence of both//When these operations occurthe event will carry information.
  
-For example, if someone tells me that five of his numbers were drawn in the lottery, that information would be much more valuable than if they said only one number was drawn.+The __value of information__ related to these events can vary significantly based on everyday experience. For instanceknowing that a rare event has occurred (such as winning the lottery) typically provides more valuable information than learning about an event that occurs frequently or predictably. 
 + 
 +For example: if someone tells me that five of his numbers were drawn in the lottery, that information would be much more valuable than if they said only one number was drawn.
  
 As we observe the outcomes of these events over time, we may conclude that certain events exhibit stability in their __frequency of occurrence__. For example, when repeatedly flipping a coin, we expect the event of landing heads to occur approximately 50% of the time, given enough trials. This regularity in frequency forms the basis for probability theory, where events with stable frequencies are described as having predictable probabilities. As we observe the outcomes of these events over time, we may conclude that certain events exhibit stability in their __frequency of occurrence__. For example, when repeatedly flipping a coin, we expect the event of landing heads to occur approximately 50% of the time, given enough trials. This regularity in frequency forms the basis for probability theory, where events with stable frequencies are described as having predictable probabilities.
Line 17: Line 19:
 In the \( E_i \) event space, an event happened \(k_i\) times then the frequency of that given event may be calculated with the following formula:  In the \( E_i \) event space, an event happened \(k_i\) times then the frequency of that given event may be calculated with the following formula: 
  
-\(g_i=\frac{k_i}{k} \)+$$ freq_i=\frac{k_i}{k} \frac{\text{number of favorable outcomes}}{\text{number of all possible outcomes}}$$
  
-This means that we divide the number of all events by the number (frequency) of that given event. In case of a large number of experiments this number will show us the probability of that event.+This means that we divide the number of that //given event// by the number of all //experiments//. In the case of a large number of experimentsthis number will show us the probability of that event.
  
-$$ \lim_{k \to \infty} g_i = \frac{k_i}{k} =  P(E_i) $$+$$ \lim_{k \to \infty} freq_i = \frac{k_i}{k} =  P(E_i) $$
  
   * if \(k_i = k \), then the occurrence will be **certain** \(P(E) = 1 \)   * if \(k_i = k \), then the occurrence will be **certain** \(P(E) = 1 \)
Line 33: Line 35:
 {{:tanszek:oktatas:techcomm:pasted:20240826-164556.png}} {{:tanszek:oktatas:techcomm:pasted:20240826-164556.png}}
  
-The probability of every event will be 1/6 which can be calculated with the following formula. The rolls (of the dice) will form a so-called //full event system//. In the case of a //full event system// the sum of the probabilities (of each event) is 1 (by definition).+The probability of every event will be \(\frac{1}{6}\), which can be calculated with the following formula. The rolls (of the dice) will form a so-called //full event system//. In the case of a //full event system// the sum of the probabilities (of each event) is 1 (by definition).
  
 If one of the events happens then the others can not happen: If one of the events happens then the others can not happen:
Line 53: Line 55:
 We can only form a general formula, if we extract the probability of the intersection of both sets from the total sum: We can only form a general formula, if we extract the probability of the intersection of both sets from the total sum:
  
-$$ p(A \cap B) = p(A) + p(B) - p(A \cup B) $$+$$ p(A \cup B) = p(A) + p(B) - p(A \cap B) $$
  
 So we can say that (according to this formula) the total probability for both events is 4/6. So we can say that (according to this formula) the total probability for both events is 4/6.
  
-**Example 2**: What is the probability of getting at least one 5 when rolling two dice?+**Example 2**: What is the probability that we roll the dice twice and the results will be 6 in both cases? 
 + 
 +The probability of throwing a 6 is 1/6, but we cannot multiply it by 2 and take the result (2/6). We can not do that because both events are independent. There is no connection between the 2 trials, so we have to look at them as independent events. So the result will be the multiplication of both events: 
 + 
 +$$ p(A) \times p(B) = \frac{1}{6} \times \frac{1}{6} = \frac{1}{36} $$ 
 + 
 +**Example 3**: What is the probability of getting at least one 5 when rolling two dice?
  
 Let //Event A// represent rolling a 5 on the first die and //Event B// represent rolling a 5 on the second die. These are independent events. Let //Event A// represent rolling a 5 on the first die and //Event B// represent rolling a 5 on the second die. These are independent events.
Line 65: Line 73:
   * The probability of both dice showing a 5 (i.e, \( A \cap B \) is \( p(A \cap B) = \frac{1}{6} \times \frac{1}{6} = \frac{1}{36} \)   * The probability of both dice showing a 5 (i.e, \( A \cap B \) is \( p(A \cap B) = \frac{1}{6} \times \frac{1}{6} = \frac{1}{36} \)
  
-**Example 3**: What is the probability that we roll the dice twice and the results will be 6 in both cases? 
  
-The probability of throwing 6 is 1/6but we cannot multiply it by 2 and take the result (2/6). We can not do that because both events are independent. There is no connection between the 2 trialsso we have to look at them as independent eventsSo the result will be the multiplication of both events:+$$ p(A \cup B) = p(A) + p(B) - p(A \cap B) $$ 
 +$$ p(A \cup B) = \frac{1}{6} + \frac{1}{6} - \frac{1}{36} =  \frac{2}{6} - \frac{1}{36} = \frac{12}{36} - \frac{1}{36} = \frac{11}{36} $$ 
 + 
 +**Example 4:**:  Woman is expecting twins, what is the probability that one of the children will be girl? 
 + 
 +Create sets containing all the possibilities.    
 + 
 +Try the following c code here: [[https://www.onlinegdb.com/online_c_compiler| online compiler]] and examine the results. 
 + 
 +<sxh c> 
 +#include <stdio.h> 
 +#include <stdlib.h> 
 +#include <time.h> 
 + 
 +#define SIMULATIONS 10000 
 + 
 +// Function to simulate the birth of twins 
 +int simulate_twins() { 
 +    // Randomly determine the gender of the twins (0 = boy1 = girl) 
 +    int first_child = rand() % 2
 +    int second_child = rand() % 2; 
 + 
 +    // Return 1 if there is at least one girl, otherwise 0 
 +    return (first_child == 1 || second_child == 1); 
 +
 + 
 +int main() { 
 +    int at_least_one_girl = 0; 
 + 
 +    // Initialize the random number generator 
 +    srand(time(0)); 
 + 
 +    // Simulate 1000 pairs of twins 
 +    for (int i = 0; i < SIMULATIONS; i++) { 
 +        if (simulate_twins()) { 
 +            at_least_one_girl++; 
 +        } 
 +    } 
 + 
 +    // Calculate and print the result 
 +    float probability = (float)at_least_one_girl / SIMULATIONS; 
 +    printf("In %.2f%% of cases, there is at least one girl in the twin pair.\n"probability * 100.0f);
  
-$$ p(A) p(B) = \frac{1}{6} \frac{1}{6} = \frac{1}{36} $$+    return 0; 
 +} 
 +</sxh>
  
  
 +**Example 5:**: https://en.wikipedia.org/wiki/Monty_Hall_problem
  
tanszek/oktatas/techcomm/statistical_properties.1727692184.txt.gz · Last modified: 2024/09/30 10:29 by knehez