Results 1 to 3 of 3

Math Help - counting sets

  1. #1
    Newbie
    Joined
    Dec 2009
    Posts
    12

    counting sets

    Please help to solve the following problem.

    I own twenty-three programming textbooks. Nine of them cover Java, ten cover Python, and ten cover C++. Three cover Java and C++, one covers Python and C++, and two cover Python and Java. How many cover only Python?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Oct 2009
    Posts
    5,517
    Thanks
    769
    This can be solved using Inclusion–exclusion principle (IEP). Let us denote the sets of books covering each language as J, P, and C. The set of all books is J\cup P\cup C, though these three sets intersect invarious ways. By IEP,

    |J\cup P\cup C|=|J|+|P|+|C|-|J\cap P|-|J\cap C|-|P\cap C|+|J\cap P\cap C|

    You know the left-hand side and all but the last term in the right-hand side, so you can find the last one.

    Next, Let PO be the set of books about Python only. Then P=PO\cup (P\cap C)\cup (P\cap J). Again we have the union of three sets. Apply IEP to this union. This will allow you to find |PO|.

    It may also help looking at the three-set diagram on the Wikipedia page given above.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Dec 2009
    Posts
    12
    Thanks that really helped.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Counting Sets
    Posted in the Discrete Math Forum
    Replies: 3
    Last Post: April 21st 2010, 03:39 AM
  2. sets and counting
    Posted in the Discrete Math Forum
    Replies: 1
    Last Post: November 3rd 2009, 09:08 PM
  3. G-sets to counting
    Posted in the Advanced Algebra Forum
    Replies: 3
    Last Post: December 15th 2008, 11:52 AM
  4. Counting Sets
    Posted in the Discrete Math Forum
    Replies: 6
    Last Post: July 26th 2007, 03:34 AM
  5. Sets and counting
    Posted in the Advanced Algebra Forum
    Replies: 8
    Last Post: March 7th 2006, 03:35 AM

Search Tags


/mathhelpforum @mathhelpforum