DOMMETI commited on
Commit
0f50859
·
verified ·
1 Parent(s): 46c2a60

Update pages/2_Events.py

Browse files
Files changed (1) hide show
  1. pages/2_Events.py +16 -0
pages/2_Events.py CHANGED
@@ -129,3 +129,19 @@ if numbers_input_5:
129
  st.subheader("Independent Events")
130
  st.markdwon("""An event is said to be independent event when the probability of occurance of one event doesnot effect the probability of other event.""",unsafe_allow_html=True)
131
  st.title("Tossing a coin and rolling a die.")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  st.subheader("Independent Events")
130
  st.markdwon("""An event is said to be independent event when the probability of occurance of one event doesnot effect the probability of other event.""",unsafe_allow_html=True)
131
  st.title("Tossing a coin and rolling a die.")
132
+ Trail_6 = st.number_input("Number of Trials:", min_value=1, max_value=100, value=7,key="Trail_6")
133
+ if st.button('Start the Experiment: Will it Rain or Not? and Tossing a Coin',key="start_experiment_5"):
134
+ st.write(f"Running {Trail_6} trials...")
135
+ list1=[]
136
+ list2=[]
137
+ for i in range(1, Trail_4 + 1):
138
+ result = random.choice(['Rain', 'No Rain'])
139
+ result1= random.choice(['Head','Tail'])
140
+ list1+=[result]
141
+ list2+=[result2]
142
+ p_rain_1=1/len(np.unique(list1))
143
+ p_no_rain_1=1/len(np.unique(list1))
144
+ p_head=1/len(np.unique(list2))
145
+ p_tail=1/len(np.unique(list2))
146
+ st.write(f"Event_1:Probability of having rain:{p_rain_1}")
147
+ st.write(f"Event_2:Probability of getting head:{p_head}")