Enjoy an ad free experience by logging in. Not a member yet? Register.

Results 1 to 6 of 6
Thread: Truth Table Question

01252006, 07:24 PM #1
 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.

01252006, 08:31 PM #2
 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.

01252006, 08:44 PM #3
 Join Date
 Jan 2006
 Posts
 17
 Thanks
 0
 Thanked 0 Times in 0 Posts
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

01252006, 10:46 PM #4
 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++; }
!(!a&&!b))=a!b
is always true (i.e. each side is the same)

01262006, 12:52 AM #5
 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

01262006, 02:13 AM #6
Just use DeMoivre's theorem:
!(!A & B) = !!A  !B = A  !B
Thus, NOT (NOT a AND b) is equivalent to: a OR NOT b