Re: hacker challenge - traverse a list
- From: spinoza1111 <spinoza1111@xxxxxxxxx>
- Date: Tue, 4 Mar 2008 10:56:19 -0800 (PST)
On Mar 5, 2:08 am, Ben Bacarisse <ben.use...@xxxxxxxxx> wrote:
spinoza1111<spinoza1...@xxxxxxxxx> writes:
On Mar 4, 10:39 pm, Ben Bacarisse <ben.use...@xxxxxxxxx> wrote:
spinoza1111<spinoza1...@xxxxxxxxx> writes:
On Mar 4, 7:10 pm, Ben Bacarisse <ben.use...@xxxxxxxxx> wrote:
spinoza1111<spinoza1...@xxxxxxxxx> writes:
On Mar 3, 7:11 pm, "Clive D. W. Feather" <cl...@on-the-
train.demon.co.uk> wrote:
In article
<3d782936-6a2d-4016-85f9-e475d98c6...@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,spinoza1111<spinoza1...@xxxxxxxxx> writes
OK: any O(1) solution can use a stack of arbitrary bounds by mapping
that stack to a long integer and packing its values, perhaps adding
one to integer values to disambiguate them from zero.
No it can't. If the maximum value you are going to push is M, and the
maximum value that can be stored in a long integer is L, then you can
only push P values where P = floor (log L / log M) (the base used for
the logarithms doesn't matter).
Arbitrary in the sense of fixed. My poor choice of words. I realized
it is small: that's why I said that you can increase this fixed bound
by using a fixed (constant) number of stack objects, each bounded in
the way you say, to create a truly arbitrary, but limited and bounded,
stack for each new edition of the code.
It's obvious to all of us that a stack represented as powers of N in
an integer is bounded. You don't have to belabor the point with
pretentious mathematics.
If an algorithm has some internal bound that means that it only works
on a finite set of inputs (trees in this case) then it can have no
"big O" complexity bounds at all.
By this reasoning, Ben, then no actual (physically executable)
programs have complexity bounds.
Of course. But note that I was talking about algorithms, not programs.
I was giving you the benefit of the doubt -- I was assuming you were
You need give me no such benefit. You don't judge me, I don't judge
you.
"All scientists are candidates for posts" (Adorno) - on the job. But
here, we're talking about a problem, not looking for a frigging job.
suggesting an algorithm for the problem, not just a bounded program.
Your algorithm, in abstract, is either bounded (and thus does not solve
the problem in any general algorithmic sense) or it does not use O(1)
extra storage -- you choose. It depends on how you define your
integers.
OK, you claim my hack is an algorithm. You do me too much credit.
But we CAN abstract "representing a stack in code when you can use
either only one or a finite number K of integers" as an algorithm, and
your apparent conclusion, that if in the Platonic world we have
unlimited precision then stacks are O(1), is true.
Sorry, I have no time for this sort of game. If you choose to offer
an algorithm that addresses the program, I'll be glad to look at it but I
don't want to discuss your vague ideas about big O notation.
The vagueness is in your very understanding and in your prose...look
at your error: "an algorithm that addresses the program" is more than
a typographical error, it was made because people in this newsgroup
are confused about the distinction.
"Platonism" has a precise meaning. Just because it sounds vague
doesn't mean it is vague, just as Saturn has an iron core. The REAL
imprecision here is a twittering false precision in which people
assert with a straight face that they "write O(1) code".
For the last time: code isn't "order" anything. Code isn't "order"
jack ***. Code imperfectly and as a social construct in a human life-
world expresses the algorithm as a prediction that the computer will
form the algorithm's execution trace for all usable sets of data. The
algorithm is "order" something.
Get it? A human life-world in which we don't ascribe the most
convenient motivations and meaning intentions to people to make
ourselves come out on top in a bad rerun of Survivor or The
Apprentice.
You are play-acting a gatekeeper to this discussion, but there is no
gate and this is why you make elementary blunders such as confusing an
algorithm and a program. I know perfectly well you meant it the other
way, and the ONLY reason I point it out is to show that the confusion
is a group disorder.
There's a certain slant of light,
On winter afternoons
That oppresses, like the weight
Of cathedral tunes.
Heavenly hurt it gives us;
We can find no scar,
But internal difference
Where the meanings, are.
None may teach it anything,
'T is the seal, despair, --
An imperial affliction
Sent us of the air.
When it comes, the landscape listens,
Shadows hold their breath;
When it goes, 't is like the distance
On the look of death.
"We can find no scar". The actual algorithm with let us say an
unbounded stack, a truly unbounded stack, has no scar. Instead, it has
a linked list which will sooner or later run out of memory, or a fixed
large array and a test for its end.
The meaning of the program is the "internal difference" where poet
Emily Dickinson finds meaning. It is, in fact, the very failure of the
code to be the Turing Machine, with truly unlimited and unbounded
behavior.
The problem here is that thugs think they can discount intentions.
Using strlen(s) in a for loop created a "difference" between ideal
"efficiency" and the intent to say, not to a dead thing (the computer)
but to another person, don't forget, the end of the string is the end
of the for. The distance between the repeated evaluation of for, or
math.Pow in two sets of code not meant for execution, and copying
those values into temporary variables means that the code writer in
fact likes to waste "valuable (ha!) computer time" in favor of human
understanding.
Sure, I'll recalculate Math.Pow until the cows come home. Big deal. It
keeps my computer out of trouble.
Programmers give lip service to "readability". The problem is that as
"candidates for posts" they are like Rosencrantz and Guildenstern at
saying a lot of things to keep a job so there is no real commitment to
"readability" nor even consensus on what it is. Harter's code is
readable...although he uses one character identifiers in the old
memory management, because his good intentions shine forth in the fact
that his active intellect in 1990 had him comment every line in an
assembler style, which really just works.
Whereas the thugs are all too eager to ascribe bad motivations,
including the bad motivation of stupidity, to anything that questions
their thug wisdom.
Really understanding (listening) is what Italian mathematician Enrico
Bombieri did for Nash when he contacted my supervisor to ask, who is
this guy? Most mathematicians are deluged with crap on the order of
Clive Feather's nonsense about Schildt, and many of them assume it's
all crap. But as we perceive a slant of light, Bombieri detected
SOMETHING in Nash's email and wasn't a thug, like Richard, who
(wrongly) assumes that all problems are solved, and that only in-crowd
members could provide him with new insight on Riemann.
Harter asked for a hack. You're playing games, because I gave him a
stack that wasn't a hack, because I don't hack. It was finite in size,
could be increased by a switch statement to any size, and is order,
prime, one. Now quit pestering me.
I'll learn, one day.
I don't think you will learn anything useful until you thoroughly
understand the difference between an algorithm and a program in such a
way you wouldn't ever reverse the words.
--
Ben.- Hide quoted text -
- Show quoted text -
.
- References:
- Re: hacker challenge - traverse a list
- From: spinoza1111
- Re: hacker challenge - traverse a list
- From: Richard Heathfield
- Re: hacker challenge - traverse a list
- From: spinoza1111
- Re: hacker challenge - traverse a list
- From: Clive D. W. Feather
- Re: hacker challenge - traverse a list
- From: spinoza1111
- Re: hacker challenge - traverse a list
- From: Ben Bacarisse
- Re: hacker challenge - traverse a list
- From: spinoza1111
- Re: hacker challenge - traverse a list
- From: Ben Bacarisse
- Re: hacker challenge - traverse a list
- From: spinoza1111
- Re: hacker challenge - traverse a list
- From: Ben Bacarisse
- Re: hacker challenge - traverse a list
- Prev by Date: Re: Talking to kids in Primary School
- Next by Date: Re: Controversial subjects/claims in computing
- Previous by thread: Re: hacker challenge - traverse a list
- Next by thread: Re: hacker challenge - traverse a list
- Index(es):