SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Site Related Forums
 Article Discussion
 Reader Challenge #3: Find the Yak!
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 3

AskSQLTeam
Ask SQLTeam Question

USA
0 Posts

Posted - 03/22/2002 :  09:01:51  Show Profile  Visit AskSQLTeam's Homepage  Reply with Quote
Tired of all those standard SQL problems? Begging for a real challenge?? Think you're some kind of SQL Jedi Master???

Here's a puzzle that I found on the Internet. It has nothing to do with databases, but can you solve it using SQL?

Can you....FIND THE YAK????


Article Link.

Edited by - robvolk on 03/22/2002 09:52:05

robvolk
Most Valuable Yak

USA
15654 Posts

Posted - 03/22/2002 :  14:13:20  Show Profile  Visit robvolk's Homepage  Reply with Quote
UPDATE:

I should mention that you can submit as many solutions as you like, and if you can think of different ways to solve it...

SEND 'EM TO ME!

There's no limit. Each solution will be reviewed and considered.

Go to Top of Page

robvolk
Most Valuable Yak

USA
15654 Posts

Posted - 03/22/2002 :  16:25:07  Show Profile  Visit robvolk's Homepage  Reply with Quote
SECOND UPDATE:

Just to clarify some requirements that may seem vague:

-There are 5 houses, all in a line next to each other
-Each neighbor has a different nationality

These are natural inferences based on the other rules, so it's unlikely to have any effect on your solution.

IF YOU HAVE NOT SEEN THIS COMMENT BEFORE, CHECK THE ARTICLE AGAIN FOR THE CLARIFICATIONS!

Edited by - robvolk on 03/22/2002 16:36:17
Go to Top of Page

robvolk
Most Valuable Yak

USA
15654 Posts

Posted - 03/30/2002 :  08:41:03  Show Profile  Visit robvolk's Homepage  Reply with Quote
THIRD UPDATE:

The "Find the Yak" Reader Challenge is now closed!

Thank you to everyone who submitted a solution! I will be reviewing them for the next day or two and writing the follow-up articles. Keep an eye out for them soon!

This topic is now open for comments, however, please do not post any solutions in this thread.

Edited by - robvolk on 03/30/2002 08:42:05
Go to Top of Page

Arnold Fribble
Yak-finder General

United Kingdom
1961 Posts

Posted - 04/02/2002 :  10:30:16  Show Profile  Reply with Quote
Anyone notice that one of the constraints is redundant?


Go to Top of Page

Jay99
Constraint Violating Yak Guru

USA
468 Posts

Posted - 04/02/2002 :  10:36:53  Show Profile  Reply with Quote
quote:

Anyone notice that one of the constraints is redundant?



Which?

Jay
<O>
Go to Top of Page

Arnold Fribble
Yak-finder General

United Kingdom
1961 Posts

Posted - 04/02/2002 :  10:50:54  Show Profile  Reply with Quote

Oh all right, it's the last one, water next to blend.


Go to Top of Page

juggler
Starting Member

9 Posts

Posted - 04/02/2002 :  10:59:15  Show Profile  Reply with Quote
Yes, I noticed.
I coded it into my solution, but then commented it out to show it wasn't really needed.
Go to Top of Page

Jay99
Constraint Violating Yak Guru

USA
468 Posts

Posted - 04/02/2002 :  11:03:24  Show Profile  Reply with Quote
I look forward to seeing these solutions. The way I solved it, I need the water/blend req, but it could be because of my approach . . .

Jay
<O>

EDIT: So who all is in the sub-1-sec club?


Edited by - Jay99 on 04/02/2002 11:05:09
Go to Top of Page

robvolk
Most Valuable Yak

USA
15654 Posts

Posted - 04/02/2002 :  11:06:22  Show Profile  Visit robvolk's Homepage  Reply with Quote
Arnold-

I found out that it's only redundant if you interpret the Green house-White house rule as adjacent to one another (which is a perfectly reasonable interpretation), instead of the Green house simply being anywhere to the left of the White. I tested both variations, and discovered that disabling Water/Blend will generate more answers than if it was enabled.

Go to Top of Page

Arnold Fribble
Yak-finder General

United Kingdom
1961 Posts

Posted - 04/02/2002 :  11:15:46  Show Profile  Reply with Quote
Oh, I thought there were 7 (or 20) solutions with Green < White (there is only 1 (or 11) with Green > White, but that's not really relevant).

quote:

So who all is in the sub-1-sec club?


Big yes here! I was impressed at what a good job the query optimizer did on this.


Go to Top of Page

juggler
Starting Member

9 Posts

Posted - 04/02/2002 :  13:01:12  Show Profile  Reply with Quote
This link contains a good discussion about different assumptions leading to different solutions to this puzzle:

http://www.noctua.demon.co.uk/einstein/einstein.html

EDIT: Oh, sorry, this link has solutions to the puzzle, but not SQL solutions to the puzzle. Now I'm confused. The solution to the puzzle is no secret, right? It's just SQL solutions we're not supposed to post, right?


Edited by - juggler on 04/02/2002 13:04:42
Go to Top of Page

robvolk
Most Valuable Yak

USA
15654 Posts

Posted - 04/02/2002 :  13:12:58  Show Profile  Visit robvolk's Homepage  Reply with Quote
No problem, I figured most people would look up the solution anyway, just to make sure they were on the right track.

I did like this part very much:
quote:
Without making these initial assumptions, I don't think you can logically deduce the answer to the puzzle, but would just need a computer to do an exhaustive search of all the possibilities. That might even come up with several valid answers!

...which is EXACTLY what I was hoping people would discover (and they did!)

Go to Top of Page

Jay99
Constraint Violating Yak Guru

USA
468 Posts

Posted - 04/02/2002 :  14:21:56  Show Profile  Reply with Quote
Found some solutions out there written in LISP and C++ . . . (can I post a link?)


Jay
<O>

EDIT:
here

Edited by - Jay99 on 04/02/2002 15:17:54
Go to Top of Page

robvolk
Most Valuable Yak

USA
15654 Posts

Posted - 04/02/2002 :  14:59:40  Show Profile  Visit robvolk's Homepage  Reply with Quote
You can post non-SQL solutions here, or email me the link and I'll include it in the follow-up.

Go to Top of Page

Jay99
Constraint Violating Yak Guru

USA
468 Posts

Posted - 04/03/2002 :  15:36:10  Show Profile  Reply with Quote
Is there anything we (SQLTeam GP) can do to help with the judging process? Maybe vote on the winner from the sub-1 sec club . . .

(Just a suggestion)

Jay
<O>
Go to Top of Page

Arnold Fribble
Yak-finder General

United Kingdom
1961 Posts

Posted - 04/03/2002 :  15:51:09  Show Profile  Reply with Quote
I'd love to help, but it might spoil my chances at the "Ugliest ASCII Art" title


Go to Top of Page

Jay99
Constraint Violating Yak Guru

USA
468 Posts

Posted - 04/03/2002 :  15:57:26  Show Profile  Reply with Quote
quote:

I'd love to help, but it might spoil my chances at the "Ugliest ASCII Art" title



True, true

Well I am thinking the entries are already submitted so tampering shouldn't really be an issue...No big.

I was quite stoked about my solution, but the couple posts on this thread have me a bit nervous ... :)

Jay
<O>
Go to Top of Page

efelito
Constraint Violating Yak Guru

USA
478 Posts

Posted - 04/05/2002 :  16:37:46  Show Profile  Visit efelito's Homepage  Reply with Quote
I can't wait to see the answers to this. I think I was close, but I didn't get to complete it. Every time I get a little cocky and feel like I know a little something about SQL I come out here and then feel the need to crawl back into my crib....

Jeff Banschbach
Consultant, MCDBA
Go to Top of Page

Jay99
Constraint Violating Yak Guru

USA
468 Posts

Posted - 04/05/2002 :  16:44:59  Show Profile  Reply with Quote
Yeah, come on RobVolk? Don't you have anything better to do than figure out who found the the best?

So far, the Illustrious Fribble and I are the only ones to cop to an under 1 sec solution. There's gotta be more than that . . .



Jay
<O>


Edited by - Jay99 on 04/05/2002 16:45:23
Go to Top of Page

robvolk
Most Valuable Yak

USA
15654 Posts

Posted - 04/05/2002 :  16:48:32  Show Profile  Visit robvolk's Homepage  Reply with Quote
quote:
Yeah, come on RobVolk? Don't you have anything better to do than figure out who found the the best?

Well, now that you mention it, I have been looking for a job this past week, don't know if that qualifies as BETTER than comparing queries though.



Go to Top of Page
Page: of 3 Previous Topic Topic Next Topic  
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.14 seconds. Powered By: Snitz Forums 2000