Simple exercise

Jussi Piitulainen jussi.piitulainen at helsinki.fi
Tue Mar 15 05:04:44 EDT 2016


Steven D'Aprano writes:

> On Tuesday 15 March 2016 16:26, Jussi Piitulainen wrote:
>
>> Steven D'Aprano writes:
>> 
>>> Unfortunate or not, it seems to be quite common that "zip"
>>> (convolution) discards items when sequences are of different lengths.
>> 
>> Citation needed. Where is zip called convolution?
>
> Wikipedia :-)
>
> Unfortunately "convolution" is one of those technical terms with many
> related but slightly different meanings. It's used in calculus, signal
> processing, geology, biology, probability theory, formal languages,
> and more. I don't have a citation for it being used in functional
> programming, but is it so hard to believe? A "convolution" is usually
> described as something being folded over another thing, which sounds
> rather like zip, doesn't it?

I'm asking precisely because the term "convolution" already has more
interesting uses that I find somewhat non-trivial, and I don't see zip
being one of those.

> Take two pieces of paper, say one white and one black, one on top of the 
> other, and fold them in half, then in half again, then again:
>
> zero folds = W B
>
> one fold = W B B W
>
> two folds = W B B W W B B W
>
>
> which is not that far from what zip would give you:
>
> W B W B W B W B ...

Seems different to me.

> I don't know enough about the lambda calculus and other theoretical computer 
> science topics to give a definitive citation for "zip" being a convolution, 
> but I do know enough to accept it as plausible.

Perhaps someone else can provide citations. At the moment, I think the
idea is both new and bad.

>> Why should zip be called convolution?
>
> Why should anything be called anything?
>
> Don't worry, I'm not suggesting that the zip function be renamed.

I'm not worried about "zip". I'm worried about "convolution". It's
confusing to adopt an existing term for a different purpose.

>>> See https://en.wikipedia.org/wiki/Convolution_%28computer_science%29
>> 
>> "This article possibly contains original research. Please improve it by
>> verifying the claims made and adding inline citations."
>
> Meh, there are Wikipedia editors that seem to flag just about every article 
> with that. You could write "water is wet" and technically that's "original 
> research" that needs a citation. It is so over-used that it is practically 
> meaningless.

In this case, it seems accurate to me. The article makes a factual claim
that the term is actually used this way in computer science, with no
evidence to back it up. I doubt it. I failed to find evidence myself.

Anyone?



More information about the Python-list mailing list