evalb cmd
Publié : jeu. nov. 08, 2018 7:35 pm
Hi BP, in the following case evalb does not work.
As a suggestion, each comparison should return true/false, for the educational environment, it is better to use symbolic words than their numerical equivalents
Exercice:
x ∈ [-5,-3,-1,1]
For what values of x does the inequality x ≥ -1 is a true or false expression?
evalb( map([-5,-3,-1,1], x→ x≥-1 ) ) ↦ [0,0,1,1] ↦ [false,false,true,true]
map([-5,-3,-1,1], x→ x≥-1 ) ↦ [false,false,true,true]
in the following cases there is no consistency, sometimes true/false other 1/0
//
[[ 0 or 0],
[ 0 or 1],
[1 or 0],
[1 or 1]]
↦
[[false],
[true],
[1],
[1]]
//
[[ 0 and 0],
[ 0 and 1],
[1 and 0],
[1 and 1]]
↦
[[0],
[0],
[false],
[true]]
//
[[ 0 xor 0],
[ 0 xor 1],
[1 xor 0],
[1 xor 1]]
↦
[[0],
[1],
[1],
[0]]
As a suggestion, each comparison should return true/false, for the educational environment, it is better to use symbolic words than their numerical equivalents
Exercice:
x ∈ [-5,-3,-1,1]
For what values of x does the inequality x ≥ -1 is a true or false expression?
evalb( map([-5,-3,-1,1], x→ x≥-1 ) ) ↦ [0,0,1,1] ↦ [false,false,true,true]
map([-5,-3,-1,1], x→ x≥-1 ) ↦ [false,false,true,true]
in the following cases there is no consistency, sometimes true/false other 1/0
//
[[ 0 or 0],
[ 0 or 1],
[1 or 0],
[1 or 1]]
↦
[[false],
[true],
[1],
[1]]
//
[[ 0 and 0],
[ 0 and 1],
[1 and 0],
[1 and 1]]
↦
[[0],
[0],
[false],
[true]]
//
[[ 0 xor 0],
[ 0 xor 1],
[1 xor 0],
[1 xor 1]]
↦
[[0],
[1],
[1],
[0]]