Question

In: Computer Science

[x, y, and z are integer variables, which expressions are equivalent to each other?] a. (x==y...

[x, y, and z are integer variables, which expressions are equivalent to each other?]

a. (x==y && x !=z) || (x!=y && x==z)

b. (x==y || x==z) && (x!=y || x!=z)

c. (x==y) != (x==z)

Solutions

Expert Solution

We will be breaking down the following expressions similar to simple englisg statements as follows

1. (x==y && x !=z) || (x!=y && x==z)

   In this experssion we see that X is equal to Y and X is not equal to Z. Secondly we see that X is equal to

   Z but X is not equal to Y.

   Conclusion: So we can conclude that X is equal to Y |Z but not the other

   Explanation: Here we can see that in the first case When X is equal to Y it is not equal to Z and vice versa when

                       X is equal to Z then it is not equal to Y.

2. (x==y || x==z) && (x!=y || x!=z)

    In this case we see that X is equal to Y or X is equal to Z and X is not equal to Y or X is not equal to Z

Conclusion: X is eequal to one of the two values and X is not equal to one of the two values

    Explanation: Here in this Expression we see that the Left hand side is true if any one ofthe value is true and on

                       the Right Hand Side is true if any one of the value is not equal to other. but both are required to

                       true as AND operator is between them

3. (x==y) != (x==z)

      Here in this Expression we see thar in Left Hand side X is equal to Y and in the Right hand side we see that

     Xis equal to Z but the Left hand side should be complement of Right hand side and Vice Versa.

     Conclusion:So we can conclude that X is equal to Y |Z but not the other

     Explanation: In the above expression we see that If X is equal to Y then it should be equal to Z and

                        on the other side if X is equal to Z it should not be equal to Y

                     

    


Related Solutions

x, y, z, w, u and t are integer variables, what will their value be after...
x, y, z, w, u and t are integer variables, what will their value be after the execution of the statements below. Give the final value of each variable x = 7; y = x + 1; z = x % (y – 2) + 4; y = (y + z ) % (x + 4) ; w = (x * y) / (z – 3); x = x + x; u = w - 3; t = z +...
Assume that X, Y, and Z are independent random variables and that each of the random...
Assume that X, Y, and Z are independent random variables and that each of the random variables have a mean of 1. Further, assume σX = 1, σY = 2, and σZ = 3. Find the mean and standard deviation of the following random variables: a. U = X + Y + Z b. R = (X + Y + Z)/3 c. T = 2·X + 5·Y d. What is the correlation between X and Y? e. What is the...
The joint density function for random variables X, Y, and Z is f(x, y, z)= Cxyz  if...
The joint density function for random variables X, Y, and Z is f(x, y, z)= Cxyz  if 0 ≤ x ≤ 1, 0 ≤ y ≤ 2, 0 ≤ z ≤ 2, and f(x, y, z) = 0 otherwise. (a) Find the value of the constant C. (b) Find P(X ≤ 1, Y ≤ 1, Z ≤ 1). (c) Find P(X + Y + Z ≤ 1).
Write down expressions for the first-order partial derivatives, ?z and ?z for ?x ?y (a)z=x2 +4y5...
Write down expressions for the first-order partial derivatives, ?z and ?z for ?x ?y (a)z=x2 +4y5 (b)z=3x3 ?2ey (c)z=xy+6y (d)z=x6y2 +5y3
1) Generate a data set with three variables (X, Y and Z). X and Y have...
1) Generate a data set with three variables (X, Y and Z). X and Y have 10 observations for each (N=10), and Z has 13 observations (N=13). Each observation should have two digits (such as “83” or “8.3”). 2) Draw a stem-and-leaf display for variable Z only and draw a box plot display for variable Z after specifying the 5 numbers (UEX, LEX, FU, FL, MD). 3) Calculate the mean and standard deviation for variable X 4) Calculate the mean...
Let X, Y and Z be independent random variables, each uniformly distributed on the interval (0,1)....
Let X, Y and Z be independent random variables, each uniformly distributed on the interval (0,1). (a) Find the cumulative distribution function of X/Y. (b) Find the cumulative distribution function of XY. (c) Find the mean and variance of XY/Z.
For each of the formulas below, state whether it is true or false. a) pX,Y,Z(x,y,z)=pY(y)pZ∣Y(z∣y)pX∣Y,Z(x∣y,z)   ...
For each of the formulas below, state whether it is true or false. a) pX,Y,Z(x,y,z)=pY(y)pZ∣Y(z∣y)pX∣Y,Z(x∣y,z)       Select an option         True         False    b) pX,Y∣Z(x,y∣z)=pX(x)pY∣Z(y∣z)       Select an option         True         False    c) pX,Y∣Z(x,y∣z)=pX∣Z(x∣z)pY∣X,Z(y∣x,z)       Select an option         True         False    d) ∑xpX,Y∣Z(x,y∣z)=1       Select an option         True         False    e) ∑x∑ypX,Y∣Z(x,y∣z)=1       Select an option         True   ...
Which of the following are correct for P(x,y,z)= xyz + x(yz)' + x'(y + z) +...
Which of the following are correct for P(x,y,z)= xyz + x(yz)' + x'(y + z) + (xyz)' ? 1) P(0, 0, 1) = 0 2) P(0, 1, 0) = 1 3) P(0, 0, 0) = 1 4) P(1, 1, 1) = 1 5) P(1, 0, 0) = 0
Suppose X and Y are independent variables and X~ Bernoulli(1/2) and Y~ Bernoulli(1/3) and Z=X+Y A-...
Suppose X and Y are independent variables and X~ Bernoulli(1/2) and Y~ Bernoulli(1/3) and Z=X+Y A- find the joint probability table B- find the probility distribution table of Z C- find E(X+Y) D- find E(XY) E- find Cov(X, Y)
The curried version of let f (x,y,z) = (x,(y,z)) is let f (x,(y,z)) = (x,(y,z)) Just...
The curried version of let f (x,y,z) = (x,(y,z)) is let f (x,(y,z)) = (x,(y,z)) Just f (because f is already curried) let f x y z = (x,(y,z)) let f x y z = x (y z)
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT