Alternative Plans

This started out as a series of Advent challenges a couple of Christmases ago, but is now open for anyone to post challenges on any topic!
DDRM

Alternative Plans

Post by DDRM »

Due to the impact of both bird flu and Covid, our romantic friend from the first challenge has had to revise his plans – he has now bought a nice woolly hat and scarf from M&S (other retailers available) for his True Love.

He has cancelled most of his previous orders, and the Covid guarantee on the hotel bookings means they won’t cost anything, but he has been left with a substantial aviary, with space for 200 birds. He has retained options on the French hens (3 a day, starting on day 3 of Christmas (December 27th)) and the geese a-laying (6 a day, starting on day 6), and is thinking of starting a poultry business. To keep life simple, he only wants to have one kind of bird.

Assume that the hens cost £5 each, and the geese £10 each, and that they will all start laying straight away and lay an egg each day. These terms are guaranteed for the current orders (10 days’ worth of hens, or 7 of geese), but after that no more will be available for purchase. Feeding a hen costs 5p/day; a goose’s food costs 20p/day.

He can either sell the eggs (15p each for hen’s eggs, or 50p each for goose eggs), or allow them to hatch (21 days for hens; 30 days for geese) to increase the flock: it takes 4 months for hens to mature to laying point, but geese take 9 months! Alternatively, excess hens can be sold at 3 months for £3: geese can be sold at 6 months for £8.

What is his optimal strategy, considered over the first year (up to Christmas Day 2022)? How much will he make (or lose...)? If he was prepared to wait until Christmas 2023, would it change your strategy?

Hint: this problem is small enough that you could simply model it completely, though you may wish to consider some basic strategies (raise/sell eggs or poultry? How many laying/non-laying birds can you keep? Chickens or geese?). I've deliberately spread the start days for the poultry out, so there may not be a simple "closed" solution....
jgharston
Posts: 37
Joined: Thu 05 Apr 2018, 14:08

Re: Alternative Plans

Post by jgharston »

My first stab assumes that hens live forever, and I sell all the eggses. After three weeks losing money, you get a steady profit of £3 per day.

Code: Select all

      REM > Hens
      REM 10 days = buy 10 x 3 hens at £5 each
      REM 1 hen lays 1 egg per day
      REM 21 days for egg to hatch
      REM 120 days (4 months) for chick to mature to laying
      :
      day%=2:hens%=0:eggs%=0:spend%=0:sale%=0
      cost%=500:REM £5 per day to feed hens
      feed%=005:REM 5p per day to feed hens
      eggprice%=15:REM Sell for 15p
      REPEAT
        IF (day% MOD 20)=2:PRINT"Day Hens Eggs | Spend TotalSpend | EggsSold Income TotalIncome | Net      TotalNet"
        day%=day%+1
        IF day%<13 THEN hens%=hens%+3:spend%=spend%+cost%*3
        IF day%>3 THEN eggs%=eggs%+hens%
        todayspend%=hens%*feed%
        spend%=spend%+todayspend%
        :
        PRINT TAB(0);day%;SPC1;
        PRINT TAB(5);hens%;SPC1;
        PRINT TAB(10);eggs%;SPC1;
        PRINT TAB(16)"£";FNdp(todayspend%,2);SPC1;
        PRINT TAB(24)"£";FNdp(spend%,2);SPC1;
        :
        sold%=eggs%
        PRINT TAB(38);sold%;SPC1;
        todaysale%=sold%*eggprice%
        sale%=sale%+todaysale%:eggs%=eggs%-sold%
        PRINT TAB(45)"£";FNdp(todaysale%,2);SPC1;
        PRINT TAB(55)"£";FNdp(sale%,2);SPC1;
        :
        PRINT TAB(65)"£";FNdp(todaysale%-todayspend%,2);SPC1;
        PRINT TAB(75)"£";FNdp(sale%-spend%,2);
        IFGET
        PRINT
      UNTIL FALSE
      END
      :
      DEFFNdp(A%,N%)=STR$(A%DIV100)+"."+RIGHT$("0"+STR$(100+A%MOD100),2)