Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am a beginner in Mathematica, so take this into account. I could not find anything similar in the internet so far.

I am trying to find a closed form solution for A in the equation below as a function of n, where n is countable and grows large. Potentially is infinite, but it would suffice to see a result for this when n is only large enough. I am using Reduce in the following way:

Reduce[
  Sum[Subscript[λ, t]*((A + B)/2 + Subscript[b, t] - D - E)^2, {t, 1, n}] == 
    Sum[Subscript[λ, t]*((B + C)/2 + Subscript[b, t] - D - E)^2, {t, 1, n}] && 
  Sum[Subscript[λ, t], {t, 1, n}] == 1,
  A]

Apparently Reduce is incapable of solving it. Perhaps I need another function.

When I use this specification above and assign numbers for n, for instance 3, the result is perfect and delivers what I need. Here is the example:

Reduce[Sum[
  Subscript[λ, t]*((A + B)/2 + Subscript[b, t] - D - E)^2, {t, 1, 3}] == 
    Sum[Subscript[λ, t]*((B + C)/2 + Subscript[b, t] - D - E)^2, {t, 1, 3}] && 
  Sum[Subscript[λ, t], {t, 1, 3}] == 1, 
  A]

Here is the output -- it is in the closed form solution that I am looking for:

A == 
  -2 B - C + 4 D + 4 E - 4 Subscript[b, 1] + 
  4 Subscript[b, 1] Subscript[λ, 2] - 
  4 Subscript[b, 2] Subscript[λ, 2] + 
  4 Subscript[b, 1] Subscript[λ, 3] - 
  4 Subscript[b, 3] Subscript[λ, 3]

Could you try to help me out with this?

share|improve this question
up vote 3 down vote accepted

$\sum _{t=1}^n l(t) \left(\frac{\text{A}+\text{B}}{2}+b(t)-\text{D}-\text{E}\right)^2-\sum _{t=1}^n l(t) \left(b(t)+\frac{\text{B}+\text{C}}{2}-\text{D}-\text{E}\right)^2=0$

$\sum _{t=1}^n (\text{A}-\text{C}) l(t) (\text{A}+4 b(t)+2 \text{B}+\text{C}-4 \text{D}-4 \text{E})=0$

Then

$\text{A}=\text{C}$

Or since $\sum _{t=1}^n l(t)=1$

$\text{A}=-4 b.l-2 \text{B}-\text{C}+4 \text{D}+4 \text{E}$

share|improve this answer
    
Thank you very much! It is exactly that form. – econ_sb Feb 13 at 14:21

I have rewritten your equations as

Sum[λ[t]*((a + b)/2 + β[t] - d - e)^2, {t, 1, n}] == 
  Sum[λ[t]*((b + c)/2 + β[t] - d - e)^2, {t, 1, n}] && 
Sum[λ[t], {t, 1, n}] == 1

because identifiers C, D, and E are reserved for system use in Mathematica and because subscripts are a pain in computation.

I can't find a closed form solution for a, but by doing a little math I could derive a recursive definition.

a[1] = -2 b - c + 4 d + 4 e - 4 β[1];
a[n_Integer /; n > 1] := (a[n] = a[n - 1] + 4 β[1] λ[n] - 4 β[n] λ[n])

This, for example, gives

a[7]
-2 b - c + 4 d + 4 e - 4 β[1] + 
4 β[1] λ[2] - 4 β[2] λ[2] + 4 β[1] λ[3] - 4 β[3] λ[3] + 
4 β[1] λ[4] - 4 β[4] λ[4] + 4 β[1] λ[5] - 4 β[5] λ[5] + 
4 β[1] λ[6] - 4 β[6] λ[6] + 4 β[1] λ[7] - 4 β[7] λ[7]

A little further analysis, using the relation Sum[λ[t], {t, 1, n}] == 1, gives

a[n_Integer?Positive] := 1 - 2 b - c + 4(d + e - Sum[β[t] λ[t], {t, 1, n}])

That is a far as I can carry the analysis, not knowing any details of β[t] and λ[t].

share|improve this answer
    
Thank you very much. Impressively helpful. – econ_sb Feb 13 at 14:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.