Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Site Related Forums
 Article Discussion
 Reader Challenge #3: Find the Yak!

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-03-22 : 09:01:51
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

15732 Posts

Posted - 2002-03-22 : 14:13:20
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

15732 Posts

Posted - 2002-03-22 : 16:25:07
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

15732 Posts

Posted - 2002-03-30 : 08:41:03
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

1961 Posts

Posted - 2002-04-02 : 10:30:16
Anyone notice that one of the constraints is redundant?


Go to Top of Page

Jay99

468 Posts

Posted - 2002-04-02 : 10:36:53
quote:

Anyone notice that one of the constraints is redundant?



Which?

Jay
<O>
Go to Top of Page

Arnold Fribble
Yak-finder General

1961 Posts

Posted - 2002-04-02 : 10:50:54

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


Go to Top of Page

juggler
Starting Member

9 Posts

Posted - 2002-04-02 : 10:59:15
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

468 Posts

Posted - 2002-04-02 : 11:03:24
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

15732 Posts

Posted - 2002-04-02 : 11:06:22
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

1961 Posts

Posted - 2002-04-02 : 11:15:46
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 - 2002-04-02 : 13:01:12
This link contains a good discussion about different assumptions leading to different solutions to this puzzle:

[url]http://www.noctua.demon.co.uk/einstein/einstein.html[/url]

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

15732 Posts

Posted - 2002-04-02 : 13:12:58
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

468 Posts

Posted - 2002-04-02 : 14:21:56
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

15732 Posts

Posted - 2002-04-02 : 14:59:40
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

468 Posts

Posted - 2002-04-03 : 15:36:10
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

1961 Posts

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


Go to Top of Page

Jay99

468 Posts

Posted - 2002-04-03 : 15:57:26
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

478 Posts

Posted - 2002-04-05 : 16:37:46
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

468 Posts

Posted - 2002-04-05 : 16:44:59
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

15732 Posts

Posted - 2002-04-05 : 16:48:32
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
    Next Page

- Advertisement -