Propositional Equivalences Rosen 5th and 6th Editions section 1.2
I assume you know what follows
Okay? If not then please read appropriate section from Rosen
// // are functions f and g logically equivalent? public class Obfuscate { public static boolean f(int x,int y){ boolean z; if (!(x>5 || (x<=5 && y<3))) z = true; else z = false; return z; } public static boolean g(int x,int y){return x<=5 && y>=3;} public static void main(String[] args) { int n = Integer.parseInt(args[0]); int m = Integer.parseInt(args[1]); System.out.println(f(n,m) + " " + g(n,m));
What’s the difference between & and && | and ||
Can you think of a reason why we might use | in place of || & in place of &&
Propositional Equivalences