Maths problem

This is a discussion on Maths problem within the A Brief History of Cprogramming.com forums, part of the Community Boards category; In a town there was a population of 660 dogs and cats. Although, many of the dogs and cats were ...

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    367

    Maths problem

    In a town there was a population of 660 dogs and cats. Although, many of the dogs and cats were crazy. 25% of the actual dogs thought they were cats, and 20% of the actual cats thought they were dogs.

    In a poll regarding whether one is dog or cat, in which every animal of this population participated, 40% answered "cat".

    How many dogs respectively cats were there in this population?
    Last edited by Zewu; 11-13-2002 at 12:24 PM.

  2. #2
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,825
    I'm not sure about the math, but I think there's somewhere in the neighborhood of 480 dogs and 170 cats... I'm not sure what happened to the other 10, though. We'll just assume they're rats.

  3. #3
    BMJ
    BMJ is offline
    Banal internet user BMJ's Avatar
    Join Date
    Aug 2002
    Location
    Chicagoland
    Posts
    1,380
    I'm not sure either... but I get

    463 dogs: 116 of them think they're cats
    197 cats: 40 of them think they're dogs

    edit: well, it's wrong... doesn't work out
    Last edited by BMJ; 11-13-2002 at 12:50 PM.

  4. #4
    Lead Moderator kermi3's Avatar
    Join Date
    Aug 1998
    Posts
    2,595
    I do know the math and the answer is:

    180 Cats
    480 Dogs

    I can explain the math if somone wants
    Kermi3

    If you're new to the boards, welcome and reading this will help you get started.
    Information on code tags may be found here

    - Sandlot is the highest form of sport.

  5. #5
    Registered User
    Join Date
    Dec 2001
    Posts
    367
    I'd be delighted if you could explain for us how you got to this conclusion
    Last edited by Zewu; 11-13-2002 at 01:04 PM.

  6. #6
    Lead Moderator kermi3's Avatar
    Join Date
    Aug 1998
    Posts
    2,595
    Is this for homework? A stats class perhaps?

    Basically is this graded? If not I'll explain heh.
    Kermi3

    If you're new to the boards, welcome and reading this will help you get started.
    Information on code tags may be found here

    - Sandlot is the highest form of sport.

  7. #7
    Registered User
    Join Date
    Nov 2002
    Posts
    1
    no homework, we had this question on a math test we had yesterday but nobdy didn't make it, and we want the solution..
    Last edited by tedde; 11-13-2002 at 01:18 PM.

  8. #8
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    no problem - make the number of cats be "x", then the number of dogs is "660-x". Now, 40% of 660 said they were cats, which is 264. 80% of the cats say they are cats, 25% of the dogs think they are cats, therefore the equation becomes:

    .8*x+.25*(660-x)=264

    work the equation, and x=180, so the number of cats is 180, the number of dogs is 480. Sucks to be a cat in this town

  9. #9
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,136
    .25d + .8c = .4*660
    d + c = 660

    Solve the system.


    Edit: PJ beat me with a different way.

  10. #10
    Lead Moderator kermi3's Avatar
    Join Date
    Aug 1998
    Posts
    2,595
    Ah ok, well I'm drawing an easy to read explanation....of why it all works:
    Kermi3

    If you're new to the boards, welcome and reading this will help you get started.
    Information on code tags may be found here

    - Sandlot is the highest form of sport.

  11. #11
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,802
    Well...

    .75D + .20C = .60 * 660 and
    .25D + .80C = .40 * 660

    So...

    .75D + .20C = 396 and
    .25D + .80C = 264

    Continuing...

    .75D + .20C = 396 and
    -.75D - 2.40C = -792

    Adding we get...

    -2.2C = -396

    Dividing we have...

    C = 180

    Since C+D=660, and C=180, D=480. Did I make any mistakes?
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

  12. #12
    Lead Moderator kermi3's Avatar
    Join Date
    Aug 1998
    Posts
    2,595
    Ok then...Here's the answer:

    Check out the picture, we know what's in black, red's from my calculations.

    Oh I should explain it....

    The numbers are the percent of something happenning given what was on the previous branches, so there's a .25 chance that a dog answered cat. And due to the nature of probablilty there is a .727*.25 chance that you will randomly pick a dog that answered cat

    Now the total number AC is:

    AC=.8c +.2d
    .4 * 660 = .8c +.2d

    Using d = 660 - c:

    .4*660 = .8c + .2(660 - c)
    .4*660 = .8c + 165-.25c
    Solve it all:

    c = .273 - That's the pecent of cats
    and of course since c% + d% much = 1; d% = .727

    now C%*660=number of cats
    and D%*660=number of dogs

    and therefore 480 cats and 180 dogs

    The other numbers (.454 and .546) I used to check it.
    Attached Images Attached Images  
    Kermi3

    If you're new to the boards, welcome and reading this will help you get started.
    Information on code tags may be found here

    - Sandlot is the highest form of sport.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  2. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  3. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  4. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 05:24 PM
  5. beginner problem
    By The_Nymph in forum C Programming
    Replies: 4
    Last Post: 03-05-2002, 04:46 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21