1

I'm looking for a simple function defined as: $$ f(x) = \begin{cases}

0, & \text{ when } x = 0, \ C, & \text{ when }x \neq 0. \end{cases} $$

Basically, I only want the constant to matter if $x \neq 0$.

Srivatsan
  • 26,311
moevi
  • 11

4 Answers4

7

Yes, there certainly is such a function! The notion that a function has to be defined by some sort of 'formula' is thoroughly out of date -- you can define a function to be anything you like, as long as it has an unambiguous value for each of its arguments.

You forgot to specify what the possible arguments of this function are, so -- to be complete -- you need to do that. Do you want your function to be defined on the set of real numbers? Then you should say so.

TonyK
  • 64,559
  • 2
    +1 is thoroughly out of date: More precisely, that occured around 1750-1800 (Euler still had it not entirely clear) http://www.gap-system.org/~history/HistTopics/Functions.html – leonbloy Sep 15 '11 at 15:12
  • @leonbloy: I would say that your link misses the point entirely: that a function from $D$ to $R$ is a subset of $D\times R$ that satisfies some simple conditions. This is obviously (with the benefit of hindsight!) a much better definition than any of those given there. The set-theoretic definition of Patrick Suppes that is given at the end is in the spirit of "gosh, look at this!", and no attempt is made to make sense of it. So the page gets a B- from me. – TonyK Sep 15 '11 at 15:27
3

You had just defined it :-)

What about $f(x) = C \cdot \mathrm{sign}(|x|)$?

Srivatsan
  • 26,311
Tomas
  • 1,368
1

You can define your function $f: \Bbb R \longrightarrow \{0, 1\}$ as follows: $f(0) = 0$ and $f(x) = 1$ for $x \neq 0$.

Henry T. Horton
  • 18,318
  • 5
  • 60
  • 77
Steven Gamer
  • 427
  • 2
  • 6
0

You can write it as $C\cdot(1-\delta_0)$ where $\delta_0(x)=1$ if $x=0$ and otherwise $\delta_0(x)=0$.

Generally speaking, though, functions do not need to be defined by a formula. Most functions, in fact, cannot be defined by formulas. Function is some sort of a machine which is designed to result in a particular output when entered a particular input. What's inside? Magic!

Asaf Karagila
  • 393,674