How to redefine the function $f(n) = \begin{cases} 1, & \text{if $n$ is even} \\ 0, & \text{if $n$ is odd} \end{cases}$ in terms of arithmetic operations using ⅈ?
Asked
Active
Viewed 4,401 times
2
-
Have you experimented with $(-1)^n$ and $i^n$? – Joonas Ilmavirta Oct 01 '14 at 14:11
-
yeah, but not enough. i just was curious about how $i$ can create different oscillations. here, for example – Dan Oak Oct 01 '14 at 14:15
-
As you can see from the answer below, the powers of $i$ and $(-1)$ do give enough tools for building such a function. Don't judge too quickly. :) – Joonas Ilmavirta Oct 01 '14 at 14:19
2 Answers
4
The function $g(n)=i^{2n}$ maps even values to $+1$ and odd values to $-1$.
So you just need a function $h(n)$ such that:
- $h(+1)=1$
- $h(-1)=0$
This function is pretty simple: $h(n)=\dfrac{n+1}{2}$.
Now you just need to construct the function $f(n)=h(g(n))=\dfrac{i^{2n}+1}{2}$.
UPDATE:
Your piecewise function is from $\mathbb{N}$ to $\mathbb{N}$, so clearly there is no need to "involve" $\mathbb{C}$ here.
As implied by @columbus8myhw in the comment-thread below, $i^{2n}=(i^2)^n=(-1)^n$.
Therefore, you might as well use $f(n)=\dfrac{(-1)^n+1}{2}$.
barak manos
- 43,599
-
-
-
$\frac{(-1)^n+1}2+i-i$ works, then, if you want to be cheaty. – Akiva Weinberger Oct 01 '14 at 15:25
-
@columbus8myhw: Yeah, I've figured I could just add $0 \cdot i$, but I'm not sure if there is any point to that. In any case, OP's piecewise function is from $\mathbb{N}$ to $\mathbb{N}$, so clearly there is no need to "involve" $\mathbb{C}$ here, unless that's really what you want to do (and I guess that's what OP wanted to do). – barak manos Oct 01 '14 at 15:28
-
My guess is that he was interested in the "oscillatory" properties of $i^n$. However, all roots of unity (not just $i$) have that property, including $-1$. – Akiva Weinberger Oct 01 '14 at 15:30
-
@columbus8myhw: OK, I added your suggestion to the answer. Thanks for pointing that out. – barak manos Oct 01 '14 at 15:39
-
yeah, thanks guys. i was really interested in the "oscillatory properties". actually just i wanted to convert $\sum_{n\ge0}{z^{2n}}$ to $\sum_{n\ge0}{f(n)z^n}$. hmm... interesting how to generalize to the case of sum of $z^{kn}$ – Dan Oak Oct 01 '14 at 15:59
-
@DanyloDubinin You use other roots of unity. (I will agree, though - it is an interesting problem.) – Akiva Weinberger Oct 01 '14 at 16:18