# Add two functions in a table with the same variables

How can I print the values of the function expere in the table of the function exper ... Note that I use this code

exp := Subscript[x, 2] Subscript[x, 3] +
Subscript[x, 1] Subscript[x, 2] Subscript[x, 3] Subscript[x, 4]

exper := Subscript[x, 1] Subscript[x, 3] +
Subscript[x, 1] Subscript[x, 2] Subscript[x, 3] Subscript[x, 4]

variables = exp // Variables // Sort;

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


This program compensates the values of the variables of a function and gives the result of the function in the shape of a table ... A column should be added to a second function with the same variables as in the image

Add them along with the other NumberForms and adjust the sort criterion

Module[{expValue, experValue, varValues},
With[{nbrOfResults = 10},
Table[Catch[
Do[If[0 <= (experValue =
Round[exper /.

• @Emadkareem The code below "I used this answer" is almost the same as what I wrote, but you replaced experValueby expValue in the If condition, so experValue remains a symbol. I don't see how you encountered Null[[-2]] though Jun 11, 2017 at 18:04