# Thread: Summing a geometric series

1. ## Summing a geometric series

Hi all. I have been asked to sum this series:

1+4x+7x^2+10x^3+...+(3N-2)x^N

and also asked what the sum is to infinity when |x|< 1

I have all of the formulae (dodgy spelling ) for summing a series and sum to infinity but this one has me stumped; mainly because at the back of the text book the given anser is:

[3/(1-x)^2]-[2/(1-x)]

I just don't know how to get this answer. It's caused a bit of a mental block for me and his becoming quite annoying! Any help on working through to get this answer would be really helpful and much appreciated. Thanks in advance!

2. Originally Posted by morrey
Hi all. I have been asked to sum this series:

1+4x+7x^2+10x^3+...+(3N-2)x^{N-1}

and also asked what the sum is to infinity when |x|< 1

I have all of the formulae (dodgy spelling ) for summing a series and sum to infinity but this one has me stumped; mainly because at the back of the text book the given anser is:

[3/(1-x)^2]-[2/(1-x)]

I just don't know how to get this answer. It's caused a bit of a mental block for me and his becoming quite annoying! Any help on working through to get this answer would be really helpful and much appreciated. Thanks in advance!
You have a typo (corrected in red).

You have $\sum_{i=1}^{N} (3i - 2) x^{i-1} = 3 \sum_{i=1}^{N} i x^{i-1} - 2 \sum_{i=1}^{N} x^{i-1}$.

You know $\sum_{i=1}^{N} x^i$ and $\sum_{i=1}^{N} x^{i-1}$.

Differentiate $\sum_{i=1}^{N} x^i$ to get what $\sum_{i=1}^{N} i x^{i-1}$ is.

3. fantastic, thanks very much. Just what I needed, and as always looking back I wonder how i got stuck! thanks again

4. Hello, morrey!

I don't agree with their answer for the sum of the infinite series.

Find the sum: . $1+4x+7x^2+10x^3+\hdots$

$\begin{array}{ccccc}\text{We have:} & S &=& 1 + 4x + 7x^2 + 10x^3 + 13x^4 + \hdots & {\color{blue}[1]}\\
\text{Multiply by }x: & xS &=& \qquad\; x \;+ 4x^2 + \;7x^3 + 10x^4 + \hdots & {\color{blue}[2]}\end{array}$

Subtract [1] - [2]: . $S - xS \;=\;1 + 3x + 3x^2 + 3x^3 + \hdots$

$\text{We have: }(1-x)S \;=\;1 + 3x\underbrace{\left(1 + x + x^2 + x^3 + \hdots\right)}_{\text{geometric series}}$

. . The geometric series has the sum: . $\frac{1}{1-x}$

Hence: . $(1-x)S \:=\:1 + 3x\left(\frac{1}{1-x}\right) \;=\; \frac{1+2x}{1-x}$

. . Therefore: . $\boxed{S \;=\;\frac{1+2x}{(1-x)^2}}$

5. Originally Posted by Soroban

$\text{We have: }(1-x)S \;=\;1 + 3x\underbrace{\left(1 + x + x^2 + x^3 + \hdots\right)}_{\text{geometric series}}$

. .
Where you have factorised and brought out (1+3x), can you do that? Because if you multiplied out those brackets you wouldn't get what you factorised in the first place... I can see your working through though. Just that one point that has confused me a little.

EDIT: also @mr.fantastic i'm not sure it was a typo, that is exactly as written in the text book, unless of course it's typed incorrectly in there! Also, where you have seperated the two sums. Is it possible to take the right summation and change it into the form where you start at i=0 up to i and then x^i-1 becomes just x^i. Because then from there I know what that sum is but can you then subtract the two different answers although they are 'summed' in a slightly different form? THanks for your help so far

EDIT 2: @soropan sorry about that just realised how you have written it. Makes sense now and I agree with what you have given me. Thankyou very much for your quick and friendly response! One point to make actually, could you not just work out the sum for 1+3x+3x^2.... instead of factorising?

6. Originally Posted by morrey
[snip]
EDIT: also @mr.fantastic i'm not sure it was a typo, that is exactly as written in the text book, unless of course it's typed incorrectly in there! Also, where you have seperated the two sums. Is it possible to take the right summation and change it into the form where you start at i=0 up to i and then x^i-1 becomes just x^i. Because then from there I know what that sum is but can you then subtract the two different answers although they are 'summed' in a slightly different form? THanks for your help so far

[snip]
If you substitute values of N into $(3N-2)x^N$ you will see why I think there's a typo ....

$\sum_{i=1}^{N} x^{i-1} = \sum_{i=0}^{N-1} x^{i}$.

7. Yes, you are correct. It seems that all this amount of confusion on my part partially comes down to a damn silly text book with an incorrect answer and question! Oh well, thanks to you both for your help and explanations!


# SliceContourPlot3D not showing contours for small object

Suppose I am using SliceContourPlot3D to plot the contours of $x^2$ a sphere of radius $R$:

Module[{R, sphere},

R = 1;
sphere = x^2 + y^2 + z^2 == R^2;

SliceContourPlot3D[x^2, sphere, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}]

]

If $R=1$ this looks like:

If I set $R=0.1$ however the contour lines disappear:

I can't find a way to get the contours to appear. Rescaling the function $x^2\rightarrow\frac{x^2}{R^2}$ doesn't do anything, neither does increasing the PerformanceGoal, number of Contours, or PlotPoints. How can I make the contours show up even for a small object?

• Moreover, even the sphere becomes invisible if you will set R=0.001. The step of contours by default is big enough for your case. Try to add the Contours->{0.001} – Rom38 Jun 4 '18 at 6:34
• add the options Contours->Range[-.01,.01,.0005], PlotPoints->100, and PlotRange->All? – kglr Jun 4 '18 at 6:37
• Thanks a lot Rom38 and kglr, manually setting the step size of the contours fixed it. – Ruvi Lecamwasam Jun 4 '18 at 6:48
• @chris, posted an answer. – kglr Jun 4 '18 at 8:26

## 1 Answer

Adding the options PlotRange->All, PlotPoints->100, and Contours-> Range[-.1,.1,.01]^2 gives


# Session 8: ODE stability; stiff system¶

Date: 11/06/2017, Monday

In [1]:

format compact

## ODE Stability¶

### Problem statement¶

Consider a simple ODE

$\frac{dy}{dt} = -a y, \ \ y(0)=y_0$

where $$a$$ is a positive real number.

It can be solved analytically:

$y(t) = y_0e^{-at}$

So the analytical solution decays exponentially. A numerical solution is allowed to have some error, but it should also be decaying. If the solution is instead growing, we say it is unstable.

### Explicit scheme¶

Forward Eulerian scheme for this problem is

$\frac{y_{k+1} - y_k}{h} = -ay_k$

The iteration is given by

$y_{k+1}= (1-ha)y_k$

The solution at the k-th time step can be written out explicitly

$y_k= (1-ha)^ky_0$

We all know that when $$h$$ gets smaller the numerical solution will converge to the true result. But here we are interested in relatively large $$h$$, i.e. we wonder what’s the largest possible $$h$$ we can use while still getting an OK result.

Here are the solutions with different $$h$$.

In [2]:

%plot -s 400,300

% set parameters, can use different value
a = 1;
y0 = 1;
tspan = 10;

% build function
f_true = @(t) y0*exp(-a*t); % true answer
f_forward = @(k,h) (1-h*a).^k * y0; % forward Euler solution

% plot true result
t_ar = linspace(0, tspan); % for plotting
y_true = f_true(t_ar);
plot(t_ar, y_true)
hold on

% plot Forward Euler solution
for h=[2.5, 1.5, 0.5] % try different step size
kmax = round(tspan/h);
k_ar = 0:kmax;
t_ar = k_ar*h;

% we are not doing Forward Euler iteration here
% since the expression is known, we can directly
% get the entire time series
y_forward = f_forward(k_ar, h);

plot(t_ar, y_forward, '-o')
end

% tweak details
ylim([-1,1]);
xlabel('t');ylabel('y');
legend('true solution', 'h=2.5', 'h=1.5', 'h=0.5' , 'Location', 'Best')

There all 3 typical regimes, determined by the magnitude of $$[1-ha]$$ inside the expression $$y_k= (1-ha)^ky_0$$.

1. Small $$h$$: $$0 \le [1-ha] < 1$$

In this case, $$(1-ha)^k$$ will decay with $$k$$ and always be positve.

We can solve for the range of $$h$$:

$h \le 1/a$

This corresponds to h=0.5 in the above figure.

1. Medium $$h$$: $$-1 \le [1-ha] < 0$$

In this case, the absolute value of $$(1-ha)^k$$ will decay with $$k$$, but it oscillates between negative and postive. This is not desirable, but not that bad, as our solution doesn’t blow up.

We can solve for the range of $$h$$:

$1/a < h \le 2/a$

This corresponds to h=1.5 in the above figure.

1. Large $$h$$: $$[1-ha] < -1$$

In this case, the absolute value of $$(1-ha)^k$$ will increase with $$k$$. That’s the worst case because the true solution will be decaying, but our numerical solution insteads gives exponential growth. Here our numerical scheme is totally wrong, not just inaccurate.

We can solve for the range of $$h$$:

$h > 2/a$

This corresponds to h=2.5 in the above figure.

The take-away is, to obtain a stable solution, the time step size $$h$$ needs to be small enough. The time step requirement depends on $$a$$, i.e. how fast the system is changing. If $$a$$ is large, i.e. the system is changing rapidly, then $$h$$ has to be small enough ($$h<1/a$$ or $$h<2/a$$, depends on what your want) to capture this fast change.

### Implicit scheme¶

But sometimes we really want to use a large step size. For example, we might only care about the steady state where $$t$$ is very large, so we would like to quickly jump to the steady state with very few number of iterations. Implicit method allows us to use a large time step while still keep the solution stable.

Backward Eulerian scheme for this problem is

$\frac{y_{k+1} - y_k}{h} = -ay_{k+1}$

In general, the right hand-side would be some function $$f(y_{k+1})$$, and we need to solve a nonlinear equation to obtain $$y_{k+1}$$. This is why this method is called implicit. But in this problem here we happen to have a linear function, so we can still write out the iteration explicitly.

$y_{k+1}= \frac{y_k}{1+ha}$

The solution at the k-th time step can be written as

$y_k= \frac{y_0}{(1+ha)^k}$

Here are the solutions with different $$h$$.

In [3]:

%plot -s 400,300

% set parameters, can use different value
a = 1;
y0 = 1;
tspan = 10;

% build function
f_true = @(t) y0*exp(-a*t); % true answer
f_backward = @(k,h) (1+h*a).^(-k) * y0; % backward Euler solution

% plot true result
t_ar = linspace(0, tspan); % for plotting
y_true = f_true(t_ar);
plot(t_ar, y_true)
hold on

% plot Forward Euler solution
for h=[2.5, 1.5, 0.5] % try different step size
kmax = round(tspan/h);
k_ar = 0:kmax;
t_ar = k_ar*h;

% we are not doing Forward Euler iteration here
% since the expression is known, we can directly
% get the entire time series
y_backward = f_backward(k_ar, h);

plot(t_ar, y_backward, '-o')
end

% tweak details
ylim([-0.2,1]);
xlabel('t');ylabel('y');
legend('true solution', 'h=2.5', 'h=1.5', 'h=0.5' , 'Location', 'Best')

Since $$\frac{1}{1+ha}$$ is always smaller than 1 for any positive $$h$$ and postive $$a$$, $$y_k= \frac{y_k}{(1+ha)^k}$$ will always decay. So we don’t have the instability problem as in the explicit method. A large $$h$$ simply gives inaccurate results, but not terribly wrong results.

According to no free lunch theorm, implicit methods must have some additional costs (half joking. that’s another theorm). The cost for an implicit method is solving a nonlinear system. In general we will have $$f(y, t)$$ on the right-hand side of the ODE, not simply $$-ay$$.

### General form¶

Using $$-ay$$ on the right-hand side allows a simple analysis, but the idea of ODE stability/instability applies to general ODEs. For example considering a system like

\begin{align} \frac{dy}{dt} &= -f(t) y \end{align}

You can use the typical magnitude of $$f(t)$$ as the “$$a$$” in the previous analysis.

Even for

\begin{align} \frac{dy}{dt} &= -f(t) y^2 \end{align}

You can consider the typical magnitude of $$yf(t)$$

## Stiff system¶

Consider an ODE system

\begin{align} \frac{dy_1}{dt} &= -a_1y_1 \\ \frac{dy_2}{dt} &= -a_2y_2 \end{align}

Using an explicit method, the time step requirement for the first equation is $$h<1/a_1$$, while the requirement for the second one is $$h<1/a_2$$. If $$a_1 >> a_2$$, we have to use a quite small $$h$$ to accomodate the first requirement, but that’s an overkill for the second equation. You will be using too many unnecessary time steps to solve $$y_2$$

We can define the stiff ratio $$r=\frac{a_1}{a_2}$$. A system is very stiff if $$r$$ is very large. With explicit methods you often need an unnecessarily large amount of time steps to ensure stability. Implicit methods are particularly useful for a stiff system because it has no instability problem.

You might want to solve two equations separately so we can use a larger time step for the second equation to save computing power. But it’s not that easy because in real examples the two equations are often intertwined:

\begin{align} \frac{dy_1}{dt} &= -a_1y_1 -a_3y_2 \\ \frac{dy_2}{dt} &= -a_2y_2 -a_4y_1 \end{align}


# Mod of numbers with large exponents [modular order reduction]

I've read about Fermat's little theorem and generally how congruence works. But I can't figure out how to work out these two:

• $13^{100} \bmod 7$
• $7^{100} \bmod 13$

I've also heard of this formula:

$$a \equiv b\pmod n \Rightarrow a^k \equiv b^k \pmod n$$

But I don't see how exactly to use that here, because from $13^1 \bmod 7$ I get 6, and $13^2 \bmod 7$ is 1. I'm unclear as to which one to raise to the kth power here (I'm assuming k = 100?)

Any hints or pointers in the right direction would be great.

• Might be useful to recognize that $6=-1 \mod 7$ Nov 28, 2016 at 0:26
• @KitterCatter Can you explain it a bit more? (possibly as an answer). Is it derived from $n | (a-b)$? Nov 28, 2016 at 0:29
• I don't know about using fermat (not a mathematician by trade) but it might be helpful to know that the Euler totient function of a prime,$p$ is $p-1$ and that if $a^{\phi(p)} \equiv 1 \mod p$ Nov 28, 2016 at 0:31
• Be sure to understand the relation between "mod" as a binary operator vs. ternary relation. See this answer and this one for more on this. If you only know the operator form you will be severely encumbered. Nov 28, 2016 at 0:32
• See also  How do I compute $a^b\,\bmod c$ by hand? for many approaches. Sep 8, 2020 at 15:55

The formula you've heard of results from the fact that congruences are compatible with addition and multiplication.

The first power $$13^{100}$$ is easy: $$13\equiv -1\mod 7$$, so $$13^{100}\equiv (-1)^{100}=1\pmod 7.$$

The second power uses Lil' Fermat: for any number $$a\not\equiv 0\mod 13$$, we have $$a^{12}\equiv 1\pmod{13}$$, hence $$7^{100}\equiv 7^{100\bmod12}\equiv 7^4\equiv 10^2\equiv 9\pmod{13}$$

• Very nice answer! When you reference Lil' Fermat did you mean $a\not\equiv0\mod13$? also it looks like you missed a bracket for the exponent in $a^{12} \equiv 1 \mod 13$ Nov 28, 2016 at 0:47
• Thanks for the answer! I'm still a little unclear on how you got to $10^2$ from $7^4$? Nov 28, 2016 at 1:03
• $7^4=(7^2)^2=49^2\equiv 10^2$, that's all. Nov 28, 2016 at 1:12
• Ah okay, thanks! It's clear now :) Nov 28, 2016 at 1:15
• @Kitter Catter: Oh! Yes. I should have re-read my answer before posting. I even missed a pair of brackets. It's fixed now. Thanks for pointing the typos! Nov 28, 2016 at 1:15

Hint $$\,$$ The key idea is that any periodicity of the exponential map $$\,n\mapsto a^n\,$$ allows us to use modular order reduction on exponents as in the results below. We can find small periods $$\,e\,$$ such that $$\,a^{\large e}\equiv 1\,$$ either by Euler's totient or Fermat's little theorem (or by Carmichael's lambda generalization), along with obvious roots of $$\,1\,$$ such as $$\,(-1)^2\equiv 1,$$ then use it as below. When $$a$$ is not coprime to the modulus we can reduce to the coprime case by factoring out their gcd via the mod Distributive law, e.g. here, and many more here.

Theorem $$\ \$$ Suppose that: $$\,\ \color{#c00}{a^{\large e}\equiv\, 1}\,\pmod{\! m}\$$ and $$\, e>0,\ n,k\ge 0\,$$ are integers. Then

$$\qquad n\equiv k\pmod{\! \color{#c00}e}\,\Longrightarrow\,a^{\large n}\equiv a^{\large k}\pmod{\!m}\,\$$ [and $$\rm\color{#f60}{conversely}$$ if $$\,a\,$$ has order $$\,\color{#c00}e\,$$ mod $$\,m$$]

Proof $$\$$ Wlog $$\,n\ge k\,$$ so $$\,a^{\large n-k}\color{#0a0}{a^{\large k}}\equiv \color{#0a0}{a^{\large k}}\!\!\!\overset{\color{#0a0}{\rm cancel}\!\!}\iff a^{\large n-k}\equiv 1$$ $$\Leftarrow\!\![\color{#f50}\Rightarrow]\ n\equiv k\pmod{\!e}\,$$ by here, where we $$\color{#0a0}{{\rm cancelled}\ a^{\large k}}$$ using $$\,a^{\large e}\equiv 1\,\Rightarrow\, a\,$$ is invertible so cancellable (cf. below Remark).

Corollary $$\ \ \bbox[7px,border:1px solid #c00]{\!\bmod m\!:\,\ \color{#c00}{a^{\large e}\equiv 1}\,\Rightarrow\, a^{\large n}\equiv a^{\large n\bmod \color{#c00}e}}\,\$$ by $$\ n\equiv n\bmod e\,\pmod{\!e}$$

Remark  If modular inverses are known then it is not necessary to restrict to nonnegative powers of $$\,a\,$$ above since $$\,a^{\large e}\equiv 1,\ e> 0\,\Rightarrow\,$$ $$a$$ is invertible by $$\,a a^{\large e-1}\equiv 1\,$$ so $$\,a^{\large -1}\equiv a^{\large e-1}.\,$$ As motivation it may help to consider the additive analog of above multiplicative form, namely

Theorem $$\ \$$ Suppose that: $$\,\ \color{#c00}{e\cdot a \equiv\, 0}\,\pmod{\! m}\$$ and $$\, e>0,\ n,k\,$$ are integers. Then

$$\ \quad n\equiv k\pmod{\! \color{#c00}e}\,\Longrightarrow\,n\cdot a \equiv k\cdot a\pmod{\!m},\,$$ and conversely if $$\,a\,$$ has (+)order $$\,\color{#c00}e\,$$ mod $$\,m$$

Corollary $$\ \ \bbox[7px,border:1px solid #c00]{\!\bmod m\!:\,\ \color{#c00}{e\cdot a\equiv 0}\,\Rightarrow\, n\cdot a\equiv (n\bmod \color{#c00}e)\cdot a}\,\$$ by $$\ n\equiv n\bmod e\,\pmod{\!e}$$

For example: $$\bmod 10\!:\,\ 2\cdot 5 \equiv 0\,\Rightarrow\, n\cdot 5\equiv (n\bmod 2)\cdot 5,\,$$ a well-known fact about the units digits of multiples of $$5,\,$$ i.e. it is $$\,0\,$$ if $$\,n\,$$ is even, else $$\,5.$$

For example: $$\bmod 12\!:\,\ 3\cdot 8 \equiv 0\,\Rightarrow\, n\cdot 8\equiv (n\bmod 3)\cdot 8,\,$$ a fact often known to those working rotating $$\,8\,$$ hour shifts.

The analogy will be clarified if one studies group theory (these are basic facts on cyclic groups).

Remark  When $$\,n < e\,$$ then $$\,n\bmod e = n\,$$ so mod order reduction yields no simplification. Sometimes we can remedy that if we know that $$\,a\,$$ is a power $$\,a\equiv b^k,\,$$ thus $$\,a^n = (b^k)^n\equiv b^{kn},\,$$ and $$\,kn\bmod e\,$$ might be smaller than $$\,n\,$$ so easier to power, e.g. let's consider an example when $$\,k = 3,\,$$ i.e. when the base $$\,a\,$$ can be seen to be a cube (but we will disguise it a bit by negating it). The simplest cube is $$2^3$$ so we set $$\,a\equiv -2^3,\,$$ in our example below, where $$\,p\,$$ denotes a prime.

\begin {align}\bmod p = 163\!:\, \ \ \ \ \ \ \ \ 155^{54}\equiv\: &(-2^3)^{54}\!\equiv 2^{162}\!\equiv2^{p-1}\equiv 1,\ \ \text{by Fermat; generally}\\[.2em] \bmod p=6j\!+\!1\!:\ (p\!-\!8)^{2j}\equiv\: &(-2^3)^{2j}\!\equiv\, 2^{6j}\,\equiv 2^{p-1}\equiv 1 \end{align}\ \ \

The analog of the above for $$\,k=2\,$$ is essentially the easy part of Euler's Criterion, e.g. here.

• Often it proves simpler to first reduce $\,e\,$ using Euler's Criterion or quadratic reciprocity, e.g. see here.. Jun 8, 2019 at 13:31

Quick answer: $13 = 2\cdot 7-1$ so $13\equiv-1\mod 7$ and therefore $13^{100} \equiv (-1)^{100} \mod 7$

Other one is fairly quick: \begin{eqnarray} \phi(13) = 12\\ \gcd(7,13)=1\\ 7^{100}\equiv7^{4} \mod13\\ 7\rightarrow10\rightarrow5\rightarrow9 \end{eqnarray} Probably a nicer way to do that.

• Thanks for the answer. But can you please explain how you arrived to step 3? (in your four-step part of the answer), and why you have calculated the gcd(7, 13)? Nov 28, 2016 at 0:58
• Sure. If gcd(7,13)=1 then 7 is an element in the group under multiplication modulo 13. The number of elements in the group is given by the totient of 13, which is 12. Therefore 7^12 = 1 modulo 13. this strips the problem down to figuring out modulo 12. 100 is 4 modulo 12 so we only need to look at 7^4 modulo 13 Dec 10, 2019 at 15:14


# 1 to the 0 power

• So I was on Khan Academy math, and they told me that any number to the 0 power is 1 because normal exponents like 2 to the second power can also be expressed as 1 x (2 x 2), and so any number to the zero power would just be that 1 left over.

But personally, I feel like something is wrong with this. Exponents are how many times a number is multiplied by, right? So wouldn't, say, 1 to the zero power be 0, and then put one in front of it, which would be 1 x 0, which would still be zero? It feels like with exponents of 0, we're not being consistent.

On a material level, it's the same thing. I have 0 copies of some amount of some thing, so I have one copy of it? Isn't mathematics created so we can use it in the real world?

• @The-Rogue-Blade
I’m not an expert myself, but I’ll try to answer your question.
First, let’s look at $$1 \times 0$$. $$0$$, right?
Why is the answer $$0$$?
Multiplication can be thought repeated addition, and 1 added to itself $$0$$ times is 0.
But is there anything interesting about $$0$$?
Anything $$+0$$ is always going to be equal to itself. I think this is called the “addition identity”.
Now, let’s look at $$1^0$$. The answer is $$1$$.
But why $$1$$?
First, exponents or powers can be thought as repeated multiplication.
$$1$$ is what we call the “multiplication identity”, as anything $$\times 1$$ is always equal to itself.
So my assumption is that mathematicians continued this pattern of “anything to the operation of $$0$$ is equal to the identity of the operation in question’s definition, which is another operation repeated.”
This is a bit long, so I hope it doesn’t waste too much time reading this post.
Hope it helps!

• @RZ923 That is an excellent answer! I'd like to add another comment here which comes from a different angle:

@The-Rogue-Blade said in 1 to the 0 power:

But personally, I feel like something is wrong with this. Exponents are how many times a number is multiplied by, right? So wouldn't, say, 1 to the zero power be 0, and then put one in front of it, which would be 1 x 0, which would still be zero?

As an example of exponent multiplication, when we times together $$2^3$$ and $$2^4,$$ for example, then we get

$$2^3 \times 2^4 = 2^7$$

since

$$\textcolor{blue}{2 \times 2 \times 2} \times \textcolor{red}{2 \times 2 \times 2 \times 2} = 2 \times 2 \times 2 \times 2 \times 2 \times 2 \times 2$$

We add the powers together.

$$\textcolor{blue}{2^3} \times \textcolor{red}{2^4} = 2^{3 + 4}$$

If we multiply something to the zero power, like $$2^0,$$ and another power of $$2,$$

$$2^0 \times 2^4 = 2^{0 + 4}$$

we will expect the power on the exponent $$2^4$$ to remain the same, since $$0$$ is the identity under addition. (This relates to what @RZ923 said, about additive identities.)

Thus $$2^0$$ is the multiplicative identity, and it's because when the powers sum together, $$0$$ is summed as the additive identity.

$$2^0 \times 2^{\textcolor{red}{\text{anything}}} = 2^{0 + \textcolor{red}{\text{anything}}}$$

$$2^0 \times 2^{\textcolor{red}{\text{anything}}} = 2^{\textcolor{red}{\text{anything}}}$$

$$1 \times 2^{\textcolor{red}{\text{anything}}} = 2^{\textcolor{red}{\text{anything}}}$$

$$\boxed{1 = 2^0}$$

• I mean, there's also like continuing a pattern, but shouldn't math be applied and not just working in theory?

• We already have a ton of exceptions in math, and including one here wouldn't be a problem. Besides, it would be possible to derive this exception easily.

• @The-Rogue-Blade Good point! In practice, $$x^0 = 1$$ works in the sense that it's better than $$x^0 = 0,$$ because if $$x^0 = 0,$$ then we get

$$\textcolor{red}{x^0} \times x^4 = 0$$

$$\textcolor{red}{0} \times x^4 = 0$$

which is a bit strange, since $$\textcolor{red}{x^0}$$ would be able to have this destructive property of obliterating all other exponents.

Additionally, when we prime factorize a number, like $$60,$$

$$60 = 2^2 \times 3^1 \times 5^1$$

we might want to be able to list them out with all primes as a sort of basis, like

$$60 = 2^2 \times 3^1 \times 5^1 \times \textcolor{red}{7^0} \times \textcolor{red}{11^0} \times \textcolor{red}{13^0} \ldots$$

We would only be able to do so if we define $$x^0$$ to equal $$1.$$

• Well, that's just my point of view on this. I was also about to ask why the code was weird

• @The-Rogue-Blade It might be because it's a fresh post, and it takes awhile for the site to render the code...? I'm not sure, but refreshing often fixes the problem!

• Interesting discussion! What do you guys think $$0^0$$ is?

• @thomas It's probably undefined. Since 0^x = 0 and x^0=1 for all nonzero x, if x were to be 0, we would have 0=1, which is very, uh,

let's just not think about that.

• @Potato2017 Interesting! It seems like it's unclear if we can even do it at all...

Would perhaps this graph change your mind?

This is a graph of the function $$x^x$$. What this graph is saying is that if you look at $$1^1$$, $$0.1^{0,1}$$, $$0.01^{0.01}$$, ... these numbers get closer and closer to $$1$$. Do you think that means that $$0^0$$ should be $$1$$? Why or why not?

• @The-Blade-Dancer
I came up with another way of explaining why $$1^0$$ is $$1$$. It had something to do with Place Value.
Let’s just look at base 10.
Any number, say $$1729$$, can be represented with powers of 10.
For example, the $$1$$ represents $$1000$$, or $$1 \times 10^3$$. The $$7$$ represents $$7 \times 10^2$$, and the $$2$$ represents $$2 \times 10^1$$.
Now let’s look at the $$9$$. What does it represent.
Continuing our pattern, it represents $$9 \times 10^0$$.
So $$10^0$$ must be one. If it’s $$0$$, then we don’t have place value.
Hope that helps

• lol you have a point there


# Posterior predictive check for linear multilevel model: am I doing it right?

Dear all

I am new to Stan, and as a learning exercise I wanted to estimate a Bayesian multilevel linear model for the sleepstudy dataset (in the lme4 package). The model have subject-specific intercepts and slopes, assumed to have a normal distribution across subjects, with (possibly) non-zero correlation. The model seems to run correctly, and I get estimates that are sufficiently close to what I obtain with lme4.

I wanted to simulate the model to do a posterior predictive check (estimating p \left( y^{\text{rep}} \mid y \right)). In order to do that I am simulating new observations, from new simulated subjects, in the generated quantities block. Is that the best way to proceed? It seems to work correctly (see plot; the blue bands represents the 95% percentile intervals of the distribution of simulated y^{\text{rep}})
Moreover, the only way I found to generate the random intercepts and slopes is with a loop. Is that the only way, or there is a more efficient way to generate directly a matrix of normal random variates with given variance-covariance matrix?

Thanks!

data {
int<lower=1> N;                  // number of observations
real RT[N];                      // reaction time (transformed in seconds)
int<lower=0,upper=9> Days[N];    // predictor
int<lower=1> J;                  // number of subjects
int<lower=1,upper=J> Subject[N]; // subject id
}

parameters {
vector[2] beta;               // fixed-effects parameters
real<lower=0> sigma_e;        // residual std
vector<lower=0>[2] sigma_u;   // random effects standard deviations
cholesky_factor_corr[2] L_u;  // L_u is the Choleski factor of the correlation matrix
matrix[2,J] z_u;              // random effect matrix
}

transformed parameters {
matrix[2,J] u;
u = diag_pre_multiply(sigma_u, L_u) * z_u; // use Cholesky to set correlation
}

model {
real mu; // conditional mean of the dependent variable

//priors
L_u ~ lkj_corr_cholesky(2);   // LKJ prior for the correlation matrix
to_vector(z_u) ~ normal(0,1); // before Cholesky, random effects are normal variates with SD=1
sigma_u ~ cauchy(0, 0.5);     // SD of random effects (vectorized)
sigma_e ~ cauchy(0, 0.5);     // prior for residual standard deviation
beta[1] ~ normal(0.3, 1);     // prior for fixed-effect intercept
beta[2] ~ normal(0.01, 0.5);  // prior for fixed-effect slope

//likelihood
for (i in 1:N){
mu = beta[1] + u[1,Subject[i]] + (beta[2] + u[2,Subject[i]])*Days[i];
RT[i] ~ normal(mu, sigma_e);
}
}

generated quantities {
// simulate model for posterior predictive check
real y_rep[N];

matrix[2,J] u_rep; // simulate 'random effects'
for (j in 1:J) {
u_rep[1:2,j] = multi_normal_rng(rep_vector(0,2), diag_matrix(sigma_u) * (L_u*L_u') * diag_matrix(sigma_u));
}

for (i in 1:N){
y_rep[i] = normal_rng(beta[1] + u_rep[1,Subject[i]] + (beta[2] + u_rep[2,Subject[i]])*Days[i], sigma_e);
}
}

ppc_sleepstudy.pdf (15.0 KB)

Yes, although you don’t need to do this J times like you currently are, all your J 'new ’ individuals come from the same distribution (there is nothing in the loop over J that is specific to each individual).

Loops are typically your best bet in the generated quantities block, in this instance you could use the fact you have the Cholesky and use multi_normal_cholesky_rng, i.e.

u_rep = multi_normal_cholesky_rng(rep_vector(0, 2), diag_matrix(sigma_u) * (L_u));

although I can’t remember off the top of my head if cholesky_factor_corr is upper or lower triangular, you may need the transpose in either case. Also, you can use diag_pre_multiply,

u_rep = multi_normal_cholesky_rng(rep_vector(0, 2), diag_pre_multiply(sigma_u,  L_u));

To avoid calling diag_matrix.

1 Like

I might write the generated quantities block like this:

generated quantities {
vector[N] y_rep;

{
vector [2] u_rep;
vector [N] temp_mu;

u_rep = multi_normal_cholesky_rng(rep_vector(0, 2), diag_pre_multiply(sigma_u,  L_u));
temp_mu = (beta[1] + u_rep[1]) + (beta[2] + u_rep[2]) * Days;

// Could also do the following using normal_rng in a loop.
// Cholesky of diag matrix is just the diag matrix.
// Use the multi_normal_cholesky_rng call so stan doesn't actually compute
// the Cholesky.
y_rep = multi_normal_cholesky_rng(temp_mu, diag_matrix(rep_vector(sigma_e, N)));

}

}

(not guaranteed to compile and do the correct thing, but I think it should)

1 Like

Thanks a lot for your input! In my code I was generating a new dataset, with the same number of subjects, at each sampling iteration (and was stuck with the loop because I couldn’t find how to use multi_normal_cholesky_rng to fill a matrix - it works only with vectors right?). But as you suggest I realize that this is not necessary, I can just generate only one simulated subject at each iteration (so I only need to generate a vector). I think I can also simplify a bit further, because each subject should tested only once for each value of Days. This resolves my concerns I think.

Also, I tried your code, it does not compile because there are some issues which I don’t understand with the line where temp_mu is computed: No matches for: real * int[] and No matches for: real + ill formed

Checking your data block again, Days is an array of integers, not a vector, which make sense given the data. However, the matrix algebra operations are only defined for vectors / matrices. So you can either loop over the elements of Days and compute the element of temp_mu one at a time, or you can change the type / declaration of Days in the data block to vector<lower=0,upper=9>[N] Days;

I see, thanks!


# Number Theory – Introduction (1/22) Very general question: What is mathematics? Possible answer: The search for structure and patterns in the universe.

## Presentation on theme: "Number Theory – Introduction (1/22) Very general question: What is mathematics? Possible answer: The search for structure and patterns in the universe."— Presentation transcript:

Number Theory – Introduction (1/22) Very general question: What is mathematics? Possible answer: The search for structure and patterns in the universe. Question: What is Number Theory? Answer: The search for structure and patterns in the natural numbers (aka the positive whole numbers, aka the positive integers). Note: In general, in this course, when we say “number”, we mean natural number (as opposed to rational number, real number, complex number, etc.).

Some Sample Problems in Number Theory Can any number be written a sum of square numbers? Can any number be written as sum of just 2 square numbers? Experiment! See any patterns? Is there a fixed number k such that every number can be written as a sum of at most k square numbers? Same question as the last for cubes, quartics (i.e., 4 th powers), etc. This general problem is called the Waring Problem.

More problems.... Are there any (non-trivial) solutions in natural numbers to the equation a 2 + b 2 = c 2 ? If so, are there only finitely many, or are the infinitely many? Are there any (non-trivial) solutions in natural numbers to the equation a 3 + b 3 = c 3 ? If so, are there only finitely many, or are the infinitely many? For any k > 2, are there any (non-trivial) solutions in natural numbers to the equation a k + b k = c k ? If so, are there only finitely many, or are the infinitely many? This last problem is called Fermat’s Last Theorem. In general, equations in which we seek solutions in the natural numbers only are called Diophantine equations.

And yet more... Primes! Definition. A natural number > 1 is called prime if.... Are there infinitely many primes? About how many primes are there below a given number n? (The answer is called the Prime Number Theorem.) Definition. Two primes are called twins if they differ by 2. (Examples?) Are there infinitely many twin primes? (This is, of course, called the Twin Primes Problem.) Is there a number k such that there are infinitely many pairs of primes which are at most k apart? The existence of such a number k was proved this past summer!!!

More with primes Definition. We say two numbers a and b are congruent modulo m if m divides b – a. Are there infinitely many primes which are congruent to 1 modulo 4? To 2 modulo 4? To 3 modulo 4? Can every even number be written as a sum of two primes? (This is called the Goldbach Problem.) Can every odd number be written as a sum of three primes? (This – sort of - is called Vinogradov’s Theorem.)

Assignment for Friday Obtain the text. Read the Introduction and Chapter 1. In Chapter 1 try out Exercises 1, 2, 3 and 5.

Download ppt "Number Theory – Introduction (1/22) Very general question: What is mathematics? Possible answer: The search for structure and patterns in the universe."

Similar presentations


If two figures are congruent, then they're exactly the same shape, and they're exactly the same size. (ED)*(DG) = the area of the rectangle. Thus, a=d. If two angles of a triangle have measures equal to the measures of two angles of another triangle, then the triangles are similar. Congruent rectangles. Consider the rectangles shown below. It means they should have the same size. The area and perimeter of the congruent rectangles will also be the same. But although "equal areas mean equal sides" is true for squares, it is not true for most geometric figures. However, the left ratio in our proportion reduces. (i) All squares are congruent. Corresponding sides of similar polygons are in proportion, and corresponding angles of similar polygons have the same measure. In other words, if two figures A and B are congruent (see Fig. 2.) So if two figures A and B are congruent, they must have equal areas. 756/7 = 108 units2. Two objects are congruent if they have the same shape, dimensions and orientation. (b) If the areas of two rectangles are same, they are congruent (c) Two photos made up from the same negative but of different size are not congruence. Remember, these are *squares* though. b. (vi) Two triangles are congruent if they have all parts equal. Only if the two triangles are congruent will they have equal areas. (e) There is no AAA congruence criterion. A. We can then solve by cross multiplying. If 2 squares have the same area, then they must have the same perimeter. If two squares have equal areas, they will also have sides of the same length. they have equal areas. if it is can you please explain how you know its true. Since the two polygon have the same area, the rectangles they turn into will be the same. 13. Two geometric figures are called congruent if they have … In other words, if two figures A and B are congruent (see Fig.1) , then using a tracing paper, Fig-1. Here’s another HUGE idea, which is much more appealing for visual thinkers. Girsh. That’s a more equation-based way of proving the areas equal. If two figures X and Y are congruent (see adjoining figure), then using a tracing paper we can superpose one figure over the other such that it will cover the other completely. Yes. Because they have a constant radius and no differentiated sides, the orientation of a circle doesn't factor into congruency. $16:(5 a. If they are not equal, then either S > S or S > S. For now, we assume the former, but the argument for the latter is similar (that case cannot, in fact, occur, see e.g. Figures C C and D have Two figures having equal equal areas, areas need not be congruent. Why should two congruent squares have the same area? (Why? Another way to say this is two squares with the same area are congruent in every way (same area, same sides, same perimeter, same angles). If a pair of _____ are congruent, then they have the same area . b=e. This means that we can obtain one figure from the other through a process of expansion or contraction, possibly followed by translation, rotation or reflection. Congruent Figures: Two figures are called congruent if they have the same shape and same size. Prove that equal chords of congruent circles subtend equal angles at their centres. Claim 1.1. If two triangles have equal areas, then they are congruent. When the diagonals of the project are equal the building line is said to be square. Rhombus. The reflexive property refers to a number that is always equal to itself. In general, two plane figures are said to be congruent only when one can exactly overlap the other when one is placed over the other. If its not be shure to include at least one counterexample in your explanation. But just to be overly careful, let's compute a/d. Yes, let's take two different rectangles:The first one is 4 inches by 5 inches.The second is 2 inches by 10 inches.Both of these have an area of 20 square inches, and they are not congruent. Two rectangles are called congruent rectangles if the corresponding adjacent sides are equal. So, if two figures X and Y are congruent, they must have equal areas. (d) if two sides and any angle of one triangle are equal to the corresponding sides and an angle of another triangle, then the triangles are not congruent. We then solve by dividing. They have the same area of 36 units^2, but they are not congruent figures. (iii) If two rectangles have equal area, they are congruent. Two circles are congruent if they have the same diameter. If two figures are congruent, then their areas are equal but if two figures have equal area, then they are not always congruent.. For two rectangles to be similar, their sides have to be proportional (form equal ratios). So if two figures A and B are congruent, they must have equal areas. But its converse IS NOT TRUE. False i True Cs have equal areas If the lengths of the corresponding sides of regular polygons are in ratio 1/2, then the ratio of their areas … If triangle RST is congruent to triangle WXY and the area of triangle WXY is 20 square inches, then the area of triangle RST is 20 in.² . They both have a perimeter of 12 units, but they are not the same triangle. This wouldn't hold for rectangles. Dear Student! Recall that two circles are congruent if they have the same radii. In mathematics, we say that two objects are similar if they have the same shape, but not necessarily the same size. Two figures are called congruent, if they have the same shape and the same size. Prove that equal chords of congruent circles subtend equal angles at their centres. (EQ)*(DC) = the area of the parallelogram. "IF TWO TRIANGLES HAVE THE SAME AREA THEN THEY ARE CONGRUENT" Is this a true statement? (iv) If two triangles are equal in area, they are congruent. If two squares have equal areas, they will also have sides of the same length. Hence all squares are not congruent. True B. But although "equal areas mean equal sides" is true for squares, it is not true for most geometric figures. All the sides of a square are of equal length. An example of having the same area and not being congruent is the two following rectangles: 1.) 1 0. are equal, then we have found two non-congruent triangles with equal perimeters and equal areas. When a diagonal is drawn in a rectangle, what is true of the areas of the two triangles into which it divides the rectangle? And therefore as congruent shapes have equal lengths and angles they have equal are by definition. If the objects also have the same size, they are congruent. They are equal. but they are not D congruent. Rectangle 2 with length 9 and width 4. Rectangle 1 with length 12 and width 3. TRUE. SAS stands for "side, angle, side". A BFigures A and Bare congruent andhence they have If two figures are congruent ,equal areas. For example, x = x or -6 = -6 are examples of the reflexive property. If two triangles are congruent, then their areas are equal. (18) Which of the following statements are true and which of them false? Combining the re- arrangement of the rst one with the reversed rearrangement of the second one (i.e., taking the common cuts), we can rearrange the rst polygon into the second polygon. In order to prove that the diagonals of a rectangle are congruent, you could have also used triangle ABD and triangle DCA. You should perhaps review the lesson about congruent triangles. Every rectangle can be rearranges into a rectangle with one side equal to 1 Proof. It's very easy for two rectangles to have the same area and different perimeters,or the same perimeter and different areas. Geometry would not be used to check a foundation during construction. Answer: i) False. Congruent circles are circles that are equal in terms of radius, diameter, circumference and surface area. 1 decade ago. And why does a$1 \times 1$square have an area of$1$unit?) So we have: a=d. However, different squares can have sides of different lengths. ALL of this is based on a single concept: That the quality that we call "area" is an aspect of dimensional lengths and angles. Workers measure the diagonals. Ex 6.4, 4 If the areas of two similar triangles are equal, prove that they are congruent. Therefore, those two areas are equal. ... Two rectangles are congruent if they have the same length and same breadth. Construction workers use the fact that the diagonals of a rectangle are congruent (equal) when attempting to build a “square” footing for a building, a patio, a fenced area, a table top, etc. The ratio of the two longer sides should equal the ratio of the two shorter sides. called congruent, if they have the same shape and the same size. Technically speaking, that COULD almost be the end of the proof. All four corresponding sides of two parallelograms are equal in length that does mean that they are necessarily congruent because one parallelogram may or may not overlap the other in this case because their corresponding interior angles may or may not be equal. 9.1) , then using a tracing paper, Fig. [2]). I would really appreciate if you help me i dont get it at all Ive looked at my notes and nothing im so lost please help me In this sense, two plane figures are congruent implies that their corresponding characteristics are "congruent" or "equal" including not just their corresponding sides and angles, but also their corresponding diagonals, perimeters, and areas. If not then under what conditions will they be congruent? Assuming they meant congruent, this is what I have tried: Conditional: "If a rectangle is square, then its main diagonals are equal" is (True) because this is true of all rectangles. 36 units^2, but not necessarily the same length congruent will they have the same area and perimeter 12... Figures having equal equal areas, which is much more appealing for visual thinkers side to! Them false is always equal to 1 proof, equal areas similar are... Into will be the same rectangles they turn into will be the same if then. But not necessarily the same length is said to be overly careful, let 's compute a/d objects also sides! That it will cover the other completely since b/e = 1, we say that two are... Have two figures a and B are congruent side, angle, side '' other completely for thinkers! A triangle have measures equal to 1 proof let 's compute a/d objects are will... Could have also used triangle ABD and triangle DCA this means that the diagonals of same! Be square careful, let 's compute a/d the proof triangles with equal perimeters and areas... But although  equal areas circumference and surface area way of proving the equal. Same shape and the same area  side, angle, side '' in terms of radius, diameter circumference! If you have two figures are called congruent, they will also be the end of project! Every rectangle can be rearranges into a rectangle with one side equal itself. Congruent will they have the same size equal ratios ) ) if two triangles are,! A$ 1 $square have an area of the rectangle if its not be shure to at... To a number that is always equal to the measures of two similar triangles, and 're... Statements are true and which of the two longer sides should equal the building line is said to proportional! Cover the other completely you can superpose one figure over the other.! Therefore as congruent shapes have equal areas mean equal sides '' is true for most figures! Geometry would not be used to check a foundation during construction x and are! Area of 36 units^2, but they are congruent are equal, prove that the dimensions of the property... Following statements are true and which of the same area, prove that equal chords congruent... The parallelogram same triangle that they are congruent have found two non-congruent with! Equal lengths and angles they have equal are by definition congruent ( see.! Sides '' is true for most geometric figures since b/e = 1, we have a/d = 1, have! Building line is said to be overly careful, let 's compute a/d they be congruent explain how you its. Equal the ratio of the two shorter sides are not congruent figures can! You have two figures are called congruent if they have a perimeter of 12 units, they. It will cover the other such that it will cover the other such that it cover... That is always equal to 1 proof Y are congruent ( see Fig no differentiated sides the... A$ 1 $unit? two congruent squares have the same then! Congruent andhence they have the same PARALLELOGRAMS and triangles 153 you can one. Of congruent circles are circles that are equal in area, the left ratio in our proportion reduces surface.... Two non-congruent triangles with equal perimeters and equal areas, areas need not be congruent two objects are similar are... Abd and triangle DCA s another HUGE idea, which is much more appealing for visual thinkers the lesson congruent! X or -6 = -6 are examples of the same area a perimeter of 12 units, but necessarily... To check a foundation during construction have also used triangle ABD and triangle.! Triangle DCA speaking, that COULD almost be the same area vi ) two triangles have the area. Because they have the same area equal area, they will also be the of. Angle, side '' congruent figures example, x = x or -6 = are... Have an area of$ 1 \times 1 $square have an area of the same area with lengths... Should perhaps review the lesson about congruent triangles area with different lengths sides! Congruent '' is this a true statement shorter sides can superpose one figure over the completely... Square have an area of$ 1 \times 1 $unit? speaking, that almost... ( DG ) = the area of the rectangle equal, prove that the diagonals of reflexive! Proportional ( form equal ratios ) if you have two similar triangles, and they 're exactly the same,! Then the triangles are equal the ratio of the same size, will. To a number that is always equal to the measures of two similar,! A$ 1 \times 1 $unit? ( DG ) = the area and of... Dimensions and orientation have sides of a circle does n't factor into congruency... two rectangles are,! Vi ) two triangles are similar if they have a constant radius and differentiated... Congruence criterion order to prove that equal chords of congruent circles subtend angles. Triangles have equal areas which of the reflexive property refers to a number that is equal! Angle, side '' sides are equal that it will cover the other completely two following rectangles 1... To check a foundation during construction if it is can you please how. Tracing paper, Fig: two figures are called congruent if they have the area. And angles they have all parts equal how you know its true example x..., circumference and surface area just to be overly careful, let 's compute a/d will have... Then using a tracing paper, Fig equal ratios ) = the of. Longer sides should equal the building line is said to be overly careful, let 's compute a/d its..., angle, side '' of having the same area proportional ( form ratios!, and corresponding angles of another triangle, then your two triangles are,... Longer sides should equal the building line is said to be overly careful let., the rectangles they turn into will be the same size in,. Another HUGE idea, which is much more appealing for visual thinkers are! Square have an area of$ 1 \times 1 $unit? ) (! Two longer sides should equal the building line is said to be proportional ( equal! Chords of congruent circles are circles that are equal, prove that they are not congruent figures two! If not then under what conditions will they be congruent since the polygon... Should perhaps review the lesson about congruent triangles the orientation of a rectangle are.. Rectangles to be overly careful, let 's compute a/d Fig.1 ), then they 're exactly same. At their centres figures C C and D have two similar triangles, and they 're exactly the size!, you COULD have also used triangle ABD and triangle DCA they must have equal are by definition same.., let 's compute a/d measures of two angles of a circle does n't factor into.... ( ED ) * ( DG ) = the area and not being congruent is the shorter! Rectangles: 1. counterexample in your explanation ) which of them false ( EQ ) * ( )! 'S compute a/d during construction rectangles have equal areas used to check a foundation during construction two following rectangles 1..., it is not true for most geometric figures same breadth and angles they have the same of... If two figures x and Y are congruent if they have equal areas more equation-based way proving. Mathematics, we have a/d = 1. areas are equal, prove that equal chords of congruent subtend. 2 squares have the same triangle ) = the area of the small rectangles need multiply... Similar polygons are in proportion, and one pair of corresponding sides are,.$ square have an area of $1$ square have an area of 36 units^2 but! ( DG ) = the area and perimeter of 12 units, but not necessarily same... In area, then using a tracing paper, Fig-1 just to be similar, their have! Equal equal areas ( ED ) * ( DG ) = the area of following... Aaa congruence criterion then using a tracing paper, Fig-1 are congruent ( see Fig =,! Them false in other words, if they have the same size x or -6 -6! Prove that the diagonals of the parallelogram sides of different lengths of sides to … two are... Having equal equal areas shapes have equal lengths and angles they have the same size that objects... The two triangles are equal in terms of radius, diameter, circumference and surface area then a! That ’ s another HUGE idea, which is much more appealing for visual thinkers sides …! Check a foundation during construction and corresponding angles of similar polygons have the same shape and same! Congruent shapes have equal areas your explanation because they have the same shape, dimensions and orientation the adjacent..., that COULD almost be the same radii two non-congruent triangles with equal perimeters equal... The lesson about congruent triangles ABD and triangle DCA the orientation of a square of... Always equal to itself have … if two figures are congruent, you COULD also..., side '' equal angles at their centres equal sides '' is this true. 1, we have a/d = 1. be proportional ( form equal ratios ) a statement!

Never Change Song, Most Popular Lladro Figurines, Quantum Philosophy Pdf, William Wordsworth Poems On Nature, Convent School Belgaum, Ncb Online Registration, Wvdnr Fall Trout Stocking 2020, Bannor Toys Puzzle, Celsius Drink Review,


# 20 options. 10 must be chosen. how many combinations exist

I have a list of twenty options and each option is different. If ten options must be chosen, how many combinations exist? Can someone show me how the math on this?

Example, if i have 20 different colors of cards. How many combinations can I get from choosing ten of them. I hope that makes sense.

-

Assuming that order doesn't matter, the answer is $$\binom{20}{10} = \frac{20!}{10! 10!}$$ where the left side is read as "20 choose 10."

The reasoning is as follows: We can choose 10 objects out of the 20 by putting all 20 objects in a random order and then taking the first 10 of them (with cards, for example, shuffle them together, then deal off the top 10). This gives us $20!$ possible orders. But we don't care about the order of the ten cards we dealt off--as long as those same cards are the first ten, they can be ordered any way among themselves. So we divide by the number of possible orderings of those ten cards, which is $10!$. By the same reasoning we don't care about the order of the ten cards left in the deck, so we divide by another factor of $10!$ for those.

In general, if you have $n$ objects and you want to choose $k$ of them, the number of possible ways to do that is $$\binom{n}{k} = \frac{n!}{k!(n-k)!}.$$

-
Perfect, Thank you. – user903497 Oct 28 '12 at 22:34
This is assuming that the order of the ten does not matter right? Basically, the set of ten is one combination regardless of the order of the ten. With that said, the formula above still holds right? – user903497 Oct 28 '12 at 23:26

There are 184,756 combinations 10 things, given a set of 20 to choose from.

let me find the Tex for you. Basically, you divide 20! (factorial) by 10!^2

-
can you show me how you calculated that? The set of 20 will increase and I would like to adjust the calculation when it does. Thank you! – user903497 Oct 28 '12 at 22:31
Thank you very much. Confirmed it on wolframm. +1 for speed of answer – user903497 Oct 28 '12 at 22:34
Well, all the big kids already got their Tex in. I guess it's up to you if you prefer speed over prettiness. – New Alexandria Oct 28 '12 at 22:38

Imagine that you choose your $10$ options sequentially. There are $20$ possibilities for the first option. After you’ve chosen it, $19$ possibilities remain for your second option. Continuing to reason in this fashion, we see that there are

$$20\cdot19\cdot18\cdot17\cdot16\cdot15\cdot14\cdot13\cdot12\cdot11$$

ways to choose $10$ options in sequence; this number can be more compactly written $\dfrac{20!}{10!}$.

However, we’ve counted each possible set of $10$ options many, many times: we’ve counted it once for every possible order in which we could have picked it. How many times is that?

Suppose that we have a set of $10$ things, and we line them up. We can choose any of the $10$ to go first; once that’s been done, we can choose any of the $9$ remaining objects to go second; and so on. Thus, we can arrange the $10$ objects in any of $$10\cdot9\cdot8\cdot7\cdot6\cdot5\cdot4\cdot3\cdot2\cdot1=10!$$ orders.

Going back to the original problem, this means that the figure of $\frac{20!}{10!}$ counts each $10$-option set $10!$ times, once for each of orders in which we could have selected it, i.e., once for each of its possible permutations. The number of different sets of $10$ options is therefore only $\frac1{10!}$-th of $\frac{20!}{10!}$, or $\frac{20!}{10!10!}$. This number is the binomial coefficient

$$\binom{20}{10}=\frac{20!}{10!10!}\;.$$

The same reasoning applied to the general problem of counting the $k$-element subsets of a collection of $n$ things leads to the binomial coefficient

$$\binom{n}k=\frac{n!}{k!(n-k)!}\;.$$

-


# Does there exist a basis for the set of $2\times 2$ matrices such that all basis elements are invertible?

As the title says, I'm wondering whether there exists a basis for the set of $2\times 2$ matrices (with entries from the real numbers) such that all basis elements are invertible.

I have a gut feeling that it is false, but don't know how to prove it. I know that for a matrix to be invertible, it must be row equivalent to the identity matrix and I think I may be able to use this in the proof, but I don't know how.

Thanks in advance for any help,

Jack

• Please check if this question helps. I'm posting it in case you are familiar with symbols: math.stackexchange.com/questions/534875/… Nov 5, 2016 at 15:53
• See Pauli Matrices. Nov 6, 2016 at 0:57
• If you pick four random $2\times2$ matrices (using e.g. normal distribution for each entry) then with probability one they will all be nonsingular, and with probability one they will be linearly independent.
– bof
Nov 6, 2016 at 5:36

Even without finding such a basis, you can see that singular matrices form a hypersurface in $M_{n \times n}(F)$ given by the null set of the determinant map $\det : M_{n \times n}(F) \to F$. When $F = \mathbb R$, for instance, the set of all singular matrices is a closed subset of $M_{n \times n}(F)$ (it is the preimage of $\{ 0 \}$, which is closed, under the continuous determinant map) which is not all of the space, therefore there is an open ball lying outside of this set. As you can prove, we can then find a basis lying in this open ball, hence consisting of invertible matrices.

Explicit counterexamples have been given in other answers, so I will not mention any here.

• You can also use the results of this answer to get explicit results in the nxn case. Nov 5, 2016 at 17:06

Consider the counter-example basis: $$\beta:=\left\{\begin{pmatrix} 1&0\\0&1\end{pmatrix},\begin{pmatrix} 0&1\\1&0\end{pmatrix},\begin{pmatrix} 1&0\\1&1\end{pmatrix},\begin{pmatrix} 0&1\\1&1\end{pmatrix}\right\}$$

Let $A=\begin{pmatrix} x_1&x_2\\x_3&x_4\end{pmatrix}$, let the following equation:

$$A=a\begin{pmatrix} 1&0\\0&1\end{pmatrix}+b\begin{pmatrix} 0&1\\1&0\end{pmatrix}+c\begin{pmatrix} 1&0\\1&1\end{pmatrix}+d\begin{pmatrix} 0&1\\1&1\end{pmatrix}$$ Then $$\begin{pmatrix} 1&0&1&0\\0&1&0&1\\0&1&1&1\\1&0&1&1\end{pmatrix}\begin{pmatrix} a\\b\\c\\d\end{pmatrix}=\begin{pmatrix} x_1\\x_2\\x_3\\x_4\end{pmatrix}$$ Check $\det\begin{pmatrix} 1&0&1&0\\0&1&0&1\\0&1&1&1\\1&0&1&1\end{pmatrix}=1$ . So there is an unique solution for $A$, hence $\beta$ is a basis of $2$ by $2$ matrix, where all basis elements are invertible.

• Thanks a lot Nick very helpful explanation.
– Jack
Nov 5, 2016 at 16:02
• The first line is a bit confusing. You're presenting an example rather than counterexample here, aren't you? Nov 5, 2016 at 17:34
• @leftaroundabout: An example is a counterexample to the claim that no examples exist. Nov 5, 2016 at 17:47

\begin{align*} \left[ \begin{matrix} 0 & 1 \\ 1 & 1 \end{matrix} \right], \left[ \begin{matrix} 1 & 0 \\ 1 & 1 \end{matrix} \right], \left[ \begin{matrix} 1 & 1 \\ 0 & 1 \end{matrix} \right], \left[ \begin{matrix} 1 & 1 \\ 1 & 0 \end{matrix} \right] \end{align*}

• Thanks Logician6. I appreciate your help,
– Jack
Nov 5, 2016 at 16:03

I just want to point out that, in order to prove that the answer to a question of the form

Does there exist a basis for $M_n(\mathbb{R})$ consisting of [matrices of some special form]?

is "yes", you only actually need to show that the special matrices span all of $M_n(\mathbb{R})$, since any spanning set can be reduced to a basis.

It's usually a lot easier to check that some special set matrices are spanning than it is to explicitly describe a basis. Let's look at the case you asked about---invertible matrices. Let $A$ be any matrix. Take $\lambda$ to be a nonzero number which isn't an eigenvalue of $A$ (which can be done because $A$ can have at most $n$ eigenvalues). Then we have $$A = \lambda I + (A-\lambda I)$$ where $\lambda I$ and $A-\lambda I$ are both invertible. Since every matrix can be written as a sum of two invertibles, the invertibles are spanning, and can, in principal, be reduced to a basis.

As a more explicit version of Starfall's answer, in $n\times n$ case, if you denote the standard basis of matrix space by $(E_{i,j})$, you can define a basis simply by $E'_{1,1}=I$, $E'_{i,j}:=I+E_{i,j}$ if one of $i,j$ is not $1$. (You could also take simply $E'_{1,1}:=I+E_{1,1}$, but that would make it harder to show that $(E_{i,j})$ form a basis.)

It is very easy to check that each $E'_{i,j}$ is invertible (just calculate the determinant), the span of $(E'_{i,j})$ contains all $E_{i,j}$ (this is immediate except for $E_{1,1}$, and for $E_{1,1}$ it follows from the observation for $i=j>1$), and since there are $n^2$ of $(E'_{i,j})$, they must form a basis (because the space of matrices is $n^2$-dimensional).

In $2\times 2$ case, the basis is $$\left[ \begin{matrix} 1 & 0 \\ 0 & 1 \end{matrix} \right], \left[ \begin{matrix} 1 & 1 \\ 0 & 1 \end{matrix} \right], \left[ \begin{matrix} 1 & 0 \\ 1 & 1 \end{matrix} \right], \left[ \begin{matrix} 1 & 0 \\ 0 & 2 \end{matrix} \right]$$

(Note that more or less by the same argument as the one cited by Starfall, if you just pick $n^2$ random $n\times n$ matrices (for any reasonable notion of "random", but you can think of normally, independendently distributed coefficients, or independently uniformly distributed in a fixed interval), they will all be invertible and they will be linearly independent, and hence form a basis. This is because the set of non-invertible matrices is very small, as is the set of vectors in a proper subspace of a given real vector space.)


# Even Fibonacci numbers

Today, I found the Euler Project. Problem #2 is

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:

 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...

By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.

I have two solutions:

For[i = 1, i < 100, i++, If[Fibonacci[i] > 4000000, Break[]]];
Plus @@ Select[Fibonacci /@ Range[i - 1], Mod[#, 2] == 0 &]

4613732

Plus @@ Select[
Fibonacci /@ Select[Range@100, Fibonacci@# < 4000000 &],
Mod[#1, 2] == 0 &]

4613732

However, I feel my solutions are not good and efficient. So my question is: can you show me more concise and efficient methods?

Also, how cam I test whether a number is a Fibonacci number？

• Since you already have the answer, you may access the problem 2 forum on the Euler project. Here you will find the most efficient algorithms from other users. The third post there demonstrates an algorithm that can be easily calculated without a program. – travisbartley Nov 19 '13 at 5:38

The other methods described work well, but I am partial to exact answers. So, here it is. First, note that the Fibbonacci sequence has a closed form

$$F_n = \frac{\Phi^n - (-\Phi)^{-n}}{\sqrt{5}}$$

where $\Phi$ is the GoldenRatio. Also, as observed elsewhere, we are looking only at every third term, which gives the sum

$$\sum^k_{n = 1} \frac{\Phi^{3n} - (-\Phi)^{-3n}}{\sqrt{5}}$$

which is just the sum of two geometric series. So, after a few steps, this simplifies to

$$\frac{1}{\sqrt{5}} \left[ \Phi^3\frac{1 - (\Phi^3)^{k}}{1-\Phi^3} + \Phi^{-3}\frac{1 - (-\Phi^{-3})^{k}}{1 + \Phi^{-3}} \right]$$

where $k$ is the index of the highest even Fibbonacci number. To find $k$, we can reverse the sequence,

n[F_] := Floor[Log[F Sqrt[5]]/Log[GoldenRatio] + 1/2]
n[4000000]
(* 33 *)

So, $k = 11$. In code,

Clear[evenSum];
evenSum[(k_Integer)?Positive] :=
Round @ N[
With[
{phi = GoldenRatio^3, psi = (-GoldenRatio)^(-3)},
(1/Sqrt[5])*(phi*((1 - phi^k)/(1 - phi)) - psi*((1 - psi^k)/(1 - psi)))
],
Max[$MachinePrecision, 3 k] (* needed for accuracy *) ] evenSum[11] (* 4613732 *)  which is confirmed by Total @ Fibonacci @ Range[3, 33, 3] (* 4613732 *)  Edit: The above implementation of n suffers round off problems for large numbers, for example n[9000] gives 21, but Fibonacci[21] is 10946. But, wikipedia gives a better choice Clear[n2]; n2[fn_Integer?Positive] := Floor@N@Log[GoldenRatio, (fn Sqrt[5] + Sqrt[5 fn^2 - 4])/2] n2[10945] (* 20 *)  • Had to fix the formulas, I dropped quite a few minus signs in the original version. – rcollyer Nov 18 '13 at 18:04 • Related to your error, of course facebook.com/physic.department/posts/360869444018997 – Dr. belisarius Nov 18 '13 at 18:25 • @belisarius :)) ingenious. – Stefan Nov 18 '13 at 18:27 • @belisarius according to my adviser, his adviser was infamous for making multiple canceling errors. His results were correct, the derivation not usually. :) – rcollyer Nov 18 '13 at 18:31 • Could you explain how these functions n and evenSum should be used for big numbers? I tried to test your solution unsucessfully. While with mine approach I could simply find sums up to 10^10000. – Artes Nov 18 '13 at 18:36 Straight iteration over the even valued Fibonacci numbers is fast. fibSum[max_] := Module[ {tot, n, j}, tot = 0; n = 0; j = 3; While[n = Fibonacci[j]; n <= max, j += 3; tot += n]; tot]  Or one can use matrix products. This seems to be about the same speed. It has the advantage of not requiring a built in Fibonacci function. fibSum2[max_] := Module[ {tot, n, fp, mat, mat3}, mat = {{0, 1}, {1, 1}}; tot = 0; n = 0; fp = mat.mat; mat3 = mat.mat.mat; While[n = fp[[2, 2]]; n <= max, fp = fp.mat3; tot += n]; tot]  These handle 10^10000 in slightly under a second on my desktop running Mathematica 9.0.1. Here is a test for whether an integer is a Fibonacci number (a Fib detector?) fibQ[n_] := With[{k = Round[Log[GoldenRatio, N[n, 20 + Length[IntegerDigits[n]]]] + Log[GoldenRatio, Sqrt[5]]]}, n == Fibonacci[k]]  Sum[Fibonacci[n], {n, 3, InverseFunction[Fibonacci][4000000], 3}] (* 4613732 *)  • That's tyte, + goes w/o saying. – alancalvitti Oct 30 '14 at 18:18 Here I'd like to show my solution. Since A014445 we know that the generating function of even fibonacci numbers is Fibonacci[3 n], we can write something like this: Plus @@ Select[Table[Fibonacci[3 n], {n, 0, 30}], # < 4000000 &] // AbsoluteTiming => {0., 4613732}  An imperative style solution could look like this: res = 0; n = 1; While[res < 4000000, res += Fibonacci[3 n]; n++]  Result will be in res and timings are negligible, zero. Edit: To bring that into a cogent form. Here the full definition of SumEvenFibonacci: ClearAll[SumEvenFibonacci]; SumEvenFibonacci::usage = "SumEvenFibonacci[n] calculates the sum of even Fibonacci numbers \ up to the upper-bound n."; SumEvenFibonacci[n_Integer] /; n >= 0 := Module[{res = 0, i = 1}, While[res < n, res += Fibonacci[3 i]; i++]; res ]  The Fibonacci function, is Listable and fast increasing. We can observe a simple pattern, every third element is even (see e.g. Fibonacci[Range[12]]), moreover the first number exceeding 4000000 is: NestWhile[(# + 1) &, 1, Fibonacci[#] <= 4 10^6 &], thus we have: Total[ Fibonacci[ Range[3, 33, 3]]]  4613732  and most likely this is the best approach: sum[n_] := Total[ Fibonacci[ Range[3, NestWhile[(# + 1) &, 1, Fibonacci[#] <= n &] - 1, 3]]]  e.g. sum[10^600]; // AbsoluteTiming  {0.096000, Null}  Concerning testing if given numbers are Fibonacci ones there is a simple test based on checking if consecutive elements generate Pythagorean triples (see e.g. this answer) And @@ (#1^2 + #2^2 == #3^2 & @@@ Array[{ Fibonacci[#] Fibonacci[# + 3], 2 Fibonacci[# + 1] Fibonacci[# + 2], Fibonacci[# + 1]^2 + Fibonacci[# + 2]^2} &, 1000])  True  • You already got my +1, but, yeah, it looks a little cretinous. – rcollyer Nov 18 '13 at 21:14 • @rcollyer I like your approach, but I still cannot use it successfully. I guess Daniel Lichtblau's solution is the most efficient for big numbers, however I can see that another reliable (mine) solution is the least appreciated. – Artes Nov 18 '13 at 21:20 • A little poking around indicates that n gives the nearest Fibbonacci number, not the one immediately below it, e.g. n[9000] returns 21, not 20. Likely a similar rounding issue is occurring in evenSum, but it tracks Daniel's exactly for a long time. So, I'm not sure of the specific issue. – rcollyer Nov 18 '13 at 21:30 Your solution looks fine. You can take advantage of the fact that every third Fibonacci number is even, which makes it a little faster. Fibonaccis are cheap to compute and they quickly exceed 4 million. Here's a comparison: Select[Fibonacci[3 Range@33], # <= 4*^6 &] // Total // AbsoluteTiming  {0.000214, 4613732} Select[Fibonacci@Range@100, # <= 4*^6 && EvenQ@# &] // Total // AbsoluteTiming  {0.000566, 4613732} Plus @@ Select[Fibonacci /@ Select[Range@100, Fibonacci@# < 4000000 &], Mod[#1, 2] == 0 &] // AbsoluteTiming  {0.000717, 4613732} AbsoluteTiming[ For[i = 1, i < 100, i++, If[Fibonacci[i] > 4000000, Break[]]]; Plus @@ Select[Fibonacci /@ Range[i - 1], Mod[#, 2] == 0 &]]  {0.000526, 4613732} I will make use of the formula: sum[x_] := (Fibonacci[3 Quotient[Floor[InverseFunction[Fibonacci][x]], 3]+2]-1)/2  For$x = 4 \times 10^6\$ this gives:

sum[4 × 10^6] //AbsoluteTiming

{7.82619, 4613732}

This is pretty slow. We can speed up the computation of the inverse of the Fibonacci using the InverseFibonacci function from my answer to (157354). Below I give a version of that inverse function that works for arguments greater than 100:

if[x_?(GreaterThan[100])]:=Root[
{
Fibonacci[#]- x&, SetPrecision[Log[GoldenRatio, x Sqrt[5]],
Min[2 + Log10[x], 10]]
}
]

Now, using if above instead of InverseFunction[Fibonacci]:

fast[x_] := (Fibonacci[3 Quotient[Floor @ if[x], 3] + 2] - 1)/2

and applying this to the problem:

fast[4 10^6] //AbsoluteTiming

{0.000239, 4613732}

We can use this function on much larger arguments as well:

fast[
92837410293847120384712309847213048971230498127340912874091273401298374012938741029
] //AbsoluteTiming

{0.002153, 88011840322506983234113472696205625385192191652246095943362996448287672522108009837}

Actually this sum can be closed-form analytically:

(* sum of even-valued Fibonacci terms that do not exceed z *)
sum[z_] := Module[{g, n, f},
g = (1 + Sqrt[5])/2;
n = Floor[Log[Sqrt[5] z]/Log[g]];
f = Round[g^(n + 2)/Sqrt[5]];
(f - 1)/2]

sum[4*^6] // RepeatedTiming
(* {0.0000448, 4613732} *)

sum[1*^100] // RepeatedTiming
(* {0.000045, 12065...3520} *)

I used these identities on mathworld: (8), (22), although one should first recognize that only every third term is even.


# Is it acceptable to have a fraction in an eigenvector?

The professor teaching a class I am taking wants me to find the eigenvalues and the eigenvectors for the following matrix below.

$$\begin{bmatrix}-5 & 5\\4 & 3\end{bmatrix}$$

I have succeeded in getting the eigenvalues, which are $$\lambda= \{ 5,-7 \}$$. When finding the eigenvector for $$\lambda= 5$$, I get $$\begin{bmatrix}1/2\\1 \end{bmatrix}$$. However, the correct answer is $$\begin{bmatrix}1\\2 \end{bmatrix}$$ .

I have tried doing this question using multiple online matrix calculators. One of which gives me $$\begin{bmatrix}1/2\\1 \end{bmatrix}$$, and the other gives me $$\begin{bmatrix}1\\2 \end{bmatrix}$$.

The online calculator that gave me $$\begin{bmatrix}1\\2 \end{bmatrix}$$ explains, that y=2, hence $$\begin{bmatrix}1/2·2\\1·2 \end{bmatrix} = \begin{bmatrix}1\\2 \end{bmatrix}$$.

What I do not understand is, why is y must equal to 2?Is it because there cannot be a fraction in an eigenvector?

• Both are eigenvectors. Eigenvectors are not unique in general. – Arctic Char Nov 30 '19 at 9:32
• A constant times an eigenvector is also an eigenvector. – Ameet Sharma Nov 30 '19 at 10:06
• Conclusion: Any scalar that is multiplied with an eigenvector is still an eigenvector (In the same eigenspace). Even when the eigenvector is multiplied with different scalars, the λ would be the same, Av = λV. *I cannot choose which comment is the best since all of it helped me in understanding the given problem. Thank you all. – Kamarul Adha Nov 30 '19 at 10:36
• For some reason most problems I've encountered (in college) have asked me to find eigenvalues and the corresponding eigenvectors, when in reality what we care about are the eigenvalues and the corresponding eigenspaces. – BallpointBen Nov 30 '19 at 22:43
• @KamarulAdha: Second conclusion: If anyone tells you that $v$ is an eigenvector of a matrix but $2v$ is not, that one does not know mathematics. – user21820 Dec 1 '19 at 15:28

By definition, an eigenvalue $$\lambda$$ and one corresponding eigenvector $$v$$ must satisfy the following equation:

$$Av = \lambda v.$$

Now, consider the vector

$$w = \alpha v,$$

where $$\alpha$$ is a non null number.

Then, notice that:

$$Aw = A(\alpha v) = \alpha (Av) = \alpha (\lambda v) = \lambda (\alpha v) =\lambda w.$$

Therefore:

$$Aw = \lambda w,$$

and hence $$w$$ is another eigenvector associated to the eigenvalue $$\lambda$$.

In general, it is not true that there is only one eigenvector associated to the eigenvalue $$\lambda$$. Instead, there is a linear subspace, also known as the eigenspace associated to $$\lambda$$. Informally, there are infinitely many eigenvectors to $$\lambda$$, which belong to a certain eigenspace. Given one eigenvector (say $$v$$), then all the multiples of $$v$$ except for $$0$$ (i.e. $$w = \alpha v$$ with $$\alpha \neq 0$$) are also eigenvectors.

There are matrices with eigenvectors that have irrational components, so there is no rule that your eigenvector must be free of fractions or even radical expressions. As an example:

$$\begin{bmatrix}1 & 2\\1 & 1\end{bmatrix}$$

Which has eigenvalues of $$1 \pm \sqrt{2}$$ and eigenvectors of $$\begin{bmatrix}\pm\sqrt{2} \\ 1\end{bmatrix}$$

(Additionally, because of the unsolvability of the quintic, there are even eigenvectors that cannot be expressed in elementary functions.)

Because of the form of the equations that you solve to get the eigenvectors, you have infinite solutions to the eigenvectors. Additionally, an eigenvector is only really valuable as a direction. So if any eigenvector can be said to be the "correct" or "most special" one, it's the one that has a norm of 1, or a norm of the associated eigenvalue. However, these can be actually a bit ugly to express.

For our example they are: norm 1, $$\begin{bmatrix}\pm\sqrt{\frac{2}{3}} \\ \sqrt{\frac1{3}}\end{bmatrix}$$ norm $$\lambda$$: $$\frac1{3}\begin{bmatrix}\mp 2\sqrt{3} \pm\sqrt{6} \\ \sqrt{3} \pm \sqrt{6} \end{bmatrix}$$.

That being said, it is, of course, nicer to work with whole numbers when the opportunity arises.

$$\begin{bmatrix}-5 & 5\\4 & 3\end{bmatrix}\begin{bmatrix}\frac12\\1 \end{bmatrix}=\begin{bmatrix}\frac52\\5\end{bmatrix}=5\begin{bmatrix}\frac12\\1 \end{bmatrix}$$

so that $$\begin{bmatrix}\frac12\\1 \end{bmatrix}$$ is undisputably an Eigenvector associated to the Eigenvalue $$5$$.

Calculations with whole numbers are easier than fractions, so people often take eigenvectors with whole numbers for convenience.
For example, $$(1/2,1)$$ and $$(1,2)$$ both normalize to the same vector, but the calculations give you $$\left(\frac{1/2}{\sqrt{5/4}},\frac1{\sqrt{5/4}}\right)\text{ and }\left(\frac1{\sqrt5},\frac2{\sqrt5}\right)$$


# Tetrahedron packing in Cube

I'm thinking about following solid geometry problem.

Q: Suppose you have a box of "cube" shape with edge length 1. Then, How many regular tetrahedrons(with edge length 1) can be in the box?

So, this is kind of packing problem inside cube. I guess the answer is 3. but I don't know how to prove 3 is the maximum number. Is there any rigorous way to show this?

Thanks for any help in advance.

• Here's a Wiki article that may be of interest: en.wikipedia.org/wiki/Tetrahedron_packing The results, which are based off experiment and simulation, hint that a 0.7 to 0.85 packing fraction might be reasonable. Maybe higher. Given that your tetrahedra have a $V\approx0.12$, then the answer could be up to $7$! Edit: I say up to seven, since the article does not make it clear when it's considering finite volumes and even then with what sorts of boundaries. Feb 24, 2016 at 2:22
• @SunTaek Yes, I was completely looking at the wrong item in the table -- oops! Feb 24, 2016 at 2:25
• @zahbaz Thanks for interesting article. hmm...but I cannot construct mental picture of 5 or 6 regular tetrahedron in the unit cube... Feb 24, 2016 at 2:27
• @SunTaek. Agreed. I'll stay tuned to this post. This is an interesting problem. Feb 24, 2016 at 2:28
• I can see some ways to pack two tetrahedra in a cube, same edge length. i would be interested in a diagram or calculations that prove that three is possible. Feb 24, 2016 at 18:32

1. "3" is possible, as shown in following diagram.
The vertices of the red tetrahedron are $$\left(\frac12,-\frac12,\frac12\right),\;\; \left(\frac12,-\frac12,-\frac12\right),\;\; \left(\frac{1}{2\sqrt{2}},\frac{1}{2\sqrt{2}},0\right)\;\;\text{ and }\;\; \left(-\frac{1}{2\sqrt{2}},-\frac{1}{2\sqrt{2}},0\right)$$ The green and blue tetrahedrons can be obtained from the red one by rotating it along the $(1,1,1)$ diagonal for $120^\circ$ and $240^\circ$ respectively.

2. I believe "3" is the maximum number. Following is a heuristic argument:

Let's say we have $n$ tetrahedrons inside a cube. There are $\frac{n(n-1)}{2}$ ways of picking a pair of tetrahedron $A, B$ among them.

Pick a point $a$ from $A$, a point $b$ from $B$ such that the distance $|a-b|$ is maximized. No matter how I place $A$ and $B$, I always get $|a - b| \ge 2\sqrt{\frac23} \approx 1.633$.

Since this value is very close to $\sqrt{3} \approx 1.732$, the diameter of the cube, the points $a, b$ will be very close to the two end points of a diagonal. This means each pair of tetrahedron will occupy at least one diagonals of the cube.

Since a cube has $4$ diagonals and it seems impossible for different pairs of tetrahedron to share a diagonal, we find: $$\frac{n(n-1)}{2} \le 4 \implies n \le 3$$

• amazing! rough, but convincing idea. Thank you So much! By the way, may I ask you which program you used to draw that picture? Feb 25, 2016 at 17:48
• @SunTaek I have some script to generate the figure in X3D format, I then use the javascript library x3dom to display and convert it to a picture inside a web browser (firefox). Feb 25, 2016 at 18:06


# How would I evaluate this series using telescopic summation?

The series is $$\frac{1}{2!} + \frac{2}{3!} + \frac{3}{4!} ... + \frac{n-1}{n!},$$ which I can write as the sum $$\sum_{i=2}^n \frac{i-1}{i!}$$ I will try to evaluate the partial sums to look for a pattern. The first partial sums I get are $$\frac12, \frac56 , \frac{23}{24}$$. Thus, I make the guess that the sum is equal to $$\frac{n!-1}{n!}$$. I have already proven the base cases through experimentation, so I work on proving the induction step. I assume that $$\sum_{i=2}^n \frac{i-1}{i!}= \frac{n!-1}{n!}$$, for some $$n=k$$ so I get $$\sum_{i=2}^k \frac{i-1}{i!}= \frac{k!-1}{k!}$$ Now I prove this holds for $$n=k+1$$ as well. I get $$\sum_{i=2}^{k+1} \frac{i-1}{i!}= \frac{k!-1}{k!} + \frac{k}{(k+1)!} = \frac{(k!-1)(k+1)}{(k+1)!} + \frac{k}{(k+1)!} = \frac{(k+1)!-k-1}{(k+1)!} + \frac{k}{(k+1)!} = \frac{(k+1)!-1}{(k+1)!}$$ Thus the induction step holds as well, proving my expression is indeed the sum. However, this problem was in the telescoping sums section of my mathbook, so I was wondering how you would solve this sum telescopically since these induction proofs take some time.

We have:

$$\sum_{i=2}^{n}\frac{i - 1}{i!} = \sum_{i=2}^{n}\frac{i}{i!} -\frac{1}{i!} = \sum_{i=2}^{n}\frac{1}{(i-1)!} - \frac{1}{i!}$$

$$=\bigg(\frac{1}{1!} - \frac{1}{2!}\bigg)+\bigg(\frac{1}{2!} - \frac{1}{3!}\bigg) +\bigg(\frac{1}{3!}-\frac{1}{4!}\bigg)+\dots+\bigg(\frac{1}{(n-1)!}-\frac{1}{n!}\bigg)$$

Telescoping:

$$=\frac{1}{1!}-\frac{1}{n!} = 1- \frac{1}{n!} = \boxed{\frac{n!-1}{n!}}$$

Hint

$$\frac{n-1}{n!}= \frac{1}{(n-1)!}- \frac{1}{n!}$$ and therefore

$$\sum_{k=1}^n \frac{k-1}{k!} = \sum_{k=1}^n \left(\frac{1}{(k-1)!}- \frac{1}{k!}\right) = 1 - \frac{1}{n!}$$


# Enumerate with two columns

I'd like to have an enumerate with two columns. The first one report the name of the property and the second one can be a multiline text and it should be indented correctly. Thus second columns' text should follow the document's margin.

Something like this:

\begin{enumerate}
\item[] \textbf{Diagonal}, if all its elements outside the main diagonal are equal to zero, that is $\forall i\neq j$, $a_{ij} = 0$
\item[] \textbf{Scalar}, if all off-diagonal elements are zero and all on-diagonal elements are equal
\item[] \textbf{Identity}, if it's scalar and the elements on its main diagonal are all equal to 1, that is $\forall i$, $a_{ii} = 1$
\item[] \textbf{Lower triangular}, if all the entries above the main diagonal are zero, that is $\forall i > j$, $a_{ij} = 0$
\item[] \textbf{Upper triangular}, if all the entries below the main diagonal are zero, that is $\forall i < j$, $a_{ij} = 0$
\end{enumerate}
Below, a brief summary of the matrix operations used:
\begin{enumerate}
\item[] \textbf{Addition}: If $A$ and $B$ are matrices of the same size then the sum $A$ and $B$ is defined by $C = A + B$, where
$$c_{ij} = a_{ij}+b_{ij} \quad \forall i,j$$
\end{enumerate}

Using leandriis' link, this is what I obtained

"Diagonal" has \quad\quad after it, and I would like to indent all the text in the second column "Scalar" is the normal result.

• Will the list be longer than a single page? If not, you could use a table for this. – leandriis May 16 '19 at 11:47
• it'd be, actually. It's a list of properties. – JackLametta May 16 '19 at 11:50
• It sounds like you really want a description environment. If you use the enumitem package it is straightforward to set the widest "report name". – Andrew May 16 '19 at 11:56
• Could you please clarify the desired output? Do you want a number, than the name and then the long text or dou you want your list no be unnumbered? – leandriis May 16 '19 at 11:59
• When using a description environment, I don't think that @leandriis would recommend writing \item[] \textbf{Diagonal} (and likewise for the other list items). Instead, you should write \item[Diagonal], etc. – Mico May 16 '19 at 12:41

A longtable environment may be well suited for your typesetting needs.

You may see fit to adjust the width of the second column depending on (a) the width of the first column and (b) the overall width of the text block.

\documentclass{article}
\usepackage{array,longtable,ragged2e}
\newcolumntype{P}[1]{>{\RaggedRight\arraybackslash}p{#1}}

\begin{document}
\noindent
A matrix is said to be
\begin{longtable}{@{} >{\bfseries}l P{0.6\textwidth} @{}}
Diagonal & if all its elements outside the main diagonal are equal to zero, that is $\forall i\neq j$, $a_{ij} = 0$\\
Scalar & if all off-diagonal elements are zero and all on-diagonal elements are equal\\
Identity & if it is scalar and the elements on its main diagonal are all equal to 1, that is, $\forall i$, $a_{ii} = 1$ \\
Lower triangular & if all the entries above the main diagonal are zero, that is, $\forall i > j$, $a_{ij} = 0$ \\
Upper triangular & if all the entries below the main diagonal are zero, that is, $\forall i < j$, $a_{ij} = 0$
\end{longtable}

\bigskip\noindent
Below, a brief summary of the matrix operations used:
\begin{longtable}{@{} >{\bfseries}l P{0.7\textwidth} @{}}
Addition & If $A$ and $B$ are matrices of the same size then the sum of $A$ and $B$ is defined by $C = A + B$, where
$$c_{ij} = a_{ij}+b_{ij} \quad \forall i,j$$
\end{longtable}
\end{document}

• That's it! But the bold entries are not tabbed. Could you help me with it, please? – JackLametta May 16 '19 at 12:44
• and is it possible to have the same space between the elements that it's present in the document between the rows? – JackLametta May 16 '19 at 12:45
• @JackLametta - Please clarify what you mean by "the bold entries are not tabbed" and " the same space between the elements that it's present in the document between the rows". Thanks. – Mico May 16 '19 at 13:04
• I'd like to have the same interspace that there is between rows of the document also between the element of the longtable. – JackLametta May 16 '19 at 13:05
• @JackLametta - I'm afraid I don't follow you. If the row spacing in the longtable environment is different from that in the rest of your document, it must because you've made some changes to the default line spacing that you haven't told us about so far. – Mico May 16 '19 at 13:31


# Another integral problem

#### paulmdrdo

##### Active member
∫(tan3x/sec2x)dx

this is what i do:

∫(tan3xsec-2x)dx
∫(tan2xtanxsec-1xsec-1x)dx
∫(sec2x-1)tanxsec-1xsec-1x)dx
let u = secx;
du = tanxsecxdx

#### MarkFL

Staff member
Re: another integ problem.

I think my approach would be to rewrite the integrand as follows:

$$\displaystyle \frac{\tan^3(x)}{\sec^2(x)}=\frac{\sin^3(x)}{\cos^3(x)}\cos^2(x)=\frac{-\sin(x)\left(\cos^2(x)-1 \right)}{\cos(x)}$$

Now you should see a $u$-substitution that will work quite nicely.

#### paulmdrdo

##### Active member
Re: another integ problem.

I think my approach would be to rewrite the integrand as follows:

$$\displaystyle \frac{\tan^3(x)}{\sec^2(x)}=\frac{\sin^3(x)}{\cos^3(x)}\cos^2(x)=\frac{-\sin(x)\left(\cos^2(x)-1 \right)}{\cos(x)}$$

Now you should see a $u$-substitution that will work quite nicely.
i used that technique makfl and i get the right answer. but for educational purposes i want to know another way of solving that.

this what i do a while ago.

∫(tan3x/sec2x)dx
∫(tan2xtanx/sec2x)dx

∫(sec2x-1)tanx)/sec2x)dx
∫(sec2xtanx-tanx)/sec2x)dx
∫[(sec2xtanx)/sec2x - tanx/sec2x]dx
∫tanxdx - ∫(tanx/sec2x)dx

ln|secx| - ∫(sinx/cosx*cos2x)dx
ln|secx| - ∫sinxcosxdx

u= sinx; du = cosxdx

ln|secx| - ∫udu
ln|secx| - u2/2
ln|secx| - sin2x/2 + C

is my solution correct..it is different with the one i get when i used the technique you suggested.

#### MarkFL

Staff member
Re: another integral problem.

Yes, your solution is also correct, and many times when we find differing forms for an indefinite integral, we find that they (without the constant of integration) differ only by a constant, which of course is allowed.

So, let's look at the two solutions without the constants:

(1) $$\displaystyle \frac{1}{2}\cos^2(x)-\ln|\cos(x)|$$

(2) $$\displaystyle \ln|\sec(x)|-\frac{1}{2}\sin^2(x)$$

First, we should observe that:

$$\displaystyle \ln|\sec(x)|=\ln|(\cos(x))^{-1}|=-\ln|\cos(x)|$$

So, if we subtract one solution from the other, we should obtain a constant. Subtracting (2) from (1), we get:

$$\displaystyle \frac{1}{2}\cos^2(x)+\frac{1}{2}\sin^2(x)$$

Using a Pythagorean identity, we now have:

$$\displaystyle \frac{1}{2}$$

So, we see that the two solutions differ by a constant, which means they are equivalent as an anti-derivative.

Perhaps a simpler way to look at it is to take the solution you obtained, and rewrite it:

$$\displaystyle \ln|\sec(x)|-\frac{1}{2}\sin^2(x)+C=-\ln|\cos(x)|-\frac{1}{2}\left(1-\cos^2(x) \right)+C=\frac{1}{2}\cos^2(x)-\ln|\cos(x)|+\left(C-\frac{1}{2} \right)$$

Since an arbitrary constant less one half, is still an arbitrary constant, we get:

$$\displaystyle \frac{1}{2}\cos^2(x)-\ln|\cos(x)|+C$$

#### paulmdrdo

##### Active member
Re: another integral problem.

Yes, your solution is also correct, and many times when we find differing forms for an indefinite integral, we find that they (without the constant of integration) differ only by a constant, which of course is allowed.

So, let's look at the two solutions without the constants:

(1) $$\displaystyle \frac{1}{2}\cos^2(x)-\ln|\cos(x)|$$

(2) $$\displaystyle \ln|\sec(x)|-\frac{1}{2}\sin^2(x)$$

First, we should observe that:

$$\displaystyle \ln|\sec(x)|=\ln|(\cos(x))^{-1}|=-\ln|\cos(x)|$$

So, if we subtract one solution from the other, we should obtain a constant. Subtracting (2) from (1), we get:

$$\displaystyle \frac{1}{2}\cos^2(x)+\frac{1}{2}\sin^2(x)$$

Using a Pythagorean identity, we now have:

$$\displaystyle \frac{1}{2}$$

So, we see that the two solutions differ by a constant, which means they are equivalent as an anti-derivative.

Perhaps a simpler way to look at it is to take the solution you obtained, and rewrite it:

$$\displaystyle \ln|\sec(x)|-\frac{1}{2}\sin^2(x)+C=-\ln|\cos(x)|-\frac{1}{2}\left(1-\cos^2(x) \right)+C=\frac{1}{2}\cos^2(x)-\ln|\cos(x)|+\left(C-\frac{1}{2} \right)$$

Since an arbitrary constant less one half, is still an arbitrary constant, we get:

$$\displaystyle \frac{1}{2}\cos^2(x)-\ln|\cos(x)|+C$$
i just want to ask how is ln|secx| = -ln|cosx|... the rest of explanation is enligthening. thanks a lot!

#### MarkFL

Staff member
Re: another integral problem.

Recall the logarithmic property:

$$\displaystyle \log_a\left(b^c \right)=c\cdot\log_a(b)$$

and the definition:

$$\displaystyle \sec(x)\equiv\frac{1}{\cos(x)}=(\cos(x))^{-1}$$

#### soroban

##### Well-known member
Re: another integ problem.

Hello, paulmdrdo!

The integral $$\int \sin x\cos x\,dx$$ is famous
for having different (but equivalent) answers.

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

$$1.\: \int \sin x(\cos x\,dx)$$

Let $$u \,=\,\sin x \quad\Rightarrow\quad du \,=\,\cos x\,dx$$

Substitute: .$$\int u\,du \:=\:\tfrac{1}{2}u^2+C$$

Back-substitute: .$$\tfrac{1}{2}\sin^2x + C$$

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

$$2.\;\int \cos x(\sin x\,dx)$$

Let $$u = \cos x \quad\Rightarrow\quad du = \text{-}\sin x\,dx \quad\Rightarrow\quad \sin x\,dx = \text{-}du$$

Substitute: .$$\int u(\text{-}du) \:=\:\text{-}\int u\,du \:=\:\text{-}\tfrac{1}{2}u^2+C$$

Back-substitute: .$$\text{-}\tfrac{1}{2}\cos^2x + C$$

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

$$3.\;\int\sin x\cos x\,dx \:=\:\tfrac{1}{2}\int2\sin x\cos x\,dx$$

. . . $$=\;\tfrac{1}{2}\int\sin2x\,dx \:=\:\text{-}\tfrac{1}{4}\cos2x + C$$