Spaces:
Sleeping
Sleeping
Update pages/1_Probability.py
Browse files- pages/1_Probability.py +18 -2
pages/1_Probability.py
CHANGED
|
@@ -89,7 +89,7 @@ st.markdown("""Probability is classifed into 2 types:
|
|
| 89 |
</ul>
|
| 90 |
""",unsafe_allow_html=True)
|
| 91 |
st.subheader("Empirical probability")
|
| 92 |
-
st.markdown("""Empirical Probability is a type of probability that is determined based on Trails rather than theoretical calculations""")
|
| 93 |
st.latex(r"""
|
| 94 |
P(E) = \frac{\text{Number of Favorable Outcomes}}{\text{Total Number of Trials}}
|
| 95 |
""")
|
|
@@ -106,4 +106,20 @@ if st.button('Start the Experiment: Will it Rain or Not?',key="start_experiment_
|
|
| 106 |
p_rain=round(rain/Trail_3,2)
|
| 107 |
p_no_rain=round(no_rain/Trail_3,2)
|
| 108 |
st.write(f"Event_1:Probability of having rain:{p_rain}")
|
| 109 |
-
st.write(f"Event_1:Probability of having no_rain:{p_no_rain}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 89 |
</ul>
|
| 90 |
""",unsafe_allow_html=True)
|
| 91 |
st.subheader("Empirical probability")
|
| 92 |
+
st.markdown("""Empirical Probability is a type of probability that is determined based on Trails rather than theoretical calculations""",unsafe_allow_html=True)
|
| 93 |
st.latex(r"""
|
| 94 |
P(E) = \frac{\text{Number of Favorable Outcomes}}{\text{Total Number of Trials}}
|
| 95 |
""")
|
|
|
|
| 106 |
p_rain=round(rain/Trail_3,2)
|
| 107 |
p_no_rain=round(no_rain/Trail_3,2)
|
| 108 |
st.write(f"Event_1:Probability of having rain:{p_rain}")
|
| 109 |
+
st.write(f"Event_1:Probability of having no_rain:{p_no_rain}")
|
| 110 |
+
st.subheader("Theoretical probability")
|
| 111 |
+
st.markdown("""
|
| 112 |
+
Theoretical probability is a type of probability that is calculated based on the possible outcomes and the best part of Theoretical probability is it is independent of Trails.""",unsafe_allow_html=True)
|
| 113 |
+
st.latex(r"P(E) = \frac{\text{Number of favorable outcomes}}{\text{Total number of possible outcomes}}")
|
| 114 |
+
st.title("Theoretical probability_Caluculation")
|
| 115 |
+
Trail_4 = st.number_input("Number of Trials:", min_value=1, max_value=100, value=7,key="Trail_4")
|
| 116 |
+
if st.button('Start the Experiment: Will it Rain or Not?',key="start_experiment_3"):
|
| 117 |
+
st.write(f"Running {Trail_4} trials...")
|
| 118 |
+
list1=[]
|
| 119 |
+
for i in range(1, Trail_3 + 1):
|
| 120 |
+
result = random.choice(['Rain', 'No Rain'])
|
| 121 |
+
list1+=[result]
|
| 122 |
+
p_rain_1=round(1/len(np.unique(list1)))
|
| 123 |
+
p_no_rain_1=round(1/len(np.unique(list1)))
|
| 124 |
+
st.write(f"Event_1:Probability of having rain:{p_rain_1}")
|
| 125 |
+
st.write(f"Event_1:Probability of having no_rain:{p_no_rain_1}")
|