Can Trig Functions Satisfy These Conditions for Even and Odd Numbers?

  • Thread starter Thread starter mohamadh95
  • Start date Start date
  • Tags Tags
    Function
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
3 replies · 2K views
mohamadh95
Messages
43
Reaction score
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.
 
Physics news on Phys.org
vanhees71 said:
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
 
The trig functions are quite nice if the domain is ℝ. For example, look at cos2(pi*x) or cos(2*pi*x).