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,867 of 57,431   
   =?UTF-8?B?xo4=?= to Dmitry A. Kazakov   
   Re: Another little puzzle   
   30 Dec 22 18:18:16   
   
   From: angel00000100000@mail.ee   
      
   You !   
      
      
      
   On Wednesday, December 21, 2022 at 11:54:47 PM UTC+2, Dmitry A. Kazakov wrote:   
   > On 2022-12-21 20:55, Mike Terry wrote:   
   >   
   > > The OP was probably deliberately rather vague on this point!  The   
   > > easiest definition for "average" literally doesn't make sense in a   
   > > modulo context:  we can ADD the modular values, but in general dividing   
   > > in such a mathematical setting doesn't make much sense, so   
   > >   
   > >     Average ([i=1,2,..n] x_i)  =[def]=  Sum ([i=1,2,..n] x_i) /n   
   > >   
   > > would be inappropriate due to the /n operation.   
   > Unless you calculate everything as reals or integers and then take the   
   > remainder of 24. Which is kind of most natural definition, at least to me.   
   > > HOWEVER, there's another characterisation for the average of a set,   
   > > which looks more promising in a modular (or other more general)   
   > > setting:  the average is the value of V which MINIMISES THE "ERROR"   
   > > calculated by   
   > >   
   > >     error = Sum ([i=1,2,..n] (V - x_i)^2)   
   > >   
   > > that is, minimises the sum of squares of differences from V.   
   > This has exactly same problem as above, because subtraction and   
   > multiplication (power of two) have different semantics in modular   
   > arithmetic.   
   > > [Incidentally, if we minimise the sum of absolute differeces from V,   
   > > that characterises the mode (aka "midpoint") of the sample, but I think   
   > > the median is more what is wanted here...]   
   > Actually it is the same beast. Median is the least C-norm defined as |x-y|.   
   >   
   > Mean is the least Euclidean norm (squares), the thing you proposed.   
   >   
   > Mean and average are same for real numbers.   
   >   
   > You are right that median (and C-norm) can be unambiguously defined in   
   > modular numbers. But nobody would ever qualify this as a puzzle! (:-))   
   >   
   > [...]   
   > > Now, as to how to CALCULATE the V above???   
   > As I said, in real numbers V is the mean, i.e.   
   >   
   > V = Sum (Xi) =def= mean({Xi | i=1..n})   
   > i=1..n   
   >   
   > Any numeric method is in the end mapping Xi to some normal number,   
   > calculating a classic mean, mapping back. The problem is with the   
   > forward mapping being ambiguous. One method to disambiguate is staying   
   > within the same day. Another could be taking a median and considering 12   
   > hours before and 12 hours after it. And there are many more.   
   >   
   > P.S. There are differences between the average and mean. OP referred the   
   > average, which may mean something completely counterintuitive (no pun   
   > intended (:-))   
   > --   
   > 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