Switch Function: Interval Restriction for Functions

  • Context: Undergrad 
  • Thread starter Thread starter pondzo
  • Start date Start date
  • Tags Tags
    Function Switch
Click For Summary

Discussion Overview

The discussion revolves around the concept of defining a function that operates within specific intervals without resorting to piecewise definitions. Participants explore various mathematical constructs and operators that could achieve this goal, focusing on interval restrictions and alternative representations of functions.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested

Main Points Raised

  • One participant proposes a function g(x) that combines different expressions based on the value of x, seeking a non-piecewise representation.
  • Another participant suggests the use of a step function as a potential solution to the problem posed.
  • A third participant introduces the idea of "mathematical cheat codes" and provides specific functions derived from the sgn(x) function, detailing how to create functions that switch behavior at specified points.
  • Concerns are raised about the indeterminate nature of certain functions at specific points, with suggestions for using the Kronecker delta function to address this issue.
  • One participant questions the necessity of avoiding piecewise functions, prompting further exploration of the topic.
  • Another participant mentions the indicator function as a relevant concept for the discussion.

Areas of Agreement / Disagreement

Participants express differing views on the necessity and implications of avoiding piecewise functions, with some suggesting alternative methods while others question the rationale behind the restriction.

Contextual Notes

Some proposed functions may be indeterminate at certain points, and the discussion includes various mathematical constructs that may depend on specific definitions or assumptions.

pondzo
Messages
168
Reaction score
0
Hi i was wondering if there is such a function/operator/something that restricts a function within an interval. I know that doesn't make a lot of sense but ill show you what i mean;

Say i want to define f(x) = x for 0<x<a and f(x) = sqrt(x) for x>a. Now i know this is easily represented as a piecewise function, but i do not want this to be a pieceswise function.

So instead I define g(x) = &{x} + %{sqrt(x)} where the &{} is some type of operator that is 1 when 0<x<a and 0 elsewhere and the %{} is a similar operator that is 1 when x>a and 0 elsewhere. What this 'operator' (probably not the right term) is effectively doing is switching the function for a given interval... i apologise for the abstractness.
 
Mathematics news on Phys.org
HEY! I know about this! I hope you're still watching this thread. I frequently need "mathematical cheat codes" which implement weird functions in terms of what you normally put into a calculator.

Consulting my recipe book, there's a few ways to do this. For clarity, I'll name the function which is 1 until x, then turns to 0, f(x); and the function which is 0 until x, then turns to 1, g(x).

You can derive these both from the sgn(x) function, which you can implement with f(x) / |f(x)|. Using the rules for translating and stretching functions, you end up with:

f(x) = (x-A)/(2abs(x-A)+(1/2)

g(x) = (A-x)/(2abs(A-x)+(1/2)

If you aren't allowed to use the absolute value function, you can implement that with sqrt(f(x)^2). Due to how only the principal value is taken.

Note, the above functions are indeterminate at x = 0. You can use the Kronecker delta function to get a function which is 0 at all points except A, where it is some number you specify. This is 0^abs(x), assuming your use-case assumes indeterminate values to be zero, and not, say, an error.

If indeterminate values are a problem, you can use the particularly evil identity sgn(x) = tanh(1000000x).

So, the most rigorous function I can give is f(x) = tanh(1000000(x-A))/2+1/2 and g(x) = tanh(1000000(A-x))/2+1/2

Your final function R(x) will just be xf(x)+sqrt(x)g(x).
 
pondzo said:
but i do not want this to be a pieceswise function.
Why?
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K