Questions tagged [products]

Questions about the use of `Product`, `NProduct`, and other types of multiplication, like `Dot`.

Filter by
Sorted by
Tagged with
0
votes
0answers
33 views

Product[(n - 1)/n, {n, 1, 1 k}] [closed]

Could someone explain why Product[(n - 1)/n, {n, 1, 1 k}] always returns zero? I tried using different equations and it worded fin but when I use $\frac{n-1}{n}$ it won't work.
3
votes
3answers
379 views

Smoother ways for setting up a Product function with j=0 and j != i

I want to implement a Product function, particularly the Lagrange polynomial $\ell_{i}(x)=\prod_{j=0 \atop j \neq i}^{n} \frac{x-x_{j}}{x_{i}-x_{j}}$ Are there ways to implement the "not equal" ...
8
votes
2answers
144 views

Closed form of product of Gamma function

Mathematica recognizes this closed form \begin{align} \prod_{k=1}^{n-1}\sin(\pi k/n) &= 2^{1-n}\,n \end{align} just fine: but fails on this one despite that this expression also has a known ...
1
vote
0answers
37 views

Simplifying the dot product [closed]

Why does the code D[x.x, x] /. {1. x -> x, x .1 -> x} gives 1.x+x.1, while ...
1
vote
0answers
44 views

How to evaluate an expression [closed]

I have a 3-dimensional array of numbers say A. I want to evaluate the following expression. $\displaystyle\sum_{\sigma,\tau \in S_6}(\Pi_{i=1}^6A(i,\sigma(i),\tau(i)))$. $S_6$ is the symmetric group ...
7
votes
1answer
149 views

Why is this product equal to zero, when the correct result is 2+GoldenRatio?

Consider the following product $$ \prod _{k=2}^{\infty } \frac{1}{1-\frac{\left(\frac{1}{2} \left(\sqrt{5}-1\right)\right)^k}{1-\left(\frac{1}{2} \left(\sqrt{5}-1\right)\right)^{2 k}}}$$ Mathematica ...
0
votes
0answers
52 views

How to multiply the elements of each site of tensor products to each other while using symbolic representation?

If I have, say three sites in a symbolic operator which is of the form A = a⊗1⊗c and I want it to act on another operator B = a1⊗b⊗1 in order to find the commutator A.B - B....
1
vote
2answers
79 views
2
votes
1answer
73 views

Product from max to min [closed]

Product[f[i], {i, 1, 4}] gives us f[1] f[2] f[3] f[4] Is there any way I can take the product it will give something ...
1
vote
1answer
78 views

Series of a product of series

I am writing a code where I have to multiply large series truncated at some order, say 100. As a result I want again a series up to order 100, and I want to get it in the fastest way. I have tried a ...
10
votes
1answer
214 views

How to calculate $\displaystyle \prod_{p}\frac{p^2+1}{p^2-1}$?

When I input $$ \prod _{p=2}^{\infty } \text{If}\left[\text{PrimeQ}[p],\frac{p^2+1}{p^2-1},1\right] $$ in Mathematica 12.0, it gives out the value $1$. The result is ridiculous, for that according to ...
0
votes
1answer
52 views

Return last value of While function

I want to make a function that performs a multiplication with Inner i number of times using a ...
0
votes
1answer
42 views

Set default product

I want to set a default product in Mathematica in place of the standard product. Specifically, I want to change the standard product for CenterDot so that when I ...
1
vote
3answers
80 views

Summation and product term expressed in Mathematica [duplicate]

I have the following term which I would like to express correctly in Mathematica: $$\sum_{i=1}^{m}\frac{1}{\prod_{j=1,j\neq i}^m(\rho_i-\rho_j)}$$ This means that for $m=3$ for example you should ...
5
votes
2answers
135 views

How to write down a product with omitted terms?

I have the following term which I would like to express correctly in Mathematica: $$ \prod_{j=1,j\neq i}^m(\rho_i-\rho_j) $$ Can you please help?
2
votes
1answer
119 views

Outer (dyadic) product between vectors of the same index in two lists

I have two lists of vectors and I want to take the outer product between elements in the lists of the same index. Using either Outer or TensorProduct works for e.g. the first two indices: ...
1
vote
2answers
86 views

Where is the “mistake in the recursion” while there is no recursion? [closed]

So my code is as follows xi = Exp[2*Pi I/13] tauA = xi + xi^(-1) sigma[tau_, n_] := tau^n Product[(x - sigma[tauA, i]), {i, 3, 8}] // FullSimplify This should ...
1
vote
1answer
83 views

How to create a dot product version of the product function

I would like to create a function to matrix multiply (dot product) n matrices together, where n is large, for example M1*M2*M3*M4*M5*...*Mn I know there is the 'product' function that can do this ...
2
votes
1answer
38 views

How to PowerExpand a generic Product?

I have: PowerExpand[Log[Product[f[i], {i, 1, n}]]] // InputForm (* Output: Log[Product[f[i], {i, 1, n}]] *) However, I would expect to get the following as the ...
2
votes
4answers
223 views

Dot product result has wrong dimension [closed]

I'm doing a small project and I've encountered a problem while using Mathematica. I should mention that I'm kinda new to this software, so maybe it's just something I haven't grasped yet. Anyway, I ...
4
votes
2answers
156 views

Why does this simple ratio of products not simplify?

Why does this ratio of products not Simplify to a[n]? Clear[a,k,n] $Assumptions={n>1} Simplify[ Product[a[k], {k, 1, n}] / Product[a[k], {k, 1, n - 1}] ] ...
2
votes
2answers
150 views

Sums of products with $ n $ variables

I want to be able to compute a function of $ n $ indices which looks as follows if $ n>2 $: $$ \sum_{(i=1,j=1,k=1,l=1,...), (i\neq j\neq k \neq l \neq ...)}^{n} x_{i}x_{j}(x_{k}^2+y_{k}^2)(x_{l}^...
1
vote
2answers
201 views

Calculating the series expansion of a theta function

I have defined the q-theta function as follows: $$\theta(x;q) = \prod_{k=0}^{\infty} (1-q^k x)(1-q^{k+1}/x)$$ I want to calculating, using this, the series expansion of the following series: $$\...
1
vote
1answer
86 views

Calculate the product

I have the following problem: Wolfram calculates the product incorrectly. In addition, lots of errors appears. Is it possible to improve the code? Thanks in advance! Define functions: ...
4
votes
2answers
94 views

Expanding Log[Product[…]]

I'm trying to get the log-likelihood of a Gaussian in the form $$ p(\textbf{x}|u,\sigma^2)=\prod_{n=1}^{N}\mathcal{N}(x_n|\mu,\sigma^2) \quad (1) $$ $$ \ln\ p(\textbf{x}|\mu,\sigma^2)=-\frac{1}{2\...
3
votes
2answers
242 views

How to get vector a from known inner product?

Assuming that a.b=z,where b={b1,b2,b3} and z=x b1+y b2+z b3, obviously ...
0
votes
1answer
47 views

hermitian matrix-vector product does not give real result

Background : If $H$ is a Hermitian matrix, then for any complex vector $\psi$ it holds that $\psi^* \cdot H\cdot \psi$ gives a real number. The problem I am creating a 16x16 Hermitian matrix in ...
11
votes
3answers
1k views

François Viète's approximation to π

How do I program the approximation to π devised by François Viète, which is given by 2 * 2/Sqrt[2] * 2/Sqrt[2 + Sqrt[2]] * 2/Sqrt[2 + Sqrt[2 + Sqrt[2]]] * ... ...
0
votes
1answer
71 views

Product of matrices with symbolic bounds

Before this is closed for duplicate, know that I have read the following posts: A product function for matrix products Taking the product of a list of matrices [duplicate] I need to multiply a ...
0
votes
2answers
92 views

Defining a recursive product function

I have defined a non-commutative product: ...
6
votes
1answer
106 views

Infinite product with the Catalan numbers

During the analysis of OEIS sequence A179381 I got the following expression with an infinite product: $$\prod _{k=1}^{\infty } \left(1-4^{-k} C_{k-1}\right)$$ ...
0
votes
1answer
94 views

Sum over permuted and unpermuted indices

I would like to write a code to evaluate the following (up to $N=20$) $\sum_{s_1,...,s_N=\pm 1;s_1 \cdot \cdot \cdot s_N=1}\sum_{\sigma\in S_N}\prod_{i=1}^N x_{\sigma(i)}^{s_i \lambda_i}$ There are ...
1
vote
1answer
24 views

User-defined Product with blocked variable and syntax hightlighting

I want to define a new Product but for NonCommutativeMultiply, which I do something like this: ...
1
vote
1answer
81 views

Summation and production using hold

Let's take a sum and an example production $z_{1}=\sum_{k=1}^{3}(k!+(k+1)!)$ and $z_{2}=\prod_{k=1}^{3}(k!+(k+1)!)$ I wish to get in z1 a result like that $...
1
vote
1answer
120 views

Can I split products into list [closed]

Is there a way to take a term that is a product like xyz and split it into {x,y,z}?
1
vote
1answer
333 views

How can I multiply all elements of a list together with user-defined multiplicatoin? [closed]

so currently I have my own definition of multiplication between elements but it can only multiply two elements. MyMult[a_,b_]:=... I want to multiply all ...
2
votes
2answers
92 views

Product over several previous primes

I'd like to evaluate $$\prod_p\left(1-\frac1p\right)$$ over the $k$ largest previous primes $p\le n/2$, where $n$ is the parameter. E.g., if $n=20$ and $k=3$, I'd like the product to be over the 3 ...
0
votes
3answers
135 views

Listing products of prime powers

Given a positive integer $n$, what is the code to list $2^{a_2}3^{a_3}\cdots p^{a_p}$, where $a_i\ge 0$ are integers, with respect to the lexicographic ordering on $(a_2,a_3,\ldots, a_p)$? The only ...
5
votes
2answers
163 views

Series expansion of a certain infinite product

I wanted to find Series[Product[Cos[t/n], {n, 1, Infinity}], {t, 0, 5}] but failed. Then, I tried ...
7
votes
1answer
150 views

Cross product without reordering (noncommutative)

Not related to question I assume this question (as it is of very general structure) might have been asked before, unfortunately I did not find an answer to it - despite what I used as search queries. ...
3
votes
1answer
468 views

Multiply lists of matrices

Hello I would like to multiply a list of matrices by another list of matrices and return all elements. I.e. K={A,B,C} L={X,Y} And the result should be ...
12
votes
1answer
478 views

multiplication of vector spaces

Original Question Disclaimer: The question motivated by the product of Hilbert spaces which arises from separate degrees of freedom which a system might contain in quantum technical system. Examples ...
4
votes
1answer
95 views

N[Product] and NProduct give different results

I have some trouble. I've been using finite product to study a certain function (see below). However, when I wanted to compute it precisely, I decided to use ...
3
votes
1answer
106 views

Net Present Value Calculation for a Changing Variable

I have a list of 1000 lists, each comprising 100 pairs of numbers, with the first of these numbers running from 1 to 100, and the second being an output from an equation, dependent upon variable G. ...
1
vote
0answers
217 views

Creating a scalar product function [closed]

I'm new to Mathematica and I'm struggling a bit with it. I need to make a function that returns me the scalar product $a\cdot b$ of two vectors $a$ and $b$, without using the ...
0
votes
0answers
90 views

Expressing the output product using dot

I have an expression of the form Hbar.H where H and Hbar are vectors. How can I get the ...
10
votes
1answer
211 views

TensorReduce and Dot

I'm manipulating abstract tensors with Mathematica. I have a question. With the assumptions $Assumptions = (R | r) ∈ Arrays[{4}]; I can do two operations: ...
2
votes
1answer
178 views

How to put conditions on indices of product

I'm trying to solve for the Lagrangian form of the interpolation polynomial. Right now, I'm just trying to solve for the $l_i(x)$ values which are equal to $l_i(x)=\prod_{j\neq i, j=1}^{n}{\frac{x-x_j}...
5
votes
0answers
73 views

TensorContract applied twice

I have a very simple question about TensorContract command: I'm declaring ...
2
votes
1answer
179 views

To what extent can one simplify these products of gamma functions?

I have these three expressions ...