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

Need someone to explain Boolean Expressions Please?

  • 22-02-2009 5:23pm
    #1
    Registered Users, Registered Users 2 Posts: 79 ✭✭


    Hi Everyone,
    I need to know how to do truth tables and it said here : Show the truth table for AND (2 variables), OR (2 variables) ,NOT

    I've also got Show the truth table for NAND (2 variables), NOR (2 variables), NOT

    Theres 3 variables and 4 variables in some of the maths also.

    Then theres Do truth tables for each of the following equations

    (i) Z = A + B.C
    (ii) Z = A.B + C
    (v) Z = A(C + D) + AB.

    I looked up the net and found this link which explained everything but i'm sorry i can't do maths and this makes no sences whats so ever to me so could someone explain it to me please?

    http://en.wikipedia.org/wiki/Truth_table


Comments

  • Registered Users, Registered Users 2 Posts: 1,163 ✭✭✭hivizman


    One way to think of it is to make the situation less abstract. "A", "B", "C" etc stand for statements (technically referred to as "propositions"), which can be everyday sentences like "Pat is Irish" or "my car is silver". A truth table is a systematic way of demonstrating whether a complex statement made up of various simple statements in logical relationship to each other will be true or false, given all the possible combinations of truth or falsity of the simple statements.

    The easiest logical relationship is negation, NOT. Let's take the statement "A" to be "Pat is Irish". The negation of this, NOT A, (or sometimes written "-A" or "~A") is the statement "Pat is not Irish" (strictly "It is not the case that Pat is Irish"). The statement "Pat is Irish" can be either true or false. If the statement A is true, its negation is false, because Pat can't be both Irish and not Irish. (At least in logic! This is something called the "law of excluded middle"). On the other hand, if the statement A is false (that is, Pat is not Irish), its negation is true. This can be expressed in a table, see the Wikipedia article for this.

    With two statements A and B, we have four possible combinations of truth and falsity (both true, A true but B false, A false but B true, and both false). The Boolean operator AND implies that you are constructing the complex statement A AND B. This is true if, and only if, BOTH the statements A and B taken separately are true. If A is "Pat is Irish" and B is "my car is silver", then the complex statement "Pat is Irish AND my car is silver" is true if, and only if, BOTH Pat is Irish AND my car is silver. If either one of these simple statements is false, the combined statement A AND B must be false, and similarly if both statements are false. Again, this can be represented in a truth table as shown in the Wikipedia article.

    Things get more complicated with more than two statements, for example with four statements there are 16 combinations of truth and falsity. The way to use truth tables is to build up to the final statement by working out the truth values of the components of the statement, and then combining the components to build up the whole statement. By the way, is "+" the same as "AND" and "." the same as "OR", or is it the other way round?


  • Registered Users, Registered Users 2 Posts: 79 ✭✭blathnaid21


    Could you make another example using letters 4 me please? i don't want anyone to do my work 4 me. i just need to understand it is all.you can use one of questions and i might understand it then. sorry i'm useless at maths.


  • Registered Users, Registered Users 2 Posts: 1,163 ✭✭✭hivizman


    Don't think of it as maths!

    Let's take the first one of your problems: Z = A + B.C

    In this notation, "." means "AND" (in logic, this is called "conjunction"), and "+" = "OR" (in logic, this is called "disjunction").

    So the expression Z can be written out as: Z = A OR (B AND C) - note that I have put brackets around the second element of the expression to clarify that this is a different expression from (A OR B) AND C. Just as in ordinary arithmetic we do multiplications in an expression before additions, so in a Boolean expression we do AND before OR.

    Remember the original sentences A = "Pat is Irish" and B = "my car is silver". Let's have a new sentence C = "the Liffey flows through Dublin". Then the sentence Z can be restated as:

    Pat is Irish OR (my car is silver AND the Liffey flows through Dublin).

    The bit of the sentence in brackets is true if, and only if, it is true both that my car is silver and the Liffey flows through Dublin, and false if either or both of these statements is false. The whole sentence is true if (1) Pat is Irish, whatever is the case about whether or not my car is silver and whether or not the Liffey flows through Dublin, and (2) my car is silver and the Liffey flows through Dublin (even if Pat is not Irish).

    This is where the truth tables come in and actually make things easier.

    This is the truth table for the second part of the expression (B AND C):

    B C B AND C
    T T T
    T F F
    F T F
    F F F


    It basically says that the only situation where the statement B AND C is true is when both B and C separately are true.

    If we then include the other statement A, and prepare a truth table for the compound expression A OR (B AND C), we get the following truth table:

    A B C B AND C A A OR (B AND C)
    T T T T T T
    T T F F T T
    T F T F T T
    T F F F T T
    F T T T F T
    F T F F F F
    F F T F F F
    F F F F F F


    This table has eight lines, because there are 2 x 2 x 2 = 8 possible combinations of true and false for three statements. All the possible combinations are listed. I have then shown the truth values (T or F) for the expression B AND C. The fifth column simply repeats the first column for clarity. The last column is T if either or both of the truth values in the previous two columns is T, or F if both of the truth values in the previous two columns is F.

    The final column has five cases where the compound sentence is true. The first four of these correspond to the situation where sentence A is true, whether or not either or both of B and C are true or false, while the fifth case is the situation where both B and C are true, even though A is false.

    Sorry that this is a long-winded explanation, but just to remind you, this isn't maths, it's just logic.


Advertisement