Checking weather any positive number is zero or not

  • Context: Undergrad 
  • Thread starter Thread starter Lslander
  • Start date Start date
  • Tags Tags
    Positive Weather Zero
Click For Summary

Discussion Overview

The discussion revolves around the construction of a function f that satisfies specific conditions: f(0) = 0 and f(x) = 1 for any positive integer x. Participants explore various mathematical approaches and definitions, including linearity, piecewise functions, and integer operations.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant proposes a function f(x) = (2*x+1)/2 - (2*x-1)/2, but notes issues with division when x=0.
  • Another participant asserts that the function described is non-linear and suggests a piecewise function as a possible solution.
  • There is a discussion about the applicability of the Intermediate Value Theorem (IVT) and the existence of continuous functions with the desired properties.
  • Some participants question the definition of the remainder operation and its implications for constructing the function.
  • A suggestion is made for an alternative function f(n) = [n/(n+1)], where [] denotes the ceiling function, but concerns about the representation of the ceiling function in the context of positive integers are raised.
  • One participant mentions that f(x) = x^0 could work, though its relevance to the original question is uncertain.
  • There is a light-hearted exchange regarding the notation for the ceiling function, indicating some confusion about mathematical symbols.

Areas of Agreement / Disagreement

Participants express differing views on the feasibility of constructing a function that meets the specified criteria. There is no consensus on a definitive solution, and multiple competing ideas are presented.

Contextual Notes

Participants clarify their definitions of integers and real numbers, which affects the applicability of proposed functions. The discussion includes unresolved mathematical steps and varying interpretations of operations like division and remainder.

Lslander
Messages
2
Reaction score
0
I would like to have a function f such that f(0) = 0 and f(x) = 1 for any x>0. I can compute f in the following way:

f(x) = (2*x+1)/2 - (2*x-1)/2 . Here the division is integer division. But if x=0, here we divide (2*0-1)/2 or -1/2, which is a problem. Because we do not have any number -1 here.

We can also compute f(x) as follows
f(x) = ((2*x+3) % 2*(x-1)+3)/2 . Here % is remainder. This is also a problem because we are doing something like x%y which is nonlinear. To be clear x%2 is allowed, but x%y is not allowed.

So, can anyone help me constructing such a function which is linear and over positive integer and all operation will be integer operation? Or can anyone tell me that it is not possible to construct f with such restriction?

I really appreciate any help.
NB: f simply checks weather any positive number is zero or not and return 0 if 0 ;else return -1.
Thanks a lot...
 
Physics news on Phys.org
"So, can anyone help me constructing such a function which is linear"

The function you are describing is non-linear by definition. So no, there is no linear function that can give the output:

f(0) = 0 and f(x) = 1 for any x>0


There is a piecewise linear function:

f(x) = { 0 if x=0
1 otherwise



But someone who knows math better than me may demonstrate this wrong...
 
Lslander said:
I would like to have a function f such that f(0) = 0 and f(x) = 1 for any x>0. I can compute f in the following way:

For all integers greater than 0 or for all real numbers greater than 0?

If you want it for all real numbers greater than 0, you could use the piecewise function the previous poster suggested. If you weren't looking for a piecewise function, a continuous function does not exist. By the IVT, it's impossible to have a continuous function with this property.

With integers, it's possible.

Lslander said:
f(x) = (2*x+1)/2 - (2*x-1)/2 . Here the division is integer division. But if x=0, here we divide (2*0-1)/2 or -1/2, which is a problem. Because we do not have any number -1 here.

This example doesn't work. f(x) = (2*x+1)/2 - (2*x-1)/2 = x + (1/2) - x - (1/2) = 0, so really, this just says that f(x) = 0.

Lslander said:
We can also compute f(x) as follows
f(x) = ((2*x+3) % 2*(x-1)+3)/2 . Here % is remainder. This is also a problem because we are doing something like x%y which is nonlinear. To be clear x%2 is allowed, but x%y is not allowed.

I'm not sure what your definition of remainder is here.

Lslander said:
So, can anyone help me constructing such a function which is linear and over positive integer and all operation will be integer operation? Or can anyone tell me that it is not possible to construct f with such restriction?

Why not f(n) = [n/(n+1)], where [] is the ceiling function?
 
gb7nash said:
For all integers greater than 0 or for all real numbers greater than 0?

If you want it for all real numbers greater than 0, you could use the piecewise function the previous poster suggested. If you weren't looking for a piecewise function, a continuous function does not exist. By the IVT, it's impossible to have a continuous function with this property.

With integers, it's possible.



This example doesn't work. f(x) = (2*x+1)/2 - (2*x-1)/2 = x + (1/2) - x - (1/2) = 0, so really, this just says that f(x) = 0.



I'm not sure what your definition of remainder is here.



Why not f(n) = [n/(n+1)], where [] is the ceiling function?
Dear gb7nash

Thanks for your reply.

"For all integers greater than 0 or for all real numbers greater than 0?"
I am considering natural numbers including 0.

"This example doesn't work. f(x) = (2*x+1)/2 - (2*x-1)/2 = x + (1/2) - x - (1/2) = 0, so really, this just says that f(x) = 0.
"
f(x) = (2*x+1)/2 - (2*x-1)/2 works because you have to consider (2*x-1) as a whole number. you should not simplify it. look when x=2, f(2)= (2*2+1)/2 - (2*2-1)/2 = 5/2-3/2= 2-1=1.

"I'm not sure what your definition of remainder is here."

c=a%b , d= a/b => a=d*b +c

"Why not f(n) = [n/(n+1)], where [] is the ceiling function?"

Since I am considering only positive integer number including 0, probably i cannot represent ceiling.

Thanks...
 
f(x) = x^0 works but I don't know if that's quite what you're looking for.
 
gb7nash said:
Why not f(n) = [n/(n+1)], where [] is the ceiling function?

Isn't the ceiling function notation ⌈x⌉ rather than the whole [x]
 
dimension10 said:
Isn't the ceiling function notation ⌈x⌉ rather than the whole [x]

Yes, but I can't find ⌈⌉ on the keyboard. :-p
 

Similar threads

  • · Replies 26 ·
Replies
26
Views
2K
  • · Replies 0 ·
Replies
0
Views
1K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 19 ·
Replies
19
Views
3K
Replies
48
Views
6K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 41 ·
2
Replies
41
Views
5K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K