Spaces:
Sleeping
Sleeping
Commit
Β·
c60d7b7
1
Parent(s):
56db230
update text
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ def roll_die():
|
|
12 |
# Roll the die and check if the result is even
|
13 |
def test_event():
|
14 |
result = roll_die()
|
15 |
-
return result, "Yes" if result % 2 == 0 else "No"
|
16 |
|
17 |
# Compute the probability of an event
|
18 |
def compute_event_probability(favorable_outcomes, possible_outcomes):
|
@@ -74,12 +74,13 @@ with gr.Blocks(css=css) as demo:
|
|
74 |
## Sample Spaces and Outcomes
|
75 |
The `sample space` is the **set of all possible `outcomes`** of a random experiment or random process.
|
76 |
|
77 |
-
For example, if you roll a `six-sided die
|
|
|
78 |
"""
|
79 |
)
|
80 |
with gr.Row():
|
81 |
die_roll = gr.Button(value="Roll the Die! π²π²")
|
82 |
-
die_roll_output = gr.Textbox(label="You
|
83 |
die_roll.click(roll_die, [], [die_roll_output])
|
84 |
|
85 |
gr.Markdown(
|
@@ -88,7 +89,7 @@ with gr.Blocks(css=css) as demo:
|
|
88 |
|
89 |
An `event` is any **subset of the `sample space`**, representing a specific outcome or a combination of outcomes.
|
90 |
<br>
|
91 |
-
|
92 |
|
93 |
Continuing with our example, an event like `rolling an even number` would correspond to the subset: `{2, 4, 6}`
|
94 |
|
@@ -110,11 +111,11 @@ with gr.Blocks(css=css) as demo:
|
|
110 |
$$ P(\text{Event}) = \frac{\text{Number of (Favorable Outcomes)}}{\text{Number of (Possible Outcomes)}} $$
|
111 |
|
112 |
- `Favorable outcomes` are those that satisfy the condition of the `event`.
|
113 |
-
- `Possible outcomes` are all outcomes, regardless of whether they
|
114 |
|
115 |
You can use the space below to calculate the probability of an event.
|
116 |
<br>
|
117 |
-
Play around with different sets of favorable and possible outcomes to see how the probability changes
|
118 |
"""
|
119 |
)
|
120 |
|
|
|
12 |
# Roll the die and check if the result is even
|
13 |
def test_event():
|
14 |
result = roll_die()
|
15 |
+
return result, "Yes!" if result % 2 == 0 else "No.."
|
16 |
|
17 |
# Compute the probability of an event
|
18 |
def compute_event_probability(favorable_outcomes, possible_outcomes):
|
|
|
74 |
## Sample Spaces and Outcomes
|
75 |
The `sample space` is the **set of all possible `outcomes`** of a random experiment or random process.
|
76 |
|
77 |
+
For example, if you roll a `six-sided die` π², the sample space is all the possible configurations the die could end up in.
|
78 |
+
<br>These are either with the side facing up showing the value 1, or 2 or... We can summarize this as: `{1, 2, 3, 4, 5, 6}`
|
79 |
"""
|
80 |
)
|
81 |
with gr.Row():
|
82 |
die_roll = gr.Button(value="Roll the Die! π²π²")
|
83 |
+
die_roll_output = gr.Textbox(label="You side facing up shows a..", placeholder="", interactive=False)
|
84 |
die_roll.click(roll_die, [], [die_roll_output])
|
85 |
|
86 |
gr.Markdown(
|
|
|
89 |
|
90 |
An `event` is any **subset of the `sample space`**, representing a specific outcome or a combination of outcomes.
|
91 |
<br>
|
92 |
+
This often corresponds to some event of interest (e.g. whether if will rain tomorrow) but may be sometimes an interemediary step when dealing with more complex probability problems.
|
93 |
|
94 |
Continuing with our example, an event like `rolling an even number` would correspond to the subset: `{2, 4, 6}`
|
95 |
|
|
|
111 |
$$ P(\text{Event}) = \frac{\text{Number of (Favorable Outcomes)}}{\text{Number of (Possible Outcomes)}} $$
|
112 |
|
113 |
- `Favorable outcomes` are those that satisfy the condition of the `event`.
|
114 |
+
- `Possible outcomes` are all the outcomes, regardless of whether they satisfy the event or not.
|
115 |
|
116 |
You can use the space below to calculate the probability of an event.
|
117 |
<br>
|
118 |
+
Play around with different sets of favorable and possible outcomes to see how the probability changes!
|
119 |
"""
|
120 |
)
|
121 |
|