1

Given

  1. an $n$-tuple of ordinal values $\mathbf{x}$, the members of which are each comparable to one another and

  2. a single value $y$, $\mathrm{min}(\mathbf{x})\le y$, which is comparable to any of the members of $\mathbf{x}$,

maximize $x\in \mathbf{x}$, $x\le y$.

(This seems to be a simple, special case among "constrained extrema" problems.)

In terms of the range, this function is like the floor function, except that the range is constrained to $\mathbf{x}$ rather than to the integers.

For example, suppose $\mathbf{x}=(-100, -10, 0, 10, 100)$ and $y=-11$. Then $x=-100$. And if $y=-10$, $x=-10$.

Provided that the constraints are met, I believe this can be expressed in R as max(x[x <= y]).

One application is to the selection of aesthetic boundaries for a plot.

  • 3
    This is a common thing to do but I don't know if it has a name. I just say "the largest element of x less than $y$." – Jair Taylor Aug 04 '21 at 23:53
  • @JairTaylor I suppose maxle (or maxlt, as you have it) would be an OK name for a function in a computer program or software library, then. I am still wondering whether the mathematics community has a special name already, though. The $\mathrm{max}$ and $\mathrm{min}$ functions are easy enough to find. – Ana Nimbus Aug 05 '21 at 16:06

0 Answers0