# Finding coefficients

1. Jul 12, 2006

this problem has been bugging me for a few weeks now and here it is
$$A=\sum_{k=0}^{\infty}\sum_{m=-N}^{+N}a_k\cos(\frac{mk\pi}{N+1})\cos(\frac{mj\pi}{N+1})=1$$
what i am trying to do is find the $a_k$ terms.
i've tried a couple of different ways but there just seems to be too many different possibilities to be able to find the $a_k$ terms.
like for example i found that $\sum_{m=-N}^{+N}\cos(\frac{mk\pi}{N+1})\cos(\frac{mj\pi}{N+1})$
=N (if k=j)
=1 (if k+j) is odd)
=-1 (if k+j is even)
=2N+1 (if k=j=0)
i have been told there is nothing wrong with the above solution but from that i still dont know how to find a_k
i also suggested solving a recurrence relation as suggest by another guy but that proved to be unsuccessful also as it just turned into a giant mess.
if it helps i am trying to calculate probabilities so $A$ should be returning probabilities but that is not the major problem at the moment i just want the a_k terms so i can work out some numerical values.

Last edited: Jul 13, 2006
2. Jul 14, 2006

### MalayInd

Is j is a constant here?

Keep Smiling
Malay

3. Jul 14, 2006

### HallsofIvy

Am I missing something here? Doesn't a0= 1, ai= 0 if i is not 0 work?

In that case both $cos\left(\frac{m(k\pi)}{N+1}\right)$ and $cos\left(\frac{mj\pi}{N+1}\right)$ (what is j?) are 1 for m= 0, the other values don't matter and the sum on the right reduces to the single term 1.

4. Jul 14, 2006

### 0rthodontist

If you want to find the inner sum disregarding the ak's, solving the sequence should not be a mess. Back in the original thread
all you have to do to finish solving it is find
$$a_n = a_{n-1}+2cos(\theta n)$$
where you know that the particular solution is of the form
$$C_1 sin(\theta n) + C_2 cos(\theta n)$$
and you know that the homogeneous solution is a constant function, adding another coefficient C3. To sum it up,
$$a_n = C_1 sin(\theta n) + C_2 cos(\theta n) + C_3$$
Just find some actual values of the sequence and use them to solve for the C's.

Last edited: Jul 14, 2006
5. Jul 14, 2006

firstly, thanks for the replies
MalayInd: j is an integer which can take on any value you choose, which is troublesome for me because $B=\sum_{m=-N}^{+N}\cos(\frac{mk\pi}{N+1})\cos(\frac{mj\pi}{N+ 1})$ takes on different values depending on the value of j (which can be either odd or even)

HallsofIvy: i hope it is that simple but i dont follow how you went about your answer, and in particular "the other values don't matter " part. would your solution change whether j=1 or j=2 or j=3 for example? if not then i think this is what i am after but its magic to me how you got it - i'm a bit slow yes.
Orthodontist: yeah i solved that recurrence thing to get
$$a_n=2+\frac{\sin(\theta)\sin(n\theta)}{\cos(\theta)-1}-\cos(n\theta)$$
$$\theta = \frac{(k+j)\pi}{N+1}$$
and then my sum is something like,
$$\sum_k a_k((N+1)\delta_{k,j} + a_N) = 1$$ (1)
from that i am unable to determine the a_k terms. i was hoping i would get a $\delta_{k,j}$ popping out of the sum $B$ to be able to find the a_k terms but the above sum (1) is too difficult for me.

this may help you understand where i am coming from
i originally found a function
$$p(m,n)=\sum_k a_k \cos ^n (\theta) \cos(m\theta)$$
where $p(m,0)=\delta(m)$ where
$$\delta(m) = 1$$ if m=0
$$\delta(m)=0$$ otherwise
in an attempt to find a_k i multiplied both sides by
$$\cos(\frac{mj\pi}{N+1})$$
so hopefully that made it a bit clearer.

the solution still eludes me.

Last edited: Jul 14, 2006
6. Jul 15, 2006

### 0rthodontist

I'm not sure what HallsofIvy means by the other terms not mattering, but using the same idea, letting the inner sum except for ak equal X for k = 0, then you can let a0 = 1/X and let all the other a's be 0.

7. Jul 15, 2006

### HallsofIvy

I was wrong! For some reason, I got in my head that the inner sum was from -k to k rather than -N to N. InTHAT case, the first term, with k=0, the inner sum would also just be m=0 so both cosines would just give 1. "The other terms don't matter" because they are all multiplied by ai= 0.

Of course, since the inner sum is always from -N to N whatever k is, that's not true.

8. Jul 15, 2006

ok so whats the verdict
a_i = 0 for i > 0?
a_0 = ?

9. Jul 17, 2006

i dont see how you got that the a_i's are 0
Orthodontist do you mean this?
$$a_0=\frac{1}{\sum_{m=-N}^{+N}\cos(\frac{mj\pi}{N+1})}$$

10. Jul 17, 2006

### 0rthodontist

No, I meant
$$a_0 = \frac{1}{\sum_{m=-N}^{+N}\cos(\frac{mk\pi}{N+1})\cos(\frac{mj\pi} {N+1})}$$
The thing is that your equation does not completely determine the ai's--for example, you could let the ai's be such that the inner sums are arranged in a geometric sequence summing to 1.

Last edited: Jul 17, 2006
11. Jul 17, 2006

"The thing is that your equation does not completely determine the ai's"
i see.

$$p(m,n)=\sum_k a_k \cos ^n (\frac{k\pi}{N+1}) \cos(\frac{mk\pi}{N+1})$$
i think if i used the value for a_0 you have there that would make p no longer a function of m or n. do you know how i would go about getting some sort of a_i's (even if u cant completely determine them) so that p was a function of m and n ? because if u set a_k = 0 for k>0 then pop in k=0 into the following
$$\cos ^n (\frac{k\pi}{N+1}) \cos(\frac{mk\pi}{N+1})$$ = 1, and if i am not wrong that means m and n do the disappearing act.
i have a hazy idea it might have something to do with what you were talking about with the geometric sequence. why do the a_i's have to sum to 1?

thanks for your help

Last edited: Jul 17, 2006
12. Jul 17, 2006

### 0rthodontist

That looks like it would be a function of m and n to me, specifically one that is constant in n.

The inner sums (not the a's) would have to sum to 1--it was just an example. You can pick any infinite sequence that sums to 1, and choose your a's so that the inner sums match that sequence. If you don't want p to be constant in n, the simplest choice is to let that sequence be 0, 1, 0, 0, ...

Last edited: Jul 17, 2006
13. Jul 17, 2006

ok thanks Orthodontist thats what i was looking for
but how did you work out that the a_i's must sum to 1?

14. Jul 17, 2006

### 0rthodontist

I said, they don't--the inner sums do because you have stated that they have to when you asked the original question.

Maybe I should clarify:

$$a_1 = \frac{1}{\sum_{m=-N}^{+N}\cos(\frac{mk\pi}{N+1})\cos(\frac{mj\pi} {N+1})}$$
where k = 1, all other ai's are 0.