+ 1

X=>yz, z=>cw X=>yzc

is it true?

11th Nov 2019, 2:36 PM
Erraoui Faysal
Erraoui Faysal - avatar
25 ответов
+ 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.
11th Nov 2019, 3:04 PM
Seb TheS
Seb TheS - avatar
+ 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.
11th Nov 2019, 3:27 PM
Russ
Russ - avatar
+ 2
Code is true and result depends on variables' value
11th Nov 2019, 8:17 PM
Davron
Davron - avatar
+ 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. ?
11th Nov 2019, 2:43 PM
Seb TheS
Seb TheS - avatar
+ 1
yes
11th Nov 2019, 2:45 PM
Erraoui Faysal
Erraoui Faysal - avatar
+ 1
either true or false the question is how to rewerite the condition by using ternary operation :)
11th Nov 2019, 2:52 PM
Erraoui Faysal
Erraoui Faysal - avatar
+ 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.
11th Nov 2019, 3:11 PM
Russ
Russ - avatar
+ 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.
11th Nov 2019, 3:17 PM
Seb TheS
Seb TheS - avatar
+ 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);
11th Nov 2019, 7:38 PM
Erraoui Faysal
Erraoui Faysal - avatar
+ 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)); }
13th Nov 2019, 12:06 PM
Abdul Wahab Chattha
Abdul Wahab Chattha - avatar
0
I doubt c in 2nd line is useless, because z would already mean that c and w were true.
11th Nov 2019, 2:48 PM
Seb TheS
Seb TheS - avatar
0
Russ No, you are right.
11th Nov 2019, 3:12 PM
Seb TheS
Seb TheS - avatar
0
really we need a cup of coffe right now or what we call here atay with naenae (tea with mint)
11th Nov 2019, 3:25 PM
Erraoui Faysal
Erraoui Faysal - avatar
0
Yes,true
12th Nov 2019, 2:39 PM
Differentical
Differentical - avatar
12th Nov 2019, 5:07 PM
Seb TheS
Seb TheS - avatar
0
help is java 😣
13th Nov 2019, 11:37 AM
Higer
0
please tell me by don't bother angel
13th Nov 2019, 12:14 PM
শাওন আহমেদ
শাওন আহমেদ - avatar
13th Nov 2019, 12:14 PM
শাওন আহমেদ
শাওন আহমেদ - avatar
0
https://code.sololearn.com/Wc5ncgkpNjwR/?ref=app
13th Nov 2019, 2:19 PM
শাওন আহমেদ
শাওন আহমেদ - avatar