Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

logical expressions without using negation

Options
  • 07-08-2011 8:39pm
    #1
    Registered Users Posts: 1,849 ✭✭✭


    Hi guys,Just going over exam papers and coming over different results for the following question(Might be abit sleep as its a sunday :rolleyes: ),What is the correct answers tho :o

    Give equivalent logical expressions for the following without using negation:

    1) !(a > b)
    2) !(a <= b && c <= d)
    3) !(a + 1 == b + 1)
    4) !(a < 1 || b < 2 && c <3)

    Many thanks in advanced.


Comments

  • Closed Accounts Posts: 460 ✭✭murraykil


    1) !(a > b)
    2) !(a <= b && c <= d)
    3) !(a + 1 == b + 1)
    4) !(a < 1 || b < 2 && c <3)

    a <= b
    a > b && c > d
    a > b ¦¦ b > a
    a >= 1 ¦¦ b >= 2 && c >= 3


  • Registered Users Posts: 1,849 ✭✭✭Bummer1234


    murraykil wrote: »
    1) !(a > b)
    2) !(a <= b && c <= d)
    3) !(a + 1 == b + 1)
    4) !(a < 1 || b < 2 && c <3)

    a <= b
    a > b && c > d
    a > b ¦¦ b > a
    a >= 1 ¦¦ b >= 2 && c >= 3

    Had the first one but could not figure the 2-4 ones...Thanks a million murraykil


  • Registered Users Posts: 89 ✭✭tehjimmeh


    murraykil wrote: »
    1) !(a > b)
    2) !(a <= b && c <= d)
    3) !(a + 1 == b + 1)
    4) !(a < 1 || b < 2 && c <3)

    a <= b
    a > b && c > d
    a > b ¦¦ b > a
    a >= 1 ¦¦ b >= 2 && c >= 3
    Err.. no.


    1)
    !(a > b)
    a <= b

    2)
    !(a <= b && c <= d)
    !(a <= b) || !(c <= d) ... De Morgan's law
    a > b || c > d

    3)
    !(a + 1 == b + 1)
    a + 1 != b + 1

    4)
    !(a < 1 || b < 2 && c < 3)
    !(a < 1) && !(b < 2 && c < 3) ... De Morgan's law
    !(a < 1) && !(b < 2) || !(c < 3) ... De Morgan's law
    a >= 1 && b >= 2 || c >= 3


  • Registered Users Posts: 3,078 ✭✭✭onemorechance


    Bummer1234 wrote: »
    without using negation
    tehjimmeh wrote: »
    Err.. no.
    3)
    !(a + 1 == b + 1)
    a + 1 != b + 1
    :confused:


  • Registered Users Posts: 89 ✭✭tehjimmeh


    The not equal to operator isn't negation.


  • Advertisement
  • Registered Users Posts: 3,078 ✭✭✭onemorechance


    tehjimmeh wrote: »
    The not equal to operator isn't negation.

    I would have thought that's exactly what it is. :confused:


  • Registered Users Posts: 255 ✭✭boblong


    I would have thought that's exactly what it is.

    Surely negation is unary, but not-equals is binary (2-arity) no?


  • Registered Users Posts: 3,078 ✭✭✭onemorechance


    Yes, that distinction makes it clear to me now! Good stuff!


  • Closed Accounts Posts: 460 ✭✭murraykil


    Bummer1234 wrote: »
    Had the first one but could not figure the 2-4 ones...Thanks a million murraykil
    tehjimmeh wrote: »
    Err.. no.


    1)
    !(a > b)
    a <= b

    2)
    !(a <= b && c <= d)
    !(a <= b) || !(c <= d) ... De Morgan's law
    a > b || c > d

    3)
    !(a + 1 == b + 1)
    a + 1 != b + 1

    4)
    !(a < 1 || b < 2 && c < 3)
    !(a < 1) && !(b < 2 && c < 3) ... De Morgan's law
    !(a < 1) && !(b < 2) || !(c < 3) ... De Morgan's law
    a >= 1 && b >= 2 || c >= 3

    Ooops! Sorry! :o


  • Closed Accounts Posts: 25 iDigian


    tehjimmeh wrote: »
    The not equal to operator isn't negation.

    Are you not negating the equals?


  • Advertisement
  • Registered Users Posts: 7,157 ✭✭✭srsly78


    3) (a > b) || (a < b)

    edit: oops second post got it. Just pointing out the +1 is a red herring.


  • Registered Users Posts: 89 ✭✭tehjimmeh


    iDigian wrote: »
    Are you not negating the equals?
    No...

    Negation is a unary operation on an expression equal to true if the expression is false and false if the expression is true.
    The not equal to operator is a binary operation on two expressions which equates to true if the expressions do not equate to both true or both false.

    It's the negation of equality in the same sense that >= is the negation of <. The point here is not to use the unary negation operator, which it does not. It's commonly written in programming as "!=", and perhaps the exclamation mark is causing confusion? I could have also written it like 'a + 1 != b + 1', 'a + 1 ≠ b + 1' or 'a + 1 <> b + 1'.


Advertisement