#MATHSTODON
can anyone help me with this?

let's say you have a rational number n

what's the best way of computing the shortest list of integers whose mean average is n?

the result could be represented as a list (where some numbers are stated multiple times) e.g:
n = 4.75
avg([7, 7, 4, 1]) = 4.75

or as a set of tuples where the second value is the number of times that number occurs, e.g:
n = 4.75
[ {7, 2}, {4, 1}, {1, 1} ]

@jk do you have a rational representation of the number? a/b?
@yatchi turns out not always :/ so it has to work for all real numbers
@jk @yatchi seems like you'd hit a problem with irrational real numbers if the mean is computed from integers? as that'd imply your mean is in Q, not R
@ninjawedding @jk yeah the average must be a rational number, you can't do this with an irrational number
@yatchi @ninjawedding accuracy isn't paramount so I can just truncate to a rational approximation anyway; it seems fairly workable
@jk @yatchi ah, gotcha