Akhil4839's picture
Rename pages/Events.py to pages/3. Events.py
b89a3f0 verified
import streamlit as st
import pandas as pd
import numpy as np
st.header(":blue[Types of events]")
multi='''In probability, events can be classified into several types based on their characteristics and relationships with other events.
Here are the common types of events:
'''
st.markdown(multi)
st.subheader(":grey-background[*1.Simple event*]")
st.write("An event that consists of a single outcome is called Simple event")
st.markdown(""":green[- Example:]Selecting a winning lottery number.
Random experiment: picking the number 7 in a single-number lottery.
The event is getting exactly the number 7.
sample space : {1, 2, 3, 4, 5, 6, 7, 8, 9}.
A = getting exactly the number 7
""")
st.latex(r'''P(A)=\frac{1}{9}''')
st.subheader(":grey-background[*2.Compound event*]")
st.write("An event that consists of two or more outcomes is called Compound event")
st.markdown(''':green[- Example:]
Random experiment: Selecting a vowel when randomly choosing a letter from the alphabet.
trail=1
sample space = {A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z}
B= Getting an vowel letter from the alphabet.
''')
st.latex(r'''P(B)=\frac{5}{26}''')
st.subheader(":grey-background[*3.Impossible event*]")
st.write("An impossible event is an event that cannot occur under any circumstances in a given random experiment. The probability of an impossible event is always 0")
st.markdown(''':green[- Example:]Selecting a month of the year with 32 days. No month has more than 31 days, so this is an impossible event.''')
st.latex(r'''P(IE) = 0''')
st.subheader(":grey-background[*4.Independent event*]")
st.markdown('''lets say having an two events.
Independent events are events where the occurrence of one event does not affect the occurrence of another. In other words, the outcome of one event has no impact on the probability of the other event happening.
The probability of two dependent events A and B occurring together can be expressed as:
''')
st.latex(r'''P(A and B) = P(A)\times P(B)''')
st.write(":green[- Example:] Selecting Two Different Fruits: Choosing an apple from a basket and then choosing a banana from another basket. The selection of one fruit does not affect the selection of the other.")
st.subheader(":grey-background[*5.Dependent event*]")
st.markdown('''lets say having an two events.
Dependent events are events where the occurrence of one event affects the occurrence of another. In other words, the outcome of one event influences the probability of the other event happening.
The probability of two dependent events A and B occurring together can be expressed as:
''')
st.latex(r'''P(A and B)= P(A)\times P(B∣A)''')
st.write(":green[- Example:] If you select two students from a class without replacement, the choice of the second student depends on who was selected first. For instance, if the first student selected is a girl, there may be fewer girls left for the second selection.")
st.subheader(":grey-background[*6.Exclusive event*]")
st.markdown('''lets say having an two events.
Exclusive event are events that cannot occur at the same time.
In other words, the occurrence of one event prevents the occurrence of the other. If one event happens,
the probability of the other event happening is zero.
If events A and B are mutually exclusive, then:
''')
st.latex(r'''P(A and B)=0''')
st.write("The probability of either event A or event B occurring (the union of A and B) is the sum of their individual probabilities:")
st.latex(r'''P(A or B)=P(A)+P(B)''')
st.write(":green[- example:] Flipping a Coin, The events 'getting heads' and 'getting tails' are mutually exclusive. You cannot get both heads and tails in a single coin flip.")
st.subheader(":grey-background[*7.Certain event*]")
st.markdown('''A certain event in probability is an event that is guaranteed to happen.
The probability of a certain event is always 1, meaning it is 100% certain to occur.
If an event is certain, its probability is:
''')
st.latex(r'''P(Certain Event)=1''')
st.write(":green[- Example:] The Sun Rising Tomorrow: Assuming normal astronomical conditions, the event of the sun rising tomorrow is a certain event.")