Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #16151
| Path | csiph.com!news.mixmin.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Tim Rentsch <tr.17687@z991.linuxsc.com> |
| Newsgroups | comp.programming |
| Subject | Re: Another little puzzle |
| Date | Sun, 25 Dec 2022 00:37:47 -0800 |
| Organization | A noiseless patient Spider |
| Lines | 77 |
| Message-ID | <86r0wnyj38.fsf@linuxsc.com> (permalink) |
| References | <puzzle-20221214131815@ram.dialup.fu-berlin.de> <algorithm-20221221130021@ram.dialup.fu-berlin.de> <86pmcczcak.fsf@linuxsc.com> <87wn6krsc5.fsf@bsb.me.uk> <868riwzxu3.fsf@linuxsc.com> <to7ar5$aqn$1@gioia.aioe.org> |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Injection-Info | reader01.eternal-september.org; posting-host="bacb00f09a0305cdb2c72c0e332a04cb"; logging-data="2744161"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/jNWLUeTdPuSQt6V8QDGopqBYHNYnXRok=" |
| User-Agent | Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) |
| Cancel-Lock | sha1:hqa+uRS7Gvo5DC7e6IReCDBIAf0= sha1:P4JGpWw7kXsEbj/1Qf3NeLwNK4s= |
| Xref | csiph.com comp.programming:16151 |
Show key headers only | View raw
Mike Terry <news.dead.person.stones@darjeeling.plus.com> writes:
> On 24/12/2022 14:21, Tim Rentsch wrote:
>
>> Ben Bacarisse <ben.usenet@bsb.me.uk> writes:
>>
>>> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>>>
>>>> ram@zedat.fu-berlin.de (Stefan Ram) writes:
>>>>
>>>>> ram@zedat.fu-berlin.de (Stefan Ram) writes:
>>>>>
>>>>>> Given n times of the 24-hour day, print their average.
>>>>>> For example, the average of "eight o'clock" and
>>>>>> "ten o'clock" (n=2) would be "nine o'clock".
>>>>>> (You can choose any representation, for example "HH:MM"
>>>>>> or "seconds since midnight".)
[...]
>>> The input is a collection, t(n), of n > 1 numbers in [0, 24). The
>>> average should be a number, A, in [0, 24) that minimises
>>>
>>> Sum_{i=1,n} distance(A, t(i))
>>>
>>> (or Sum_{i=1,n} difference(A, t(i))^2 if you prefer to think in terms
>>> of variance). So far, this is just what an average is. The key point
>>> is what is the distance (or difference) whose sum (or sum of squares)
>>> we want to minimise? For times, I would say it is the length of the
>>> shorter arc round an imaginary 24-hour clock face.
>>
>> Minimizing the square of the distance (aka length of the shorter
>> arc) is one metric, and I think a reasonable one. [...]
>
> Yes - perhaps Ben was thinking of making
>
> Sum_{i=1,n} signed_distance(A, t(i)) = 0
>
> rather than minimising the (absolute) distance. [...]
I think Ben meant what he said, but I will let him speak for
himself.
>>> The problem has a natural interpretation in terms of angles.
>>> Whatever the circular quantity is, convert the values to unit
>>> vectors round a circle. For times of day, just scale [0, 24) to
>>> [0, 2*pi). The average is then just the direction of the average
>>> vector, converted back to a time of day.
>>
>> Averaging the "time unit vectors" is another plausible metric.
>
> Yes I think this one would work best in most situations, [...]
It gives results in many cases, including many easy cases, that I
think would surprise most people.
> Another way of thinking of this approach is "balancing" the 24-hour
> modular circle, where we've put unit weights at each of the times
> x_i. E.g. we look for a balancing line through the centre of the
> circle. [Note times on the circle go from 1-24, not 1-12 like a
> normal clock.]
To me this way of thinking about the problem seems not very
useful.
> Also, thinking like this, it's equivalent to (conventional)
> averaging of the sin of the angular differences from the average
> (balancing) point, since the sin will give the perpendicular
> distance of the weight from the balancing line. [...]
I think this statement is nonsensical. We are taking the
conventional average of "something", but the "something" has
been chosen so that its conventional average is zero. It's
like saying, Once you get to where you're going, you know that
where you're going is where you are. There is no information
about how to solve the problem, and so it cannot be equivalent
to any method that provides an actual answer.
Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar
Re: Another little puzzle Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-12-21 13:17 -0800
Re: Another little puzzle Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-12-22 04:10 +0000
Re: Another little puzzle Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-12-24 06:21 -0800
Re: Another little puzzle Mike Terry <news.dead.person.stones@darjeeling.plus.com> - 2022-12-24 16:53 +0000
Re: Another little puzzle Richard Heathfield <rjh@cpax.org.uk> - 2022-12-24 17:14 +0000
Re: Another little puzzle Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-12-24 22:30 +0000
Re: Another little puzzle Mike Terry <news.dead.person.stones@darjeeling.plus.com> - 2022-12-25 00:02 +0000
Re: Another little puzzle Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-12-25 01:30 +0000
Re: Another little puzzle Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-12-25 01:55 +0000
Re: Another little puzzle Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-12-25 00:37 -0800
Re: Another little puzzle Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-12-25 00:41 +0000
Re: Another little puzzle Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-12-25 01:05 -0800
Re: Another little puzzle Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-12-25 09:30 -0800
Re: Another little puzzle Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-12-25 21:44 +0000
Re: Another little puzzle Richard Damon <Richard@Damon-Family.org> - 2022-12-25 17:59 -0500
Re: Another little puzzle Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-12-25 18:39 -0800
Re: Another little puzzle Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-12-26 03:18 +0000
Re: Another little puzzle Tim Rentsch <tr.17687@z991.linuxsc.com> - 2022-12-25 18:35 -0800
Re: Another little puzzle Ben Bacarisse <ben.usenet@bsb.me.uk> - 2022-12-26 03:49 +0000
csiph-web