A person purchased different types of gems viz., Diamond, Emerald, Ruby, Sapphire, Opal, Pearl, Topaz and Garnet on either the first or the last day of January, March, April and May of the same year, but not necessarily in the same order.
So, we get:
Dates | Months | Gems |
1st | January | |
31st | | |
1st | March | |
31st | | |
1st | April | |
30th | | |
1st | May | |
31st | | |
Garnet was purchased on date 30th of the month.
Pearl was purchased after Garnet.
| | Case 1 | Case 2 |
Dates | Months | Gems | Gems |
1st | January | | |
31st | | | |
1st | March | | |
31st | | | |
1st | April | | |
30th | | Garnet | Garnet |
1st | May | Pearl | |
31st | | | Pearl |
Four gems were purchased between Diamond and Pearl.
| | Case 1 | Case 2 |
Dates | Months | Gems | Gems |
1st | January | | |
31st | | Diamond | |
1st | March | | Diamond |
31st | | | |
1st | April | | |
30th | | Garnet | Garnet |
1st | May | Pearl | |
31st | | | Pearl |
Topaz was purchased before Diamond.
| | Case 1 | Case 2 | Case 2a |
Dates | Months | Gems | Gems | Gems |
1st | January | Topaz | Topaz | |
31st | | Diamond | | Topaz |
1st | March | | Diamond | Diamond |
31st | | | | |
1st | April | | | |
30th | | Garnet | Garnet | Garnet |
1st | May | Pearl | | |
31st | | | Pearl | Pearl |
Only Opal was purchased between Topaz and Diamond. Thus, case 1 and case 2a are invalid.
Emerald was purchased on date 1st of the month.
Neither Emerald nor Ruby was purchased after Garnet.
Therefore, the final arrangement is:
Dates | Months | Gems |
1st | January | Topaz |
31st | | Opal |
1st | March | Diamond |
31st | | Ruby |
1st | April | Emerald |
30th | | Garnet |
1st | May | Sapphire |
31st | | Pearl |
Sapphire was purchased on the 1st May.