CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11

Thread: Truth Tables

  1. #1
    Join Date
    Jun 2008
    Posts
    3

    Question Truth Tables

    Hi,

    Sorry if this thread doesn't belong here... but anyways I need help understanding a truth table I was given. I think I understand it for the most part but I'm confused as to how the last statement results in a true value?

    p = T
    q = F
    p Λ q = F
    p V q = T
    ~ ( p Λ q) = T
    (p Λ q) V ~ (p V q) = T


    I worked out the last statement as follows:

    (p Λ q) = F
    (p V q) = T
    ~(p V q) = F
    (F) V F = F

    So that contradicts what the book says. Also I checked the errata for this book too and it doesn't mention this as an error. So I'm guessing I got something wrong with precedence.. any help would be greatly appreciated. Thank you!

    EDIT: I pulled the statement from this truth table:
    http://img258.imageshack.us/img258/9333/ttableme4.jpg
    Last edited by SEUNG1; June 21st, 2008 at 06:57 PM.

  2. #2
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: Truth Tables

    IF that is all the information you are given, then the solution is indeterminate.

    For example "If P is True then Q is True" does not impose ANY contraints on Q if P is False.

    It is the same below:

    T^F is known to be F by virtuel of the first three statements. But
    T^T F^T F^F are ALL unknown results.....
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  3. #3
    Join Date
    Jun 2008
    Posts
    3

    Re: Truth Tables

    Hi CPUWizard, thanks for taking the time to help me out.

    I'm a bit confused now how the solution is indeterminate.. are you suggesting that p and q actually have different values in the last statement than the other statements? If so, wouldn't that contradict the table? I should have stated this before but the values I gave in my post were from a specific row in the following table:


    p | q | p Λ q | p V q | ~ ( p Λ q) | (p Λ q) V ~ (p V q)

    T T T T F T
    T F F T T T
    F T F T T T
    F F F F T T

    EDIT: Sorry about the poor quality of the table, it's difficult to format with this editor. I'll try to post an image.

    EDIT 2: I uploaded an image of the table. Here it is:
    http://img258.imageshack.us/img258/9333/ttableme4.jpg
    Last edited by SEUNG1; June 21st, 2008 at 07:00 PM.

  4. #4

    Re: Truth Tables

    It does look like the last column heading should be (p V q ) V ~ ( p Λ q) instead of (p Λ q) V ~ (p V q)

  5. #5
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: Truth Tables

    What I am stating is that you have NOT provided sufficient EXPLICIT information. There is NO definition of "v" and "^". Thereofre....

    1) Only one (out of a possible 4) input patterns yields a defined output

    or

    2) You are using the conventional meanings (which makes parts 3&4 redundant).
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  6. #6

    Re: Truth Tables

    Would you expect an arithmetic question to start with a definition + and - ? It is sparingly unlikely that any text book on logic which uses standard logical and and or symbols to mean anything else, but unfortunately common for basic typos to exist in them. I've even got one where no 'fi' ligatures are printed, which makes it completely unreadable.

  7. #7
    Join Date
    Jun 2008
    Posts
    3

    Re: Truth Tables

    My apologies.. I thought those symbols were universal in meaning. Here are their definitions:

    ~ stands for 'not'
    Λ stands for 'and'
    V stands for 'or'


    I'm going to assume that what pm_kirkham said is the case.. I can't see any way that the entire last column consists of just true values without contradicting prior statements.

    Thanks for your guys' help btw
    Last edited by SEUNG1; June 22nd, 2008 at 08:47 PM.

  8. #8
    Join Date
    Feb 2008
    Posts
    966

    Re: Truth Tables

    The Λ and V are indeed very standard (although they are usually represented by U and not V, I understood their meaning).

    I think you are reading too much into the problem.

    (p Λ q) V ~ (p V q) = T

    Is a false statement, plain and simple. It is probably just a typo or some oversight.

    (p Λ q) = F
    (p V q) = T
    -------------
    ~(p V q) = F

    Therefore: F V F != T

    EVEN if they are saying that V is an exclusive or.

  9. #9
    Join Date
    Apr 2007
    Location
    Mars NASA Station
    Posts
    1,436

    Re: Truth Tables

    How to code truth table in program ?

  10. #10
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: Truth Tables

    Quote Originally Posted by ProgramThis
    The Λ and V are indeed very standard (although they are usually represented by U and not V, I understood their meaning).
    I agree that they are, but then the post contains redundant information:

    (p Λ q) = F
    (p V q) = T
    Since the source of the 'problem' was unknown, makin any assumptions would [IMHO] be a mistake.
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  11. #11
    Join Date
    Mar 2007
    Location
    Argentina
    Posts
    579

    Re: Truth Tables

    Quote Originally Posted by Peter_APIIT
    How to code truth table in program ?
    Do you want to code an equivalent sequence of conditional lines, or want a function which returns the right boolean answer, equal to an arbitrary truth table?
    (Second option is easy)
    Last edited by Marraco; October 23rd, 2008 at 12:22 PM.
    [Vb.NET 2008 (ex Express)]

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured