+ Reply to Thread
Results 1 to 4 of 4

Integer iterations in solver

  1. #1
    Stevie D
    Guest

    Integer iterations in solver

    Hello, I am trying to solve the following a puzzle:

    A farmer has exactly £100 to buy exactly 100 animals (He must spend all the
    money and he must buy exactly 100 animals - at least one of each type).

    The animals are:

    Sheep which cost £0.05,
    Pigs which cost £1.00
    and Cows which cost £5.00.

    I have tried using solver to crack this problem (I am assured there is a
    solution) but the answers I'm getting include decimal places (using the
    solver) that changes the values in three cells.

    Excel finds a solution but uses fractions of an animal where only whole
    animals are used in the solution.

    Is it possible to force the solver to use exact integer values?



  2. #2
    Ken Wright
    Guest

    Re: Integer iterations in solver

    Sure, just add constraints within Solver making the adjustable cells
    integer.

    --
    Regards
    Ken....................... Microsoft MVP - Excel
    Sys Spec - Win XP Pro / XL 97/00/02/03

    ------------------------------*------------------------------*----------------
    It's easier to beg forgiveness than ask permission :-)
    ------------------------------*------------------------------*----------------



    "Stevie D" <Steve@127.0.0.1> wrote in message
    news:dbvp4g$rvg$1@newsg2.svr.pol.co.uk...
    > Hello, I am trying to solve the following a puzzle:
    >
    > A farmer has exactly £100 to buy exactly 100 animals (He must spend all
    > the
    > money and he must buy exactly 100 animals - at least one of each type).
    >
    > The animals are:
    >
    > Sheep which cost £0.05,
    > Pigs which cost £1.00
    > and Cows which cost £5.00.
    >
    > I have tried using solver to crack this problem (I am assured there is a
    > solution) but the answers I'm getting include decimal places (using the
    > solver) that changes the values in three cells.
    >
    > Excel finds a solution but uses fractions of an animal where only whole
    > animals are used in the solution.
    >
    > Is it possible to force the solver to use exact integer values?
    >
    >




  3. #3
    Ken Wright
    Guest

    Re: Integer iterations in solver

    Only read if you get stuck:-----------------













    Scroll down
















    And down














    80 Sheep at 0.05 = 4.00
    1 Pig at 1.00 = 1.00
    19 Cows at 5.00 = 95.00
    -----------------------------------------
    100 = 100.00



  4. #4
    Bernard Liengme
    Guest

    Re: Integer iterations in solver

    Solver will try to get integer solutions when asked but depending on the
    setting of Tolerance the results may be values such as 6.9999 instead of 7
    best wishes

    --
    Bernard V Liengme
    www.stfx.ca/people/bliengme
    remove caps from email

    "Stevie D" <Steve@127.0.0.1> wrote in message
    news:dbvp4g$rvg$1@newsg2.svr.pol.co.uk...
    > Hello, I am trying to solve the following a puzzle:
    >
    > A farmer has exactly £100 to buy exactly 100 animals (He must spend all
    > the
    > money and he must buy exactly 100 animals - at least one of each type).
    >
    > The animals are:
    >
    > Sheep which cost £0.05,
    > Pigs which cost £1.00
    > and Cows which cost £5.00.
    >
    > I have tried using solver to crack this problem (I am assured there is a
    > solution) but the answers I'm getting include decimal places (using the
    > solver) that changes the values in three cells.
    >
    > Excel finds a solution but uses fractions of an animal where only whole
    > animals are used in the solution.
    >
    > Is it possible to force the solver to use exact integer values?
    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1