Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #16103

Re: Another little puzzle

Path csiph.com!aioe.org!jsz7MSurcLFfjpj9fQtAZA.user.46.165.242.91.POSTED!not-for-mail
From "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Newsgroups comp.programming
Subject Re: Another little puzzle
Date Wed, 21 Dec 2022 15:15:58 +0100
Organization Aioe.org NNTP Server
Message-ID <tnv4eu$13i8$1@gioia.aioe.org> (permalink)
References <puzzle-20221214131815@ram.dialup.fu-berlin.de> <algorithm-20221221130021@ram.dialup.fu-berlin.de>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
Injection-Info gioia.aioe.org; logging-data="36424"; posting-host="jsz7MSurcLFfjpj9fQtAZA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0
X-Notice Filtered by postfilter v. 0.9.2
Content-Language en-US
Xref csiph.com comp.programming:16103

Show key headers only | View raw


On 2022-12-21 13:03, Stefan Ram wrote:

>    There were not enough tests written and run. As a result,
>    the puzzle has not yet been solved (unless I have overlooked
>    a contribution or misworded expectations).
> 
>    So, here are two possible test cases.
> 
> average( 23.5,  1.5 )==  0.5

Nope, it is 12.5! (:-))

Well, assuming that time samples can cross the day boundary and assuming 
that averaged time is defined as averaging duration from some epoch and 
adding the epoch back:

    Avr({Ti}) =def= Avr({Ti}-E) + E

(you cannot average time as it is).

Then in the case of n = 2 you have two competing answers:

    (23.5 + n * 24 + 1.5 + m * 24) / 2 (mod 24)

where n and m are any natural numbers (specifying the day). This 
resolves to:

    12.5 + (n + m) * 12 (mod 24)

which gives either 12.5 or 0.5 depending on whether n + m is odd or even.

Now the fun part is that when n contains factors other than 2 or 3 
(24=2*2*2*3) then there might be up to 23 different answers!

Your puzzle is ill specified.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

Back to comp.programming | Previous | Next | Find similar


Thread

Re: Another little puzzle "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2022-12-21 15:15 +0100

csiph-web