• Support PF! Buy your school textbooks, materials and every day products Here!

Searching for a function

  • Thread starter mohamadh95
  • Start date
  • #1
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
2019 Award
14,716
6,243
What's the desired domain? If it's only [itex]\mathbb{Z}[/itex] think about the expression [itex](-1)^x[/itex]!
 
  • #3
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,393
683
The trig functions are quite nice if the domain is ℝ. For example, look at cos2(pi*x) or cos(2*pi*x).
 

Related Threads on Searching for a function

Replies
0
Views
733
  • Last Post
Replies
3
Views
1K
Replies
0
Views
2K
  • Last Post
Replies
7
Views
2K
Replies
0
Views
948
  • Last Post
Replies
4
Views
684
Replies
4
Views
712
Top