Compare two revisions of: RandadjustIf

... ... @@ -1,11 +1,13 @@
1 1 {{TOC}}
2 2
3 3 Random variables can be adjusted to satisfy a specific constraint. <br/>
4 -For example we might adjust the variable x to be always greater than the variable y.<br/>
4 +For example we might adjust the variable x to be always greater than the variable y by using
5 +the command `\randadjustIf{x,y}{x<=y}`<br/>
5 6
6 7 The command `\randadjustIf` has the syntax `\randadjustIf{[varlist]}{[relation]}` .
7 8 * **varlist** comma separated list of variables to be adjusted
8 -* **relation** a relation that defines an avoidance condition under which the variables in varlist should be adjusted
9 +* **relation** a relation that defines an avoidance condition under which the variables
10 +in varlist should be adjusted.
9 11
10 12 ```LaTeX
11 13 \begin{question}
... ... @@ -22,6 +24,24 @@ The command `\randadjustIf` has the syntax `\randadjustIf{[varlist]}{[relation]}
22 24 \end{question}
23 25 ```
24 26
27 +The avoidance_relation has to be a logical (boolean) combination (use $$NOT$$, $$AND$$, $$OR$$) of simple comparison
28 +relations $$(=, !=, <, <=, >, >=)$$ between **expressions** in the variables.
29 +
30 +These expressions may include **random and non-random** variables defined in the same variable
31 +environment.
32 +
33 +See [Expressions And Relations](Expressions-And-Relations.md#relations-usable-in-randadjustif)
34 +for a more detailed description.
35 +
36 +*Hint*:
37 +
38 +* Make sure that the avoidance relation can be avoided at all for the random variables with the ranges given.
39 +The `\randint` commands jointly define a product set which has to have a non-empty intersection with the
40 +complement of the avoidance set. Otherwise you get a runtime error when the problem is run.
41 +* Even if the intersection is non-empty but has a equi-distribution probability being too small,
42 +a runtime error might be the result, though the algorithm tries its best to find an admissible point.
43 +
44 +
25 45 <div class="alert green">
26 46 \randadjustIf on a variable defined by \drawFromSet only works for (the default) type _number_
27 47 </div>
... ... @@ -71,4 +91,6 @@ You may use `\randadjustIf` in the same
71 91 manner as explained above, also multiple times for disjoint sets of global variables. You should *NOT* adjust
72 92 global variables within a question, but only in the problem environment where they are defined.
73 93
74 -[Alternatively use a switch/case statement](Switch-Case-Statement)
94 +[Alternatively use a switch/case statement](Variables.md#switchcase-statements)
95 +
96 +
75 97