AbbasAga/statistics
0
1import streamlit as st2import pandas as pd3import numpy as np4st.header("PROBABILITY")5multi ='''Probability is a measure of the likelihood that a particular event will occur, 6expressed as a number between 0 and 1.7A probability of 0 indicates that the event will not happen, while a probability of 1 indicates certainty that the event will occur.8In mathematical terms, the probability P of an event A can be calculated using the formula:9'''10st.markdown(multi)11st.write("The formula for probability is:")12st.latex(r'''P(A)=\frac{Number of favorable outcomes}{Total number of possible outcomes}''')13st.write("Probability measures are in two type.")14 15st.subheader("*1.Empirical Probability:*")16st.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.")17st.write("Empirical probability is entirely depends on observed data.")18st.write("The formula for empirical probability is:")19st.latex(r'''P(A)=\frac{Number of times event A occurs}{Total number of trials}''')20st.write("- Example: If you roll a die 60 times and get a 3 ten times, the experimental probability of rolling a 3 is:")21st.latex(r'''\frac{10}{60}=\frac{1}{6}''')22 23st.subheader("*2.Theoretical Probability:*")24multi='''*Theoretical probability* refers to the likelihood of an event occurring based on mathematical reasoning and the assumption that all outcomes are equally likely.25It is calculated by dividing the number of favorable outcomes by the total number of possible outcomes in a perfect.26Theoretical probability is actually independent of number of trail or actual experiment.27Theoretical probability purely based on possible outcomes.28'''29st.markdown(multi)30st.latex(r'''P(A)=\left(\frac{Number of favorable outcomes}{Total number of possible outcomes}\right)''')31st.write(" - example:if you roll a fair six-sided die, the theoretical probability of rolling a 3 is:")32st.latex(r'''p(3)=\frac{1}{6}''')33st.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.")