Questions tagged [summation]

Questions using the Sum command, especially for series and other algebraic objects, and related functions such as SumConvergence

Filter by
Sorted by
Tagged with
7
votes
5answers
575 views

Stop Mathematica from rounding the value

My task is simple. Calculate the average value for 10^7 dice throws using computer pseudo-random-number-generator. x := RandomInteger[{1, 6}] gives me one ...
1
vote
1answer
109 views

Long time to solve numerical integration involved summation over large n

I need to solve this numerical integration to plot w as a function of x.. ...
0
votes
1answer
432 views

The simplest way to sum the elements of a n*1 -matrix [closed]

Suppose we have a 10*1 (n*m) matrix: b = {{2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}, {11}} // MatrixForm Now, if I want to sum the elements of this matrix ...
0
votes
1answer
411 views

Plot a summation

How can I plot f = Sum[(4 Sqrt[6])/(n^2 π^2) Sin[(n π)/2], {n, 1, 20}] I need to plot the sum of the first 20 terms.
7
votes
2answers
305 views

Relabeling of dummy variables

I have the following expression F[p1, p2] a[p1] ** b[p2] - F[p1, p2] a[p2] ** b[p1] where ** is the non-commutative ...
1
vote
0answers
60 views

Why MMA cannot get the closed-form of this infinite series of B when it known that of A+B and A?

The following input s1 = Sum[(2 l + 1)*t^l*LegendreP[l, Cos[θ]], {l, 0, Infinity}, Assumptions -> {t < 1, 0 < θ < π}] returns the closed-form ...
10
votes
5answers
650 views

Possible bug in infinite sum Sum[(Sin[k]/k)^m,{k,0,∞}]

EDIT 11.10.2017 In order to avoid confusion which might arise from the statements I made in this question I declare here that the extensive discussion here has shown that the described behaviour is ...
1
vote
1answer
63 views

Leave Kronecker deltas unevaluated

When performing sums over Kronecker deltas, how can I tell Mathematica to leave deltas that are not summed over unevaluated? In particular, the following expression contains indices $i$, $j$, $k$, $l$....
0
votes
1answer
75 views

Why my code for format change doesn't work? (Format Rules)

I want to write the following in mathematica $$ (\sum_{k=1}^n a^2_k)$$ Now I've written this as an indexed variable Sum[(a^2)[k], {k, 1, n}] which in ...
12
votes
2answers
476 views

Summation bug in 11.2

If I sum all the positive-numbered Fourier coefficients of $\cos(x)$, I get the correct answer. If I sum the negative-numbered ones, I get a wrong answer. Splitting the sum into two parts somehow ...
4
votes
1answer
130 views

NSum not able to sum Abs[Sin[n]]

Is it a bug? ...
0
votes
1answer
50 views

Help to implement an expression

How can I implement this summation in Mathematica, where $r$, $k$ and $n$ are fixed value: r=3; k=0; n=0; Edit: Is that right? ...
-1
votes
1answer
101 views

Why can't Mathematica simplify this? (FullSimplify usage)

I have an expression like this (the one shown below is a generic form) $$ (F22)^3\left(\sum_{k=1}^n a_k\right)^2 \left(\sum_{k=1}^n d_k\right)^2 \left[\left(\sum_{k=1}^n b_k^2\right) - \left(\sum_{k=...
1
vote
2answers
188 views

Restricting a plot to be over integers

I am trying to plot the following function: ...
0
votes
1answer
120 views

How do I get Mathematica to invert a matrix with subscripts involved? (Subscript usage)

I want Mathematica to invert a matrix in which all variables are symbolic including Subscript. Now I am guessing this has something to do with the method I'm ...
4
votes
1answer
260 views

How do I get Mathematica to recognize this simplification? (ReplaceAll pattern rule)

I want Mathematica to understand this $$(\sum_{k=0}^n a_k)(\sum_{j=0}^n b_j) = (\sum_{k=0}^n \sum_{j=0}^n a_k b_j)$$ I have tried this ...
1
vote
1answer
80 views

Evaluation of `RandomChoice` in a summation

Of course the familiar summation Sum[i, {i,n}] yields $n (1 + n)/2$. I'd like to add integers with an arbitrary randomly chosen sign (+ or -) before each term ...
0
votes
1answer
107 views

Slow evaluation of sum of Binomials [closed]

I am trying to use DiscretePlot on the expression shown below, but my system is taking surprisingly long to complete the task. In fact, after 15 minutes, its still working. I would have thought the ...
0
votes
1answer
74 views

Large sum of 6-rank tensors

I have a question regarding the use of ParallelSum. I would like to perform a sum of the form: ...
0
votes
1answer
295 views

Getting error messages during double summation [closed]

I have two lists xi and ai of equal length, n. I would like to perform a sum over the ...
3
votes
2answers
220 views

ParallelSum vs. Sum: New functions also defined in other Kernels?

Set-Up: While I had tested a few toy examples that ParallelSum produces the result faster than the Sum, here I encounter one example in my code that the ParallelSum produces either wrong/incorrect ...
0
votes
0answers
65 views

The conditions used in Sum or ParallelSum: Calling a function/variable

For some reason, I encounter a problem when doing the Sum and ParallelSum (or doing the Do or ParallelDo, e.g. such as the issue here), I figured that the potential cause of the problem can be ...
1
vote
1answer
162 views

Taking the limit of a sum

Question: Why can't Mathematica calculate this limit in this way? And what can I do to fix it? ...
1
vote
1answer
343 views

kronecker delta symbolic summation

I have tried to have mathematica replace the kronecker delta in the summation, but I have not obtained result, the index remain the same. First i define the derivative the z-function in function of ...
0
votes
1answer
64 views

Integrating multivariable funciton

I'm new to Mathematica, and trying to plot a function, but stuck at integrating the function for hours. What I want to do is to plotting the following function with respect to $x$. $$-\int^1_0\sum^n_{...
0
votes
1answer
321 views

Contracting Levi-Civita [duplicate]

I am trying to contract two Levi-Civita symbols in tensor format like so: $\epsilon_{a b} \epsilon_{c d}$ This code generates the Levi-Civita: ...
1
vote
0answers
90 views

How to work out sums symbolically?

Intro Consider these two equal expressions of the variance $$\frac{\sum _{i=1}^n x(i)^2}{n}-\frac{\left(\sum _{i=1}^n x(i)\right){}^2}{n^2}$$ and $$\frac{\sum _{i=1}^n \left(x(i)-\frac{\sum _{i=1}...
3
votes
1answer
71 views

Weird problem adding up elements from matrice in list

I encountered a problem which seems very weird to me. I hope it can be understood from my description and is reproducible. I try to add up elements of a matrice to a vector (part of FEM), an example ...
3
votes
2answers
142 views

Faster sum of products of tuples?

My function: sumprob[lst_,size_]:=Sum[Product[x,{x,part}],{part,Tuples[lst,{size}]}]; Example: ...
0
votes
0answers
80 views

Why does a linear change of variable in a double sum enable Mathematica to obtain a symbolic answer?

I perform two equivalent sums. Mathematica returns a symbolic expression in one case but not the other. Shouldn't Mathematica be able to do either sum? First sum ...
0
votes
0answers
49 views

Sum negative factorials

Is it possible to get Mathematica to evaluate Sum[1/Gamma[1 - a], {a, 0,ul}] to 1 for all nonnegative integer values of ul ? In particular I would like to have ...
0
votes
2answers
112 views

Extracting order n coefficients from a non-closed form summation

I am trying to evaluate the following expression when $c=0$: $$\sum _{k=1}^{\infty} \dfrac{(k+1) c^{k-1} g(k)}{(k-1)!}+\left(\sum_{k=0}^{\infty} \dfrac{(k+1) c^k g(k)}{k!}\right)^2$$ (copyable ...
0
votes
1answer
46 views

How can I evaluate a series expressed with ellipses?

I want to evaluate an series given with ellipses. For example, 1/2 + 1/(2 + 4) + 1/(2 + 4 + 6) + ... + 1/(2 + 4 + 6 + ... + 20) Wolfram|Alpha works great, but ...
0
votes
1answer
119 views

Hessian for a function including a double summation

I am new to mathematica and I really struggling at finding the hessian for this function: $$U=\sum_{i=1}^{N-1}\sum_{j=i+1}^{N}\varphi(r_{ij}),$$ where $\qquad r_{ij}=\sqrt{(x_i^1-x_j^1)^2+(x_i^2-...
2
votes
3answers
233 views

Finding a polynomial representation for a sum function

I'm trying to find a polynomial representation for this horrendous function: $$f(x)=\frac{\frac{1}{2}-\frac{4}{1+10,000x}\sum_{n=0}^{\infty}\frac{(-1)^n}{\big[\big(n+\frac{1}{2}\big)\pi\big]^4}\tanh\...
1
vote
1answer
134 views

Summing over Prime Factors (without repetition)

Wolfram Mathworld (http://mathworld.wolfram.com/SumofPrimeFactors.html) describes a function sopfr(n), the sum of prime factors, which I currently need. This code doesn't work when I insert it in ...
1
vote
1answer
145 views

Does this sum converge?

If I input: Sum[Binomial[-1/2, n], {n, 0, ∞}] MMA returns: Sum::div: Sum does not converge. >> But I think that this sum does converge. It is an alternating ...
0
votes
1answer
122 views

How can show my series converges to zero [closed]

I have a summation, with that goes for 1 to ∞. I suspect that it should converge to zero as n -> ∞. ...
9
votes
8answers
581 views

How to find the sum for each individual row in a binary matrix until the first zero is reached from left to right.

I have a 150 by 300 binary matrix. I would like to sum the 1's for each individual row (from left to right) until the first zero is encountered. For example, if a given row is 1 1 1 1 1 1 0 0 0 1 0 0 ...
2
votes
1answer
48 views

Numerical result using summation limit

I'm exploring the possibilities of the Limit function: Example 1: $\lim_{x\to \infty } \, \frac{\sqrt{x-1}}{x}$ ...
1
vote
1answer
105 views

Code for specific sum

Given a positive integer $n$, let $p$ denote the largest prime $p$ less than $2^n$. That is, $p$ equals Max[Table[Prime[i], {i, 1, PrimePi[2^n]}]] I want to ...
0
votes
1answer
91 views

Hecke Operator- sum over divisors of a number

I am trying to write out the Hecke Operator; however, I don't know how to sum over all divisors of an integer. Could someone please give me some advice how to do that. Below is the Hecke Operator ...
2
votes
1answer
146 views

Having problem with using Replace in Do-loop

I am trying to set to zero some expression in a very long summation in mathematica. So I have decided to use a do loop along with a the replace operator over all indices I want to remove (actually ...
4
votes
2answers
141 views

Sum indexed by Primes [duplicate]

How can I express a sum indexed by primes in Mathematica? Two examples that I am interested in are (1) where the primes go from $p=2$ to, say, $p=17$. (2) It would also be useful to have the sum ...
-2
votes
1answer
65 views

Not able to plot a function of two variables defined by summation

I have the following code: ...
1
vote
0answers
61 views

ParallelSum faster… if I don't load my own Package

I have a big sum to compute. I remarked that if I load my package, the parallelisation is as slow as the "non" parallelisation. Whereas, when I don't load it, the parallelisation is faster. The ...
0
votes
0answers
58 views

Evaluating a sum with constraints on the indices

I want to know how to write $$\sum_{\substack{a,b,c>0 \\ a+b+c=n}} f(a,b,c).$$ as an expression that can be evaluated in Mathematica. I know that I can write the summation $$\sum_{\substack{a,...
0
votes
0answers
63 views

Plotting a partial sum with imaginary numbers on exponentials

Exercise Given Given $\qquad f(x)=\sum\limits_{n=-\infty}^{\infty}f_{n}e^{i\,n\,x}$ where $\qquad \left \langle f,g \right \rangle = \frac{1}{2\pi}\int_{-\pi}^{\pi}f\,g^{*}\,dx$ ...
0
votes
1answer
110 views

Need help defining function using Sum [closed]

Can anyone help me to calculate: ...
5
votes
2answers
224 views

Finding given sums over one variable in sums over multiple variables

I have a function of three discrete variables $f=f(n,m,p)$. It is known that the sum of $f$ over all three variables $$F=F(N)=\sum_{n,m,p = 1}^N f(n,m,p)$$ can be expressed in terms of a sum $Q$ ...