I'm going to make a assumptions here:
- You start at 1 day, even if you do not test, you would be at 0 days the next day. If you are not allowed to add extra days because you still have 2 prisoners left, you would instantly lose. Therefore, I assume you are allowed to add extra days even when you are at 0 days, as long as you have prioners left alive.
- Similar, when you go negative, I still assume you can add extra days as long as you have enough prisoners to do so.
I will use the following strategy:
- If my counter is at 0 or negative, I will use enough prisoners to get it back to 1.
- Any other prisoner left alive is used to get more prisoners.
- I will let the following number of prisoners drink from a new bottle of wine:
- Let N be maximal number of toxic bottles. This is 10 - nr of dead prioners.
- If I have more than 2xN-1 prisoners, all of them will drink wine from a new bottle.
- If I do not have enough prisoners for step 2, only half minus 1 is allowed to drink.
- If all 1000 bottles are tested, or if 10 prisoners have died, I'm done.
Best case this will take me 6 days, if 10 prisoners die on day 5+6.
Usually this will take me 10 days, if the first 495 bottles are safe, I will have all 1000 bottles tested on day 10.
Even with 2 of the 257 bottles tested on day 9 toxic, this will only take 10 days.
In most other cases, I will need 11 days. As long as the first 44 bottles are safe (drunk in the first 6 days), 9 prisoners can die on day 7, and I will still finish testing all bottles by day 11.
Worse case, the first 9 bottles I test are toxic. My run will now extend up to 16 days. This is however, very unlikely.
This solution should have the lowest average number of days. Max dead prisoners it equal to the number of toxic bottles.
If, however, you want the minimal worse case, simply wait till day 11 until you have over 1000 prisoners, and let them all test one bottle at that time.
Example run:
Day 1: 2 prisoners, 0 drink, 0 die, get 1 new.
Day 2: 3 prisoners, 0 drink, 0 die, get 2 new.
Day 3: 5 prisoners, 1 drink, 0 die, get 4 new.
Day 4: 9 prisoners, 3 drink, 0 die, get 8 new.
Day 5: 17 prisoners, 7 drink, 0 die, get 16 new.
Day 6: 33 prisoners, 33 drink, 0 die, get 32 new.
Day 7: 65 prisoners, 65 drink, 0 die, get 64 new.
Day 8: 129 prisoners, 129 drink, 0 die, get 128 new.
Day 9: 257 prisoners, 257 drink, 0 die, get 256 new.
Day 10: 513 prisoners, 505/513 drink, 0-10 die, done.
Some on day 9 die:
Day 9: 257 prisoners, 257 drink, 2 die, get 252 new.
Day 10: 507 prisoners, 505/507 drink, 0-8 die, done.
More likely scenario: some die on day 5:
Day 5: 17 prisoners, 7 drink, 2 die, get 12 new.
Day 6: 27 prisoners, 27 drink, 7 die, get 12 new.
Day 7: 32 prisoners, 32 drink, 0 die, get 31 new.
Day 8: 63 prisoners, 63 drink, 0 die, get 62 new.
Day 9: 125 prisoners, 125 drink, 0 die, get 124 new.
Day 10: 249 prisoners, 249 drink, 0 die, get 248 new.
Day 11: 497 prisoners, 493/497 drink, 0-1 die, done.
Still only 11 days!
Worse case:
Day 1: 2 prisoners, 0 drink, 0 die, get 1 new.
Day 2: 3 prisoners, 0 drink, 0 die, get 2 new.
Day 3: 5 prisoners, 1 drink, 1 die, get 2 new.
Day 4: 6 prisoners, 2 drink, 2 die, get 1 new.
Day 5: 5 prisoners, 1 drink, 1 die, get 2 new.
Day 6: 6 prisoners, 2 drink, 2 die, get 1 new.
Day 7: 5 prisoners, 1 drink, 1 die, get 2 new.
Day 8: 6 prisoners, 6 drink, 2 die, get 1 new.
Day 9: 5 prisoners, 5 drink, 0 die, get 4 new.
Day 10: 9 prisoners, 9 drink, 0 die, get 8 new.
Day 11: 17 prisoners, 17 drink, 0 die, get 16 new.
Day 12: 33 prisoners, 33 drink, 0 die, get 32 new.
Day 13: 65 prisoners, 65 drink, 0 die, get 64 new.
Day 14: 129 prisoners, 129 drink, 0 die, get 128 new.
Day 15: 257 prisoners, 257 drink, 0 die, get 256 new.
Day 16: 513 prisoners, 472/513 drink, 0-1 die, done.
Not only is the worse case extremely unlikely, it also takes N=9 or N=10.
See/play with numbers here.