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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

logical expressions without using negation

  • 07-08-2011 7:39pm
    #1
    Registered Users, Registered Users 2 Posts: 1,872 ✭✭✭


    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, Registered Users 2 Posts: 1,872 ✭✭✭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, Registered Users 2 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, Registered Users 2 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, Registered Users 2 Posts: 89 ✭✭tehjimmeh


    The not equal to operator isn't negation.


  • Advertisement
  • Registered Users, Registered Users 2 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, Registered Users 2 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, Registered Users 2 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, Registered Users 2 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, Registered Users 2 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