Discrete math question Im stuck on Rewrite the conditional c
Discrete math question I\'m stuck on.
Rewrite the conditional ((c > 5 && b == a) || c >= 5) in a simpler way using a truth table.
(truth table please :D)
update: This is the whole question in the book. I can\'t give anymore information on it beside that a truth table would be something like.... A | B | C
T T T with true and false filled out.
Solution
as given we have to find the truth table for given condition
we have conditional statemnet given by,
((c > 5 && b == a) || c >= 5)
so we can say that we have three different conditions
let we can sau that we have 3 conditional statement
let condition X = c > 5 menas A = true = T when c > 5 otherwise X = false = F
let condition Y = b== a menas B = true = T when b==a otherwise Y = false = F
let condition Z = c >= 5 menas C = true = T when c >= 5 otherwise Z = false = F
we can write our conditional statement as
W = ((c > 5 && b == a) || c >= 5) = ((X && Y) || Z)
so we can say that W = True = T when ((X && Y) || Z) = T otherwise W = F
so find the truth table as below
where,
X = c > 5
Y = b==a
Z = c >=5
W = ((c > 5 && b == a) || c >= 5) = ((X && Y) || Z)
as W = ((X && Y) || Z),
W = T when Z = T
W = T when (X && Y ) = T means when X = T and Y = T
W = F when Z = F and (X && Y ) = F means W = F when Z = F and (X = F or Y = F)
| X | Y | Z | W |
| T | T | T | T |
| T | T | F | T |
| T | F | T | T |
| T | F | F | F |
| T | T | T | T |
| T | T | F | T |
| T | F | T | T |
| T | F | F | F |

