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

 Colored Board Baffle (Posted on 2022-09-13)
Precisely 7 boards are arranged in a straight line. Their colors are:
blue, brown, green, orange, purple, red, and yellow - albeit not necessarily in that order.

It is known that:
1. Red is next to blue.
2. Purple is somewhere to the left of green.
3. There is precisely one board between yellow and red.
4. There are exactly two boards between brown and blue.
5. Blue is the 4th board from the left.
6. Orange is directly between yellow and purple.
Determine the precise order of these seven boards.

 See The Solution Submitted by K Sengupta Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
 computer solution | Comment 2 of 7 |
boards=["bl" "br" "gr" "or" "pu" "re" "ye"];
boards=perms(boards);
for i=1:length(boards)
board=boards(i,:);
red=find(board=="re");
blue=find(board=="bl");
if abs(red-blue)==1
purple=find(board=="pu");
green=find(board=="gr");
if purple<green
yellow=find(board=="ye");
if abs(yellow-red) == 2
brown=find(board=="br");
if abs(brown-blue)==3
if blue==4
orange=find(board=="or");
if abs(orange-yellow)==1 && abs(orange-purple)==1
board
end
end
end
end
end
end
end

finds

board =
1×7 string array
"pu"    "or"    "ye"    "bl"    "re"    "gr"    "br"

as the sequence of boards' colors.

Edited on September 13, 2022, 9:33 am
 Posted by Charlie on 2022-09-13 09:31:32

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 (9)
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