https://www.codingame.com/training/expert/when-pigs-fly
Send your feedback or ask for help here!
Created by @UnicornP,validated by @Katie,@darynka_xo and @Djoums.
If you have any issues, feel free to ping them.
https://www.codingame.com/training/expert/when-pigs-fly
Send your feedback or ask for help here!
Created by @UnicornP,validated by @Katie,@darynka_xo and @Djoums.
If you have any issues, feel free to ping them.
I donât understand test case 9 (Final Test). According to me, the answer should be âNo pigs can flyâ.
I think the answer given â âSome pigs can flyâ â would be justified as followed:
[A] Chickens with beaks can fly (from statements 7, 8, 9)
[B] Some llamas with mouths are chickens with beaks (statement 2)
[C] Some llamas with mouths can fly (A + B)
[D] All llamas with toenails are pigs (statement 5).
However, we cannot conclude that âsome pigs can flyâ from (C + D), as we have no way of knowing that there are some llamas that have both mouths and toenails⌠which I suppose is overlooked by the solution???
Anyone could give me some help with this? Thanks
Itâs actually a question we had during the validation process, hereâs the answer I came up with :
Step 1, from those facts :
CHICKENS with BEAKS are LLAMAS with MOUTHS
GEESE are CHICKENS
GEESE have BEAKS
BEAKS are TOENAILS
You get : some GEESE with TOENAILS are LLAMAS (technically with MOUTHS but we donât care).
Then step 2 :
LLAMAS with TOENAILS are PIGS
Combined with the result of step 1 you can say : some GEESE with TOENAILS are PIGS
And finally :
CHICKENS with TOENAILS are TREES that can FLY
Tells you that some GEESE with TOENAILS are TREES that can FLY, which combined with step 2 tells you that some PIGS are TREES that can FLY.
Thanks for your help!
There is a flaw in your reasoning however: from âsome GEESE with TOENAILS are PIGSâ and âsome GEESE with TOENAILS are TREES that can FLYâ, you cannot deduce that âsome PIGS are TREES that can FLYâ (the GEESE that are PIGS might not be the same GEESE that can FLY).
This is easily fixed though, as you have âall GEESE with TOENAILS are PIGSâ and âall GEESE with TOENAILS are TREES than can FLYâ (rather than just some). And from the former you can deduce âsome PIGS are GEESE with TOENAILSâ (logically flawed, but this assumption is well specified in the puzzle description).
Yes step 1 should say all GEESE with TOENAILS are LLAMAS, that solves the problem.
I like this test, your program can get it right without you understanding why
Continuing the discussion from [Community Puzzle] When pigs fly:
I still donât follow this. Do the rules explain how we can deduce the existence of âGEESE with TOENAILSâ? It seemed reasonably clear to me that only pure âObjectâ categories would be guaranteed to be non-empty, as the mere existence of some combination of attributes shouldnât imply the existence of individuals that meet all of those attributes. In retrospect, I gather that thatâs not the intent.
So, does the fact that âGEESE with TOENAILSâ is mentioned on the left-hand side of an âareâ statement imply that some member of such a set exists? Would it be the same if it were on the right? Has anyone else worked on this puzzle since then?
Some X can fly means that X has a subcategory that can fly. This subcategory might be empty, it is not questionned here.
Continuing the discussion from [Community Puzzle] When pigs fly:
I do not see the problem here in the last test case:
(a) GEESE are CHICKENS
(b) CHICKENS with BEAKS are LLAMAS with MOUTHS
(c) MOUTHS are HOLES
(d) GEESE have BEAKS
(e) LLAMAS with TOENAILS are PIGS
(f) PIGS are TREES that can WALK
(g) CHICKENS with EYES and TOENAILS are TREES that can FLY
(h) BEAKS are TOENAILS
(i) CHICKENS have EYES
You take a geese
with (a) it is a chicken
with (d) it have beaks
with (h) it have toenails
with (b) it have mouths and it is a llama
with (e) it is a pig ***
with (i) it have eyes
with (g) it is a tree and it flies**
So a geese is a pig than can fly !
Thatâs all !
I just solved it and here is the reformulation of the problem I used:
if "PIGS" implies "FLY":
-> "All pigs can fly"
else if any category implies "PIGS" and also implies "FLY":
-> "Some pigs can fly"
else:
-> "No pigs can fly"
Of course you donât want to consider any possible category (or the category âPIGS that can FLYâ would always work for second option).
Just consider categories that are actually present in the rules.
Arg! Validator 7 fails for me, while all the tests pass.
Hey guys,
If you want to test your code :
[PINGS with WINGS are GODS, GODS with WINGS can FLY] , the answer should be âSome PIGS can FLYâ
If you pass this one you can try that one :
[PINGS with WINGS are GODS, GODS with WINGS and MOUTH can FLY, PIGS have MOUTH] , the answer should also be âSome PIGS can FLYâ
Best regards
Same here, but I fail validator 9 as well. I must be missing some subtle effect in large loopsâŚ
Hi
I donât understand the test case #6. I donât see why we can conclude that âNo pigs can flyâ. I think we canât conclude anything because we donât know anything about pigs having limbs. So all answers seem possible.
Thanks
Adam
I think thereâs are two implicit assumptions at play:
Another way to think about it is to change in your mind what the output statements are to the following three possibilities:
Hi,
first thanks Nowis5, your sentences help me.
I have some other sentences what i created
[1] âPIGS that can RUN are GODSâ, âGODS can FLYâ the answer should also be âSome PIGS can FLYâ
[2] âPIGS that can RUN are GODSâ, âGODS that can RUN and EAT can FLYâ, âPIGS can EATâ the answer should also be âSome PIGS can FLYâ
[3] âPIGS with WINGS that can RUN are GODSâ, âGODS can FLYâ the answer should also be âSome PIGS can FLYâ
[4] âPIGS have WINGSâ, âMOUTH are WINGSâ, âGODS with MOUTH can FLYâ, âPIGS are GODSâ the answer should also be âSome PIGS can FLYâ
[5] âPIGS with WINGS are GODSâ, âMOUTH are WINGSâ, âGODS with MOUTH can FLYâ the answer should also be âSome PIGS can FLYâ
Most importantly, to pass the test (7) after you submit your solution you need to reevaluate sentences you already check ! maybe you say one element are for some pigs but you know after itâs for all pigs !
But we donât know if there are PIGS that can RUN.
This puzzle seems overrated with its âVery Hardâ difficulty.
I know that it can be an endless debate, but this puzzle is easier that the logic puzzle âEinsteinâs riddle solverâ that is rated as an hard puzzle.
In my opinion this puzzle is average (parsing is not very difficult), but I set it as a âhardâ puzzle.
If you solve both, then your average solved difficulty wonât suffer
There is a special note for this case in puzzle description:
Note for logicians and mathematicians : The statement (2) is not an hypothetical proposition, it implies that MICE with WINGS do exist. In a nutshell: All objects evoked are supposed to exist.
Obviously, âPIGS that can RUNâ were evoked thus we know they exist by puzzle definition.
I added the note, actually.