Rocksolid Light

Welcome to Rocksolid Light

mail  files  register  newsreader  groups  login

Message-ID:  

I've looked at the listing, and it's right! -- Joel Halpern


devel / comp.programming / Re: Another little puzzle

SubjectAuthor
* Another little puzzleTim Rentsch
`* Another little puzzleBen Bacarisse
 `* Another little puzzleBen Bacarisse
  `- Another little puzzleTim Rentsch

1
Re: Another little puzzle

<86cz7pnji2.fsf@linuxsc.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=3962&group=comp.programming#3962

  copy link   Newsgroups: comp.programming
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: tr.17687@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.programming
Subject: Re: Another little puzzle
Date: Sun, 08 Jan 2023 07:17:25 -0800
Organization: A noiseless patient Spider
Lines: 140
Message-ID: <86cz7pnji2.fsf@linuxsc.com>
References: <puzzle-20221214131815@ram.dialup.fu-berlin.de> <algorithm-20221221130021@ram.dialup.fu-berlin.de> <average-20221228125821@ram.dialup.fu-berlin.de> <87tu1diu2s.fsf@bsb.me.uk> <864jtdtkt5.fsf@linuxsc.com> <87o7rlhtsv.fsf@bsb.me.uk> <878rioifnh.fsf@bsb.me.uk> <868rinskhk.fsf@linuxsc.com> <87zgb3giu6.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader01.eternal-september.org; posting-host="74dc1f9657693bf61783dca6338fedc2";
logging-data="4074897"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19UWJyzZCncI2wW2EB+XyZo9VmeG3O7p70="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:ypv5MB0KMo9XjLJekX5CiVv+WOU=
sha1:jGHvPy/d7QgkPccIJiaYSCBsP0M=
 by: Tim Rentsch - Sun, 8 Jan 2023 15:17 UTC

Ben Bacarisse <ben.usenet@bsb.me.uk> writes:

> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>
>> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>>
>>> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>>>
>>>> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>>>
>>> A couple of further thoughts only one of which is directed at you
>>> Tim (at the end)...
>>>
>>> Given the general conception of a mean (rather than any other kind
>>> of summary statistic) as minimising the sum of squares of some
>>> "distance" metric:
>>>
>>> Sum_{i=1,n} difference(A, t(i))^2
>>>
>>> we can characterise the two contenders by what distance is being
>>> minimised. For the less well discussed "conventional average" (to
>>> use your terminology) we are minimising the sum of squares of the
>>> shorter arc lengths between A and the t(i).
>>>
>>> For the "vector average", we convert the t(i) to unit vectors u(i)
>>> and we calculate the mean if the u(i) to get a vector m. The
>>> "average", A, is just the direction of this vector -- another
>>> point on the unit circle. In this case we are minimising the sum
>>> of squares of the /chord/ lengths between A and the t(i).
>>
>> I think of this approach differently. I take the time values
>> t(i) as being unit masses on the unit circle, and calculate the
>> center of mass. As long as the center of mass is not the origin
>> we can project it from the origin to find a corresponding time
>> value on the unit circle (which in my case is done implicitly by
>> using atan2()).
>
> It's the [same] calculation though.

Yes, my first sentence there was meant to convey that I am
offering an alternate formulation that is mathematically
equivalent, which I expected would be self-evident.

>>> The mean vector itself (which may not lie on the unit circle)
>>> minimises the sum of the squares of the length of the vector
>>> differences m-u(i):
>>>
>>> Sum_{i=1,n} |m - u(i)|^2
>>
>> That's true but I thought of it just as the average of the time
>> value "masses" on the unit circle.
>>
>>> and any other vector along the same line as m (i.e. c*m for real
>>> c) minimises
>>>
>>> Sum_{i=1,n} |c*m - u(i)|^2
>>
>> I'm not sure what you're saying here. Only the one point (m in
>> your terminology) minimizes the sum of squares of distances. How
>> do other points on the same line qualify?
>
> I over-simplified by omitting "compared to any other point on that
> circle". The mean vector is the absolute minimum, but at any radius
> |c*m| the sum above is at a minmum at c*m.

I see. Not obvious to me that this is true (and I didn't see an
easy proof either). OTOH certainly it is plausibly true, so for
now I can take your word for it.

>>> This includes, of course, m projected out to the unit circle.
>>>
>>> This distinction between arc lengths and chord lengths helps to
>>> visualise where these averages differ, and why the conventional
>>> average may seem more intuitive.
>>
>> Interesting perspective. I wouldn't call them chord lengths
>> because I think of a chord as being between two points both on
>> the same circle,
>
> m (the vector) is the centre of mass, but for some c, c*m lies on
> the circle. All the lines from the data points to c*m are actual
> chords. The average "time", A, is the point on the circle that
> minimises the sum of squares of the cords between A the t(i).

Minor point: the center of mass is a point, not a vector.
Because the circle is centered on the origin, it happens that the
point and the vector from the origin to the point have the same
coordinate values, but still points are different from vectors.

> The "other" average, minimises the sum of the of the angular
> distances.

I think you mean it minimizes the sum of the squares of the
angular distances.

>> and the center of mass is never on the unit
>> circle (not counting the case when all the time values are the
>> same). Even so it's an interesting way to view the distinction.
>
> It's more interesting because it really is about chords!

I don't buy the "really" here. The center of mass is fundamental
and always well-defined. Furthermore it works for collections of
points that are not all on the same circle or sphere. Looking at
the problem in terms of chords seems somewhat artificial, or at
least less fundamental.

>>> Incidentally, I found another book on statistics on spheres, and
>>> that gets the average over in a few paragraphs. It states,
>>> without considering any alternatives, that the average is the
>>> vector average. I can't find anyone using or citing the
>>> arc-length minimising average, despite it being natural on a
>>> sphere to find the mid-point of, say, a set of points on the
>>> Earth's surface.
>>
>> Do you mind my asking, which book was that?
>
> http://library.sadjad.ac.ir/opac//temp/19108.pdf

That's great, thank you.

>> Now that I think about it, finding the point that minimizes the
>> great circle distances squared would be at least computationally
>> unpleasant. But it could be relevant in some contexts (thinking
>> in particular of astronautics, or, dare I say it, rocket science).
>>
>>> Tim, my best shot at calculating this other average sorts the
>>> points to find the widest gap. I suspect your algorithm is
>>> similar since you say it is O(n log n).
>>
>> Your instinct that I sorted the time values is right. If you
>> think a little more I think you will see that the widest gap need
>> not have any particular relationship to where the cut point is.
>> No further elaboration for now so as not to be a spoiler (and I
>> know you like to try figuring things out yourself).
>
> You must be confusing me with someone else!

Oh. Maybe it was your brother posting in those other messages I
saw coming from your address.

Re: Another little puzzle

<87ilhgx152.fsf@bsb.me.uk>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=3967&group=comp.programming#3967

  copy link   Newsgroups: comp.programming
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ben.usenet@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.programming
Subject: Re: Another little puzzle
Date: Sun, 08 Jan 2023 19:43:53 +0000
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <87ilhgx152.fsf@bsb.me.uk>
References: <puzzle-20221214131815@ram.dialup.fu-berlin.de>
<algorithm-20221221130021@ram.dialup.fu-berlin.de>
<average-20221228125821@ram.dialup.fu-berlin.de>
<87tu1diu2s.fsf@bsb.me.uk> <864jtdtkt5.fsf@linuxsc.com>
<87o7rlhtsv.fsf@bsb.me.uk> <878rioifnh.fsf@bsb.me.uk>
<868rinskhk.fsf@linuxsc.com> <87zgb3giu6.fsf@bsb.me.uk>
<86cz7pnji2.fsf@linuxsc.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="dc4bdde2c7b818e72ded116daac42e58";
logging-data="4121219"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19uJhGJ703FBcBb2Cgz7o6R7vAVGgeH7FU="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:i1BEDL/DURwi2uY3wGEnvZ6M+Lw=
sha1:8lLhs42ZCNMkKuytIXqT2VGwpfU=
X-BSB-Auth: 1.34eb3bde66d4002cc60d.20230108194353GMT.87ilhgx152.fsf@bsb.me.uk
 by: Ben Bacarisse - Sun, 8 Jan 2023 19:43 UTC

Tim Rentsch <tr.17687@z991.linuxsc.com> writes:

> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
<cut>
>> The "other" average, minimises the sum of the of the angular
>> distances.
>
> I think you mean it minimizes the sum of the squares of the
> angular distances.

Yes thanks. I originally thought I'd write an abbreviation but then I
convinced myself I would not forget any of the "squares of"s. Proof
reading might have been useful too.

>>> and the center of mass is never on the unit
>>> circle (not counting the case when all the time values are the
>>> same). Even so it's an interesting way to view the distinction.
>>
>> It's more interesting because it really is about chords!
>
> I don't buy the "really" here. The center of mass is fundamental
> and always well-defined. Furthermore it works for collections of
> points that are not all on the same circle or sphere. Looking at
> the problem in terms of chords seems somewhat artificial, or at
> least less fundamental.

There are other ways for something to be interesting (at least to me).
When you plot the two averages, and look at the chords vs the arcs, it
becomes clear why one average "looks" more average than the other.

--
Ben.

Re: Another little puzzle

<87cz7ox0fh.fsf@bsb.me.uk>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=3968&group=comp.programming#3968

  copy link   Newsgroups: comp.programming
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ben.usenet@bsb.me.uk (Ben Bacarisse)
Newsgroups: comp.programming
Subject: Re: Another little puzzle
Date: Sun, 08 Jan 2023 19:59:14 +0000
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <87cz7ox0fh.fsf@bsb.me.uk>
References: <puzzle-20221214131815@ram.dialup.fu-berlin.de>
<algorithm-20221221130021@ram.dialup.fu-berlin.de>
<average-20221228125821@ram.dialup.fu-berlin.de>
<87tu1diu2s.fsf@bsb.me.uk> <864jtdtkt5.fsf@linuxsc.com>
<87o7rlhtsv.fsf@bsb.me.uk> <878rioifnh.fsf@bsb.me.uk>
<868rinskhk.fsf@linuxsc.com> <87zgb3giu6.fsf@bsb.me.uk>
<86cz7pnji2.fsf@linuxsc.com> <87ilhgx152.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: reader01.eternal-september.org; posting-host="dc4bdde2c7b818e72ded116daac42e58";
logging-data="4121219"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ki2sh+d3jy0XKz4F8uJ3OJsSumf0sJvk="
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Cancel-Lock: sha1:btZ5ZljWCNeyJnrV4OTRsENRYnY=
sha1:5QQ6FksVV0QG+TBBjrzIV8qR11o=
X-BSB-Auth: 1.289b2c2d8c155bff96c2.20230108195914GMT.87cz7ox0fh.fsf@bsb.me.uk
 by: Ben Bacarisse - Sun, 8 Jan 2023 19:59 UTC

Ben Bacarisse <ben.usenet@bsb.me.uk> writes:

> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>
>> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
> <cut>
>>> The "other" average, minimises the sum of the of the angular
>>> distances.
>>
>> I think you mean it minimizes the sum of the squares of the
>> angular distances.
>
> Yes thanks. I originally thought I'd write an abbreviation but then I
> convinced myself I would not forget any of the "squares of"s. Proof
> reading might have been useful too.
>
>>>> and the center of mass is never on the unit
>>>> circle (not counting the case when all the time values are the
>>>> same). Even so it's an interesting way to view the distinction.
>>>
>>> It's more interesting because it really is about chords!
>>
>> I don't buy the "really" here. The center of mass is fundamental
>> and always well-defined. Furthermore it works for collections of
>> points that are not all on the same circle or sphere. Looking at
>> the problem in terms of chords seems somewhat artificial, or at
>> least less fundamental.
>
> There are other ways for something to be interesting (at least to me).
> When you plot the two averages, and look at the chords vs the arcs, it
> becomes clear why one average "looks" more average than the other.

I can see a possible misunderstanding here. You might have taken my "it
really is about chords" to mean "it is fundamentally about chords", but
I said "it really is about chords" because you thought I'd used the word
chord incorrectly to refer to the lines between the centre of mass and
the data points. I was saying "I really did mean chords".

--
Ben.

Re: Another little puzzle

<86k01tmt2h.fsf@linuxsc.com>

  copy mid

https://news.novabbs.org/devel/article-flat.php?id=3984&group=comp.programming#3984

  copy link   Newsgroups: comp.programming
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: tr.17687@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.programming
Subject: Re: Another little puzzle
Date: Tue, 10 Jan 2023 23:25:10 -0800
Organization: A noiseless patient Spider
Lines: 47
Message-ID: <86k01tmt2h.fsf@linuxsc.com>
References: <puzzle-20221214131815@ram.dialup.fu-berlin.de> <algorithm-20221221130021@ram.dialup.fu-berlin.de> <average-20221228125821@ram.dialup.fu-berlin.de> <87tu1diu2s.fsf@bsb.me.uk> <864jtdtkt5.fsf@linuxsc.com> <87o7rlhtsv.fsf@bsb.me.uk> <878rioifnh.fsf@bsb.me.uk> <868rinskhk.fsf@linuxsc.com> <87zgb3giu6.fsf@bsb.me.uk> <86cz7pnji2.fsf@linuxsc.com> <87ilhgx152.fsf@bsb.me.uk> <87cz7ox0fh.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader01.eternal-september.org; posting-host="b8c93f532ca61670e6683a0c36d14e62";
logging-data="887949"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+NjmE8D8rwFn2eQuYXpUR6T1t4XDghED8="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:EKa5tC6ugkfX9i4s3AUG3MQ4wXk=
sha1:AP7kMD29d5drA0jWHcarts12Itk=
 by: Tim Rentsch - Wed, 11 Jan 2023 07:25 UTC

Ben Bacarisse <ben.usenet@bsb.me.uk> writes:

> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>
>> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>>
>>> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>>
>> <cut>
>>
>>>> The "other" average, minimises the sum of the of the angular
>>>> distances.
>>>
>>> I think you mean it minimizes the sum of the squares of the
>>> angular distances.
>>
>> Yes thanks. I originally thought I'd write an abbreviation but then I
>> convinced myself I would not forget any of the "squares of"s. Proof
>> reading might have been useful too.
>>
>>>>> and the center of mass is never on the unit
>>>>> circle (not counting the case when all the time values are the
>>>>> same). Even so it's an interesting way to view the distinction.
>>>>
>>>> It's more interesting because it really is about chords!
>>>
>>> I don't buy the "really" here. The center of mass is fundamental
>>> and always well-defined. Furthermore it works for collections of
>>> points that are not all on the same circle or sphere. Looking at
>>> the problem in terms of chords seems somewhat artificial, or at
>>> least less fundamental.
>>
>> There are other ways for something to be interesting (at least to me).
>> When you plot the two averages, and look at the chords vs the arcs, it
>> becomes clear why one average "looks" more average than the other.
>
> I can see a possible misunderstanding here. You might have taken my "it
> really is about chords" to mean "it is fundamentally about chords", but
> I said "it really is about chords" because you thought I'd used the word
> chord incorrectly to refer to the lines between the centre of mass and
> the data points. I was saying "I really did mean chords".

Now that I see what you meant it all makes sense.

Also I agree that comparing the chords view and the arcs view
gives a useful perspective. I am starting to appreciate the
value of that perspective more as time goes on.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor