# Puzzle of the week

This is a discussion on Puzzle of the week within the A Brief History of Cprogramming.com forums, part of the Community Boards category; I found this in an algebra II book. They have a puzzle at the end of every chapter. If I ...

1. ## Puzzle of the week

I found this in an algebra II book. They have a puzzle at the end of every chapter. If I can remember I will try and post one a week until I run out. I don't think this one is too hard at all. Took me about 5 minutes.
Five friends, Luis, Bill, Jan, Omar, and Judy, are sitting in one row of seats. Neither Luis nor Bill is sitting next to Omar. Neither Luis nor Bill is sitting next to Jan. Neither Omar nor Bill is sitting next to Judy. Judy is sitting just to the right of Jan.

Find the seating arrangement from left to right.

2. Omar-Jan-Judy-Luis-Bill

3. yeah. Next week's one took me a little while. It will be a little harder.

4. why not make this a little more challenging? write a program that will solve the problem with a specified number of objects and a set of rules. in this example, the people were the objects and the rules were things like, A left of B, A not beside C, etc...

hint: look up "Constraint propogation" a very usefull tool in AI.

5. Originally Posted by Perspective
why not make this a little more challenging? write a program that will solve the problem with a specified number of objects and a set of rules. in this example, the people were the objects and the rules were things like, A left of B, A not beside C, etc...

hint: look up "Constraint propogation" a very usefull tool in AI.
Or, a simpler method would be to write a bunch of facts in prolog, and write a goal to find the answer.