+ 1
X=>yz, z=>cw X=>yzc
is it true?
25 Answers
+ 2
X is true when y and z is true.
z is true when c and w is true
in X' expression we can replace z with z's expression c and w:
y and (c and w)
and the result simplifies to:
y and c and w
We get expression:
X => y ^ c ^ w
"X is true, when y, c and w are true."
In:
X => y ^ z ^ c
It is right, but when we replace c with c's expression it means:
X => y ^ (c ^ w) ^ c
Which simplifies to:
X => y ^ c ^ w ^ c
X => y ^ w ^ c ^ c
With common sense we know that if c is true, then c ^ c is also true:
c <=> c ^ c
Thus we could simplify X => yzc by removing the c.
To X => yz
Which is useless because you already said that in first line.
+ 2
Seb TheS It's taken me a while, but I see what you're saying.
If z implies c, it's pointless asking whether X implies both z and c because X implying z would be enough (as z implies c).
It would make more sense if the question was X=>ycw.
+ 2
Code is true and result depends on variables' value
+ 1
Do you mean:
If X is true, then y and z are true.
If z is true, then c and w are true.
If X is true, then y, z and c are true.
?
+ 1
yes
+ 1
either true or false the question is how to rewerite the condition by using ternary operation :)
+ 1
Seb TheS I thought X=>yz meant that 'X implies y and z' or when X is True, y and z are True.
When you say X is True when y and z are True, it sounds like the opposite (i.e. y and z are implying X). Not sure, just how I remembered it.
+ 1
Russ But Because X still implies z is true, which implies that c and w are true, then c in the final expression is not needed.
+ 1
var z=x;
var y= z;
var z= y;
var w= y;
var c=z;
var x = (z === x & y === z & z === y & w === y & c === z ) ? "true" : "false" ;
alert (x);
+ 1
Erraoui Faysal
In C++
#include <iostream>
using namespace std;
int main()
{
bool X=true, y, z, c, w;
cout << boolalpha <<
(X ? (y = true, z = true), (z ? (c = true, w = true) : (c = false, w = false)) : (y = false, z = false));
}
0
I doubt c in 2nd line is useless, because z would already mean that c and w were true.
0
Russ No, you are right.
0
really we need a cup of coffe right now or what we call here atay with naenae (tea with mint)
0
Yes,true
0
Hammadi Abdelmounaim Hello
0
help is java 😣
0
please tell me by don't bother angel
0
https://code.sololearn.com/Wc5ncgkpNjwR/?ref=app