![]() |
![]() |
#1 |
Dec 2019
Kansas
24 Posts |
![]() |
![]() |
![]() |
![]() |
#2 |
Jun 2003
22·32·151 Posts |
![]()
Couple of observations.
1) The example (8 barrels) appears to be for exactly one poisonous barrel. It is not clear from the wording. 2) The wording of the problem suggests a conditional strategy is fine (i.e. Day n's pattern can be defined after observing Day n-1's outcome), but the answer format doesn't allow conditional strategy -- the pattern needs to be defined for all three days at once. Overall, it looks like this can be solved with pen and paper in a few minutes. EDIT:- Nevermind. The example does work for 2 barrels. Last fiddled with by axn on 2020-01-02 at 03:49 |
![]() |
![]() |
![]() |
#3 |
"Rashid Naimi"
Oct 2015
Remote to Here/There
5·467 Posts |
![]()
I am lost as usual.
![]() Why make it so complicated? 4 Orchids x 2 Days = 8 tests Why not test 1 barrel per plant per day? Likewise: 4 Orchids x 3 Days = 12 tests Why not test 1 barrel per plant per day? What am I missing. ![]() ETA: Never-mind, Early-deaths => reduced number of plants for testing. ![]() Last fiddled with by a1call on 2020-01-02 at 04:46 |
![]() |
![]() |
![]() |
#4 |
Dec 2019
Kansas
24 Posts |
![]()
Unless I misunderstood the challenge, I have found a very trivial solution. Are you allowed to check the outcome (whether its rotten or not) after each day? For example, imagine on one of the orchids I use barrel A on day 1, and barrels DG on day 2, can I check whether the plant is rotten or not right after day 1 (this will mean A is guaranteed to be one of the culprits), or do I have to wait until day 2 to check the result?
I assume you must be allowed to, as if you are not, the example they provided would not work if B and A were the culprits. Last fiddled with by what on 2020-01-02 at 05:23 |
![]() |
![]() |
![]() |
#5 |
"Rashid Naimi"
Oct 2015
Remote to Here/There
44378 Posts |
![]()
Even more confused with the format now.
![]() In the example if Barrel-B is poisonous, Then it will kill plant 1 after day one. So you can't test DG on plant-1 on day-2. You could shift the test onto another surviving plant, but I am having problem formulating the parameters. Last fiddled with by a1call on 2020-01-02 at 05:27 |
![]() |
![]() |
![]() |
#6 |
Jun 2003
22·32·151 Posts |
![]()
AFAICT, You're allowed to test the status of the plants after each day, but a plant that died on any given day cannot be used for further tests on subsequent days. That's the tricky part. The given example works under these constraints. To wit, these are the death signatures for each potentital combination of 2 out of 8 barrels in the example:
Code:
AB 13.2 AC 34.2 AD 23.1 AE 3.2 AF 23. AG 3.124 AH 3.24 BC 14.23 BD 12. BE 1.2 BF 12.3 BG 1.24 BH 13.24 CD 24.13 CE 4.3 CF 24.3 CG 4.13 CH 34. DE 2.1 DF 2.13 DG 2.14 DH 23.14 EF 2.3 EG .14 EH 3.4 FG 2.134 FH 23.4 GH 3.14 |
![]() |
![]() |
![]() |
#7 |
Jun 2003
22×32×151 Posts |
![]()
No shifting of tests - otherwise puzzle will be too easy. You must specify the full sequence of tests ahead of time.
|
![]() |
![]() |
![]() |
#8 |
Dec 2019
Kansas
24 Posts |
![]()
In this case, I think my solution is correct however I will check over it to confirm
|
![]() |
![]() |
![]() |
#9 |
"Rashid Naimi"
Oct 2015
Remote to Here/There
5×467 Posts |
![]()
Ok, back to one test per plant per day. I could see why that would not work 10 minutes ago but can't do so now. Early deaths would determine one death per barrel and you won't have to do further testing.
I am either getting too old or have been an idiot all along and didn't realize it before. ![]() ETA Or both. ![]() ETA II: Nevermind, back to my senses now. ![]() ETA III: No, lost again: For the example: 1st-day, one barrel per each of the 4 plants: Possibilities: 0 Deaths => test the 4 remaining barrels, one barrel per plant on day 2 => Mystery solved 1 Death => test 3 of the remaining barrels, one per surviving plant => 1 or 0 deaths => Mystery solved 2 Deaths => mystery solved no more tests required ![]() ![]() ![]() ETA IV: The way I (mis-)see it, extension of the same one barrel test per plant would work for 2-out-of-12 barrels as well. ![]() ![]() ![]() ![]() ![]() ![]() ETA V: Ok, so the only reason this would not work is because the solution can not be represented in the requested format, even though one barrel test per plant would be conclusive by itself, otherwise. Last fiddled with by a1call on 2020-01-02 at 06:22 |
![]() |
![]() |
![]() |
#10 |
Jun 2003
22×32×151 Posts |
![]()
A pari/gp program to validate a potential solution.
Code:
tokenize(str, delim)={ my(v=Vec(str), ret_val=[], s=""); for(i=1, #v, if(v[i] == delim , ret_val = concat(ret_val, [s]); s="" , s=concat(s, v[i]) ) ); concat(ret_val, [s]) } signature( b1, b2, sequence, n_flowers, n_days )={ my(still_alive=vector(n_flowers, i, 1), sig = ""); for(i=1, n_days, for(j=1, n_flowers, barrel_list = sequence[ j ][ i ]; if( still_alive[j] && (setsearch(barrel_list, b1) > 0 || setsearch(barrel_list, b2) > 0) , sig = concat(sig, Str(j)); still_alive[j] = 0; ) ); sig = concat(sig, ".") ); sig } setify(a_str)=apply(n->Set(Vec(n)), tokenize(a_str, ".")); validate(n_barrels, n_flowers, n_days, seqstring)={ my(i,j,k, barrels=vector(n_barrels, i, Strchr(i+64)), flowers, sequence, S=Set()); sequence = apply(setify, tokenize(seqstring, ",")); for(i=1, n_barrels-1, for(j=i+1, n_barrels, sig = signature(barrels[i], barrels[j], sequence, n_flowers, n_days); if( setsearch(S, sig) , printf("Oops, invalid. Dupe signature %s for %s%s\n", sig, barrels[i], barrels[j]); return 0 , printf("%s%s has signature %s\n", barrels[i], barrels[j], sig); S = setunion(S, Set(sig)) ) ) ); 1 } Code:
validate(8, 4, 2, "B.DG,DF.AB,AH.CF,C.GH") Code:
AB has signature 13.2. AC has signature 34.2. AD has signature 23.1. AE has signature 3.2. AF has signature 23.. AG has signature 3.124. AH has signature 3.24. BC has signature 14.23. BD has signature 12.. BE has signature 1.2. BF has signature 12.3. BG has signature 1.24. BH has signature 13.24. CD has signature 24.13. CE has signature 4.3. CF has signature 24.3. CG has signature 4.13. CH has signature 34.. DE has signature 2.1. DF has signature 2.13. DG has signature 2.14. DH has signature 23.14. EF has signature 2.3. EG has signature .14. EH has signature 3.4. FG has signature 2.134. FH has signature 23.4. GH has signature 3.14. %56 = 1 |
![]() |
![]() |
![]() |
#11 |
"Rashid Naimi"
Oct 2015
Remote to Here/There
1001000111112 Posts |
![]()
In the 8 barrel example's solution AE & AF would have the same signature of plants 1 & 4 surviving after 2 days.
So no distinguishable advantage over one barrel per plant testing even without test shifting. You will still need to take into account results of both days' survival results to reach a conclusive determination. ETA: Things are different for 3 days' tests though. 1st day deaths would hamper 2 future scheduled tests on the dead plants. So it won't work without test shifting for 12 barrel scenario(in the one barrel per plant procedure). Last fiddled with by a1call on 2020-01-02 at 08:42 |
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
2020 the year in space prediction thread. | Uncwilly | Science & Technology | 14 | 2021-05-13 07:17 |
2020 Prime95 observations, issues, and suggestions | rainchill | Software | 53 | 2021-05-04 13:07 |
U.S. Electile Dementia paralytica 2020 | ewmayer | Soap Box | 685 | 2021-03-03 23:29 |
2020 15e post processing reservations and results | swellman | NFS@Home | 112 | 2020-12-29 22:58 |
Any MISFIT feature requests for 2020? | swl551 | MISFIT | 13 | 2020-08-24 14:50 |