Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jan 2006
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Truth Table Question

    Hi All,

    Please could somebody advise me on my query about truth tables?

    Is

    NOT (NOT A AND B) as shown below

    A B
    T T
    F F

    and does

    A OR NOT B mean the same thing?

    A B
    T T
    F F

    This was part of a question in an assignment that I had to submit by yesterday, which I did, but unfortunately I still don't think I have the gist of this!

    Thank you in advance.

  • #2
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    Not quite sure what this has to do with Javascript, and my formal logic is a bit rusty, but basically, it depends what you mean by 'means the same as'. As I remember, there are two ways of saying this with logic, 'entailment' and something else that I forget the term for, |= and |- if you're writing them I believe.
    Dpending on which you want to use, then the answer is 'yes' or 'no', but I forget which way round. If you have a textbook for this, then it will probably tell you, as I think this was an example of the difference on our course.

    I could, of course, be getting confed, and this might all be wrong.

  • #3
    New Coder
    Join Date
    Jan 2006
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question

    Hi GJay,

    Thanks for your reply to my query. The truth table was part of an assignment that I have just had to submit in my Javascript course, so although I am having trouble getting my head around it it must have something to do with Javascript somewhere along the line. The problem I am having is with the double negative, ie; does NOT (NOT A AND B) mean it is A and B, ie; A is True and B is True? The way I have written the table is exactly how it was posed in the test paper.

    Thanks for trying to help though.

    Kindest regards,

    Jenny

  • #4
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    Code:
    a=array(true,false);
    b=array(true,false);
    i=0;
    while(i<a.length) {
      j=0;
      while(j<b.length) {  
        alert((!(!a[i]&&!b[j]))==(a[i]||!b[j]));
        j++;
      }
      i++;
    }
    Will show whether the statement:
    !(!a&&!b))=a||!b
    is always true (i.e. each side is the same)

  • #5
    New Coder
    Join Date
    Jan 2006
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi GJay,

    Thank you for your coding, I really appreciate your help.


    Kindest regards,

    Jenny

  • #6
    jkd
    jkd is offline
    Senior Coder jkd's Avatar
    Join Date
    May 2002
    Location
    metro DC
    Posts
    3,163
    Thanks
    1
    Thanked 18 Times in 18 Posts
    Just use DeMoivre's theorem:

    !(!A & B) = !!A | !B = A | !B

    Thus, NOT (NOT a AND b) is equivalent to: a OR NOT b


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •