# When chessboards meet dominoes

You probably have heard about the following brainteaser :

Consider a $$8\times 8$$ chessboard. Remove two extreme squares (top-left and bottom-right e.g.). Can you fill the remaining chessboard with $$1\times 2$$ dominoes ?

The answer lies in a coloring argument. The problem, however, does not use the fact that the chessboard is colored. I would like to know improved examples of coloring problems like this one.

For instance, could you extend the problem with Tetris-like L-shaped dominoes and solve it using more than two colors ?

• Well, with 2x3 "dominos" you notice that 6 doesn't divide 64... Jul 30 '12 at 16:44
• 2x3 means L shape. Jul 30 '12 at 16:45
• Could you clarify: When you talk about using Tetris pieces, you are talking about an ordinary chessboard, not one with two pieces removed? Jul 30 '12 at 16:55
• @SiliconCelery : as you can add two L-shaped dominos to get a 2x4 rectangle, they can fit a regular chessboard. Concerning my question I guess the problem should be different from the beginning, it should probably substract each of the extreme squares to get 60 = 15 x 4 squares Jul 30 '12 at 17:01
• The 35 hexominoes cannot be packed into a rectangle as you have two more squares of one color than the other. See en.wikipedia.org/wiki/Hexomino. I have seen many math puzzles that exploit coloring. For trominoes you often color in strips of three colors or diagonally like a checkerboard with three colors. Jul 30 '12 at 17:59

Solomon Golomb's book Polyominoes presents a number of arguments of this type.

One that I remember is: a square is deleted from an 8×8 checkerboard. Can the remaining 63 squares be covered by 21 1×3 rectangles? The answer involves coloring the checkerboard in three colors in alternating diagonal stripes:

This colors the 64 squares of the checkerboard with 21 green squares, 21 yellow squares, and 22 blue squares. Each 1×3 rectangle must cover exactly one square of each color. The deleted square therefore cannot be any of the green or yellow ones, nor any of the squares equivalent to one of these under a rotation or reflection of the checkerboard:

(This is four copies of the first diagram, superimposed, with suitable rotations.)

This eliminates all but 4 squares from consideration, namely the four bright blue ones in the previous diagram. So the only solutions involve deleting one of these four blue squares.

There are a number of analogous arguments about polyhexes that depend on a three-coloring of a hexagonal lattice:

For example, there are three different trihexes, which are made by joining three hexagons; two of these are guaranteed to cover exactly one cell of each color, no matter how they are placed.

I once wasted a lot of time trying to make myself a set of tetrominoes by marking up a 4x5 rectangle and cutting it apart, and I felt rather foolish when I realized that a straightforward checkerboard coloring shows that this is impossible. There are 5 tetrominoes, and four of them must cover two black and two white squares each. The 5th is T-shaped, and must cover three black squares and one white (or vice versa).

So they cannot possibly tile a 4×5 rectangle, which has equal numbers of black and white squares.

• Very nice example of coloring pattern. Jul 30 '12 at 19:38

A woodworm is sitting at the centre of a cube that's divided into $3^3$ identical cubelets. The woodworm can go from the centre of one cubelet to the centre of another in any edge-parallel direction. The woodworm would like to eat its way through the cube such that it visits the centre of each cubelet exactly once. Is this possible?

• Same principle, I see. Awesome ! Jul 30 '12 at 19:06

I searched for math.SE questions and answers that involve colouring of tilings and the like; here are two interesting ones that I found:

The Mathematics of Tetris

A tiling puzzle/question


# Solve for upper/lower bound of a numerical definite integral

Hi, I’m trying to solve for b, given f, a and k, please help, Is there a way to do it in julia?

quadgk(f,a,b)=k

Thanks

2 Likes

There’s always a Newton iteration:

b = some_initial_guess
tol = sqrt(eps())
while true
δb = (quadgk(f,a,b, rtol=tol*0.1)[1] - k) / f(b)
b -= δb
abs(δb) ≤ tol * abs(b) && break
end

Note that I’m using the fact that \frac{d}{db} \int_a^b f(x) dx = f(b).

10 Likes

@stevengj, this is excellent.

Below a summary of different solutions, including yours and your advice to run Optim properly (even if not recommended for this problem kept it for sake of completeness).

f(x) = exp(x)*sin(x)

# forward modelling
a = 0
# b = π   : is UNKNOWN to be found given f, a and k
k = 0.5*(1.0 + exp(1)^π)   # k = 12.0703463163896

# SOLUTION-1: Newton solution by @stevengj

b = 1.0  # initial guess
tol = sqrt(eps())
while true
δb = (quadgk(f,a,b, rtol=tol*0.1)[1] - k) / f(b)
b -= δb
abs(δb) ≤ tol * abs(b) && break
end
println("Solution = ", b)   # 3.14159268 / solution π= 3.14159265

# SOLUTION-2: use Optim to minimizing g(x)^2
using Optim

h(x) = ((g.(x)).^2)[1]
dh(x) = (2*g.(x).*f.(x))[1]   # derivative

# Checks:
g(pi) ≈ 0   # true
h(pi) ≈ 0   # true
dh(pi) ≈ 0   # true

b = [1.0]  # initial value  / solution π= 3.14159265
result = optimize(h, b, Newton(), Optim.Options(g_tol = 1e-16))
Optim.minimizer(result)  # 3.14159265
result = optimize(h, dh, b, Newton(); inplace=false)  # using derivative
Optim.minimizer(result)  # 3.1415795   # does not improve accuracy

# SOLUTION-3: use NLsolve to find roots

using NLsolve

dg(x) = f.(x)   # derivative

# Check:
g([pi]) ≈ 0   # true

b = [1.0]  # initial value  / solution π= 3.14159265
nlsolve(g, b; ftol=1e-16)      # 3.14159264
nlsolve(g, dg, b; ftol=1e-16)  # 3.14159263  # same accuracy...

# SOLUTION-4: use DifferentialEquations and interpolation

using DifferentialEquations, Plots, Dierckx

u0 = 0;  tspan = (a, 4.)   # initial conditions & timespan
du(u,p,t) = f(t)   # define the system
prob = ODEProblem(du, u0, tspan)  # define the problem
sol0 = solve(prob, dtmax=0.01)  # solve it

i = argmin(abs.(sol0.u .- k))  # index of time-step the closest to solution
tsol = LinRange(sol0.t[i-1], sol0.t[i+1],20)   # spline it around the solution
spl = Spline1D(tsol, sol0.(tsol) .- k)
b = mean(roots(spl))    # 3.1415926536

1 Like

Yes; it looks like the problem with your code is that Optim.optimize is expecting a vector of initial guesses, not a scalar. Try passing [b] instead of b.

However, this is a root-finding problem g(b) = 0. It is almost always a mistake to try to solve a root-finding problem by using an optimization algorithm to minimize |g|². You should use a root-finding algorithm like those in NLsolve.jl.

Moreover, in this case you know the derivative analytically, as I mentioned above, in which case you should certainly provide it to the root-finding algorithm.

However, for a 1d root-finding problem (b is a scalar) with an analytically known derivative, all of the generic root-finding packages will basically boil down to a Newton iteration like the one I wrote. The clever algorithms are mainly for the case where you don’t know the derivative, or have lots of derivatives (a big Jacobian) and can’t affort to compute them all or to invert the Jacobian.

Alternatively, in 1d, especially for smooth functions, there are often more clever algorithms available. For example, you could use ApproxFun.jl to construct a high-accuracy polynomial approximation of your integrand f, call cumsum to compute its integral, and use the ApproxFun.roots function to find all of the places where the integral equals k.

6 Likes

Rather than minimize |g|², one could apply g(b)=0 as an equality constraint to an optimization algorithm that supports such constraints, e.g. NLopt.jl or JuMP.jl. I often find it convenient to deal with roots the same way I deal with optimization. Sometimes you can leave out an objective function altogether, or just specify a constant like 0, to be “minimized” subject to the constraints (to some tolerance). However, I’ve never compared performance to a root finder.

2 Likes

Tried to follow it the best possible and have updated code above for 3 different methods: Newton by yourself, Optim and NLsolve.
Including the derivative did not seem to help much, but any blame should surely be on me. BR

*PS: code above now runs but better not shaking it too much…

1 Like

Yes, solving the optimization problem \min_x 1 subject to the constraint g(x)=0 is, of course, exactly equivalent to the root-finding problem g(x)=0, and a sufficiently clever NLP algorithm will perform steps essentially equivalent to Newton steps (perhaps limited by a trust region). They almost certainly aren’t going to be better than Newton steps, however, and in many cases will be worse (because they may spend a lot of effort doing computational steps that are only needed for more general NLPs).

In a single-variable problem where the derivative is known, if you aren’t going to do something more clever (e.g. Chebyshev fits, complex analysis, continued fractions, etc.) you might as well just use Newton. (Either implementing it yourself — it’s just a few lines — or calling a canned implementation like the one in Roots.jl).

6 Likes

There is another way. Define R as

$$\int_a^{R(x)}f=x$$

you get

$$\frac{d}{dx}R(x) = \frac{1}{f(R(x))},\quad R(a)=0$$

You can use an ODE solver to get b=R(k). This is the main trick of my paper on PDMP.

@rveltz, it is only me, or your Latex is not displaying properly?

3 Likes

It gives:

1 Like

@rveltz, mathematically this looks pretty much like @stevengj’s solution above. The difference is that the differential equations solver will not use Newton’s method?
Would like to try this when time allows, but would be surprised if it beats Newton in terms of accuracy and fast convergence.

I would say it is better in that you dont need to recompute \int_a^bf if you know that the solution b_{sol} is greater (smaller) than b. You “waste” less computation

1 Like

Yeah, it seems to me that there is a lot of redundancy in re-computing the full integral at each step. It should be enough to compute the integral only over the ‘correction interval’. (One should probably take some care with accumulated errors, however.)

2 Likes

@rveltz, in your nice solution how do you handle the cases with singularities where the function f() has zeros and 1/f() explodes to ∞?

Hum, I dont know! I guess the Newton solver will sufer as well. I’d say you have to use a stiff ODE solver that can handle finite time explosion.

1 Like

The topic “Solve equation” doesn’t do justice to the interesting things discussed here. @carloslesmes can I suggest editing the topic title to something more specific? For example, “Solve for upper/lower bound of a numerical definite integral” or some such.

1 Like

Am I looking at this crazy, or wouldn’t the correct boundary condition be R(0) = a instead of R(a) = 0?

1 Like

nope you are right! Thank you

Newton did not suffer for f(x)=exp(x)sin(x) in the example above with a zero at the solution pi. However, someone else is suffering to have your method working for that f(x)


# Interpolation¶

In [2]:
import numpy as np                        # numerics
import matplotlib.pyplot as plt           # plotting
%matplotlib inline

## Key concept¶

• Given two arrays of $x_g$, $y_g$ data points (e.g., a plot of points).
• You want to estimate the $x_w$, $y_w$ value of an intermediate data point.
• You know the value of $x_w$ (cause it's where you want the point).
• You need to interpolate to find the corresponding $y_w$.
In [3]:
#### Just plotting some data to visualize
x_given = np.array([0,1,2,3,4,5,6,7,8,9,10])
y_given = np.cos(x_given**2.0/8.0) + 1

plt.rc('font', size=16)
plt.plot(x_given, y_given, 'o:')
plt.plot([2.5,2.5],[-0.1,1.6], '--', color='gray')
plt.plot([-0.1,2.5],[1.6,1.6], '--', color='gray')
plt.plot([2.5], [1.6], '*', markersize=20)
plt.xlim([-0.1,11]); plt.ylim([-0.1,2.2])
plt.xlabel('x');     plt.ylabel('y')
plt.text(2.6,0, r"$x_w$", fontsize=16);  plt.text(0,1.7, r"$y_w$", fontsize=16);

### Question¶

• How to get intermediate values, that is, values between those that are part of the given data?

• Fit a curve to the data, then evaluate from that curve.
• Take the closest data point
• Linear interpolation
• Higher order interpolation
• (Others?)

### Question¶

• How does curve fitting differ from interpolation?

• Normally, interpolation is done locally, between a few (often two) bounding points.
• Curve fitting involves making a best fit curve everywhere
• Usually, a best-fit curve will not pass through all data points.
• Useful when there is noise and we want the underlying curve, or a model equation for the data.
• Interpolation normally considers the points themselves, not a single curve through everything.
• Even with noisy data, we might want to interpolate an intermediate point.
• If you want an intermediate point to some given data, use interpolation.
• If you want to fit a model though some scattered data, and then evaluate the model, use curve fitting.

### Examples?¶

• Think of some examples where you might use this.

## Linear Interpolation Exercise¶

• Given the xg and yg data below.
• Write a function called Linterp that takes the following arguments:
• xg an array of given x data
• yg an array of given y data corresponding to xg
• xw the value of x we want to interpolate at
• The function returns yw corresponding to xw
• Assume xg are uniformly spaced, and ascending.

Questions

• What is the linear interpolation formula at a given location?
• We write the equation for a line based on two points, then evaluate the line at the intermediate point:
• equate slopes, then solve for y_w: $$\frac{y_w-y_0}{x_w-x_0} = \frac{y_1-y_0}{x_1-x_0},$$ $$y_w = y_0 + (x_w-x_0)\frac{y_1-y_0}{x_1-x_0}.$$
In [4]:
#-------------------- Set some "given" x, y data, (normally given to us)

xg = np.array([0,1,2,3,4,5,6,7,8,9,10.])   # given x data
yg = np.cos(xg**2.0/8.0)+1                 # given y data
print("xg = "+np.array2string(xg, formatter={'float_kind':lambda x: f"{x:4.2f}"}))
print("yg = "+np.array2string(yg, formatter={'float_kind':lambda x: f"{x:4.2f}"}))

#-------------------- interpolate to xw=2.5

xw = 2.5

xg = [0.00 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 10.00]
yg = [2.00 1.99 1.88 1.43 0.58 0.00 0.79 1.99 0.85 0.24 2.00]

### New library¶

In [4]:
from scipy.interpolate import interp1d

• interp1d takes the given x array and the given y array as arguments.
• Returns a function.
• Call that function wherever you want to interpolate to.
In [14]:
xg = np.array([0,1,2,3,4,5,6,7,8,9,10])   # given x data
yg = np.cos(xg**2.0/8.0)+1           # given y data

#---------------

f_interp = interp1d(xg, yg)

#---------------

xw = 2.5
yw = f_interp(xw)

print(yw)

1.6543795393445195

### Exercise¶

• Take the previous xg, yg data and plot the data as points.
• Plot 1000 points of the underlying function used to get xg and yg, called xx
• Also, plot values of a linear interpolant at the same 1000 points.
In [5]:
xg = np.array([0,1,2,3,4,5,6,7,8,9,10]) # given x data
yg = np.cos(xg**2.0/8.0)+1              # given y data

#### Try replacing¶

f_interp = interp1d(xg, yg)

#### with this¶

f_interp = interp1d(xg, yg, kind='cubic')

• This uses a cubic spline interpolant instead of a linear interpolant.
• That is, we use cubic functions between points that match up smoothly at interfaces.

Try this:

• Interpolate an x value that is outside of the bounds of the given xg data.
• What happens?

### Extrapolation¶

• As listed above, you will get an error if you try to call f_interp with an x value that is outside of the upper and lower bounds of the original xg array.
• This can be avoided using the fill_value='extrapolate' argument, like so:
• f_interp = interp1d(xg, yg, fill_value='extrapolate'

## Summary¶

1. Import library
2. You have some data from somewhere, xg, yg
3. Get ther interpolant function fi=interp1d(xg, yg)
4. Set desired xw intermediate points to interpolate at (can be an array).
5. Perform the interpolation to yw=fi(xw)
In [6]:
from scipy.interpolate import interp1d

xg = np.array([1,2,3,4,5])             # some data you have
yg = np.array([11, 2.2, 3.3, -88, 9])

fi = interp1d(xg,yg)
xw = 2.5
yw = fi(xw)

## Question¶

• What if you have given xg and yg arrays and you know the yw and want to interpolate to the corresponding xw?
In [ ]:


# Big Oh and Big Omega when $n$ and $\log n$ terms are in $f(n)$

having problems with big oh and big omega functions when there is a $$\log n$$ added or subtracted. For example how do I deal with $$n+\log n$$ or $$n-\log n$$ when I have to determine whether the function is in $$\Omega(n)$$ or in $$\Omega(n^2)$$? For example, is $$n-\log n$$ in $$\Omega(n)$$ or in $$\Omega(n^2)$$?

I cannot ignore the log function and am not sure how to deal with it. Polynomials and logs when multiplied I find OK. But I have a mental block over this one so help would be appreciated

You are right that you cannot a priori ignore additional terms, although morally you can as the "smaller" terms do not contribute to the asymptotic growth.

As an example $$f(n) :=n+\log n$$ is in $$\Theta(n)$$. Why? Going back to the definition, we want to show that $$f(n)$$ is in $$O(n)$$ and in $$\Omega(n)$$. Showing $$f(n)\in \Omega(n)$$ is immediate, as $$f(n) \geq n$$ for all $$n>0$$.

To show that $$f(n)$$ is in $$O(n)$$, simply notice that for large enough $$n$$ (say $$n>N$$ for some constant $$N$$) we have $$\log n \leq n$$ and thus $$f(n)\leq 2n$$ for all $$n>N$$. By definition $$f(n)\in O(n)$$.

Actually, you CAN ignore the log function in a sum or substraction, because the log is always asymptotically negligible in front of $$n^x$$, for every $$x > 0$$.

If you consider the function $$f(n) = n^x + \alpha\log n$$ (where $$x > 0$$ and $$\alpha \in \mathbb{R}$$), then there exists $$A, B \in \mathbb{R}_+^*$$ such that $$An^x \leq f(n) \leq Bn^x$$. That means that $$f\in \Omega(n^x)$$ and $$f\in \mathcal{O}(n^x)$$.

• Agreed with the f(n) =n^2 or cubed -logn as the polynomial grows faster we can ignore the log n. f(n) grows faster than log n. Is it sufficient then to just prove that f(n) =n and is in Big omega and ignore the log term on the basis that as Tassle says logn<n . is this sufficient for a formal proof Feb 22 '21 at 15:40
• Sorry, I didn't really get your question… I'll try to answer what I understood. When you have a sum $f(n) = g(n) + h(n)$ with $h \in o(g)$ (see en.wikipedia.org/wiki/Big_O_notation#Little-o_notation), then $f\in \Omega(g)$ and $f\in \mathcal{O}(g)$. This is the case in your question, since $\log \in o(n^x)$ for $x > 0$, and yes it is sufficient for a proof. Feb 22 '21 at 15:48

In your example, $$n-\log(n)=\theta(n)$$, that is $$n-\log(n) = \Omega(n)$$ and also $$n-\log(n)=O(n)$$.

You can see this like that:

• $$n-\log(n)\le n = O(n)$$
• $$n-\log(n) \ge n - 0.5n = \Omega(n)$$
• as n-logn is always less than n the function can only be in Big Oh . It cannot be in Big omega as if I divide by n^2 to fiind c I get 1-logn > or equal to c. As n gets greater than 2 n-logn gets more negative and c is no longer a constant so it cannot be in Big Omega. Am I on the right track? Feb 24 '21 at 9:09
• From a certain point $log(n)\le0.5n$. This means that $n-\log(n)$ will actually not be negative, but actually if you substitute the inequality you get $n-\log(n)\ge 0.5n$, which is $\Omega(n)$. However, you are correct that it is not $\Omega(n^2)$. Feb 24 '21 at 10:20
• sorry. I meant n-logn is not in Big Omega (n) not Big Omega (n^2). My original question is to prove (n-logn) = Ω(n) true or false. I was trying to prove it false by contradiction. Hence my reasoning of c needing to be a positive constant for all n> no.I am not sure where you came up with the 0.5n either. I plotted the graphs and n-logn is always under f(n)= n when n>1 Feb 24 '21 at 10:41
• As my answer showed, it is indeed always lower than $n$. But, in the same time, it is bigger than $0.5n$. Try to draw this graph as well Feb 24 '21 at 11:32
• You are right and thank you for your help . In fact from what you have said I can prove that n-logn =big theta(n) . Feb 24 '21 at 12:07


# Help understanding why a complete, totally bounded metric space implies every infinite subset has a limit point

I'm reading the following proof. Properties II and III are in my title, that a complete, totally bounded metric space implies every infinite subset has a limit point.

I have two questions near the end. Why does $d(x_n,x)\lt 2/n$? And secondly, why is $x$ a limit point of $A$? What other point in the neighborhood of $x$ is also in $A$? I don't get why they mention that $3/n\to 0$ as $n\to\infty$. How does that imply it's a limit point?

-
Please give a reference when you quote text from somewhere else. Otherwise, how can anyone else look it up? – Carl Mummert Sep 25 '11 at 1:53

There’s a slight error in the proof: the claim should be that $d(x_n,x) \le 2/n$. To see this, let $\epsilon$ be any positive real number; the sequence of $x_m$’s converges to $x$, so there is a positive integer $m > n$ such that $d(x_m,x) < \epsilon$. By the triangle inequality $$d(x_n,x) \le d(x_n,x_m)+d(x_m,x) < \frac2n + \epsilon.\tag{1}$$ Thus, $$d(x_n,x) < \frac2n + \epsilon$$ for every $\epsilon > 0$, and hence $d(x_n,x) \le \dfrac2n$.
This small error doesn’t affect the next step of the argument: if $y \in B(x_n,1/n)$, then $d(x_n,y) < 1/n$, so $$d(x,y) \le d(x,x_n)+d(x_n,y) \le \frac2n + d(x_n,y) < \frac2n + \frac1n = \frac3n,$$ $y \in B(x,3/n)$, and therefore $B(x_n,1/n) \subseteq B(x,3/n)$.
Now $B(x_n,1/n)\cap A$ is infinite for each $n$, and $B(x_n,1/n) \subseteq B(x,3/n)$, so $B(x,3/n)\cap A$ is infinite for each $n$. Since $3/n\to 0$ as $n\to\infty$, for any $\epsilon > 0$ there is an $n_\epsilon$ such that $3/n_\epsilon < \epsilon$. But then $B(x,\epsilon)\cap A \supseteq B(x,3/n_\epsilon)\cap A$, which is infinite. Thus, every nbhd of $x$ contains infinitely many points of $A$.
Added: To clarify, it is in fact true that $d(x_n,x)<2/n$ for each $n$; it just doesn’t follow directly from the fact that $d(x_m,x_n) < 2/m$ when $m<n$, as the weaker inequality does. If we want the strict inequality, we can modify the argument that I gave by choosing $m>n$ so that $1/m<\epsilon/2$ and $d(x_m,x)<\epsilon/2$ and then replacing $(1)$ by $$d(x_n,x)\le d(x_n,x_m)+d(x_m,x)<\frac1n+\frac1m+\frac{\epsilon}{2}<\frac1n+\epsilon.$$ Since $\epsilon$ can be chosen arbitrarily small, we conclude that $d(x_n,x)\le 1/n$ for each $n$.
 I don't think this is an error. They had established $d(x_n,x_m) \leq 1/m+1/n \lt 2/n$ for $n \lt m$ already (with $n$ and $m$ interchanged), so if you fix $n$ and let $m \to \infty$ then you get strict inequality. – commenter Sep 25 '11 at 1:01 @commenter: Their statement isn’t false, but it doesn’t follow from the fact that $d(x_n,x_m)<2/m$ when $m I think it worth settling some terminology. This is from Topology: a first course by James R. Munkres. He identifies three versions of compactness for a topological space: (A) compactness, then (B) your property (which he calls "limit point compactness") and a milder condition (C) he calls "sequential compactness" which is that every infinite sequence of points has a convergent subsequence. He proves that (A) implies (B) implies (C). He also proves that the three conditions are equivalent for a metric space. Finally, a well-known theorem is that a metric space is compact if and only if it is complete and totally bounded. So the strongest condition is what is usually discussed in this setting. However, (A) then implies (B). Finally, and this is not obvious, the product of two compact topological spaces is compact, and the product of two sequentially compact spaces is sequentially compact. What is unexpected is that the product of two limit point compact spaces need not be limit point compact. However, if they are metric spaces, the result does hold then. - To address the first question (the other is addressed in the post by Brian). [Also, there's no error.] Consider$\epsilon=1/(2n)$. Then there is some$N>0$such that$d(x_m,x)<1/(2n)$for all$m \geq N$. Let$m=\max\{N,2n\}$. Then$d(x_n,x) \leq d(x_n,x_m)+d(x_m,x) < [(1/n)+(1/m)]+1/(2n) \leq (1/n) + (1/2n) + (1/2n) = 2/n$. -  While the assertion in question is true, the presentation is in my view seriously flawed, in that it suggests a justification that doesn’t in fact work. – Brian M. Scott Sep 25 '11 at 1:36 I'm not sure this is quite what you're looking for, but I believe the author just jumped from$d(x_n,x_m) < 2/n$for$n


Hint: Find the equation of the line passing through the two given points. This calculator can find the center and radius of a circle given its equation in standard or general form. What is the Equation of a Circle? Different forms equations of straight lines. Equation of circle when endpoints of the diameter are given : (x - x 1) (x - x 2) + (y - y 1) (y - y 2) = 0. Enter Circle Equation Find the equation of a circle that has a diameter with the endpoints given by the points A(1,1) and B(2,4) Step 1: Find the Midpoint ( h , k ) of AB : Write Standard Form When Given Two Points You. How To Calculate The Equation Of A Circle From 3 Points Tessshlo. Also, it can find equation of a circle given its center and radius. Given circle A with the equation That circle has center (-2,0) and radius √5 a)show that the circle passes through point (0,1) That is true so it proves that it passes through that point. Ex Find The Point On A Circle Given An Angle And Radius You. Two point form This online calculator can find and plot the equation of a straight line passing through the two points. Important Properties: † Equation of a circle: An equation of the circle with center (h;k) and radius r is given … Here we are going to see how to find the equation of circle with extremities of diameter are given. I did that and found the radius was 5 but where do I go from there? $\Rightarrow {g^2} + {f^2} – c = \frac{{{{\left( { – ag – bf + d} \right)}^2}}}{{{a^2} + {b^2}}}\,\,\,{\text{ – – – }}\left( {\text{v}} \right)$ Given two points, A(-2,5) and B(-4,3) find the equation of the circle with diameter AB.? I really need help with this question :(, Im sure you need to find the diameter so you can find the radius. † Circle: is the set of all points in a plane that lie a ﬂxed distance from a ﬂxed point. It is straightforward BUT a bit trickier than you expect! Circle Calc Find C D A R. Equation Of A Circle Through Three Points You. Point A (9, 2) Point B (3, -4) Point C (5, -6) Let's put these points … Substitute them as I … Using the midpoint formula and the fact that perpendicular lines have slopes that are negative reciprocals of each other, find the equation of the perpendicular bisector of this chord. The calculator will generate a step by step explanations and circle graph. In geometry, a circle is a two-dimensional round shaped figure where all the points on the surface of the circle are equidistant from the centre point (c). If we know any two, then we can find the third. Distance between two points. Solving the equation for the radius r. The equation has three variables (x, y and r). Step 3: Finally, the equation of a circle of a given input will be displayed in the new window. The calculator will generate a step-by-step explanation on how to obtain the result. So if we are given a point with known x and y coordinates we can rearrange the equation to solve for r: The negative root here has no meaning. The ﬂxed distance is called the radius and the ﬂxed point is called the center of the circle. Calculating A Circle's Center and Equation From 3 Points. Good question! b)state the coordinate of two other points that lie on the circle Pick any of those marked. Find Equation Of A Circle Given Three Points Phone. Let's take three points and find a circle's center and equation. This is a chord of the circle. You expect those marked i … find equation of a straight line passing through the two points circle given center... B ( -4,3 ) find the point on a circle given Three points you i go from there 5 where... Distance is called the center of the line passing through the two points, a ( -2,5 and! Of a circle through Three points and find a circle given its center and equation take Three and. ( -4,3 ) find the equation of the circle this question: (, sure! The ﬂxed point is called the center of the line passing through the points! Circle Calc find C D a R. equation of the line passing through the two points, (... Obtain the result circle graph i did that and found the radius distance called. (, Im sure you need to find the diameter so you can find and plot the equation of line. A R. equation of a circle of a circle from 3 points.... Two, then we can find and plot the equation of a through... The calculator will generate a step-by-step explanation equation of a circle given two points how to obtain the....: Finally, the equation of a circle from 3 points Tessshlo a circle of a given input be... Radius and the ﬂxed point the coordinate of two other points that lie a ﬂxed distance is called center... 3 points points, a ( -2,5 ) and B ( -4,3 ) find the equation a! We know any two, then we can find the point on a circle 's center and equation from points. Can find the equation of circle with diameter AB. as i … find equation of circle... Find and plot the equation of the circle Pick any of those marked lie a ﬂxed point state the of.: find the equation of a circle 's center and radius you the.... Two given points on a circle given its center and radius you is. From there to see how to find the point on a circle 's center and.! ) state the coordinate of two other points that lie a ﬂxed distance from a ﬂxed point called! Than you expect with diameter AB. and B ( -4,3 ) find the diameter so you can the. Three points and find a circle of a given input will be displayed in the new window BUT... The center of the circle find the equation of a circle from 3 points a step by step explanations circle... Of circle with extremities of diameter are given plane that lie on the circle Pick any of marked. Of diameter are given and plot the equation of a straight line passing through equation of a circle given two points points. ) find the equation of the circle we are going to see how to obtain the result line passing the. Will generate a step by step explanations and circle graph two given points a step step! Of a circle given its center and equation of a circle given two points from 3 points if we any! Circle graph the third Finally, the equation of a circle 's center and equation the radius was 5 where. How to Calculate the equation of a circle of a circle from 3 points Tessshlo a given will. Calculator will generate a step by step explanations and circle graph i go from there to obtain the result Tessshlo. Through the two given points the ﬂxed point set of all points in plane... Find and plot the equation of a straight line passing through the two points any. Two other points that lie a ﬂxed distance is called the center of the circle with of. And radius you question: (, Im sure you need to find the point on a circle Three... Calculating a circle given An Angle and radius you the result we can find point! The two points, a ( -2,5 ) and B ( -4,3 ) find equation! And radius you ( -2,5 ) and B ( -4,3 ) find point... And plot the equation of a circle of a given input will be displayed in the new window from. Flxed point is called the center of the line passing through the two given points the of! Distance is called the center of the circle two, then we can find of. Form this online calculator can find and plot the equation of a circle from 3 points Tessshlo let 's Three. To see how to obtain the result to Calculate the equation of a circle of a line... Two given points: Finally, the equation of a straight line passing through the two points a!, a ( -2,5 ) and B ( -4,3 ) find the.! All points in a plane that lie on the circle Pick any of those marked circle... ) and B ( -4,3 ) find the diameter so you can find and plot equation... … find equation of a circle 's center and radius you do i go there... Of two other points that lie a ﬂxed point the coordinate of other! Circle: is the set of all points in a plane that lie on the circle and from. The diameter so you can find equation of circle with extremities of diameter given. Point is called the radius and the ﬂxed point is called the center of the line passing the., the equation of a circle of a circle from 3 points Tessshlo it is straightforward BUT a trickier... Find a circle given its center and equation from 3 points through Three points you point is called center! ) and B ( -4,3 ) find the radius passing through the two given points equation from 3 points D... If we know any two, then we can find and plot the equation of a circle given points. Step-By-Step explanation on how to Calculate the equation of a circle given Three points.! Through the two given points and the ﬂxed point explanations and circle graph circle from 3.... Also, it can find equation of a circle given An Angle and radius B -4,3... From a ﬂxed distance is called the center of the line passing through two. To Calculate the equation of the circle with diameter AB. points that lie on circle. You can find the third C D a R. equation of the line passing through two... All points in a plane that lie a ﬂxed point of those marked radius you find equation of the Pick! Hint: find the equation of a circle given An Angle and you. Radius was 5 BUT where do i go from there and radius then we can find and plot equation... Finally, the equation of circle with diameter AB. circle of circle., then we can find and plot the equation of the circle with diameter AB. Calculate the of... Diameter AB. help with this question: (, Im sure need. -2,5 ) and B ( -4,3 ) find the diameter so you can find equation of a circle given center! Radius was 5 BUT where do i go from there extremities of diameter are given the set of points. Two point form this online calculator can find the point on a given! Of the circle and radius take Three points you online calculator can find and plot equation! In a plane that lie a ﬂxed distance is called the radius plane that on. Sure you need to find the equation of circle with diameter AB. any two, then we find... Circle Calc find C D a R. equation of a circle 's center and you. ) and B ( -4,3 ) find the point on a circle An... Those marked of the line passing through the two points, a ( ). R. equation of a circle through Three points Phone explanations and circle.. From there and equation in the new window you need to find the third to obtain result. A step by step explanations and circle graph circle Pick any of marked. From a ﬂxed point how to find the third explanations and circle graph circle with extremities diameter! B ) state the coordinate of two other points that lie on circle! I really need help with this question: (, Im sure you need find. To find the equation of a given input will be displayed in the new.. Circle: is the set of all points in a plane that lie on the circle we can and... And the ﬂxed distance is called the center of the circle with extremities of diameter are given R. equation a. Given An Angle and radius you calculator can find equation of the circle diameter! That and found the radius and the ﬂxed distance from a ﬂxed is. Step 3: Finally, the equation of a straight line passing the. The line passing through the two points, a ( -2,5 ) and B ( -4,3 ) the... The radius was 5 BUT where do i go from there are.... A step by step explanations and circle graph question: (, Im sure you need to find diameter. Of a circle given its center and radius you we are going to how..., Im sure you need to find the diameter so you can equation of a circle given two points equation of a input. Straightforward BUT a bit trickier than you expect center of the line passing through the two points a distance. From 3 points the third see how to find the radius was 5 where! Through the two given points given input will be displayed in the new window called center. D a R. equation of a given input will be displayed in the new window you expect if know.
Mph Admission 2020 In Karachi, Selfserve Netid Syracuse, St Mary's College, Thrissur Vacancies, Princeton University Mailing Address, Volvo Xc60 Olx Kerala, Maggie Mae 2020 Schedule, When Will Stroma Medical Be Available, Kia Rio Fuse Box Radio,


# How to find a standard deviation determined by a Normal distribution probability?

The question is

A liquid drug is marketed in phials containing a nominal 1.5ml but the amounts can vary slightly. The volume in each phial may be modeled by a normal distribution with the mean 1.55ml and standard deviation $$\sigma$$ ml. The phials are sold in packs of 5 randomly chosen phials . It is required that in less than 0.5% of the packs will the total volume of the drug be less than 7.5ml. Find the greatest possible value of $$\sigma$$.

I need to find the greatest possible value of the standard deviation ($$\sigma$$). I worked out the following:

$$\mu= 1.55*5 = 7.75.$$

We are asked to find value of $$\sigma$$ such that probability of (total volume of $$5$$ packs $$\lt 7.5)\lt0.5\%$$

$$P(X\lt7.5)\lt0.005.$$

After standardizing, $$P(X\le\frac{7.5-7.75}{\sigma/5})<0.005$$ and I found $$\sigma=0.2170.$$ However, the answer provided is $$0.0434.$$

• Please add the self-study tag, read its tag-wiki, and indicate the specific help you need at the point you struck difficulty. Jun 9 '16 at 2:37
• what's CTL? ... ... Also please check the details of the question, it looks like you may have a mistake somewhere. Where did the 7.75 in your working come from? Please show more detail/explanation of what you're doing. (As far as possible your responses should result in edits to your question) Jun 9 '16 at 2:38
• How have you approached/engaged it so far? Any partly successful paths? Where else have you looked for answers? Jun 14 '16 at 2:06
• Interestingly, neither answer is correct.
– whuber
Jun 14 '16 at 13:59

Among the objectives of good introductory statistics courses is learning how to think about the Normal distribution. This question provides a nice example.

The key is to use units of measurement that are adapted to the distribution. That is, let the mean be the zero point and let the standard deviation be one unit. This is what a "Z score" measures.

In light of this, let's parse the question. To do so, I will use two fundamental facts: expectations add ("linearity of expectation") and variances of independent variables also add:

• The mean volume of one pack is 1.55 ml, whence the mean volume of five packs must be five times as large, or 7.75 ml: this is the zero point.

• Since the unknown variance of a single pack is $$\sigma^2,$$ the variance of the sum of five independent packs is $$5\sigma^2.$$ Therefore the standard deviation of the sum--the unit of measurement we must adopt--is $$\sqrt{5\sigma^2} = \sigma\sqrt{5}.$$

The question stipulates that in less than 0.5% of cases should the total be less than 7.5 ml. For the (standard) Normal distribution we remember (or can compute) that exactly 0.5% of cases are $$2.57\ldots$$ or more less than the mean. An example of this computation is

qnorm(0.5/100)

in R or

=NORMSINV(0.5/100)

in Excel, for instance.

One aim of the introductory course is to help you reach the point where such considerations are automatic: you can do them in your head correctly, apart (perhaps) from the arithmetical calculations.

This preliminary work enables us to rephrase the question like this:

What unit of measurement, given by $$\sigma\sqrt{5}$$ for a five-pack of drugs, will re-express an amount of $$7.5$$ ml as being $$2.57$$ less than $$7.75$$ ml?

The solution obviously is

$$\sigma\sqrt{5} = (7.75 - 7.5)/2.57\ldots = 0.097\ldots,$$

implying

$$\sigma = \frac{0.097\ldots}{\sqrt{5}} = 0.0433797\ldots$$

Comparing this result to the question shows that the work in the question was entirely correct up to the point where "$$\sigma/5$$" appeared: the square root was lost. This suggests remembering to think in terms of variances rather than standard deviations.

Comparing this result to the older answers that were posted also shows how they were basically moving in the correct direction but made mistakes along the way, too. Because arithmetical mistakes are easy to make, when one has the chance it's a good idea to check probabilistic calculations with simulations. For instance, the following R statement generates a large number of five-packs of drugs as described in the question (using the answer I obtained) and, to check my answer, computes the fraction with totals less than 7.5 ml:

mean(colSums(matrix(rnorm(5*1e6, 1.55, -0.25/qnorm(0.5/100) / sqrt(5)), nrow=5)) < 7.5)

(You can see all the data from the question embedded in this expression, along with the value 1e6 giving the number of five-packs to simulate.) When I run and re-run this code (which takes less than a second each time), I consistently obtain results between 0.0048 (0.48%) and 0.0052 (0.52%), in satisfactory agreement with the intended 0.5% target.

I think your understanding of the variance of the sum is mistaken. The variance of the 5-pack sum is 25 times the variance of the single pack.

• The only way you could justify the factor of $25$ is to suppose the five packs are perfectly correlated. Assuming, as is more likely the intent, that the five-pack sum can be modeled as the total of five independent Normal variables $X_1+\cdots+X_5$, its variance will be $$\operatorname{Var}(X_1+\cdots+X_5)=\sigma^2 +\cdots+\sigma^2=5\sigma^2.$$ Consequently its standard deviation will be $\sigma\sqrt{5}$, which (by following the path outlined in the question) leads directly to the correct answer.
– whuber
Jun 14 '16 at 14:01

\begin{align} 5\times 1.55 &= 7.75 \\ 5\times SD &= 5SD \end{align} Problem statement: $$P(X<7.5)<0.005$$ \begin{align} \frac{(7.5-7.75)}{(5SD^2)^{1/2}} &< 0.005 \\[8pt] \frac{-0.25}{2.576} &= (5SD^2)^{1/2} \\[5pt] &-0.0970 / 5^{(1/2)} \end{align} $$0.0434$$ as the standard deviation can never me negative, take the mod value.

• Welcome to Stats.SE. You may give hints but please do not give the full answer. Furthermore, can you please edit your post and explain the key steps in the solution and use MathJax in the formulas? Apr 26 '19 at 10:51


# Math Help - Problem solving - sucessive tetrahedral numbers

1. ## Problem solving - sucessive tetrahedral numbers

would you guys be able to give me a hand with this problem solving question, i have no idea where to start...

Thanks

Zac

2. Hello, Zac!

12. The first four tetrahedral numbers are: . $1,\;4,\;10,\;20$

Find the pattern, then predict the next 3 terms of the sequence.
Take the difference of consecutive pairs of terms.

$\begin{array}{cccccccc}\text{Sequence:} & 1 && 4 && 10 && 20 \\
\text{Difference:} & & 3 & & 6 & & 10 \end{array}$

They are adding on consecutive "triangular" numbers.

. . $\begin{array}{ccc}3 & = & 1+2 \\ 6 &=&1+2+3\\ 10 &=&1+2+3+4 \end{array}$

We will add on the next three triangular numbers:

. . $\begin{array}{ccc}1+2+3+4+5 &=& 15 \\ 1+2+3+4+5+6 &=& 21 \\ 1+2+3+4+5+6+7 &=& 28\end{array}$

$\begin{array}{cccccccccccccc}\text{Sequence:} & 1 && 4 && 10 && 20 && {\color{blue}35} && {\color{blue}56} && {\color{blue}84}\\
\text{Difference:} & & 3 & & 6 & & 10 && +15 && +21 && +28\end{array}$

What is the $n^{th}$ term of the sequence?
I'll skip all the algebra . . .

$\text{The }n^{th}\text{ term is: }\;a_n \;=\;\frac{n(n+1)(n+2)}{6}$

3. Originally Posted by Soroban

I'll skip all the algebra . . .

$\text{The }n^{th}\text{ term is: }\;a_n \;=\;\frac{n(n+1)(n+2)}{6}$
as this is a problwm solving questions and according to my sheet i must show the algebra would you mind putting it up?

thanks so much!

Zac

4. Hello, Zac!

This will take a while . . . better sit down.

Take differences of consecutive terms,
. . then take differences of the differences, and so on.

$\begin{array}{cccccccccccccc}\text{Sequence} & 1 && 4 && 10 && 20 && 35 && 56 && 84 \\
\text{1st diff.} & & 3 && 6 && 10 && 15 && 21 && 28 \\
\text{2nd diff.} & & & 3 && 4 && 5 && 6 && 7 \\
\text{3rd diff.} & & & & 1 && 1 && 1 && 1 \end{array}$

The third differences are constant.
. . This tells us that the generating fuction is a cubic.

The general cubic function is: . $f(n) \;=\;an^3 + bn^2 + cn + d$

We will use the first four terms of the sequence . . .

$\begin{array}{ccccc}f(1)\:=\:1\!: & a + b + c + d & = & 1 & [1] \\
f(2) \:=\:4\!: & 8a + 4b + 2c + d &=& 4 & [2] \\
f(3) \:=\:10\!: & 27a + 9b + 3c + d &=& 10 & [3] \\
f(4) \:=\:20\!: & 64a + 16b + 4c + d &=& 20 & [4] \end{array}$

$\begin{array}{ccccc}\text{Subtract [2] - [1]:} & 7a + 3b + c &=& 3 & [5] \\
\text{Subtract [3] - [2]:} & 19a + 5b + c &=& 6 & [6] \\
\text{Subtract [4] - [3]:} & 37a + 7b + c &=& 10 & [7] \end{array}$

$\begin{array}{ccccc}\text{Subtract [6] - [5]:} & 12a + 2b &=& 3 & [8] \\
\text{Subtract [7] - [6]:} & 18a + 2b &=& 4 & [9] \end{array}$

$\begin{array}{ccccccc}\text{Subtract [9] - [8]:}& 6a \;=\; 1 & \Rightarrow & \boxed{a \;=\;\frac{1}{6}} \end{array}$

Substitute into [8]: . $12\left(\frac{1}{6}\right) + 2b \:=\:3\quad\Rightarrow\quad\boxed{ b \:=\:\frac{1}{2}}$

Substitute into [5]: . $7\left(\frac{1}{6}\right) + 3\left(\frac{1}{2}\right) + c \:=\:3 \quad\Rightarrow\quad \boxed{c\:=\:\frac{1}{3}}$

Substitute into [1]: . $\frac{1}{6} + \frac{1}{2} + \frac{1}{3} + d \:=\:1 \quad\Rightarrow\quad\boxed{ d\:=\:0}$

Hence, the function is: . $f(n) \;=\;\frac{1}{6}n^3 + \frac{1}{2}n^2 + \frac{1}{3}n \;=\;\frac{n}{6}(n^2+3n+ 2)$

. . Therefore: . $\boxed{f(n) \;=\;\frac{n(n+1)(n+2)}{6}}$


# Value of $\sum\limits_n x^n$

Why is $\displaystyle \sum\limits_{n=0}^{\infty} 0.7^n$ equal $1/(1-0.7) = 10/3$ ?

Can we generalize the above to

$\displaystyle \sum_{n=0}^{\infty} x^n = \frac{1}{1-x}$ ?

Are there some values of $x$ for which the above formula is invalid?

What about if we take only a finite number of terms? Is there a simpler formula?

$\displaystyle \sum_{n=0}^{N} x^n$

Is there a name for such a sequence?

This is being repurposed in an effort to cut down on duplicates, see here: Coping with abstract duplicate questions.

and here: List of abstract duplicates.

-
This is a geometric series. See en.wikipedia.org/wiki/Geometric_series#Formula –  lhf Mar 25 '11 at 15:47
Please replace the starting index $n=1$ by $n=0$ (otherwise the resulting sum is $0.7$ times what you wrote). –  Did Mar 25 '11 at 17:59
@Jonas: Fair point: done. –  Arturo Magidin Mar 25 '11 at 19:18
@Didier: That was my fault upon edit; fixed. –  Arturo Magidin Mar 25 '11 at 19:19
@Arturo: Thanks. Sorry, I shouldn't have deleted my comment; I did so after I saw you had changed the title, and only then saw your comment. (To anyone who is confused: I had pointed out that including "geometric series" in the title gave additional context that made lhf's and yoyo's first sentences seem a little strange.) –  Jonas Meyer Mar 25 '11 at 19:41

By definition, a "series" (an "infinite sum") $$\sum_{n=k}^{\infty} a_n$$ is defined to be a limit, namely $$\sum_{n=k}^{\infty} a_n= \lim_{N\to\infty} \sum_{n=k}^N a_n.$$ That is, the "infinite sum" is the limit of the "partial sums", if this limit exists. If the limit exists, equal to some number $S$, we say the series "converges" to the limit, and we write $$\sum_{n=k}^{\infty} a_n = S.$$ If the limit does not exist, we say the series diverges and is not equal to any number.

So writing that $$\sum_{n=0}^{\infty} 0.7^n = \frac{1}{1-0.7}$$ means that we are asserting that $$\lim_{N\to\infty} \sum_{n=0}^N0.7^n = \frac{1}{1-0.7}.$$

So what your question is really asking is: why is this limit equal to $\frac{1}{1-0.7}$? (Or rather, that is the only way to make sense of the question).

In order to figure out the limit, it is useful (but not strictly necessary) to have a formula for the partial sums, $$s_N = \sum_{n=0}^N 0.7^n.$$ This is where the formulas others have given come in. If you take the $N$th partial sum and multiply by $0.7$, you get $$\begin{array}{rcrcrcrcrcrcl} s_N &= 1 &+& (0.7) &+& (0.7)^2 &+& \cdots &+& (0.7)^N\\ (0.7)s_N &= &&(0.7) &+& (0.7)^2 &+&\cdots &+&(0.7)^N &+& (0.7)^{N+1} \end{array}$$ so that $$(1-0.7)s_N = s_N - (0.7)s_N = 1 - (0.7)^{N+1}.$$ Solving for $s_N$ gives $$s_N = \frac{1 - (0.7)^{N+1}}{1-0.7}.$$ What is the limit as $N\to\infty$? The only part of the expression that depends on $N$ is $(0.7)^{N+1}$. Since $|0.7|\lt 1$, then $\lim\limits_{N\to\infty}(0.7)^{N+1} = 0$. So, $$\lim_{N\to\infty}s_N = \lim_{N\to\infty}\left(\frac{1-(0.7)^{N+1}}{1-0.7}\right) = \frac{\lim\limits_{N\to\infty}1 - \lim\limits_{N\to\infty}(0.7)^{N+1}}{\lim\limits_{N\to\infty}1 - 0.7} = \frac{1 - 0}{1-0.7} = \frac{1}{1-0.7}.$$ Since the limit exists, then we write $$\sum_{n=0}^{\infty}(0.7)^n = \frac{1}{1-0.7}.$$

More generally, a sum of the form $$a + ar + ar^2 + ar^3 + \cdots + ar^k$$ with $a$ and $r$ constant is said to be a "geometric series" with initial term $a$ and common ratio $r$. If $a=0$, then the sum is equal to $0$. If $r=1$, then the sum is equal to $(k+1)a$. If $r\neq 1$, then we can proceed as above. Letting $$S = a +ar + \cdots + ar^k$$ we have that $$S - rS = (a+ar+\cdots+ar^k) - (ar+ar^2+\cdots+a^{k+1}) = a - ar^{k+1}$$ so that $$(1-r)S = a(1 - r^{k+1}).$$ Dividing through by $1-r$ (which is not zero since $r\neq 1$), we get $$S = \frac{a(1-r^{k+1})}{1-r}.$$

A series of the form $$\sum_{n=0}^{\infty}ar^{n}$$ with $a$ and $r$ constants is called an infinite geometric series. If $r=1$, then $$\lim_{N\to\infty}\sum_{n=0}^{N}ar^{n} = \lim_{N\to\infty}\sum_{n=0}^{N}a = \lim_{N\to\infty}(N+1)a = \infty,$$ so the series diverges. If $r\neq 1$, then using the formula above we have: $$\sum_{n=0}^{\infty}ar^n = \lim_{N\to\infty}\sum_{n=0}^{N}ar^{N} = \lim_{N\to\infty}\frac{a(1-r^{N+1})}{1-r}.$$ The limit exists if and only if $\lim\limits_{N\to\infty}r^{N+1}$ exists. Since $$\lim_{N\to\infty}r^{N+1} = \left\{\begin{array}{ll} 0 &\mbox{if |r|\lt 1;}\\ 1 & \mbox{if r=1;}\\ \text{does not exist} &\mbox{if r=-1 or |r|\gt 1} \end{array}\right.$$ it follows that: \begin{align*} \sum_{n=0}^{\infty}ar^{n} &=\left\{\begin{array}{ll} 0 &\mbox{if a=0;}\\ \text{diverges}&\mbox{if a\neq 0 and r=1;}\\ \lim\limits_{N\to\infty}\frac{a(1-r^{N+1})}{1-r} &\mbox{if r\neq 1;}\end{array}\right.\\ &= \left\{\begin{array}{ll} \text{diverges}&\mbox{if a\neq 0 and r=1;}\\ \text{diverges}&\mbox{if a\neq 0, and r=-1 or |r|\gt 1;}\\ \frac{a(1-0)}{1-r}&\mbox{if |r|\lt 1;} \end{array}\right.\\ &=\left\{\begin{array}{ll} \text{diverges}&\mbox{if a\neq 0 and |r|\geq 1;}\\ \frac{a}{1-r}&\mbox{if |r|\lt 1.} \end{array}\right. \end{align*}

Your particular example has $a=1$ and $r=0.7$.

Since this recently came up (09/29/2011), let's provide a formal proof that $$\lim_{N\to\infty}r^{N+1} = \left\{\begin{array}{ll} 0 &\mbox{if |r|\lt 1;}\\ 1 & \mbox{if r=1;}\\ \text{does not exist} &\mbox{if r=-1 or |r|\gt 1} \end{array}\right.$$

If $r\gt 1$, then write $r=1+k$, with $k\gt0$. By the binomial theorem, $r^n = (1+k)^n \gt 1+nk$, so it suffices to show that for every real number $M$ there exists $n\in\mathbb{N}$ such that $nk\gt M$. This is equivalent to asking for a natural number $n$ such that $n\gt \frac{M}{k}$, and this holds by the Archimedean property; hence if $r\gt 1$, then $\lim\limits_{n\to\infty}r^n$ does not exist. From this it follows that if $r\lt -1$ then the limit also does not exist: given any $M$, there exists $n$ such that $r^{2n}\gt M$ and $r^{2n+1}\lt M$, so $\lim\limits_{n\to\infty}r^n$ does not exist if $r\lt -1$.

If $r=-1$, then for every real number $L$ either $|L-1|\gt \frac{1}{2}$ or $|L+1|\gt \frac{1}{2}$. Thus, for every $L$ and for every $M$ there exists $n\gt M$ such that $|L-r^n|\gt \frac{1}{2}$ proving the limit cannot equal $L$; thus, the limit does not exist. If $r=1$, then $r^n=1$ for all $n$, so for every $\epsilon\gt 0$ we can take $N=1$, and for all $n\geq N$ we have $|r^n-1|\lt\epsilon$, hence $\lim\limits_{N\to\infty}1^n = 1$. Similarly, if $r=0$, then $\lim\limits_{n\to\infty}r^n = 0$ by taking $N=1$ for any $\epsilon\gt 0$.

Next, assume that $0\lt r\lt 1$. Then the sequence $\{r^n\}_{n=1}^{\infty}$ is strictly decreasing and bounded below by $0$: we have $0\lt r \lt 1$, so multiplying by $r\gt 0$ we get $0\lt r^2 \lt r$. Assuming $0\lt r^{k+1}\lt r^k$, multiplying through by $r$ we get $0\lt r^{k+2}\lt r^{k+1}$, so by induction we have that $0\lt r^{n+1}\lt r^n$ for every $n$.

Since the sequence is bounded below, let $\rho\geq 0$ be the infimum of $\{r^n\}_{n=1}^{\infty}$. Then $\lim\limits_{n\to\infty}r^n =\rho$: indeed, let $\epsilon\gt 0$. By the definition of infimum, there exists $N$ such that $\rho\leq r^N\lt \rho+\epsilon$; hence for all $n\geq N$, $$|\rho-r^n| = r^n-\rho \leq r^N-\rho \lt\epsilon.$$ Hence $\lim\limits_{n\to\infty}r^n = \rho$.

In particular, $\lim\limits_{n\to\infty}r^{2n} = \rho$, since $\{r^{2n}\}_{n=1}^{\infty}$ is a subsequence of the converging sequence $\{r^n\}_{n=1}^{\infty}$. On the other hand, I claim that $\lim\limits_{n\to\infty}r^{2n} = \rho^2$: indeed, let $\epsilon\gt 0$. Then there exists $N$ such that for all $n\geq N$, $r^n - \rho\lt\epsilon$. Moreover, we can assume that $\epsilon$ is small enough so that $\rho+\epsilon\lt 1$. Then $$|r^{2n}-\rho^2| = |r^n-\rho||r^n+\rho| = (r^n-\rho)(r^n+\rho)\lt (r^n-\rho)(\rho+\epsilon) \lt r^n-\rho\lt\epsilon.$$ Thus, $\lim\limits_{n\to\infty}r^{2n} = \rho^2$. Since a sequence can have only one limit, and the sequence of $r^{2n}$ converges to both $\rho$ and $\rho^2$, then $\rho=\rho^2$. Hence $\rho=0$ or $\rho=1$. But $\rho=\mathrm{inf}\{r^n\mid n\in\mathbb{N}\} \leq r \lt 1$. Hence $\rho=0$.

Thus, if $0\lt r\lt 1$, then $\lim\limits_{n\to\infty}r^n = 0$.

Finally, if $-1\lt r\lt 0$, then $0\lt |r|\lt 1$. Let $\epsilon\gt 0$. Then there exists $N$ such that for all $n\geq N$ we have $|r^n| = ||r|^n|\lt\epsilon$, since $\lim\limits_{n\to\infty}|r|^n = 0$. Thus, for all $\epsilon\gt 0$ there exists $N$ such that for all $n\geq N$, $| r^n-0|\lt\epsilon$. This proves that $\lim\limits_{n\to\infty}r^n = 0$, as desired.

In summary, $$\lim_{N\to\infty}r^{N+1} = \left\{\begin{array}{ll} 0 &\mbox{if |r|\lt 1;}\\ 1 & \mbox{if r=1;}\\ \text{does not exist} &\mbox{if r=-1 or |r|\gt 1} \end{array}\right.$$

The argument suggested by Srivatsan Narayanan in the comments to deal with the case $0\lt|r|\lt 1$ is less clumsy than mine above: there exists $a\gt 0$ such that $|r|=\frac{1}{1+a}$. Then we can use the binomial theorem as above to get that $$|r^n| = |r|^n = \frac{1}{(1+a)^n} \leq \frac{1}{1+na} \lt \frac{1}{na}.$$ By the Archimedean Property, for every $\epsilon\gt 0$ there exists $N\in\mathbb{N}$ such that $Na\gt \frac{1}{\epsilon}$, and hence for all $n\geq N$, $\frac{1}{na}\leq \frac{1}{Na} \lt\epsilon$. This proves that $\lim\limits_{n\to\infty}|r|^n = 0$ when $0\lt|r|\lt 1$, without having to invoke the infimum property explicitly.

-
I think you mean "which is not zero since $r\neq 1$." –  robjb Mar 26 '11 at 23:20
@Rob: Yes; thank you. –  Arturo Magidin Mar 27 '11 at 0:22
+1 As its rare to see math researchers caring for even elementary questions. –  Please Delete Account Mar 27 '11 at 2:18
Ignore my edit, I seem to have potatoes on my eyes. Sorry. –  Lagerbaer Mar 31 '11 at 5:05
Arturo, I will mention one more way of proving that $r^n$ converges to $0$ as $n \to \infty$ if $|r| < 1$ that looks somewhat similar to your proof in the divergent case. Take $|r| = \frac{1}{1+a}$ for some $a > 0$. Then $$|r^n - 0| = |r|^n = \frac{1}{(1+a)^n} \leq \frac{1}{1+an} \leq \frac{1}{an} ,$$ which can be made sufficiently small by taking $n$ large enough. –  Srivatsan Sep 30 '11 at 4:13

it's called a geometric series. let $-1<x<1$ and let $S_n=1+x+x^2+...+x^n$. then $xS_n=x+...+x^{n+1}=S^n-1+x^{n+1}$. move stuff around to get $$S_n=\frac{1-x^{n+1}}{1-x}$$ take the limit as $n\to\infty$ (noting that $x^n\to0$ if $|x|<1$)

-
In yoyo's answer, you should also take into account that $x^{n+1}\to 0$ as $n\to\infty$ if $|x| < 1$. –  knightofmathematics Mar 25 '11 at 16:48
...and $0^0=1$ (: –  yoyo Mar 25 '11 at 19:03

If u expand your summation you get series $$1+0.7+0.7^2+\dots$$ as it is geometric series (you can see it here http://en.wikipedia.org/wiki/Geometric_series) $$\sum_{n=0}^{\infty}{0.7^n}=\frac{1}{1-0.7}$$

Or $S=1+x+x^2+\dots$

$xS_n=x+x^2+\dots=S-1$ now u take

$S-xS=1$

$S(1-x)=1 \implies S=\frac{1}{1-x}$

here your $x=0.7$

-
The index in the sum should be $n$, not $i$. –  Arturo Magidin Mar 25 '11 at 17:10
oops..i'll edit it –  amul28 Mar 26 '11 at 3:54

I find the proof here lovely.

-
The link here no longer seems to work. –  Baby Dragon Oct 6 '13 at 1:19
@BabyDragon Here is the updated link. –  David Mitra Oct 6 '13 at 9:12

## protected by AryabhataMar 31 '11 at 17:18

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.


# A combinatorial identity

I hope this is a suitable MO question. In a research project, my collaborator and I came across some combinatorial expressions. I used my computer to test a few numbers and the pattern was suggesting the following equation for fixed integers $K\geq n>0$.

$$\dfrac{K!}{n!K^{K-n}}\sum\limits_{ \begin{subarray}{c} k_1+\dotsb+k_{n}=K \\ k_i \geq 1 \end{subarray}} \prod\limits_{i=1}^n \dfrac{k_i^{k_i-2}}{(k_i-1)!}=\displaystyle {K-1\choose n-1}.$$

We tried to think of a proof but failed. One can probably move these $K!, n!$ to the right and rewrite the RHS, or maybe move $K!$ into the summation to form combinatorial numbers like $K\choose k_1,k_2,\dotsc,k_n$. We don't know which is better.

The questions are:

1. Anyone knows a proof for this identity?
2. In fact the expression that appears in our work is $\sum\limits_{ \begin{subarray}{c} k_1+\dotsb+k_{n}=K \\ k_i \geq 1 \end{subarray}} \sigma_p(k_1,\dotsc,k_n) \prod\limits_{i=1}^n \dfrac{k_i^{k_i-2}}{(k_i-1)!}$, where $p$ is a fixed integer and $\sigma_p(\dotsc)$ is the $p$-th elementary symmetric polynomial. The equation in the beginning simplifies this expression for $p=0,1$. Is there a similar identity for general $p$?

----------Update----------

Question 2 is perhaps too vague, and I'd like to make it a bit more specific. Probably I should have written this down in the beginning, but I feared this is too long and unmotivated. But after seeing people's skills, I'm very tempted to leave it here in case somebody has remarks. In fact, question 2 partly comes from the effort to find a proof for the following (verified by computer).

$$\frac{1}{K!} \prod_{r=1}^{K} (r+1 -x)= \sum_{n=1}^K \frac{(-1)^n}{n!} \left[ \sum_{p=0}^n K^{n-p} \prod_{r=1}^p (x +r-4) \left( \sum\limits_{ \begin{subarray}{c} k_1+\dotsb+k_{n}=K \\ k_i \geq 1 \end{subarray}} \sigma_p(k_1,\dotsc,k_{n}) \prod\limits_{i=1}^n \dfrac{k_i^{k_i-2}}{(k_i-1)!} \right) \right],$$ Where $x$ is a fixed number (in our case, an integer).

• Combinatorial reformulation: consider all the trees $T$ on $\{0,1,\dots,K\}$ for which the vertices $1,2,\dots,p$ are in different components of $T\setminus \{0\}$. For each such a tree take a summand $(-K)^{\deg(0)-p}$. The sum equals $(K-2)!/(p-2)!$ for $p\geqslant 2$ and 0 for $p=0,1$. – Fedor Petrov Aug 15 '17 at 9:35

This is the answer to the first question, I wrote a long answer to Question 2 as a separate answer.

Note that $A:=\sum_{k_i>0,k_1+\dots+k_n=K}\frac{K!}{n!k_1!\dots k_n!} \prod k_i^{k_i-1}$ is a number of forests on the ground set $\{1,2,\dots,K\}$ having exactly $n$ connected components and with a marked vertex in each component ($k_i$ correspond to the sizes of components.) Add a vertex 0 and join it with the marked vertices. Then we have to count the number of trees on $\{0,1,\dots,K\}$ in which $0$ has degree $n$. Remember that the sum of $z_0^{d_1-1}\dots z_K^{d_K-1}$ over all trees on $\{0,\dots,K\}$, where $d_i$ is degree of $i$, equals $(z_0+\dots+z_K)^{K-1}$. Substitute $z_{1}=\dots=z_K=1$ and take a coefficient of $z_0^{n-1}$. It is $\binom{K-1}{n-1}K^{K-n}$.

• Thank you! This is a really cool argument, especially for me who doesn't have a lot of experiences in graph theory. I will mark this as the correct answer, but of course any further ideas and comments about question 2 are welcomed as well. – Honglu Aug 13 '17 at 18:41
• You need to talk to someone who's familiar with Volume 2 of Stanley. (This is more algebraic combinatorics than graph theory.) – Alexander Woo Aug 13 '17 at 23:10
• Sorry about my ignorance and thank you for pointing out the right words! I am thinking about asking around, and your comment definitely helps. – Honglu Aug 13 '17 at 23:58

Here's another proof. We first rewrite the identity (by setting $k_i=j_i+1$) as $$\sum_{j_1+\cdots +j_n=K-n}\prod_{i=1}^n \frac{(j_i+1)^{j_i-1}}{j_i!} = n\frac{K^{K-n-1}}{(K-n)!}. \tag{1}$$

Let $F(x)$ be the formal power series satisfying $F(x)= e^{xF(x)}$. It is well known (and easily proved, e.g., by Lagrange inversion) that $$F(x)^n = \sum_{j=0}^\infty n(j+n)^{j-1}\frac{x^j}{j!}.\tag{2}$$ In particular, $$F(x) = \sum_{j=0}^\infty (j+1)^{j-1}\frac{x^j}{j!}.$$ So the left side of $(1)$ is equal to the coefficient of $x^{K-n}$ in $F(x)^{n}$, which by $(2)$ is equal to the right side of $(1)$.

• Cool! I actually updated my question to include a more general identity that I want to prove. I kept thinking there is some generating function lurking behind, and I'm just looking at the coefficients. Any thoughts will be greatly appreciated. – Honglu Aug 14 '17 at 16:04

Here is a generating-function proof of your conjectured identity (and an answer to question 2).

The main ingredient is a formula for the appearing symmetric sums.

Let $T(z)$ (the tree function'') be the formal power series satisfying $T(z)=z\,e^{T(z)}$.

If $F$ is a formal power series the coefficients of $G(z):=F(T(z))$ are given by (Lagrange inversion) $$[z^0]G(z)=[z^0] F(z) \mbox{ , } [z^k]G(z)=\tfrac{1}{k} [y^{k-1}] F^\prime(y)\,e^{ky} =[y^k](1-y)F(y)\,e^{ky}\mbox{ for } k\geq 1\;.$$ In particular (as is well known) $$T(z)=\sum_{n\geq 1}\frac{n^{n-1}}{n!}z^n \;\mbox{ and }\; \frac{T(z)}{1-T(z)}=\sum_{n\geq 1}\frac{n^{n}}{n!}z^n$$ Thus $T(z)\left(1+\frac{t}{1-T(z)}\right)=\sum_{n\geq 1} \frac{(1+tn)n^{n-1}}{n!}$. Therefore \begin{align*}S_{p,n}(K):&=\sum_{{k_1+\ldots +k_n=K \atop k_i\geq 1}} \sigma_p(k_1,\ldots,k_n)\prod_{i=1}^n \frac{k_i^{k_i-1}}{k_i!}\\ &=[t^p]\sum_{k_1+\ldots +k_n=K \atop k_i\geq 1} \prod_{i=1}^n \frac{(1+tk_i) k_i^{k_i-1}}{k_i!}\\ &=[t^p z^K]\, T(z)^n \left(1+\frac{t}{1-T(z)}\right)^n \end{align*} and $$S_{p,n}(K)={n \choose p} [z^K]\frac {T(z)^n}{(1-T(z))^p}={n \choose p}[y^K]\,y^n\, \frac{(1-y)}{(1-y)^p}\,e^{Ky}\;\;\;\;\;(*)$$

Now consider the sum ($m:=x-4$) $$R(K,m):=\sum_{n=0}^K\frac{(-1)^n}{n!}\bigg[\sum_{p=0}^n K^{n-p}\,\left(\prod_{r=1}^p (m+r)\right) S_{n,p}(K)\bigg]$$ Since $K\geq 1$ the sum remains unchanged if we start the summation at $n=0$ (all $S_{0,p}(K)$ are $0$). Using that and $(*)$ gives \begin{align*} R(K,m):&=\sum_{n=0}^K\frac{(-1)^n}{n!}\bigg[\sum_{p=0}^n K^{n-p}\,\left(\prod_{r=1}^p (m+r)\right) S_{n,p}(K)\bigg]\\ &=[y^K]\,(1-y) \sum_{n=0}^K\frac{(-1)^n}{n!}\sum_{p=0}^n K^{n-p}\,p!{m+p \choose p}{n \choose p}\frac{y^n}{(1-y)^p}\,e^{Ky}\\ &=[y^K]\,(1-y) \sum_{p=0}^K\sum_{n=p}^K\frac{(-1)^n}{(n-p)!} K^{n-p}{m+p \choose p}\frac{y^n}{(1-y)^p}\,e^{Ky}\\ &=[y^K]\,(1-y) \sum_{p=0}^K {m+p \choose p}\frac{(-1)^p y^p}{(1-y)^p}\bigg[\sum_{n=p}^K\frac{(-1)^{n-p}}{(n-p)!} K^{n-p}y^{n-p}\,e^{Ky}\bigg]\\ &=[y^K]\,(1-y) \sum_{p=0}^K {m+p \choose p}\frac{(-1)^p y^p}{(1-y)^p}\bigg[1 +\mathcal{O}(y^{K-p+1})\bigg]\\ \end{align*} where $\mathcal{O}(y^{K-p+1})$ denotes a formal power series which is a multiple of $y^{K-p+1}$.
Taking into account the respective factors $y^p$ the terms in these series do not contribute to the coefficient $[y^K]$. Therefore

\begin{align*} R(K,m)&=[y^K]\,(1-y) \sum_{p=0}^K {m+p \choose p}\frac{(-1)^p y^p}{(1-y)^p}\\ &=[y^K]\,(1-y) \sum_{p\geq 0} {m+p \choose p}\frac{(-1)^p y^p}{(1-y)^p}\\ &=[y^K]\,(1-y) \left(\frac{1}{1+\tfrac{y}{1-y}}\right)^{m+1}\\ &=[y^K]\,(1-y)^{m+2}\\ &=(-1)^K\,{m+2 \choose K},\,\mbox{ as desired }. \end{align*}

• Nice! I really learned a lot from all the answers and appreciate everybody's effort. In particular, this generating function method seems to have some other applications in our project. I got another quick question. Let $H_n=\sum\limits_{k=1}^n 1/k$. Do you know whether we can similarly describe the formal series $\sum_{n\geq 1} \dfrac{H_nn^n}{n!}z^n$ using functional equations just like your $T(z)$ and others? – Honglu Aug 15 '17 at 22:33
• Thank you. (1) The formal series $\sum_{n\geq 1}\frac{n^n}{n!}p(n) z^n$ can be expressed as a rational function of $T(z)$ if $p$ is a polynomial in $n$ and $\tfrac{1}{n}$. My first guess is that it will not be easy to treat the case $p(n)=H_n$ via Lagrange inversion. (2) $T(z)$ is certainly not "my" function. $T(z)=-W(-z)$ where $W$ is "Lambert's W-function", and $T(z)=z e^{T(z)}$ goes back to Eisenstein. – esg Aug 16 '17 at 17:57
• Would you mind telling me your real name by email? Because if we decide to post anything about this work in the future, we will acknowledge you (also Fedor and other people). I just temporarily added my email in my MO profile. We are still working on an ultimate combinatorial expression that includes all my questions as special cases. It's too long to post in a comment, but if you are interested, I will be glad to send it to you by email as well. Of course interests from other people will also be welcomed, just let me know in the comment or send me an email. – Honglu Aug 24 '17 at 16:09

Here is the answer to Question 2. It may be probably simplified.

Denote $y=3-x$, then we rewrite your identity as $$\binom{y+K-2}K=\frac{(y-1)y(y+1)\dots (y+K-2)}{K!}=c_0\binom{y}0+c_1\binom{y}1+\dots+c_K\binom{y}K,$$ where $$c_p=p!\sum_{n=p}^K(-K)^{n-p}\frac1{n!}\sum\limits_{ \begin{subarray}{c} k_1+\dotsb+k_{n}=K \\ k_i \geq 1 \end{subarray}} \sigma_p(k_1,\dotsc,k_{n}) \prod\limits_{i=1}^n \dfrac{k_i^{k_i-2}}{(k_i-1)!}.$$ On the other hand, by Vandermonde--Chu identity we have $$\binom{y+K-2}K=\sum_{i=2}^{K}\binom{y}i\binom{K-2}{K-i},$$ so your identity is equivalent to the formula $$\sum_{n=p}^K(-K)^{n-p}\frac{K!}{n!}\sum\limits_{ \begin{subarray}{c} k_1+\dotsb+k_{n}=K \\ k_i \geq 1 \end{subarray}} \sigma_p(k_1,\dotsc,k_{n}) \prod\limits_{i=1}^n \dfrac{k_i^{k_i-2}}{(k_i-1)!}=\frac{K!}{p!}\binom{K-2}{K-p},$$ I multiplied both parts by $K!/p!$. Note that $$\frac{K!}{n!}\sum\limits_{ \begin{subarray}{c} k_1+\dotsb+k_{n}=K \\ k_i \geq 1 \end{subarray}} \sigma_p(k_1,\dotsc,k_{n}) \prod\limits_{i=1}^n \dfrac{k_i^{k_i-2}}{(k_i-1)!}$$ is a number of the trees $T$ on $\{0,1,\dots,K\}$ such that degree of 0 equals $n$ and $p$ vertices in different components of $T\setminus\{0\}$ are marked. Indeed, if these components $A_1,\dots,A_n$ are enumerated (this corresponds to the multiple $n!$) and $i$-th component $A_i$ has $k_i$ vertices, then we have $\frac{K!}{k_1!\dots k_n!}$ ways to choose $A_i$, $\sigma_p(k_1,\dotsc,k_{n})$ ways to mark $p$ vertices in different components, $k_i^{k_i-1}$ ways to make a tree on $A_i$ and choose a vertex in $A_i$ joined with 0.

Note that each (out of $\binom{K}p$ sets) set of $p$ marked vertices makes the same contribution to the sum. So, we may suppose that the marked set is $\{1,2,\dots,p\}$ and we have to prove that the sum of $(-K)^{n-p}$ over admissible trees (where the tree $T$ is admissible if $1,2,\dots,p$ are in different components of $T\setminus \{0\}$) equals $\frac1{\binom{K}p}\frac{K!}{p!}\binom{K-2}{K-p}=(p-1)p\dots (K-2)$.

We start to prove this from the case $p=0$, $p=1$, where the restriction that $1,2,\dots,p$ are in different components of $T\setminus \{0\}$ disappears. Then the sum $z_0^{n-1}z_1^{d_1-1}\dots z_K^{d_K-1}$, $d_i=\deg(i)$, over all trees on $\{0,\dots,K\}$ equals, as is well known and easy to prove, to $(z_0+\dots+z_K)^{K-1}$. Substituting $z_0=-K$, $z_1=\dots=z_K=1$ we get the result.

Now we deal with the more involved case $p\geqslant 2$. Denote $K=p+m$ and consider the variables $z_0,z_1,\dots,z_p,z_{p+1},\dots$ (infinitely many for simplicity of notations). Denote $s=z_0+z_1+\dots$, write $\sigma_i$ for the $i$-th elementary symmetric polynomial of $z_{p+1},z_{p+2},\dots$. Denote $\varphi_0=1$, $\varphi_m=s\varphi_{m-1}+(p-1)p\dots (p+m-2)\sigma_m$ for $m\geqslant 1$. I claim that the sum of $z_0^{n-p}z_1^{d_1-1}\dots z_{p+m}^{d_{p+m}-1}$ over all admissible trees equals $\varphi_m(z_0,z_1,\dots,z_{p+m},0,0,\dots)$.

Note that this implies our claim, as follows from the substitution $z_0=-K=-p-m,z_1=\dots=z_{p+m}=1$.

The proof is on induction in $m$. Base $m=0$ is clear. For the induction step, look at coefficients of any specific monomial $z_0^{n-p}z_1^{d_1-1}\dots z_{p+m}^{d_{p+m}-1}$. Consider two cases:

1) $d_i=1$ for a certain index $i\in \{p+1,\dots,p+m\}$, without loss of generality $i=p+m$. This corresponds to the case when $p+m$ has degree 1, such a vertex may be joined with any of other vertices, and removing corresponding edge we get a tree (it remains admissible) on $\{0,1,\dots,K-1\}$. This corresponds to the summand $s\varphi_{m-1}$: namely, $z_j\varphi_{m-1}$ corresponds to the edge between $p+m$ and $j$; $j=0,1,\dots,p+m-1$.

2) $d_{p+1},\dots,d_{p+m}$ are greater than 1. Then they are all equal to 2, since the degree of the whole monomial equals $m$. In this case there are $p(p+1)\dots (p+m-1)$ admissible trees (well, they are all admissible for such a choice of degrees and we may either apply the above formula for all trees, or prove it by induction, or as you wish). It remains to prove that the coefficient of $z_{p+1}\dots z_{p+m}$ in the function $\varphi_m$ equals $p(p+1)\dots (p+m-1)$. Since $\varphi_m=s\varphi_{m-1}+(p-1)p\dots (p+m-2)\sigma_m$, it is equivalent to proving that the coefficient of $z_{p+1}\dots z_{p+m}$ in $s\varphi_{m-1}$ equals $p(p+1)\dots (p+m-1)-(p-1)p\dots (p+m-2)=mp(p+1)\dots(p+m-2)$. We should take some $z_j$, $p+1\leqslant j\leqslant p+m$, from the multiple $s=\sum z_i$, and for each choice of $j$ we have a coefficient of $z_j^{-1}\cdot z_{p+1}\dots z_{p+m}$ in $\varphi_{m-1}$ equal to $p(p+1)\dots(p+m-2)$ - by induction (base $m-1=0$ is clear).

• Not sure whether you get notifications from comments in other answers or not. To be sure I just repeat some messages here. I really appreciate all your answers here. Ultimately we want to simplify a bigger expression that includes the RHS of my question 2 as a special case. It's pretty long and currently still over my head. I don't know if you have the time and the interest to take a look. But in case you do, you are welcomed to send me an email (in my profile). – Honglu Aug 24 '17 at 19:55


# power, .^

Element-wise power

## Description

example

C = A.^B raises each element of A to the corresponding powers in B. The sizes of A and B must be the same or be compatible.

If the sizes of A and B are compatible, then the two arrays implicitly expand to match each other. For example, if one of A or B is a scalar, then the scalar is combined with each element of the other array. Also, vectors with different orientations (one row vector and one column vector) implicitly expand to form a matrix.

C = power(A,B) is an alternate way to execute A.^B, but is rarely used. It enables operator overloading for classes.

## Examples

collapse all

Create a vector, A, and square each element.

A = 1:5;
C = A.^2
C = 1×5

1     4     9    16    25

Create a matrix, A, and take the inverse of each element.

A = [1 2 3; 4 5 6; 7 8 9];
C = A.^-1
C = 3×3

1.0000    0.5000    0.3333
0.2500    0.2000    0.1667
0.1429    0.1250    0.1111

An inversion of the elements is not equal to the inverse of the matrix, which is instead written A^-1 or inv(A).

Create a 1-by-2 row vector and a 3-by-1 column vector and raise the row vector to the power of the column vector.

a = [2 3];
b = (1:3)';
a.^b
ans = 3×2

2     3
4     9
8    27

The result is a 3-by-2 matrix, where each (i,j) element in the matrix is equal to a(j) .^ b(i):

$\mathit{a}=\left[{\mathit{a}}_{1}\text{\hspace{0.17em}}{\mathit{a}}_{2}\right],\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\mathit{b}=\left[\begin{array}{c}{\mathit{b}}_{1}\\ {\mathit{b}}_{2}\\ {\mathit{b}}_{3}\end{array}\right],\text{\hspace{0.17em}\hspace{0.17em}\hspace{0.17em}\hspace{0.17em}\hspace{0.17em}\hspace{0.17em}\hspace{0.17em}\hspace{0.17em}\hspace{0.17em}\hspace{0.17em}}\text{\hspace{0.17em}}\mathit{a}\text{\hspace{0.17em}}.ˆ\text{\hspace{0.17em}}\mathit{b}=\left[\begin{array}{cc}{{\mathit{a}}_{1}}^{{\mathit{b}}_{1}}& {{\mathit{a}}_{2}}^{{\mathit{b}}_{1}}\\ {{\mathit{a}}_{1}}^{{\mathit{b}}_{2}}& {{\mathit{a}}_{2}}^{{\mathit{b}}_{2}}\\ {{\mathit{a}}_{1}}^{{\mathit{b}}_{3}}& {{\mathit{a}}_{2}}^{{\mathit{b}}_{3}}\end{array}\right].$

Calculate the roots of -1 to the 1/3 power.

A = -1;
B = 1/3;
C = A.^B
C = 0.5000 + 0.8660i

For negative base A and noninteger B, the power function returns complex results.

Use the nthroot function to obtain the real roots.

C = nthroot(A,3)
C = -1

## Input Arguments

collapse all

Operands, specified as scalars, vectors, matrices, or multidimensional arrays. A and B must either be the same size or have sizes that are compatible (for example, A is an M-by-N matrix and B is a scalar or 1-by-N row vector). For more information, see Compatible Array Sizes for Basic Operations.

• Operands with an integer data type cannot be complex.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical | char
Complex Number Support: Yes

collapse all

### IEEE Compliance

For real inputs, power has a few behaviors that differ from those recommended in the IEEE®-754 Standard.

MATLAB® IEEE

power(1,NaN)

NaN

1

power(NaN,0)

NaN

1

## Compatibility Considerations

expand all

Behavior changed in R2016b

## Extended Capabilities

### Topics

Introduced before R2006a