Searching for a function

  • Thread starter mohamadh95
  • Start date
  • #1
mohamadh95
45
0
is there any function h(x) that satisfies these conditions:
h(x)=0 when x is even
h(x)=1 when x is odd
and is there there any function g(x) such that:
g(x)=0 when x is odd
g(x)=1 when x is even
thank you.
 

Answers and Replies

  • #2
vanhees71
Science Advisor
Insights Author
Gold Member
2021 Award
20,724
11,558
What's the desired domain? If it's only [itex]\mathbb{Z}[/itex] think about the expression [itex](-1)^x[/itex]!
 
  • #3
mohamadh95
45
0
What's the desired domain? If it's only [itex]\mathbb{Z}[/itex] think about the expression [itex](-1)^x[/itex]!
Thank you for your quick reply g(x) can be (1+(-1)^x)/2 and h(x) (1-(-1)^x)/2
 
  • #4
D H
Staff Emeritus
Science Advisor
Insights Author
15,415
687
The trig functions are quite nice if the domain is ℝ. For example, look at cos2(pi*x) or cos(2*pi*x).
 

Suggested for: Searching for a function

Replies
0
Views
926
  • Last Post
Replies
5
Views
1K
  • Last Post
Replies
4
Views
3K
  • Last Post
Replies
1
Views
2K
  • Last Post
Replies
0
Views
1K
Replies
12
Views
1K
  • Last Post
Replies
6
Views
2K
  • Last Post
Replies
11
Views
1K
Replies
23
Views
2K
  • Last Post
Replies
1
Views
1K
Top