Over a million developers have joined DZone.

Mutually Odd Functions

· Big Data Zone

Hortonworks DataFlow is an integrated platform that makes data ingestion fast, easy, and secure. Download the white paper now.  Brought to you in partnership with Hortonworks

The floor of a real number x is the largest integer n ≤ x, written ⌊x⌋.

The ceiling of a real number x is the smallest integer n ≥ x, written ⌈x⌉.

The floor and ceiling have the following symmetric relationship:

⌊-x⌋ = -⌈x
⌈-x⌉ = -⌊x

The floor and ceiling functions are not odd, but as a pair they satisfy a generalized parity condition:

f(-x) = -g(x)
g(-x) = -f(x)

If the functions f and g are equal, then each is an odd function. But in general f and g could be different, as with floor and ceiling.

Is there an established name for this sort of relation? I thought of “mutually odd” because it reminds me of mutual recursion.

Can you think of other examples of mutually odd functions?

Hortonworks Sandbox is a personal, portable Apache Hadoop® environment that comes with dozens of interactive Hadoop and it's ecosystem tutorials and the most exciting developments from the latest HDP distribution, brought to you in partnership with Hortonworks.

Topics:

Published at DZone with permission of John Cook , DZone MVB .

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}