AdvancedStatistics / pages /3_Types Of Probability.py
Sreeja6600's picture
Update pages/3_Types Of Probability.py
734aede verified
import streamlit as st
st.header(":red[PROBABILITY]")
multi ='''Probability is a measure of the likelihood that a particular event will occur,
expressed as a number between 0 and 1.
A probability of 0 indicates that the event will not happen, while a probability of 1 indicates certainty that the event will occur.
In mathematical terms, the probability P of an event A can be calculated using the formula:
'''
st.markdown(multi)
st.write("The formula for probability is:")
st.latex(r'''P(A)=\frac{Number of favorable outcomes}{Total number of possible outcomes}''')
st.subheader(":violet[Probability measures are of two types.]")
st.markdown(":grey-background[***1.Empirical Probability:***]")
st.write("Empirical probability is also known as Experimental probability. Based on the actual results of experiments or observations. It is calculated by dividing the number of times an event occurs by the total number of trials.")
st.write("Empirical probability is entirely depends on observed data.")
st.write("The formula for empirical probability is:")
st.latex(r'''P(A)=\frac{Number of times event A occurs}{Total number of trials}''')
st.write(":blue[- Example:] If you roll a die 60 times and get a 3 ten times, the experimental probability of rolling a 3 is:")
st.latex(r'''\frac{10}{60}=\frac{1}{6}''')
st.markdown(":grey-background[***2.Theoretical Probability:***]")
multi='''*Theoretical probability* refers to the likelihood of an event occurring based on mathematical reasoning and the assumption that all outcomes are equally likely.
It is calculated by dividing the number of favorable outcomes by the total number of possible outcomes in a perfect.
Theoretical probability is actually independent of number of trail or actual experiment.
Theoretical probability purely based on possible outcomes.
'''
st.markdown(multi)
st.latex(r'''P(A)=\left(\frac{Number of favorable outcomes}{Total number of possible outcomes}\right)''')
st.write(":blue[- Example:] if you roll a fair six-sided die, the theoretical probability of rolling a 3 is:")
st.latex(r'''p(3)=\frac{1}{6}''')
st.write("This assumes that each face of the die is equally likely to land face up. Theoretical probability does not require actual experiments or trials but is based purely on the known possible outcomes.")