Let $r_1,r_2,\ldots,r_m$ be positive rational numbers with a sum of $1$. Find the maximum values of the function $f:\mathbb N\to\mathbb Z$ defined by $$f(n)=n-\lfloor r_1n\rfloor-\lfloor r_2n\rfloor-\ldots-\lfloor r_mn\rfloor$$
Problem
Source:
Tags: algebra, floor function, function, optimization
08.04.2021 14:51
I'm sorry, I misread the problem. I will try again.
08.04.2021 14:55
alexheinis wrote: Easy, we have $f(n)\ge n-\sum_1^m nr_k =0$ with equality when we choose $n$ such that all numbers $nr_k$ are integer. The problem asks maximum, not minimum.
08.04.2021 15:05
08.04.2021 16:02
@above: we have $f(n)<n-\sum_1^m (nr_k-1)=m$ and since $f(n)$ is integer we have $f(n)\le m-1$. It remains to prove that this value can be attained. Let's take an example: $r_1=1/3,r_2=1/5,r_3=7/15$. Then $f(n)=n-[n/3]-[n/5]-[7n/15]$. If $a:=n \mod 3, b:=n\mod 5, c:=7n\mod 15$ then $f(n)=n-{{n-a}\over 3}-{{n-b}\over 5}-{{7n-c}\over {15}}={{5a+3b+c}\over {15}}$. In this case the choice $a=2,b=4,c=8$ gives $f(n)=2$. I'll work on the general proof and post it when I have it.
08.04.2021 16:49
@above Woops!!!! Well, I think my solution can be modified for it to work. Firstly note that the graph will always have a slope of $1$ when it does have a slope, and secondly note that since $r_m$ is always less than one (except for the case where $m=1$) there will be no jumps between the interval [c-1,c) where $c$ is the LCM of the denominators as the value $nr_k$ would not have changed enough to influence $\lfloor nr_k \rfloor$. Those two facts together forces the answer to be $m-1$