inferring the slope of a digitized line - MathOverflow most recent 30 from http://mathoverflow.net2013-06-20T10:46:18Zhttp://mathoverflow.net/feeds/question/55535http://www.creativecommons.org/licenses/by-nc/2.5/rdfhttp://mathoverflow.net/questions/55535/inferring-the-slope-of-a-digitized-lineinferring the slope of a digitized lineJames Propp2011-02-15T17:09:07Z2011-02-16T05:38:19Z
<p>Given real numbers $a$ and $b$, and an integer $n \geq 2$, let $f(n,a,b)$ be the minimum of $(nint(ja+b)-nint(ia+b)+1)/(j-i)$ (for $1 \leq i < j \leq n$) minus the maximum of $(nint(ja+b)-nint(ia+b)-1)/(j-i)$ (for $1 \leq i < j \leq n$), where $nint$ is the nearest integer function. What is known about the rate at which $f(n,a,b)$ goes to 0 as $n$ goes to infinity, for "generic" real numbers $a, b$? (That is, real numbers whose continued fractions have convergents that grow as dictated by Khinchin's law.) Experiments suggest that $f(n,a,b) = O(1/n^2)$.</p>
<p>This is related to the question of how accurately one can infer the slope of a line from a digitized version of the line; if there is any literature on this question, I would be very interested in pointers.</p>
<p>I am also interested in knowing how one can most efficiently compute the minimum of $(nint(ja+b)-nint(ia+b)+1)/(j-i)$ (for $1 \leq i < j \leq n$) and the maximum of $(nint(ja+b)-nint(ia+b)-1)/(j-i)$ (for $1 \leq i < j \leq n$).</p>
<p>For context, I'll mention that several recent postings of mine (especially <a href="http://mathoverflow.net/questions/54731/sums-of-fractional-parts-of-linear-functions-of-n" rel="nofollow">http://mathoverflow.net/questions/54731/sums-of-fractional-parts-of-linear-functions-of-n</a>) approach this question from another angle. Specifically, my posting from last week is related to an estimator of the slope of the line that can be computed in linear (as opposed to quadratic) time but has typical error $O(1/n^{3/2})$.</p>
http://mathoverflow.net/questions/55535/inferring-the-slope-of-a-digitized-line/55583#55583Answer by Gerry Myerson for inferring the slope of a digitized lineGerry Myerson2011-02-16T05:16:50Z2011-02-16T05:38:19Z<p>Not an answer, more like an overgrown comment. The nearest integer to $x$ is the floor of $x+(1/2)$, and you can incorporate the 1/2 into $b$, so you're talking about things like $([ja+b]-[ia+b]+1)/(j-i)$. Now floor is identity minus fractional part, so we get to $(ja+b-\lbrace ja+b\rbrace-ia-b+\lbrace ia+b\rbrace+1)/(j-i)$, which simplifies to $a+(\lbrace ia+b\rbrace-\lbrace ja+b\rbrace+1)/(j-i)$. So you're looking at the minimum of $(\lbrace ia+b\rbrace-\lbrace ja+b\rbrace+1)/(j-i)$ minus the maximum of $(\lbrace ia+b\rbrace-\lbrace ja+b\rbrace-1)/(j-i)$, which may be a little more tractable than what you started out with. </p>
<p>EDIT: As to whether someone has already done this, the paper by Melter, Stojmenovic, and Zunic, A new characterization of digital lines by least square fits, Pattern Recognition Letters 14 (1993) 83-88, available at <a href="http://www.site.uottawa.ca/~ivan/F29-digital-line-lsf.PDF" rel="nofollow">http://www.site.uottawa.ca/~ivan/F29-digital-line-lsf.PDF</a> may be relevant or may point you to some useful work. </p>
<p>FURTHER EDIT: Another paper that looks like it might be useful is MR2323394 (2008e:68149)
Uscka-Wehlou, Hanna,
Digital lines with irrational slopes, Theoret. Comput. Sci. 377 (2007), no. 1-3, 157–169. </p>