|
1 | 1 | from typing import Any, List, Optional, Type |
2 | 2 |
|
3 | | -from .. import time_step |
| 3 | +from numpy.random import randint, uniform |
4 | 4 |
|
5 | | -from ..core.rule import BaseRule |
| 5 | +from .. import time_step |
6 | 6 | from ..core.expressions import MathExpression |
7 | | -from ..util import get_terms, has_like_terms, is_preferred_term_form |
| 7 | +from ..core.rule import BaseRule |
8 | 8 | from ..env import MathyEnv, MathyEnvProblem |
9 | | -from ..problems import gen_binomial_times_binomial, gen_binomial_times_monomial, rand_bool |
| 9 | +from ..problems import ( |
| 10 | + gen_binomial_times_binomial, |
| 11 | + gen_binomial_times_monomial, |
| 12 | + rand_bool, |
| 13 | +) |
10 | 14 | from ..rules import ( |
11 | | - ConstantsSimplifyRule, |
12 | 15 | CommutativeSwapRule, |
| 16 | + ConstantsSimplifyRule, |
13 | 17 | DistributiveMultiplyRule, |
14 | 18 | VariableMultiplyRule, |
15 | 19 | ) |
16 | 20 | from ..state import MathyEnvState, MathyObservation |
17 | 21 | from ..types import MathyEnvDifficulty, MathyEnvProblemArgs |
| 22 | +from ..util import get_terms, has_like_terms, is_preferred_term_form |
18 | 23 |
|
19 | 24 |
|
20 | 25 | class BinomialDistribute(MathyEnv): |
@@ -59,23 +64,23 @@ def problem_fn(self, params: MathyEnvProblemArgs) -> MathyEnvProblem: |
59 | 64 | text, complexity = gen_binomial_times_binomial( |
60 | 65 | min_vars=2, |
61 | 66 | max_vars=3, |
62 | | - powers_probability=0.1, |
63 | | - like_variables_probability=0.5, |
| 67 | + powers_probability=uniform(0.1, 0.4), |
| 68 | + like_variables_probability=uniform(0.3, 0.7), |
64 | 69 | ) |
65 | 70 | elif params.difficulty == MathyEnvDifficulty.normal: |
66 | 71 | text, complexity = gen_binomial_times_binomial( |
67 | 72 | min_vars=2, |
68 | 73 | max_vars=2, |
69 | | - powers_probability=0.4, |
70 | | - like_variables_probability=0.2, |
| 74 | + powers_probability=uniform(0.2, 0.6), |
| 75 | + like_variables_probability=uniform(0.2, 0.5), |
71 | 76 | ) |
72 | 77 | elif params.difficulty == MathyEnvDifficulty.hard: |
73 | 78 | text, complexity = gen_binomial_times_binomial( |
74 | 79 | min_vars=2, |
75 | 80 | max_vars=3, |
76 | 81 | simple_variables=False, |
77 | | - powers_probability=0.8, |
78 | | - like_variables_probability=0.8, |
| 82 | + powers_probability=uniform(0.4, 0.8), |
| 83 | + like_variables_probability=uniform(0.1, 0.3), |
79 | 84 | ) |
80 | 85 | complexity += 2 |
81 | 86 | else: |
|
0 commit comments