home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.programming      Programming issues that transcend langua      57,431 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 56,787 of 57,431   
   Dmitry A. Kazakov to Stefan Ram   
   Re: Another little puzzle   
   21 Dec 22 15:15:58   
   
   From: mailbox@dmitry-kazakov.de   
      
   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   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca