[Side note: This immediately eliminates the majority of candidates - I
find it sad how many people have Masters degrees in Computer Science and
can't answer a question as basic to computer science as, say, the need
for an ER doctor to be able to identify and treat for shock.]
Once they have explained why it can be proved that an algorithm cannot
possibly do better than O(n log(n)), give them the apparent O(n)
technique for sorting, and ask them to explain what's going on...
-- Bhaskar
tjh
----- Original Message ----
From: "Holloway, Thomas (EDS)" <Thomas....@va.gov>
To: Hard...@googlegroups.com
Sent: Tuesday, October 24, 2006 12:53:55 PM
Subject: [Hardhats] Re: sorting cards again
It is so easy. Start with one card in the sorting hand and place it in
the holding hand. Pick up the next card and look at the value. Does it
go before or after the card already in the holding hand? If greater,
put it behind the card already there. If less, then put it in front of
that card. Go get the next card and read the value of the card. You
now have 3 places that this card can go, before, between, or after the
two cards in the holding hand. In each successive card sort, you will
have n+1 (where n is the number of cards in the holding hand) possible
locations to place the next card. Finding the location is the trick.
Obviously as the number goes up, the time to find the proper place to
put it goes up as well. People are lumpers, and computers are usually
rigorous. Humans make intuitive jumps to get us close to the answer
while computers usually check every possibility. I suspect that humans
are scalable in this task up until the fist full of cards gets akward
and we re-invent that wonderful randomization game, 52-pickup.
----- Original Message ----
From: r...@rcresearch.us
To: Hard...@googlegroups.com
Sent: Tuesday, October 24, 2006 1:24:12 PM
Subject: [Hardhats] Re: sorting cards again
but we do save on the time it takes to put the deck back together.
This is actually doing the sort as a string expansion. In this specific
case, we know how many items we are sorting and in Bhaskar's example, we
see the cards we are missing immediately. As a string, it might be a bit
more confusing to identify missing members.
Ok, another case. Everything we've covered on this scenario relies on
a convenient, numeric sort order. What changes in your sorting
technique if I hand you a shuffled deck of 52 cards with pictures of a
house, a ball, a tree, a hammer, a cloud, etc., and I give you a list
that is the prescribed order? If the first card you pick up is an
acorn, where does it go? Near the beginning, in the middle somewhere or
near the end? Does it go between the rabbit and frying pan? Is it
higher or lower than the thumbtack? Can you quickly put everything in
stacks of 4 or 5 and then sort those smaller stacks into order? You
could do that with the playing cards (or numerically numbered cards) but
trying to do it with random picture cards, even though there is a
specified order, will be very difficult.
tjh
-----Original Message-----
From: Hard...@googlegroups.com [mailto:Hard...@googlegroups.com] On
Behalf Of Greg Woodhouse
Sent: Tuesday, October 24, 2006 4:03 PM
To: Hard...@googlegroups.com
Subject: [Hardhats] Re: sorting cards again
How do you find the correct spot in "sort as you go" (a.k.a. insertion
sort)?
===
Gregory Woodhouse
"Mathematics is the science of patterns."
--Lynn Arthur Steen, 1988
----- Original Message ----
From: "Holloway, Thomas (EDS)" <Thomas....@va.gov>
To: Hard...@googlegroups.com
Sent: Tuesday, October 24, 2006 12:53:55 PM
Subject: [Hardhats] Re: sorting cards again
If we had learned early on in our development to recognize the pictures
as opposed to numbers, the task would be a simple as the logic defined
in the responses to the question.
The key, in my opinion, is to be comfortable with our individual
approaches to the logic we employ in response to the task at hand.
We can utilize the approaches listed in the threads of this message to
accomplish the task, as long as the task is completed, it does not
matter how we get there (within reason of course).
This does not imply that we should be sloppy, or disregard other
methods, only that we have the hardware to support most approaches to a
similar task.
I did (4 rows of 13). You evidently missed it.
----- Original Message ----
From: "Holloway, Thomas (EDS)" <Thomas....@va.gov>
To: Hard...@googlegroups.com
Sent: Tuesday, October 24, 2006 1:39:25 PM
Subject: [Hardhats] Re: sorting cards again
Greg,
No, the reference was to one of your proposals which was to put the
cards in small stacks, then pick up each small stack and sort within
that, then somehow combine stacks. The reason that works is because of
the nature of a deck of playing cards (4 Aces, 4 Twos, 4 Jacks, etc. or
13 Clubs, 13 Hearts, etc.) and the human brain can easily grasp those
distinctions. My idea for the picture cards is that they do *not* have
any categorical distinctions. Thus there is no easy, visual, intuitive
grouping in the sort order. Your original sorting problem was tied to a
distinctive data set which lent itself to some specific techniques.
Even if the cards were numbered 1 - 52 and not marked as playing cards,
we (as educated humans) have a built-in sort order that we can mentally
refer to nearly instantaneously. If the card markings were not natural
to us and if the sort order were not instinctive but instead available
from a written list, we would be forced to approach the sort from an
entirely different stand point. For one thing, it is highly unlikely
that you would use the divide-and-conquer approach or the bubble sort.
Until you memorize the list, you can't even use any sort of proximity
search on a labeled layout. I guess my real point was that using
intuition (something you had mentioned doing) is highly dependent on the
type of cards and the desired sort results. And I wasn't sure where you
were going with the SORT question. Is there a best sort technique that
is independent of the data set? Is it ever worth implementing a human
oriented technique in a computer-based sort?
tjh
-----Original Message-----
From: Hard...@googlegroups.com [mailto:Hard...@googlegroups.com] On
Behalf Of Greg Woodhouse
Greg asked: "Is the idea that the cards will fit in 4 or 5 natural
cagoerie (animal, vegetable, mineral and the like), but you don't know a
priori what those categories are?"
Greg,
No, the reference was to one of your proposals which was to put the
cards in small stacks, then pick up each small stack and sort within
that, then somehow combine stacks. The reason that works is because of
the nature of a deck of playing cards (4 Aces, 4 Twos, 4 Jacks, etc. or
13 Clubs, 13 Hearts, etc.) and the human brain can easily grasp those
distinctions. My idea for the picture cards is that they do *not* have
any categorical distinctions. ...
tjh