# How can I find the values that make a certain expression less than 0.5?

I want a work program to print the values that make expr less than 0.5 when $R_n \in (0,1)$.

exp =
Subscript[R, 1] Subscript[R, 2] Subscript[R, 5] Subscript[R, 6] Subscript[R, 11] +
Subscript[R, 1] Subscript[R, 3] Subscript[R, 5] Subscript[R, 6] Subscript[R, 11] -
Subscript[R, 1] Subscript[R, 2] Subscript[R, 3] Subscript[R, 5] Subscript[R, 6] Subscript[R, 11] +
Subscript[R, 1] Subscript[R, 2] Subscript[R, 7] Subscript[R, 11];
variables = SortBy[Variables[exp], Last];
values = Array[Symbol["v" <> ToString[#]] &, Length @ Variables[exp]];

Manipulate[
Evaluate[exp /. Thread[variables -> values] // Style[#, 24] &],
Evaluate[
## & @@
({{#, .5, ToString[#2, TraditionalForm]}, 0, 1, Appearance -> "Labeled"}&
@@@ Transpose[{values, variables}])],
Alignment -> Center]


I want a program or device policewoman prints values in the equation that make expless than 0.5 and deliver in the form of a table. Such an image or in any other form while maintaining the condition

Make compensation per ten and percent values like....$0.nn$ when n=0,1,...,9

• @kglr ...Can you help me ... With thanks and respect Mar 2, 2017 at 12:48
• if your r values are only restricted to be reals in the range 0,1 your table will be infinitely large. Do you want a bunch of random solutions or what? Mar 2, 2017 at 12:58
• @george2079 ... Yes Make compensation per ten and percent values....$0.nn$ when n=0,1,...,9 Mar 2, 2017 at 13:11
• @george2079 .... I want a bunch of random solutions. Mar 2, 2017 at 13:27

v = Variables[exp];
Prepend[N[
Append[v, exp] /.
FindInstance[exp < 1/2 && 0 < # < 1 & /@ v , v , 20]],
Append[v, "exp"]] // MatrixForm


One way to restrict the results to even 10's is to round and then double check we still meet the criterea.

TableForm[
Sort@Select[Join[#, {(exp /. Rule @@@ Transpose[{v, #}])}] & /@
Union[
Round[v /.
FindInstance[(exp /. Subscript[R, n_] :> Subscript[R, n]) <
1/2 &&
0.05 < # < .95 & /@ v , v , 20], .1]] , Last[#] < .5 &],


• Wonderful ... Can you make compensation values in $R_n$ = $\{0,0.1,0.2,... ,0.9,1\}$ Mar 2, 2017 at 14:49
• in the second code some error like ....ReplaceAll::reps: {Transpose[v->Round[True,0.1]]} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing. Mar 2, 2017 at 15:37
• Treatment be slow in the first program is the second program ... and a beautiful table display my form but some Alakhto ... With thanks and respect to help me. Mar 2, 2017 at 16:12
exp = Subscript[R, 1] Subscript[R, 2] Subscript[R, 5] Subscript[R,
6] Subscript[R, 11] +
Subscript[R, 1] Subscript[R, 3] Subscript[R, 5] Subscript[R,
6] Subscript[R, 11] -
Subscript[R, 1] Subscript[R, 2] Subscript[R, 3] Subscript[R,
5] Subscript[R, 6] Subscript[R, 11] +
Subscript[R, 1] Subscript[R, 2] Subscript[R, 7] Subscript[R, 11];

variables = exp // Variables // Sort;

Module[{expValue, varValues},
With[{nbrOfResults = 15},
Table[
Catch[
Do[
If[(expValue = Round[
variables -> (varValues =
Round[RandomReal[{0, 1}, Length[variables]], .1])],
0.01]) < 1/2,
Throw[{
NumberForm[#, {3, 1}] & /@ varValues,
NumberForm[expValue, {4, 2}]} //
Flatten]],
10000]],
{nbrOfResults}] //
SortBy[#, Last] &] //
Prepend[#, {variables, "exp"} // Flatten] & //
Grid[#, Frame -> All] &]


• Wonderful ...Treatment is faster here in the program ... Can you change the shape of the table ... with thanks and respect to help me. Mar 2, 2017 at 16:10
• The shape of the table is determined by the number of variables in exp and the nbrOfResults that you specify in the With statement. Mar 2, 2017 at 16:18