Spaces:
Running
Running
changes
Browse files
probability/11_expectation.py
CHANGED
@@ -459,7 +459,6 @@ def _(
|
|
459 |
formula = "E[X] = p"
|
460 |
|
461 |
elif dist_selection.value == "binomial":
|
462 |
-
# Get parameter range for visualization
|
463 |
p_min, p_max = param_range.value
|
464 |
param_values = np.linspace(p_min, p_max, 100)
|
465 |
|
@@ -473,7 +472,6 @@ def _(
|
|
473 |
formula = f"E[X] = n × p = {n} × p"
|
474 |
|
475 |
elif dist_selection.value == "geometric":
|
476 |
-
# Get parameter range for visualization
|
477 |
p_min, p_max = param_range.value
|
478 |
# Ensure p is not 0 for geometric distribution
|
479 |
p_min = max(0.01, p_min)
|
@@ -488,7 +486,6 @@ def _(
|
|
488 |
formula = "E[X] = 1/p"
|
489 |
|
490 |
else: # Poisson
|
491 |
-
# Get parameter range for visualization
|
492 |
lambda_min, lambda_max = lambda_range.value
|
493 |
param_values = np.linspace(lambda_min, lambda_max, 100)
|
494 |
|
|
|
459 |
formula = "E[X] = p"
|
460 |
|
461 |
elif dist_selection.value == "binomial":
|
|
|
462 |
p_min, p_max = param_range.value
|
463 |
param_values = np.linspace(p_min, p_max, 100)
|
464 |
|
|
|
472 |
formula = f"E[X] = n × p = {n} × p"
|
473 |
|
474 |
elif dist_selection.value == "geometric":
|
|
|
475 |
p_min, p_max = param_range.value
|
476 |
# Ensure p is not 0 for geometric distribution
|
477 |
p_min = max(0.01, p_min)
|
|
|
486 |
formula = "E[X] = 1/p"
|
487 |
|
488 |
else: # Poisson
|
|
|
489 |
lambda_min, lambda_max = lambda_range.value
|
490 |
param_values = np.linspace(lambda_min, lambda_max, 100)
|
491 |
|