Why does FindInstance[x>0,x] give 27? I would think it would give 1… maybe 2 or some small positive decimal.
1 Answer
$\begingroup$
$\endgroup$
1
Because it uses built-in random seed. You can change it as follows
FindInstance[x > 0, x, RandomSeeding -> 1]
(* 81 *)
FindInstance[x > 0, x, RandomSeeding -> 555]
(* 100 *)
To get 27 use the builtin value:
FindInstance[x > 0, x, RandomSeeding -> 1234]
(* 27 *)
think it would give 1
To get one do
FindInstance[x > 0, x, RandomSeeding -> 5]
(* 1 *)
What a missed opportunity to return 42!
FindInstance[x > 0, x, RandomSeeding -> 35]
(* 42 *)
-
2$\begingroup$ It looks like it's the same as
RandomInteger[{1, 101}]. On the other hand,FindInstance[x >= 0, RandomSeeding -> something]returns numbers from 0 to 101, but returns 0 about half of the time and 1..101 about half of the time. $\endgroup$Roman– Roman2024-07-12 17:57:52 +00:00Commented Jul 12, 2024 at 17:57
Options[FindInstance]shows, the defaultRandomSeedingis1234$\endgroup$