-1

My question is:


** (De Morgans law) , De Morgans law can sometimes make it more convinient for us to express a logical ex-pression. These laws state that the ex-pression ! (condition 1 && condition 2) is logically equivalent to the ex-pression (!condition 1 || ! condition 2). Also the ex-pression !(condition 1 && condition 2) is equivalent to the ex-pression (!condition1 && !condition 2).Use De Morgans law to write equivalent ex-pressions for each of the following , and then write a program to show that the orginal ex-pression and the new ex-pression are equivalent in each case:


a) !(x<5) && !(y>=7)
b) !(a==b) || ! (g!=5)
c) !((x<=8) && (y>4))
d) !((i>4)|| (j<=6))


Can anyone post me the answer for this.

it will be real help for me .
thanks.

4
Contributors
3
Replies
4
Views
11 Years
Discussion Span
Last Post by nHXenos
0

>>Would it be correct to say that you are asking us to answer your homework? <<
I think tha would be a fair assumption. Seems to me like the kind of request that gets students spelled very often.

That looks like a fun assignment though. It also looks like a full day of work.

Good luck.

0

Well demorgans law just states that you can make a new statement by using and instead of or and its the same thing. Let me take this example:

!(x<5) && !(y>=7)

That would be equal to (!(x<5)|| !(y>=7))
A program that proves that could be

import java.util.Scanner


Scanner keyboard = new Scanner(System.in);
system.out.println("Give me an X value");
int x = keyboard.nextInt();
system.out.println("Give me a y value");
int y = keyboard.nextInt();
if (!(x<5)|| !(y>=7))
{
system.out.println("The first statement is true");
else
   {
    system.out.println("The first statement is false");
   }
}

if (!(x<5) && !(y>=7))
{
system.out.println("The second statement is true");
else
   {
    system.out.println("The second statement is false");
   }
}

your homeworks probably past due but I hope this helps for the future!

Edited by Ezzaral: Added code tags. Please use them to format all code that you post.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.