All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Logic
Maurice's Garden (Posted on 2024-09-05) Difficulty: 3 of 5
Maurice suddenly decided to grow some vegetable for himself and subsequently planted his garden late in May. He planted five different vegetables: Tomatoes, Peppers, Radishes, Lettuce, and Broccoli. For each he planted a different number of rows from one to five. The hard work involved with each planting was accomplished on a separate day, from May 25th to May 30th (On Sunday May 26th he didn't work in the garden). Each vegetable was planted in a different part of the garden, the north end, the south side, the east side, the west side or the northwest corner.

1. Maurice turned the soil for the peppers three days after he dug hand-size rocks out of the radish patch.

2. Maurice's bright rows of radishes went deeper than the broccoli but were not as deep as the tomatoes.

3. Maurice rolled his trusty wheelbarrow into the west end of the garden one day before he planted the broccoli.

4. Maurice believes the morning sun is bad for tomatoes and so kept those plants out of the eastern side of his garden.

5. Maurice labored hard in the south side of the garden and was mighty proud of the three perfect rows there.

6. On one week's last day, Maurice planted the east side of the garden.

7. Maurice didn't put the peppers or the tomatoes in the northwest corner.

8. Maurice planted an even number of rows in the Northwest corner of his garden.

9. Maurice planted three rows before he planted two rows, but planted them after he planted four rows.

10. Maurice figured the lettuce wouldn't last long so he planted fewer than three rows.

11. Maurice planted the south garden one day before he planted the lettuce.

12. Maurice planted more rows of peppers than he did broccoli (which was not planted in the west side of the garden and was not planted the 29th).

Which vegetable was planted in how many rows, on which day of May and in which side of Maurice's garden?

No Solution Yet Submitted by K Sengupta    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
soln Comment 1 of 1
I assumed two things: 

For Clue 3: he rolled the wheelbarrow for that day's 
work, and _not_ in preparation for the next days work.

For Clue 6: The week's "last day" is Saturday the 25, 
and not the second week's "last work day", Thursday the 30th. 

The program is unremarkable - just a lot of loops and if's.
It gave for the day index dd, the row number rr and location
with place holders: (tom, pep, rad, lett, broc) the result:
 
dd: 2 3 1 4 5   rr: 4 3 5 1 2   ll: 1 2 3 4 5

days 1,2,3,4,5 = 25,27.28,29,30
locs 1,2,3,4,5 = N,S,E,W,SW
This result is presented as the table: 


Veg       Tom    Pep    Rads    Lett    Broc
-----------------------------------------------------------

Day          27       28        25        29       30

Rows          4        3         5         1        2

Location    North    South     East       West    Northwest

---------
 
Working it out using just logic and no code is actually easier:

Clue 11 - South planted day before Lettuce planted makes
Lettuce planted on 29 or 30:
dd = (-,-,-,4,-) or dd=(-,-,-,5,-) 
Clue 1 - pepper planted 3 days after radish give
dd = (-,3,1,-,-) or (-,5,2,-,-) 
Clue 3 - Barrow in west 1 day before brocc planting gives
dd = (-,-,-,-,3) or (-,-,-,-,4) or (-,-,-,-,5) 
Clue 12 - brocc not planted on 29th 
dd = (-,-,-,-,3) or (-,-,-,-,5) 

Together: dd = (1,5,2,4,3) or dd = (2,3,1,4,5)

Clue 10 - fewer than 3 rows lettuce
rr = (-,-,-,1,-) or rr = (-,-,-,2,-)
Clue 9 of planting is 4 rows, 3 row and 2 rows with 1 and 5
planted whenever 
Clue 12 more pepper rors then brocc rows
Together give
rr = (4,3,5,1,2) or (4,3,5,2,1) or (4,5,3,1,2) or (4,5,3,2,1)
or (5,4,3,1,2)or (5,4,3,2,1)

So with 2 dd's and 6 rr's there are 12 dd, rr combinations.. 
Clues 4 and 7 and 15 exclude location possibilities for vegatables. 
That west was planted a day before brocc planting connects the 2 dds to ll. 
All that remains is dd: 2 3 1 4 5   rr: 4 3 5 1 2   ll: 1 2 3 4 5  

Edited on September 8, 2024, 2:59 am
  Posted by Steven Lord on 2024-09-07 20:15:03

Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (6)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information