## Section5.4Intersections of General Surfaces

Although CalcPlot3D does not determine the intersection of two surfaces for you, it does make a great tool for visually checking that the parameterization you have worked out as the intersection of two surfaces is indeed correct.

Below you will find two examples to explore this concept. Hopefully this visualization process will help increase your confidence in and your appreciation for the results you have obtained.

###### Exploration5.4.1

Determine the vector-valued function that traces out the intersection of the surfaces defined by the equations below using the parameter $t\text{.}$

State the answer as a vector-valued function. Then visually verify this result, plotting the two surfaces in CalcPlot3D, and then plotting the curve to check that it really does represent the intersection of these two surfaces.

Here we can let $x=t\text{.}$ Then $y=t^2\text{.}$ What does $z$ equal (as a function of $t$)?

Then the vector-valued function we obtain that traces out the intersection of these surfaces is:

\begin{equation*} \vec{\textbf{r}}(t) = t \hat{\textbf{i}} + t^2 \hat{\textbf{j}} + (t^2 + t^4) \hat{\textbf{k}} \end{equation*}

This represents the same curve as specified by the parametric functions:

\begin{align*} x &= t\\ y &=t^2\\ z &=t^2 + t^4 \end{align*}

Now let’s verify this in CalcPlot3D visually!

a. Open the CalcPlot3D app.

b. Once the app is loaded and active, enter the first function listed above ($z =$ x^2 + y^2) in the default function object on the left and press Enter (or click on the Graph button). The surface plot of this paraboloid should appear in the plot window.

c. Now, to enter the second function, go to the Add to graph dropdown menu (just above the default function), and select Function: y = f (x, z). This will set the function to y = 1 by default. Enter x^2 in the textbox and press Enter (or use the Graph button).

d. To extend the second surface farther up the paraboloid, change the range of $z$ (just below y = x^2) to go from -2 to 4. You may want to use the scroll-wheel on the mouse to zoom-out a little. [Alternatively you could click on the Format Axes button located just to the right of the 3D Mode button. Then set $z$-max to 4. This will automatically change the upper $z$-clip value to 8. Let’s change this value to 4 also.]

e. Make the surfaces semi-transparent using the button or by typing the T key to get a clearer view of the intersection of the surfaces. Press the E key to turn off the edges on the surfaces.

f. Next we need to graph the space curve to see how well it fits the intersection of the surfaces. Select Space Curve: r(t) from the Add to graph dropdown menu. A space curve object should appear just below this menu.

Enter the three parametric equations we obtained (each in terms of $t$). Then enter a range of -2 to 2. If you press Enter on the second value, it should produce the curve on the plot. If it does not appear, click the Graph button.

g. I like the look of this one better with a constant color, so select the checkbox titled Use Constant Primary Color, at the bottom of this object.

h. Finally rotate the graph to see if it looks like we found the correct intersection curve. Except for different coloring, this should look like the image in Figure 5.4.1 below.

###### Exploration5.4.2

Determine the vector-valued function that traces out the intersection of the surfaces defined below, assuming that $y = 2\sin t\text{.}$

State the answer as a vector-valued function. Then visually verify the result, plotting the two surfaces in CalcPlot3D, and then plotting the curve to check that it really does represent the intersection of these two surfaces.

Note that we can parameterize the ellipse given by the first equation with

Now that we've parameterized $x$ and $y\text{,}$ the second surface equation makes it easy to determine $z$ in terms of $t\text{.}$

After simplifying the expression, we obtain, $z = 2 + 2\sin^2 t\text{.}$

Then the vector-valued function we obtain that traces out the intersection of these surfaces is:

\begin{equation*} \vec{\textbf{r}}(t) = \sqrt{2}\cos t \hat{\textbf{i}} + 2\sin t \hat{\textbf{j}} + (2 + 2\sin^2 t) \hat{\textbf{k}} \end{equation*}

This represents the same curve as specified by the parametric functions:

\begin{align*} x &= \sqrt{2}\cos t\\ y &= 2\sin t\\ z &= 2 + 2\sin^2 t \end{align*}

Now let’s verify this in CalcPlot3D visually!

a. Open the CalcPlot3D app.

b. Once the app is loaded and active, enter the second function listed above (z = x2 + y2) in the default function object on the left and press Enter (or click on the Graph button). The surface plot of this paraboloid should appear in the plot window.

c. Now, to enter the first function, which is stated implicitly, go to the Add to graph dropdown menu (just above the default function), and select Implicit Surface. Once this new object definition appears on the left, enter the implicit equation defining the first surface in the textbox and press Enter (or use the Graph button). This surface should look like an elliptic cylinder.

d. To make the intersection more clear, let's first zoom out once using the Zoom-out button, so the $x$- and $y$-axes run from -4 to 4 instead of from -2 to 2. Now click on the Format Axes button located just to the right of the 3D Mode button, and set the upper $z$-clip to 4.

e. Next make the surfaces semi-transparent using the transparency button or by typing the T key to get a clearer view of the intersection of the surfaces. Press the E key to turn off the edges on the surfaces.

f. Next we need to graph the space curve to see how well it fits the intersection of the surfaces. Select Space Curve: r(t) from the Add to graph dropdown menu. A space curve object should appear just below this menu.

Enter the three parametric equations we obtained (each in terms of $t$).

You will enter them like this:

\begin{align*} x &= \textbf{sqrt(2)cos(t)}\\ y &= \textbf{2sin(t)}\\ z &= \textbf{2 + 2(sin(t))\^{}2} \end{align*}

g. Now enter a range of 0 to $2\pi\text{.}$ If you press Enter on the second value, it should produce the curve on the plot. If it does not appear, click the Graph button.

I also like the look of this one better with a constant color, so select the checkbox titled Use Constant Primary Color, at the bottom of this object.

h. Finally rotate the graph to see if it looks like we found the correct intersection curve. This should look like the image in Figure 5.4.2 below.

Notice that the intersection of these two surfaces may appear a little polygonal rather than smooth like the curve we just graphed. This is because we used an implicit surface with the default resolution. To improve this resolution, you can adjust the # Cubes/axis to a higher number, like 25. See the result in Figure 5.4.3.


# Is there a general procedure for inducing a formula / recognizing a pattern?

For some problems, it's pretty simple to deduce what a formula should look like after you enumerate a few examples, but for some problems, it's not so clear. For these less clear examples, is there some procedure I can follow to find the formula?

For example, just now, I was working on the problem:

Find the expected number of tosses it takes to get $$k$$ 6s in a row.

The recursive formula is

$$E[N_k ] = 6(E[N_{k - 1}] + 1)$$

where $$N_k$$ is the number of tosses it takes to get $$k$$ 6s in a row. The initial condition is $$E[N_1] = 6$$ because $$N_1$$ is a geometric random variable with $$1/6$$ probability of success.

Then I enumerated a few cases:

$$E[N_1] = 6 \\ E[N_2] = 42 \\ E[N_3] = 258 \\ E[N_4] = 1554$$

It's not obvious to me what the formula should be. But I think it should look something like $$E[N_k] = 6^k + (k - 1) * \text{something} + \text{maybe other terms}$$

But I don't know what this "something" and "maybe other terms" should be. If I sit here long enough I could probably figure it out, but is there some kind of general procedure that I can apply to a wide array of problems?

• – John Omielan Apr 17 at 20:29

One good way is to try to convert this to a more standard linear recursion.

Letting $$a_n=6(a_{n-1}+1)=6a_{n-1}+6$$

We rewrite this as $$6=a_n-6a_{n-1}=a_{n-1}-6a_{n-2}$$

Whence $$a_n=6a_{n-1}+a_{n-1}-6a_{n-2}=7a_{n-1}-6a_{n-2}$$

and this can now be solved by standard means, yielding $$\boxed{a_n=\frac 65\times \left(6^n-1\right)}$$

• What do you mean by 'standard means' here? – roulette01 Apr 17 at 20:22
• It's a linear recursion, so you look at the characteristic polynomial $x^2-7x+6=(x-1)(x-6)$. Thus the solution is of the form $a_n=A6^n+B$ and then solve for $A,B$ using initial values. – lulu Apr 17 at 20:23
• Ah I see. I've never formally learned recursion. My understanding is there are a lot of analogies between how recursive formulas are solved vs. how ODEs are solved, and this general solution seems to be analogous to formulas in second order ODEs. – roulette01 Apr 17 at 20:25
• If you were to solve this problem without recursion, and by just inspecting the first several enumerations, is there a general approach to guess what that formula should be? – roulette01 Apr 17 at 20:26
• I think guessing is hard. You could guess that $a_n=A6^n+p(n)$ where $p(n)$ is a low degree polynomial...but I don't know how reliable that sort of guesswork is. Works in this case, though. – lulu Apr 17 at 20:28

If you call $$a_k=E[N_k]$$ then you end up with a linear induction relation: $$a_k-6a_{k-1}=6$$

Since it is linear, it solves as the sum of general solution of homegenous equation $$H_k-6H_{k-1}=0$$, which is $$H_k=6^kH_0$$ and one particular solution of the full equation.

The theory says that if the RHS is of the form $$P(k)r^k$$ then you can find a particular solution of the form $$Q(k)r^k$$ with $$\deg(Q)=\deg(P)+m$$ where $$m$$ is the multiplicity of the root of the homogenous equation.

In this case $$RHS = 6\times 1^k$$ and the single root of homogenous equation is $$r=6$$. So the multiplicity of $$1$$ is just $$m=0$$ (i.e. not a root) this means $$\deg(Q)=0+0=0$$.

All that to say that our particular solution is simply a constant...

Therefore let search for $$S_k=c$$ then $$c-6c=6\iff c=-\frac 65$$

Our general solution is then $$a_k=H_k+S_k=6^kH_0-\frac 65$$

We now solve for initial conditions:

$$a_1=6=6H_0-\frac 65\iff H_0=\frac 65$$ and we get $$E[N_k]=\frac 65(6^k-1)$$

is there some kind of general procedure that I can apply to a wide array of problems?

Around 1960 there was some work on a General Problem Solver which had very limited capabilities but much progress has been made since 1960. Still, there is no way to solve all problems and probably never will be.

However, the solution of linear recurrences is known for a long time. For example, $$a_n=6(a_{n-1}+1)=6a_{n-1}+6$$ is easily solved using the theory.

For this particular difference equation with initial value $$\,a_1\!=\!6\,$$ a lookup of $$\,6,42,258,1554\,$$ in OEIS returns OEIS sequence A105281 "a(0)=0; a(n)=6*a(n-1)+6." This entry has a program

(PARI) a(n)=if(n<0, 0, (6^n-1)*6/5)

which gives a formula for the solution.

The Mathematica program has a function RSolve which solves recurrences and also has limited capabilities

You can use the Mathematica (or WolframAlpha) command

RSolve[a[n] == 6 a[n - 1] + 6 && a[1] == 6, a[n], n]

to get the particular solution $$\,a_n = 6 (6^n-1)/5.\,$$


# Math Help - coin tossing

1. ## coin tossing

2 gamblers bet $1 each on the successive tosses of a coin. each as$6. what is the probability that
a. they break even after 6 tosses?
b. one player wins all the money on the tenth toss?

my working:

a. since there are 6 tosses and equal probability of a head and tail,
the ans should be 6 x (0.5)^6

b. in order to win all the money o the other player, he needs to win 8 games and loss 2 games, where the 10th toss have to be a win.

so, (9 choose 7) x ( 0.5)^10

but i didnt get the answer

2. Originally Posted by alexandrabel90
2 gamblers bet $1 each on the successive tosses of a coin. each as$6. what is the probability that
a. they break even after 6 tosses?
b. one player wins all the money on the tenth toss?

my working:

a. since there are 6 tosses and equal probability of a head and tail,
the ans should be 6 x (0.5)^6

b. in order to win all the money o the other player, he needs to win 8 games and loss 2 games, where the 10th toss have to be a win.

so, (9 choose 7) x ( 0.5)^10

but i didnt get the answer
hi alexandrabel90,

for the first one, they both must win 3 times each,
so that's the probability of either winning exactly 3 times and losing exactly 3 times.

for the second one, you must add the probability for the 2 players.
this is different from the first one because one or other could win the game on the 10th go, having won 7 of the preceding 9.

As I read the question we have two players each having $6 to play with. Each player either wins$1 or looses $1 on each toss of the coin. So it is possible for one player of loose all in six tosses- loses six straight. So for both to breakeven in six tosses each would wins three and lose three. Is that a misreading of the question? If not, the answer to part a) is $\frac{\binom{6}{3}}{2^6}$. If it is a misreading, please clarify the question. 4. it is not a misreading of the question. your answer is correct for part (a)..i never think that we would need to count then chances of wining since there is only a 0.5 chance of a win and lose. for part (b),Archie, what do you mean by adding the probability of the 2 players? does it mean (9 choose 7) x ( 0.5)^10 x 2? 5. Hello, alexandrabel90! Two gamblers bet$1 each on the successive tosses of a coin.
Each has $6. .What is the probability that: a. they break even after 6 tosses? They each win 3 games and lose 3 games. There are $_6C_3 \:=\:\frac{6!}{3!\,3!} \:=\:20$ ways this can happen. Answer: . $(20)\left(\frac{1}{2}\right)^3\left(\frac{1}{2}\ri ght)^3 \:=\20)\,\frac{1}{64} \:=\:\frac{5}{16}" alt="(20)\left(\frac{1}{2}\right)^3\left(\frac{1}{2}\ri ght)^3 \:=\20)\,\frac{1}{64} \:=\:\frac{5}{16}" /> b. one player wins all the money on the tenth toss? my working: In order to win all the money of the other player, he needs to win 8 games and loss 2 games, where the 10th toss has to be a win. So: . $_9C_7\left(\tfrac{1}{2}\right)^{10}$ . . . . correct, so far $_9C_7\left(\tfrac{1}{2}\right)^{10} \:=\:\tfrac{36}{1024} \:=\:\frac{9}{256}$ This is the probability that $A$ wins all of $B$'s money on the 10th game. It's also the probability that $B$ wins all of $A$'s money on the 10th game. Therefore: . $P(one\text{ player wins all the money}) \:=\:\frac{9}{256} + \frac{9}{256} \;=\;\frac{9}{128}$ 6. Originally Posted by alexandrabel90 for part (b),Archie, what do you mean by adding the probability of the 2 players? does it mean (9 choose 7) x ( 0.5)^10 x 2? Yes, that was it, because you calculated the probability of only one out of the two winning on the tenth throw. Soroban has shown that really nicely. Plato has made an interesting point also. If we interpret "break-even" as not winning or not losing on one's own throws, then that is 3 wins and 3 losses, but one can break even on one's own throws while the other has more wins than losses or vice versa on their throws. In this situation, one could break even on one's own throws but make a profit if the other player does badly, or make a loss if the other player does well, "if" losing a toss loses a dollar and winning a toss wins a dollar. Or, if the two players lost every time, "player A" wins "player B"'s 6 dollars and "player B" wins "player A"'s 6 dollars, so they break even. They could also both win 1 and lose 5 each, win 2 and lose 4 each, win 4 and lose 2 each, win 5 and lose 1 each, win 6 and lose 0 each. That's the thing with probability questions, quite often open to alternative interpretations. The answer book will distinguish given it's answers. We've been interpreting this as..... If one player loses on a throw, then the second player wins the first player's dollar. In this case then, both would have to win 3 times and lose 3 times to end up with the 6 dollars they began with. It is probably safest to assume there is just 6 tosses rather than 6 each. 7. Originally Posted by alexandrabel90 2 gamblers bet$1 each on the successive tosses of a coin. each as $6. what is the probability that b. one player wins all the money on the tenth toss? Originally Posted by Archie Meade Yes, that was it, Plato has made an interesting point also. If we interpret "break-even" as not winning or not losing on one's own throws, then that is 3 wins and 3 losses, but one can break even on one's own throws while the other has more wins than losses or vice versa on their throws. Look at the way part b) is put. It seems to me that in this game on any toss player A gets a dollar from player B or gives a dollar to player B. That is, A wins or looses on any toss. Moreover, the game is over when one player is out of money. If player A wins in each of the first six tosses she has all of the money in six tosses. If B wins five of the first six tosses he has 11 dollars and she has 1. So the question becomes “how can the game be over in exactly ten tosses?” 8. Brilliant analysis, Plato! it's not over yet. 9. I reckon that, in order for one player to win 8 to 2, the score had to stand at 5-1, at which point one player has$10 and the other has \$2 (win 5 and lose 1... 6+5-1=10, win 1 and lose 5.... 6+1-5=2).

Then the score can go to 6-1 or 5-2.

From 6-1 the score must go to 6-2, since 7-1 would end the game.
From there to 7-2 and then to 8-2.

From 5-2 the score goes to 6-2, to 7-2, to 8-2.

Beginning at 5-1, there are two ways for the leading player to win on the 10th throw.

So, we count the number of ways of getting to a 5-1 lead and double that.

$2\binom{6}{5}=2\binom{6}{1}$

$P=\frac{2(6)}{2^{10}}=\frac{3}{2^8}=\frac{3}{256}$

Then double this to get the result for either player winning by 8 to 2.


## ParthKohli 4 years ago $\Huge \mathsf{\text{Primitive Pythagorean Triplets.}}$

1. ParthKohli

Give it a start, Kingy.

2. KingGeorge

Well, they're triplets of the form $$(a,b,c)$$ such that $$a^2+b^2=c^2$$ and $$\gcd(a,b,c)=1\(. Unknown to many high school students, there are in fact several formulas for generating an infinite number of these triplets. 3. ParthKohli $2n,n^2 - 1, n^2 + 1$? 4. ParthKohli I know one. \(3,4,5$$.

5. KingGeorge

I just can't type that correctly can I? Well, they're triplets of the form $$(a,b,c)$$ such that $$a^2+b^2=c^2$$ and $$\gcd(a,b,c)=1$$. Unknown to many high school students, there are in fact several formulas for generating an infinite number of these triplets.

6. ParthKohli

Another one! $$5,12,13$$!

7. KingGeorge

Correct, (3,4,5) is a triplet as well as (5,12,13) and (7,24,25) among infinite others.

8. ParthKohli

Can you tell me the formula(s) for it, please?

9. KingGeorge

The most well known one is $2mn, \quad m^2-n^2, \quad m^2+n^2$Given any $$m,n$$ such that $$m>n$$.

10. ParthKohli

I see :) Are there any more?

11. KingGeorge

What you gave above, only works for $$m$$ even. So it generates an infinite number, but not all of them.

12. ParthKohli

Can this formula generate all such triplets, or you have to use some other formulae to generate more?

13. anonymous

another one $(x,y,z)=(2k+1,2k^2+2k,2k^2+2k+1)$

14. ParthKohli

Oh wait. It does generate all.

15. KingGeorge

There is also $(a,b,c)=\left(mn,\;\;\frac{m^2-n^2}{2},\;\;\frac{m^2+n^2}{2}\right)$This is a different formula that what I gave above since it only works with $$(m,n)$$ such that $$n>m\ge1$$ and $$\gcd(m,n)=1$$. This does not generate all of them.

16. KingGeorge

Ccorrection, $$m>n\ge1$$.

17. anonymous

if you want them "primitive" makes sure $$m,n$$ are opposite parity, and no common factors

18. ParthKohli

Well. I'd just use the first one :)

19. KingGeorge

Satellite is correct. The first formula I wrote only gives primitive triplets for $$m,n$$ such that $$m-n$$ is odd. And $$\gcd(m,n)=1$$. However, any two positive integers will give you a triplet.

20. anonymous

algebra shows you that $$(m^2-n^2)^2+(2mn)^2=(m^2+n^2)^2$$ if you want a proof that every such triple is generated by such an $$m$$ and $$n$$ try working through the attachment

21. ParthKohli

If $$\gcd(m,n) = 1$$, then it automatically means that $$m - n$$ is odd.

22. anonymous

no, try 5 and 3

23. ParthKohli

Oh grr.

24. anonymous

really, if you have time, work through the worksheet i sent you you will see why all triples come from this formula

25. ParthKohli

Yes, I am looking at it.

26. anonymous

it requires no more than algebra

27. ParthKohli

All set. I got that formula well.

28. KingGeorge

There is also a multitude of fascinating properties of primitive triplets. For example: $$c$$ is always odd. 2,3,4 divide exactly one of $$a$$ or $$b$$, 5 divides exactly one of $$a,b$$ or $$c$$. $$a+b+c$$ is always even among others. These are some of the simpler facts.

29. ParthKohli

30. anonymous

have fun. there are several steps to the proof, but it is all there

31. anonymous

what do you mean by primitive triplets?

32. KingGeorge

$$\gcd(a,b,c)=1$$.

33. anonymous

"primitive" no common factors

34. anonymous

oh

35. anonymous

so 3, 4, 5 but not 6, 8, 10

36. ParthKohli

Whoa! Primitive triplets are $$a,b,c$$ such that $$\gcd(a,b,c) = 1$$. Other words, they all are co-prime.

37. anonymous

@ParthKohli method of obtaining the formula i gave u...we will talk about later if u want... http://openstudy.com/study#/updates/500a7eb3e4b0549a892eeeee

38. ParthKohli

@mukushla I'd see that tutorial tomorrow; tired somewhat at the moment. Looks impressive by looking at it though.

39. anonymous

np...:)

40. ParthKohli

Haha$\Huge \ddot \smile$

41. anonymous

why do we need to have opposite parity? and what's with m-n being odd?

42. ParthKohli

Well. Isn't that the same thing?

43. KingGeorge

$$m-n$$ is odd if and only if they have opposite parity. So either $$m$$ or $$n$$ is odd, but not both.

44. anonymous

i understand that. but is it necessary for m-n to be odd?

45. KingGeorge

If you want a primitive triplet, it is.

46. KingGeorge

If they are both even or both odd, $$\gcd(a,b,c)\ge2$$

47. anonymous

how do i prove it?

48. KingGeorge

Note that $$2mn$$ is always even. Also notice that if $$m,n$$ are both odd, then $$m^2$$ and $$n^2$$ are both odd. If they are both even, $$m^2$$ and $$n^2$$ are both even. Now, $$m^2-n^2$$ and $$m^2+n^2$$ will both be even as well since even-even=even and odd-odd=odd. Hence, $$a,b,c$$ are all even, and their gcd must be divisible by 2.

49. anonymous

that was so easy and so stupid of me to not get it. i am sorry for troubling you on this. if i am to prove 5 exactly divides one of the triplet, is assuming all of them to be non divisible by 5 the right way?

50. KingGeorge

When I first did it, I assumed $$a$$ was not divisible by 5, and deduced that either $$b$$ or $$c$$ was divisible by 5. Then assume $$5$$ divides $$a$$ and show that it doesn't divide $$b$$ or $$c$$. This probably isn't the fastest way to do it thought.

51. anonymous

you can work by cases assume $$m$$ and $$n$$ are not divisible by 5 then prove that either $$m^2-n^2$$ or $$m^2+n^2$$ must be for example, if $$m\equiv n$$ mod 5, then $$m^2-n^2\equiv 0$$ mod 5


# Evaluate $\int \sqrt{1-x^2}\,dx$

I have a question to calculate the indefinite integral: $$\int \sqrt{1-x^2} dx$$ using trigonometric substitution.

Using the substitution $u=\sin x$ and $du =\cos x\,dx$, the integral becomes: $$\int \sqrt{\cos^2 u} \, \cos u \,du = \int \|{\cos u}\| \cos u\, du$$

Q: (part a) At what point (if at all) is it safe to say that this is the equivalent of ? $$\int \cos^2 u\, du = \int \frac {1 + \cos 2u} {2} du$$ (this is easy to solve, btw).

In lectures, it was made abundantly clear that over certain intervals (eg $0 \le u \le \pi/2$) that $cos u$ is +ve and is safe to do so, but in the indefinite form, the same argument cannot be made (eg $\pi/2 \le u \le n\pi$).

Q: (part b) Is it safe to declare it ok due to the nature of the original integral, which, using a sqrt() must return a +ve number? It could then be argued that it was the substitution which artificially added a -ve aspect...

Any suggestions on how to proceed?

PS: This is a 1st year calculus course and am revising for exams ;)

• The original integrand allows for $x$ to be in the interval $[-1,1]$ which means that $\cos$ can be negative. In my experience ignoring this is almost never a problem. Rather than worrying about the details of when $\cos$ is positive or negative, recall that you can always prove that your final answer is correct by showing that its derivative equals the original integrand. – Spencer Jun 22 '14 at 5:21
• The lecturer has been pounding into us the need to think correctly on fundamental concerns, which is why I raise it here. Although I understand I can show equivalency by derivation, it is not a proof (as far as I am aware) – cmroanirgo Jun 22 '14 at 5:37
• The definition of an indefinite integral is that it is the anti-derivative of the integrand (up to an additive constant). There is no more legitimate proof. – Spencer Jun 22 '14 at 5:39
• You have it backwards. To do this with trig substitution, $x=\sin u$, not $u=\sin x$. – alex.jordan Jun 22 '14 at 5:40
• @Spencer I don't think that's right. $x$ is in $[-1,1]$, and since $x=\sin(u)$, well, see my answer below. – alex.jordan Jun 22 '14 at 5:44

Since $x$ ranges from $-1$ to $1$, and you are using the substitution $x=\sin(u)$, you can make this substitution with $u\in[-\pi/2,\pi/2]$, and then $\cos(u)$ is unambiguously positive.

• It was the logic of discussion which had me confused. This clarifies the why. Recognising the limiting domain (to real numbers) from -1 to 1 is the key ingredient. – cmroanirgo Jun 22 '14 at 6:13

You have received good answer which all conclude that $\sqrt{\cos^2 x} = \cos x$.

But, for the time being, let us assume you still ignore if it is safe or not. So, let us write $$\int \sqrt{1-x^2} dx=\pm \int \cos^2 u\, du =\pm \int \frac {1 + \cos 2u} {2} du=\pm \Big(\frac{u}{2}+\frac{1}{4} \sin (2 u)\Big)$$ But now, let us consider the definite integral $$\int_0^1 \sqrt{1-x^2} dx=\pm \int_0^{\frac{\pi}{2}} \cos^2 u\, du =\pm \int_0^{\frac{\pi}{2}} \frac {1 + \cos 2u} {2} du=\pm \frac{\pi}{4}$$ But now, consider now the area between the curve $y=\sqrt{1-x^2}$ and the $x$ axis. All the curve is above the axis and the area is then positive. So, $\pm$ should be just replaced by $+$.

Is this making things clearer ?

Note that there is a difference between substitution as one initially learns it (let $u=g(x)$ and what in the OP is called "trigonometric substitution." The latter process, when one is feeling pedantic, is actually called inverse trigonometric substitution.

In the example we are discussing, the substitution "really is" let $u=\arcsin x$. So $u$ naturally lives in the interval $[-\pi/2,\pi/2]$, and therefore $\cos u$ is non-negative.

Hint: first integrate by parts to get,

$$\int\sqrt{1-x^2}\,\mathrm{d}x=x\sqrt{1-x^2}+\int\frac{x^2}{\sqrt{1-x^2}}\,\mathrm{d}x.$$

Now attempt the trigonometric substitution.

To answer your question: yes, it is safe and doesn't really matter. When you do trig. substitution in your first year calculus course, you are always assuming that $\cos$ is positive as a result you can do:

$$\sqrt{\cos^2 x} = \cos x$$

and not have any problems. Also, take into account what @spencer said; whatever your final answer, you can just find it's derivative and prove yourself right or wrong.

• Absolutely right but for first year, as far as I know, the integral is calculated with keeping in mind that $\cos$ is in between that intervals which you specified, otherwise $\sqrt{\cos^2 x} \rightarrow \cos x$ doesn't make sense. Depending on which textbook you use, go to the trig. substitution chapter and from an example with $\cos x$ it will say specifically that $\cos x$ is bounded between $0 \le x \le \pi/2$ – Jeel Shah Jun 22 '14 at 5:40
• The bounds for the integral and the bounds for the function are not the same. I believe that is where you are confused. All we are saying is that we want to consider $\cos x$ when it is positive and therefore, bound it between those bounds. This doesn't imply that the entire integral is bounded between those. – Jeel Shah Jun 22 '14 at 5:42


# simplify $(a_1 + a_2 +a_3+… +a_n)^m$

How to simplify this best $(a_1 + a_2 +a_3+... +a_n)^m$ for $m=n, m<n, m>n$

I could only get $\sum_{i=0}^{m}\binom{m}{i}a_i^i\sum_{j=0}^{m-i}\binom{m-i}{j}a_j ...$

-
It is already as simple as it gets if you don't have other information on the $a_i$s. – Phira May 30 '12 at 15:06
they are just variable ... let's say like a and b in binomial expansion – Santosh Linkha May 30 '12 at 15:07
Note that Pascal's Tetraedron, then its $4th$ dimensional analogue, then the $5th$, is a graphical way to visualise the multinomial theorem. – Alyosha May 5 '13 at 16:59

The simplification for this type of expansion is done through the multinomial theorem. The multinomial theorem is a generalization of the binomial case to any arbitrary number of terms in the sum to be exponentiated.

The multinomial theorem is written as follows:

$$(x_1 + x_2 + \cdots + x_m)^n = \sum_{k_1+k_2+\cdots+k_m=n} {n \choose k_1, k_2, \ldots, k_m} \prod_{1\le t\le m}x_{t}^{k_{t}}\$$

Where the multinomial co-efficient is defined as:

$${n \choose k_1, k_2, \ldots, k_m} = \frac{n!}{k_1!\, k_2! \cdots k_m!}$$

It may also be useful to you to note that the multinomial co-efficient is always expressible as products of binomial co-efficients [Graham, Knuth, Patashnik, Concrete Mathematics (2nd edition)]:

$${n \choose k_1, k_2, \ldots, k_m} = {x_1+x_2+\cdots+x_m \choose x_2+\cdots+x_m}\cdots{x_{m-1}+x_m \choose x_m}$$

A fuller explanation can be found on Wikipedia, or Wolfram MathWorld

-
is there any relation between $k_1, k_2, ...$ isn't $k_1+k_2+ ...+k_m=n$ again going to be combination of k's?? – Santosh Linkha May 30 '12 at 15:18
The only relation is that the sum of all $k_i$ is equal to n. I do not believe there is an equality relationship such as $k_1>k_2$ or anything like that. – Shaktal May 30 '12 at 15:20
Oh ... thank you both!! – Santosh Linkha May 30 '12 at 15:21

This is called the Multinomial theorem: $$(a_1 + a_2 +a_3+... +a_n)^m=\sum_{k_1+k_2+...+k_n=m}\frac{m!}{k_1!\cdot...\cdot k_n!}a_1^{k_1}\cdot...\cdot a_n^{k_n}$$

-


# Prove that $\frac{a_1}{a_2}+ \frac{a_2}{a_3}+\frac{a_3}{a_4}+…+\frac{a_{n-1}}{a_n} \le \frac{n}{2}$

Let $n \ge 2$ be a positive integer and let $a_1, a_2, ... a_n$ be positive numbers such that $$a_1\le a_2, a_1+a_2\le a_3, a_1+a_2+a_3\le a_4, ... ,a_1+a_2+...+a_{n-1}\le a_n$$ prove that $$\dfrac{a_1}{a_2}+ \dfrac{a_2}{a_3}+\dfrac{a_3}{a_4}+...+\dfrac{a_{n-1}}{a_n} \le \dfrac{n}{2} \hspace{2cm} (1)$$ When does the equality holds?

Solution: I proceed as follows using Mathematical Induction.

For $n=2, \frac{a_1}{a_2} \le 1$. Let the (1) be true for $n=k$ i.e $$\dfrac{a_1}{a_2}+ \dfrac{a_2}{a_3}+\dfrac{a_3}{a_4}+...+\dfrac{a_{k-1}}{a_k} \le \dfrac{k}{2} \hspace{2cm} (2)$$ We need to prove $$\dfrac{a_1}{a_2}+ \dfrac{a_2}{a_3}+\dfrac{a_3}{a_4}+...+\dfrac{a_{k}}{a_{k+1}} \le \dfrac{k+1}{2}$$ Consider $$\dfrac{a_1}{a_2}+ \dfrac{a_2}{a_3}+\dfrac{a_3}{a_4}+...+\dfrac{a_{k-1}}{a_k}+\dfrac{a_{k}}{a_{k+1}} \le \dfrac{k}{2} +\dfrac{a_{k}}{a_{k+1}} \hspace{2cm} (3)$$ Since $$a_1+a_2+...+a_{k-1}+a_{k}\le a_{k+1} \hspace{2cm} (4)$$ also $$a_1+a_2+...+a_{k-1}\le a_{k} \hspace{2cm} (5)$$ Using 5 in 4, we get $$a_{k}+a_{k}\le a_{k+1}$$ $$\dfrac{a_{k}}{a_{k+1}} \le \dfrac{1}{2}$$ using in (3), we get $$\dfrac{a_1}{a_2}+ \dfrac{a_2}{a_3}+\dfrac{a_3}{a_4}+...+\dfrac{a_{k-1}}{a_k}+\dfrac{a_{k}}{a_{k+1}} \le \dfrac{k+1}{2}$$ Is the procedure is correct. And when the equality holds... Thanks for any assistance

• Your proof looks good. As to the question about when equality holds, the clues are right there in your proof. How big can $\frac{a_1}{a_2}$ be? Can you force equality? What about $\frac{a_2}{a_3}, \frac{a_3}{a_4},\ldots$ ? – quasi Jan 7 '17 at 18:36
• How do you get $a_k+a_k \leq a_{k+1}$ from (4) and (5)? – rtybase Jan 7 '17 at 18:42
• Oops -- I fell in the same trap that yasir fell in -- ignore my first comment. Instead, look at rtybase's objection. – quasi Jan 7 '17 at 18:46
• @rtybase Subtracting (5) from (4) – MattG88 Jan 7 '17 at 18:49
• @rtybase -- you can't subtract inequalites that are in the same direction. You can add them, but you can't subtract them. A common illusion (which I fell victim to as well, even though I know better). – quasi Jan 7 '17 at 19:13

The idea is "local adjustments". If $k$ is the smallest integer such that $a_1+\cdots+a_{k-1} < a_k$, we adjust up $a_1$, $\cdots$, $a_{k-1}$ with a scale factor of $s=\frac{\sum_{i=1}^{k}a_i}{2\sum_{i=1}^{k-1}a_i}$ for all, and adjust down $a_k$ by a scale factor of $t=\frac{\sum_{i=1}^{k}a_i}{2a_k}$, and achieve a large value for LFS, and make $\sum_{i=1}{k}a_i=a_k$. Note that since $\sum_{i=1}^{k}a_i$ is not changed, and $a_1$, $\cdots$, $a_{k-1}$ are scaled up by the same factor, all conditions are still satisfied. We just need to prove that really the left hand side gets larger or equal.
Really there is just one case, but let's do three cases: 1) $k=2$, and 2) $k=n$; and 3) $2<k<n$.
1) $k=2$, which means $a_1<a_2$. Now The only values changed are $\frac{a_{1}}{a_2}$ and $\frac{a_{2}}{a_{3}}$, and we want to show that $\frac{a_{1}}{a_2} + \frac{a_{2}}{a_{3}} \le \frac{sa_{1}}{ta_2} + \frac{ta_{2}}{a_{3}}$. This is easy as $s=\frac{a_1+a_2}{2a_1}$ and $t=\frac{a_1+a_2}{2a_2}$, and $sa_1=ta_2=\frac{a_1+a_2}{2}$: $$\frac{a_{1}}{a_2} + \frac{a_{2}}{a_{3}} \le \frac{a_{1}}{a_1} + \frac{a_{1}}{a_{3}} = \frac{sa_{1}}{ta_2} + \frac{a_{1}}{a_{3}} < \frac{sa_{1}}{ta_2} + \frac{ta_{2}}{a_{3}},$$ where the first inequality requires a simple check.
2) $k=n$. This is easy as The only value changed is $\frac{a_{n-1}}{a_n}$ but we scale up $a_{n-1}$ and down $a_n$.
3) $2<k<n$. Now The only values changed are $\frac{a_{k-1}}{a_k}$ and $\frac{a_{k}}{a_{k+1}}$, and we want to show that $\frac{a_{k-1}}{a_k} + \frac{a_{k}}{a_{k+1}} \le \frac{sa_{k-1}}{ta_k} + \frac{ta_{k}}{a_{k+1}}$. Note that since the equality holds for $k-1$, we have $2a_{k-1}=\sum_{i=1}{k-1}a_i$. So $sa_{k-1}= \frac{2a_{k-1}+a_k}{4}$ and $ta_k=\frac{2a_{k-1}+a_k}{2}=2sa_{k-1}$. So we want to prove that $$\frac{a_{k-1}}{a_k} + \frac{a_{k}}{a_{k+1}} \le \frac{1}{2} + \frac{2a_{k-1}+a_k}{2a_{k+1}},$$ which is equivalent to the following after multiplying $2a_ka_{k+1}$: $$2a_{k-1}a_{k+1}+2a_k^2 \le a_ka_{k+1}+(2a_{k-1}+a_k)a_k,$$ which is equivalent to $$(a_{k+1}-a_k)(a_k-2a_{k-1}) \ge 0,$$ which is true since $a_{k+1}>a_k$ and $a_k \ge \sum_{i=1}^{k-1}a_i = 2a_{k-1}$.
So if we adjust up/down all $a_i$ and make all equalities in the condition hold, we achieve the largest value for $\frac{a_1}{a_2}+\cdots+\frac{a_{n-1}}{a_n}$, which happens to be $\frac{n}{2}$.


Class Notes (838,022)
Mathematics (1,919)
MATH 136 (168)
Lecture 20

Lecture 20.pdf

4 Pages
102 Views

School
Department
Mathematics
Course
MATH 136
Professor
Robert Sproule
Semester
Winter

Description
Wednesday, February 26 − Lecture 20: Linear independence Concepts: 1. Linearly independent set. 2. Recognize that subsets of linearly independent sets are linearly independent. 3. Characterize a linearly independent set as one being a set where no vector isa linear combination of the others. 20.1 Definition – Generalization of the definition of linear independence. Let v , v ...., v 1 2, k be k vectors in a vector space V. The vectors v , v ..., v are said to be linearly 1 2, k independent if and only if the only way that α 1 1 α v 2 2.. + α v = 0k k can hold true is if α ,1α ,2....., α kre all zeroes. If v1, v2,.., vkare not linearly independent (i.e. there existsα , α , .1...2 α not alk zero such that α v1 1α v +2 2... + α v = k k then they are said to be linearly dependent. x 20.1.1 Example – We know that the two functions e and sinx are vectors in the set F described above. Then S = Span{e , sinx} = { αe + βsinx : α, β belong to ℝ } is a x subspace of F. Show that the set {e , sinx} is linearly independent. Solution: Let us first recall that two functions f and g are equal on their domain Dif and only if f(x) = g(x) for all x in D. Suppxse αe + βsinx = 0(x) for all x (where 0(x) denotes the zero function; it maps every x in the domain to 0.). x - Suppose there exists α ≠ 0 such that αe + βsinx = 0(x). x - Then e = (–β/α)sinx for all x. This includes the value x = π. - But 0 ≠ e = (–β/α)sinπ = 0, a contradiction. - Then α must be 0. x x - Suppose β ≠ 0 is such that, 0e + βsinx = 0(x). Then (–0/β)e = sinx for all x. - Since sin(π/2) =1 ≠ 0, we have a contradiction. - So β must also be 0. - So {e , sinx} is linearly independent. 20.1.2 Proposition − The vectors M = {v , v , ..1, v2} with k , 2, are linearly independent if and only if no vector in M is a linear combination of the other vectors in M. Proof : This is similar to the previously given proof for the case of V = ℝ . n (⇐) - Suppose none of these vectors is a linear combination of the others. - Suppose M is not linearly independent. - Then there exists α , α 1...2., α not kll zeroes such that α v + α v +1 1..+ α2 2= k k 0. - Suppose α is not zero. Rearrange the order of {v , v , ...., v } so that p = 1, .i.e., p 1 2 k α 1s not zero. - Then v = 1 (α /α )2v +1− (2 /α ) v +3, 1.., 3 − (α /α )v . k 1 k - Hence v is a linear combination of the others. Contradiction. 1 (⇒) - Suppose {v , v1, .2.., v } ks linearly independent. - Suppose one vector of {v , v , .1..,2v } is k linear combination of the others. Say it is v . 1 - Then there exists α ....2, α suck that such that v = α v + 1.... 2 2 v . k k - Then v − 1 v − 2 v2+ , ..3, 3 α v . = 0. k k - Since the coefficient of v is n1t zero this contradicts our hypothesis. - Then no vector of {v , v ,1...2, v } iska linear combination of the others. If a vector in U is a linear combination of the others we will refer to it as being “redundant”. It doesn't contribute anything to its span. 20.2 Definition – Let {v 1, v2,..., vk} be a spanning family for a vector space V. That is, Span{v , v ..., v } = V. Then for every vector v in V there exists scalars α , α , ....., α 1 2, k 1 2 k such that v = α v1 1α v +2 2... + α v . k k If for each vectorv this set of scalars α , α , ..., α satisfying v = α v + α v + ..... + α v 1 2 k 1 1 2 2 k k is unique then we say that Span{v 1, v2,.., v k satisfies the unique representation property with respect to its spanning family. 20.2.1 Example – The spanning family Span{(1, 0), (0,1)} = Span{ e , e } = ℝ 1 2 2 satisfies the unique representation property since for an arbitrary vector v= (a, b) in ℝ , a and b are the unique scalars associated to v so that v = ae + be . 1 2 20.2.2 Theorem − Let S = {v , v , .1..,2v } be a k
More Less

Related notes for MATH 136
Me

OR

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Join to view

OR

By registering, I agree to the Terms and Privacy Policies
Just a few more details

So we can recommend you notes for your school.


# How many ten-digit numbers are there in which every digit is 2 or 3, and no two 3s are adjacent?

How many ten-digit numbers are there in which every digit is 2 or 3, and no two 3s are adjacent?

Taken from the 2008 IMC https://chiuchang.org/wp-content/uploads/sites/2/2018/02/2008-IWYMIC-Individual.x17381.pdf

my attempt

The number of ten digit numbers in which the digits are either 2 or 3 is $$2^{10}$$ and the numbers of ten digit numbers where there is no pair of adjacent numbers that are the same is $$2$$ E.g($$2323232323$$ & $$3232323232$$) and we know that the number of ten digit numbers consisting of pairs of adjacent $$2$$s and adjacent $$3$$s is the same due to symmetry therefore the answer would be $$\frac{2^{10}-2}{2}=511$$ however this doesn't taken into account the possibilities of having adjacent pairs of $$3$$s and $$2$$s in the same number.

• This is the same as this question
– lulu
Sep 24 '19 at 18:45
• And similar to this, more recent, one. Sep 25 '19 at 5:47

Suppose you have r number of 3 in a line. Now we know 3 can't be adjacent so I have to put at least 1 in between them. For example-r=3 |-|-|(| denotes 3 and - denotes 2). Now we have x=10-(r+r-1) 2's remaining. Now we can put these 2's in r+1 slots(in the example we can put in 4 slots slot1|slot2|slot3|slot4). Now this becomes a standard problem Stars and bars of x1+x2+x3+..xl=p (where l denotes the number of slots and where every xi can be 0 and p denotes number of 2 we want to distribute which is x in our case). Number of solution of above equation is given by:

$$\binom {p+l-1}{l-1}$$

here p=10-(r+r-1) and l=r+1(slots) putting these value in above formula we get:

$$\binom {11-r}{r}$$

Now you can vary r from 0-10 and just add them you will get 144 as the answer. Here you can see you do not need to vary from 6 -10 because when we place 6 or more number we don't have enough 2's to put in between them so they will contribute 0.

Suppose you have $$k$$ $$3$$s and it does not end with a $$3$$.

That the same thing as saying you have $$k$$ characters $$32$$ and $$10-k-k=10-2k$$ twos. So of the $$10-2k + k=10-k$$ characters you must choose $$k$$ spaces for the $$k$$ $$32$$ characters. There $${10-k \choose k}$$ ways to do that.

Now suppose you have $$k$$ $$3$$s and it does end with a $$3$$.

If we just ignore the last place and put the $$3$$ in it, that is the same thing as saying you have $$k-1$$ characters $$32$$ to place and $$10-k-(k-1)=11-2k$$ $$2$$s to place. There are $${10-k\choose k-1}$$ ways to do that.

So there are $${10-k \choose k}+ {10-k\choose k-1}$$ ways to place $$k$$ threes.

Now we can have at most $$5$$ threes. (Any more and we won't have enough $$2$$s to go between all $$3$$s.)

So there are

$$\sum_{k=0}^5 {10-k \choose k}+ {10-k\choose k-1}$$ ways. (Assume $${10\choose -1} = 0$$.... after all.... this would be the number of ways to choose $$0$$ threes and have a $$3$$ at the end which isn't possible.)

So $$({10\choose 0}) + ({9\choose 1}+ {9\choose 0}) +({8\choose 2}+{8\choose 1}) + ({7\choose 3}+{7\choose 2}) + ({6\choose 4}+{6\choose3}) + ({5\choose 5} + {5\choose 4})=$$

$$1 + (9+1) + (\frac {8*7}2 + 8) + (\frac {7*6*5}6 -\frac {7*6}2) + (\frac {6*5*4*3}{24}+\frac{6*5*4}6) + (1 +5)=$$

$$1 + 10 +(28+8) + (35+21) + (15+20) + 6=$$

$$11+36+56+35+5=144$$


# Finding the inverse of a number under a certain modulus

How does one get the inverse of 7 modulo 11?

I know the answer is supposed to be 8, but have no idea how to reach or calculate that figure.

Likewise, I have the same problem finding the inverse of 3 modulo 13, which is 9.

The inverses can be computed using the extended euclidean algorithm. As long as $\gcd(x,n) = 1$ the inverse $x^{-1} \bmod n$ exists and is $y$ from the extended euclidean algorithm where $$xy + kn = 1 = \gcd(x,n)$$ For example we get $$7\cdot 8 - 5\cdot 11 = 1\\ 9 \cdot 3 - 2\cdot 13 = 1$$

Note that you can also obtain negative numbers, for example $$7\cdot (-3) + 2\cdot 11 = 1$$ In this case you can use congruences $\bmod n$ to obtain the canonical inverse: $-3 \equiv 8 \pmod{11}$

• Thanks but I'm really struggling with this, could you provide me with a sample, i be stuck for two days trying to figure it out – Dan W May 4 '15 at 12:07
• @DanW What part of this do you struggle with? – AlexR May 4 '15 at 12:09
• Basically, i want to know the inverse of 7 within mod 11, i need a figure!!, i understand the gcd and what it is doing/proving. – Dan W May 4 '15 at 12:20
• @DanW Can you show me what the extended euclidean algorithm gives you wen used for $\gcd(7,11)$? – AlexR May 4 '15 at 12:23
• A B Q R 11 7 1 4 7 4 1 3 4 3 1 1 – Dan W May 4 '15 at 12:28

To find the inverse of $7$, $\pmod{11}$, you must find a solution to $7x\equiv 1 \pmod{11}$. (Then $x$ satisfies the definition of inverse.)

As suggested in other answers, one way to do this is with the extended Euclidean algorithm, and in fact this is the best general purpose algorithm for this type of problem.

But for small values, you can also try 'adding the modulus':

$7x\equiv 1\equiv 12\equiv 23\equiv 34\equiv 45\equiv 56 \pmod{11}$.

Then from $7x\equiv 56\pmod{11}$, we can cancel $7$, obtaining $x\equiv 8 \pmod{11}$.

Here's an illustration of finding the multiplicative inverse of $37 \bmod 100$ using the extended Euclidean algorithm. (I used bigger numbers for this example so that the relationships are a little clearer).

On each line, $n=100s+37t$. We start the table with two lines giving $n=100$ and $n=37$ in the obvious way. Then $q$ gives the rounded-down ratio of the current and previous value of $n$. Using this, the next line is calculated by subtracting $q$ copies of the current line entries from the previous line entries.

$$\begin{array}{c|c|c|c} n & s & t & q \\ \hline 100 & 1 & 0 & \\ 37 & 0 & 1 & 2 \\ 26 & 1 & -2 & 1 \\ 11 & -1 & 3 & 2 \\ 4 & 3 & -8 & 2 \\ 3 & -7 & 19 & 1 \\ 1 & 10 & \color{red}{-27} & 3 \\ \end{array}$$

On the last line, $1 = 10\times 100 + (-27)\times 37$, so $\color{red}{-27}\times 37 \equiv 1 \bmod 100$

Bringing the result positive, $-27 \equiv \color{red}{73} \bmod 100$. And $37 \times 73 = 2701 \equiv 1 \bmod 100 \quad \checkmark$.

As you can perhaps see, you don't actually need to calculate the $s$ values at all to get the modular inverse. I left them in to help understand the table.

The corresponding tables for your particular questions: $$\begin{array}{c|c|c|c} n & s & t & q \\ \hline 11 & 1 & 0 & \\ 7 & 0 & 1 & 1 \\ 4 & 1 & -1 & 1 \\ 3 & -1 & 2 & 1 \\ 1 & 2 & \color{red}{-3} & 3 \\ \end{array}$$ and $7^{-1} \equiv -3 \equiv \color{red}8 \bmod 11$. $\quad 7\times 8 = 56 = 55+1\quad \checkmark$

$$\begin{array}{c|c|c|c} n & s & t & q \\ \hline 13 & 1 & 0 & \\ 3 & 0 & 1 & 4 \\ 1 & 1 & \color{red}{-4} & 3 \\ \end{array}$$ and $3^{-1} \equiv -4 \equiv \color{red}9 \bmod 13$. $\quad 3\times 9 = 27 = 26+1\quad \checkmark$

${\rm mod}\ 11\!:\,\ \dfrac{1}7\equiv \dfrac{12}{-4}\equiv -3\$ (see Gauss's algorithm. for an algorithmic version of this).

Or, compute the Bezout identity $\,\gcd(11,7) = 2(11)-3(7) = 1\,$ by the Extended Euclidean Algorithm  (see here for a convenient version).  Thus $\ {-}3(7)\equiv 1\pmod{11}$

${\rm mod}\ 13\!:\,\ \dfrac{1}3\equiv \dfrac{-12}{3}\equiv -4\$

Generally inverting $\,a\,$ mod $\,m\,$ is easy if $\,a\mid m\pm1,\$ i.e. $\ m = ab\pm 1$

${\rm mod}\ ab-1 \!:\qquad ab\equiv 1\,\Rightarrow\, a^{-1}\equiv b$

${\rm mod}\ ab+1 \!:\,\ a(-b)\equiv 1\,\Rightarrow\, a^{-1}\equiv -b$

Above are special cases: $\,3\mid 13\!-\!1\$ and $\ 7\equiv -4\mid 11\!+\!1$

To find the inverse of $7$ modulo $11$, we must solve the equivalence $7x \equiv 1 \pmod{11}$. To do this, we use the Extended Euclidean Algorithm to express $1$ as a linear combination of $7$ and $11$. The coefficient of $7$ will be the inverse modulo $11$. By the Euclidean Algorithm, \begin{align*} 11 & = 1 \cdot 7 + 4\\ 7 & = 1 \cdot 4 + 3\\ 4 & = 1 \cdot 3 + 1\\ 3 & = 3 \cdot 1 \end{align*} We now take the equation $4 = 1 \cdot 3 + 1 = 3 + 1$, solve for $1$, then work backwards until we obtain $1$ as a linear combination of $7$ and $11$. \begin{align*} 1 & = 4 - 3\\ & = 4 - (7 - 4)\\ & = 2 \cdot 4 - 7\\ & = 2(11 - 7) - 7\\ & = 2 \cdot 11 - 3 \cdot 7 \end{align*} Since $2 \cdot 11 - 3 \cdot 7 = 1$, $$-3 \cdot 7 = 1 - 2 \cdot 11 \Longrightarrow -3 \cdot 7 \equiv 1 \pmod{11}$$ Hence, $-3$ is the inverse of $7 \pmod{11}$. To express the inverse as one of the residues $\{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\}$, we add $11$ to $-3$ to obtain $-3 + 11 \equiv 8 \pmod{11}$. Hence, $7^{-1} \equiv 8 \pmod{11}$.

Check: $7 \cdot 8 \equiv 56 \equiv 1 + 5 \cdot 11 \equiv 1 \pmod{11}$.

To verify you understand the algorithm, try to find the inverse of $3$ modulo $13$.

As said by AlexR, you can find $x,y\in\mathbb Z$ with $7x+11y=1$ using Extended Euclidean algorithm (see this answer for how to best use it).

You can also use elementary modular arithmetic 'tricks':

$\bmod{11}\!:\ 7x\equiv 1\equiv -21\stackrel{:7}\iff x\equiv -3\equiv 8$.

$\bmod{11}\!:\ 7x\equiv -4x\equiv 1\equiv 12\stackrel{:(-4)}\iff x\equiv -3\equiv 8$.

We could divide by $7$ and $-4$ because $(7,11)=(-4,11)=1$.


# Number of Lattice Points in a Triangle

Problem

Let the co-ordinates of the vertices of the $\triangle OAB$ be $O(1,1)$, $A(\frac{a+1}{2},1)$ and $B(\frac{a+1}{2},\frac{b+1}{2})$ where $a$ and $b$ are mutually prime odd integers, each greater than $1$. Then find the number of lattice points inside $\triangle OAB$, i.e., not on the borders of $\triangle OAB$. How does the answer change if the restriction $\operatorname{gcd}(a,b)=1$ is removed?

Solution

Let $L(a,b)$ be the number of lattice points inside $\triangle OAB$. The linear transformation $T(x,y)=(x-1,y-1)$ on the triangle $OAB$ do not have any effect on $L(a,b)$. Hence $L(a,b)$ is equal to the number of lattice points inside the triangle $O'A'B'$, where $O'=(0,0)$, ${\textstyle A'=(\frac{a-1}{2},0)}$ and ${\textstyle B'=(\frac{a-1}{2},\frac{b-1}{2})}$.

Set ${C'=(0,\frac{b-1}{2})}$. By symmetry the number of lattice points inside the rectangle $O'B'C'$ is $L(a,b)$. The number of lattice point inside the rectangle $O'A'B'C'$ is ${\textstyle \frac{a-3}{2} \cdot \frac{b-3}{2}}$. Consequently

$$2L(a,b) = \frac{a-3}{2} \cdot \frac{b-3}{2} - K$$

where $K$ are the number of lattice points on the straight line between $O'$ and $B'$. This line is given by $y= \frac{b-1}{a-1}x$, yielding

$$K = |\{ {\textstyle 0 < x < \frac{a-1}{2} \mid \frac{b-1}{a-1}x \in \mathbb{N} \}| }$$

By letting $d=\text{gcd}(a-1,b-1)$, we obtain $a-1=rd$ and $b-1=sd$ for two positive coprime integers $r$ and $s$. Therefore

$$\frac{b-1}{a-1}x = \frac{sx}{r} \in \mathbb{N} \;\; \Leftrightarrow \;\; \frac{x}{r} \in \mathbb{N}$$

Now ${\textstyle 0 < x < \frac{a-1}{2} = \frac{rd}{2}}$, implying ${\textstyle 0 < \frac{x}{r} = \frac{d}{2}}$. Since $d$ is even (since $d=\gcd(a-1,b-1)$ and $a$ and $b$ are both odd positive integers) give us ${\textstyle K = \frac{d}{2}-1}$. Thus by (1)

$${\textstyle L(a,b) = \dfrac{(a-3)(b-3)}{8} - \dfrac{\text{gcd}(a-1,b-1)}{4} + \dfrac{1}{2}}$$

But I think that by Pick's Theorem the answer should be,

$${\textstyle L(a,b) = \dfrac{(a-1)(b-1)}{8} - \dfrac{\text{gcd}(a-1,b-1)}{4} + \dfrac{1}{2}}$$

Which one is correct?

• You can easily figure out which one is correct by putting in some small values for $a$ and $b$. – Ted Sep 14 '14 at 6:06
• Try $a = 1$ and $b = 10$. This yields a degenerate triangle with $0$ lattice points strictly inside it. Which answer gives you $0$? – JimmyK4542 Sep 14 '14 at 6:17
• @JimmyK4542: Both $a$ and $b$ are odd and mutually prime and each is greater than $1$. – user170039 Sep 14 '14 at 6:26
• Fine, try a less trivial case like $a = 3$ and $b = 5$. The formula in the gray box gives $L(3,5) = 0$ while the other formula gives $L(3,5) = 1$. Which one is right? – JimmyK4542 Sep 14 '14 at 6:27
• There are $0$ lattice points inside the triangle with vertices $O(1,1)$, $A(2,1)$, $B(2,3)$. So the first formula is correct (in that case). I have no idea where the second formula goes wrong because you have left out the details of how you got that. – JimmyK4542 Sep 14 '14 at 6:34

The area of $\Delta OAB$ is $K = \dfrac{1}{2} \cdot \dfrac{a-1}{2} \cdot \dfrac{b-1}{2} = \dfrac{(a-1)(b-1)}{8}$.

The number of points on the boundary (line segments $OA$, $AB$, and $BO$) is

$\underbrace{\dfrac{a-1}{2}}_{OA}+\underbrace{\dfrac{b-1}{2}}_{OB}+\underbrace{\text{gcd}\left(\dfrac{a-1}{2},\dfrac{b-1}{2}\right)}_{BO}$ (you missed the first two terms of this).

So, by Pick's Theorem, the area is

$K = I+\dfrac{1}{2}B-1 = I+\dfrac{1}{2}\left[\dfrac{a-1}{2}+\dfrac{b-1}{2}+\text{gcd}\left(\dfrac{a-1}{2},\dfrac{b-1}{2}\right)\right]-1$

$= I + \dfrac{a-1}{4} + \dfrac{b-1}{4}+\dfrac{\text{gcd}(a-1,b-1)}{4}-1$.

Hence, the number of points in the interior is

$I = \dfrac{(a-1)(b-1)}{8} - \dfrac{a-1}{4} - \dfrac{b-1}{4} - \dfrac{\text{gcd}(a-1,b-1)}{4} + 1$

$= \dfrac{(a-3)(b-3)}{8} - \dfrac{\text{gcd}(a-1,b-1)}{4} + \dfrac{1}{2}$ (after a bit of simplification).


# What is the combinatorial interpretation of the product of binomial coefficients?

Full disclosure: This question is relating to a homework question. It's not a homework question itself, but rather a clarifying question to help myself get a handle on the actual question.

Suppose I had three sets $X$, $Y$, and $Z$ with cardinalities $|X| = x$, $|Y| = y$, and $|Z| = z$, with $z \leq y \leq x$

I know that $x \choose y$ is the number of ways of selecting $y$ elements from $X$.

However, I'm unclear of the combinatorial interpretation of the following:

$${x \choose y} {y \choose z}$$

So my question is: in general, is there an intuitive interpretation for the product of the number of choices?

• If $x\le y\le z$ then both of those coefficients are $0$ – Adam Hughes Sep 19 '14 at 1:50
• You're right, sorry; I'm updating my question now – Jason Baker Sep 19 '14 at 1:51
• There's two interpretations. 1) How many ways are there to first pick $y$ elements out of $x$, and then pick $z$ elements out of these $y$? 2) How many ways are there to divide $x$ into sets of size $z$, $y-z,$ and $x-y$? – Semiclassical Sep 19 '14 at 1:54
• @Semiclassical That makes sense; thanks for the confirmation – Jason Baker Sep 19 '14 at 1:57

The answer to your question is affirmative: Yes, there is an intuitive interpretation for the number of choices.

We know at least two interpretations of the binomial coefficient $\binom{n}{k}$ which are useful for combinatorial proofs. These are

• Set theoretical view: $\binom{n}{k}$ as number of $k$-element subsets of an $n$-element set

• Geometrical view: $\binom{n}{k}$ as number of lattice pathes of length $n$ containing $k$ horizontal $(1,0)$-steps and $n-k$ vertical $(0,1)$-steps

The geometrical view is valid because there are $\binom{n}{k}$ choices to select $k$ steps in horizontal direction leaving the remaining $n-k$ steps for the vertical direction.

Let's apply the second approach to

\begin{align*} \binom{x}{y}\binom{y}{z}\qquad z \leq y \leq x\tag{1} \end{align*}

When looking at $\binom{y}{z}$ you may think on all pathes of length $y$ starting at $A=(0,0)$ and ending in $B=(z,y-z)$ thereby containing exactly $z$ horizontal $(1,0)$-steps and $y-z$ vertical $(0,1)$-steps. All these pathes are enclosed within a rectangle of length $z$ and height $y-z$.

Similarly we consider $\binom{x}{y}$ as the number of lattice pathes of length $x$ containing $y$ $(1,0)$-steps and $x-y$ $(0,1)$-steps. But here we let all these pathes start in $B=(z,y-z)$ and so they end up in $C=(z+y,x-z)$.

We observe following

Combinatorial interpretation of $$\binom{x}{y}\binom{y}{z}$$

This is the number of lattice pathes of length $x+y$ starting in $A=(0,0)$ ending up in $C=(z+y,x-z)$ and passing through the point $B=(z,y-z)$.

The pathes contain only horizontal $(1,0)$-steps and vertical $(0,1)$-steps.

A possible interpretation is pairing sets $X$ and $Y$ with no elements of $Y$ left so that would require selecting $y$ elements from $X$ or $\displaystyle \binom xy$, then making triplets with no elemts of $Z$ left that would require selecting $z$ pairs from these $y$ pairs or $\displaystyle \binom yz$.


# Number of points of accumulation of a sequence

Can a sequence have infinitely many points of accumulation i.e. we can extract infinitely many subsequences from it s.t. they all converge to their respective point of accumulation? I have the feeling it would mean that the period of repetition of something could be infinitely big.

• Since there are countably many rational numbers, there is a sequence that includes them all. The accumulation points of this sequence is the entire set of real numbers. Apr 29 '16 at 17:29
• I like your example a lot ! Apr 29 '16 at 18:15
• There's a classic theorem that if you walk around a circle in discrete steps of $a$ radians, where $a/\pi$ is irrational, then the set of points that you visit is dense in the circle. This implies that $(\sin(an))_{n\in\mathbb N}$ is dense in $[-1, 1]$, and you can take $a=1$ for a cute example of a sequence with infinitely many accumulation points. Apr 29 '16 at 23:16
• See also this question. Some of the posts linked there might be of interest, too. Apr 30 '16 at 8:23

Start with $0,1$. Then travel backwards to $0$ in steps of $1/2$, so $1/2,0$. Then travel forwards to $1$ in steps of $1/4$, so $1/4,2/4,3/4,1$. Then travel backwards to $0$ in steps of $1/8$, so $7/8$, $6/8$, $5/8$, and so on. Continue.

Every real between $0$ and $1$ is an accumulation point of our sequence.

• Your sequence is bounded AND has infinitely many points of accumulation. Thank you for answering :) Apr 29 '16 at 16:28
• @MehdiSlimani: You are welcome. If you prefer we could use $0,1,1/2,0,1/3,2/3,1,3/4,2/4,1/4,0,1/5,2/5,\dots$ and then we can quote the result that the rationals in $[0,1]$ are dense in $[0,1]$. Apr 29 '16 at 16:29
• I'm a bit confused. How can subsequences of your sequence converge if each member is in a different space? Maybe I don't have the necessary knowledge yet Apr 29 '16 at 16:36
• For every real $x$ between $0$ and $1$, there is a subsequence of our sequence that has limit $x$. For in our back and forth travels, we get within $1$ of $x$, then within $1/2$ of $x$, then within $1/4$ of $x$, and so on. With the modified version in which we take steps $1$, then $1/2$, then $1/3$, then $1/4$, then $1/5$, and so on, our travels bring us to every rational between $0$ and $1$, so again there is a subsequence that converges to $x$. Apr 29 '16 at 16:39
• Ok, I hadn't understood it well. Thank you again Apr 29 '16 at 16:43

Yes, this is possible. For example consider the sequence $a_n$ for $n \ge 2$ defined as the smallest divisor of $n$ greater than $1$.

The accumulation points are all the prime numbers. Subsequences witnessing them are for instance the $p$-th powers for each prime $p$.

• Simple and nice example, thank you a lot :) Apr 29 '16 at 16:24

The rationals are a countable set. We can define a 1-to-1 function $f:N\to Q$ with $Q=\{f(n):n\in N\}.$ Consider the sequence $S=(f(n))_{n\in N}.$ Every real number is a limit point of a subsequence of $S.$

All the answers have uncountably many accumulation points. If you only want countably many, consider the sequence:

$1,1,2,1,2,3,1,2,3,4,1,2,3,4,5,\cdots$

Every positive integer is an accumulation point, and nothing else.

If you further want it to be bounded:

$\frac11,\frac11,\frac12,\frac11,\frac12,\frac13,\frac11,\frac12,\frac13,\frac14,\cdots$

Suppose each row of the infinite matrix below converges to a different real number

\begin{bmatrix} a_{11} & a_{12} & a_{13} & a_{14} & \dots \\ a_{21} & a_{22} & a_{23} & a_{24} & \dots \\ a_{31} & a_{32} & a_{33} & a_{34} & \dots \\ a_{41} & a_{42} & a_{43} & a_{44} & \dots \\ \vdots & \vdots & \vdots & \vdots & \end{bmatrix}

Then the sequence

$a_{11}, a_{21}, a_{12}, a_{31}, a_{22}, a_{13}, a_{41},a_{32}, a_{23}, a_{14}, a_{51}, \dots$

contains an infinite number of convergent subsequences.

• Some authors define accumulation point not so strictly, namely that it is enough that a subsequence converges to it. Apr 30 '16 at 9:37


# How many random selections needed to be 90%, 95%, 99% confident that a specific selection occurred?

For example, let's say that I have a bag of 100 marbles labeled 1 to 100. A "selection" is randomly picking a marble from the bag and then placing it back into the bag. The marble selected is not known.

How many random selections do I need to make to be X% confidence that a specific marble was one of the marbles I selected, say marble #42?

Is there a formula or a distribution that helps me solve for X (90%, 95%, 99% confidence)?

Bernoulli or Binomial distributions seem close, but I can not quite make them solve for what I want.

Each time you grab a marble you have a 1 out of 100 chance of selecting the correct one. What you are asking is what are the odds that at least one of these will be correct which would be an inclusive "or" statement

$$P_{selected} = p \cup p \cup p \cup p \cup p... \cup p$$

However this is not trivial to calculate since you could select your marble multiple times. Thus it's better to use the negative of this and calculate when it was not selected.

$$P_{selected}^\sim = (1-p)\cap(1-p)\cap(1-p)(1-p)\cap(1-p)...(1-p)\cap(1-p)$$

which can be easily calculated to N times by

$$P_{selected}^\sim = (1-p)^N$$

Where you can then show

$$P_{selected} = 1- P_{selected}^\sim = 1-(1-p)^N$$

and after some algebra

$$N = \frac{\ln(1-P_{selected})}{\ln(1-p)}$$

so 90% confidence is N = 229.

95% confidence is N = 298

99% confidence is N = 458.

If $X$ has $k$ distinct values, each appearing with equal probability $1/k$, then it follows discrete uniform distribution. Probability of drawing a specific $x$ in a single draw is

$$\Pr(X=x) = \frac{1}{k}$$

probability of drawing value other than $x$ is

$$\Pr(X \ne x) = \frac{k-1}{k} = 1-\frac{1}{k}$$

so if you make $n$ draws, probability that in neither of the draws $x$ is drawn is

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

from here you can easily find that probability of drawing at least one $x$ in $n$ draws is

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

Now all you need to know is find such $n$ that leads to prespecified probability.

This can be easily checked by simulation.

set.seed(123)

f <- function(n, k = 100) 1-((1-1/k)^n)
g <- function() which(sample(100, 1e4, replace = TRUE) == 42)[1]
sim <- replicate(5e4, g())

that returns

> quantile(sim, c(0.9, 0.95, 0.99))
90%    95%    99%
230.00 301.00 460.01
> f(c(230, 301, 460))
[1] 0.9008952 0.9514495 0.9901782

(Notice that example above concerns not with confidence intervals but with exact probabilities.)

This shows us that we need to sample $n$ values until $x$ occurs, so we are talking about negative binomial distributed variable with parameters $p=1/k$ and $r=1$ (observe $n$ values until $X=x$ occurs once, where probability of observing $x$ is $1/k$). Results obtained using negative binomial distribution agree with the simulation.

> pnbinom(c(230, 301, 460)-1, 1, 1/k)
[1] 0.9008952 0.9514495 0.9901782

So you intuition about binomial distribution was close, as it follows negative binomial distribution. Negative binomial with $r=1$ simplifies to geometric distribution. This is how we ended up with distribution that is traditionally used for modeling discrete waiting times.

> pgeom(c(230, 301, 460)-1, 1/k)
[1] 0.9008952 0.9514495 0.9901782

In fact, if you recall, cumulative distribution function for geometric distribution is

$$F(n) = 1 - (1-p)^n$$

where $p$ is a probability of observing $x$ in a single draw. So geometric distribution can be used to obtain confidence intervals for the number of samples that need to be taken.

# 95% CI using quantile function of geometric distribution
> qgeom(c(0.025, 0.975), 1/k)
[1]   2 367

Let $M=100$. Let's say you make $N$ selections and you are looking for the occurrence of marble $m$.

Let $E_n$ be the event that marble $m$ is drawn at draw $n$. Let $F_n=E_n^c$ be the event that marble $m$ is NOT drawn.

Note that $P(E_n)=1/M$. This means, $P(F_n)=1-1/M$.

Let $F$ be the failure event that marble $m$ is not drawn for any $N$. Success is then $F^c$.

$P(F^c)=1-P(F)$

Assuming independent draws, we have:

$P(F)=P(F_1 \cap F_2 \cap F_3 \cap \ldots \cap F_N)=\prod_{n=1}^N P(F_n)=(1-1/M)^N$

Therefore, $P(F^c)=1-(1-1/M)^N$.

For the $c \in [0,1]$ (e.g. $c=0.9 \equiv 90\%$ confidence) confidence, set the LHS to $c$ and solve for $N$.

$\Rightarrow N=\dfrac{\ln(1-c)}{\ln(1-1/M)}$


# Linear Algebra: Preserving the null space

What does it mean when a book says that row operations preserve the null space? And why should that be true? I have read that row operations are equivalent to multiplying a vector on the left by an invertible elementary matrix. And I think I understand that the nullspace is the set of all vectors from $u \in U$ which get mapped to the zero vector in $V$ if $T:U\rightarrow V$ is linear. But I'm still not sure what this means.

-

It means that performing an elementary row operation on a matrix does not change the null space of the matrix. That is, if $A$ is a matrix, and $E$ is an elementary matrix of the appropriate size, then the matrix $EA$ has the same null space as $A$.

To see why this is true, suppose first that $x$ is in the null space of $A$. This means that $Ax=\vec 0$. Multiplying both sides of this equation by $E$, we see that $(EA)x=E\vec 0 =\vec 0$, meaning that $x$ is also in the null space of $EA$. Now suppose that $x$ is in the null space of $EA$, so that $(EA)x=\vec 0$. As you mentioned, $E$ is invertible, so we can multiply this equation by $E^{-1}$:

$$Ax=IAx=(E^{-1}E)Ax=E^{-1}(EA)x=E^{-1}\vec 0=\vec 0\;,$$

showing that $x$ is in the null space of $A$. In other words, a vector is in the null space of $EA$ if and only if it is in the null space of $A$, and $EA$ and $A$ have the same null space.

-
Thanks a lot, the if and only if explanation helps me connect these facts together now! –  mcrocker Feb 12 '12 at 4:32

Say we have $V, W$ vector spaces and a linear transformation $T : V \to W$. The null space of $T$ is defined $N(T) = \{x \in V : T(x) = 0\}$.

When talking about row operations, we are talking about the matrix representation of the linear transformation. So if $\alpha = \{ x_1, ..., x_n \}$ is a basis of $V$ and $\beta = \{ y_1, ..., y_n \}$ is a basis of $W$ we have a matrix, say $A$, such that $A = [T]_\alpha^\beta$.

Say $T(x_i) = a_{i1}y_1 + ... + a_{in}y_n$. Then the matrix A will be the following $$A = \left[\begin{array}{ccc} a_{11} & ... & a_{1n} \\ ... & ... & ... \\ a_{n1} & ... & a_{nn} \end{array}\right].$$

Row operations are as follows
(i) Swap two rows.
(ii) Multiply row by non zero constant.
(iii) Add multiple of one row to a different row.

Say we swap the $i$th and $j$th row and call the new matrix $A'$. This new matrix defines a new linear transformation $T':V \to W$ such that $T'(x) = A'x$. We want to show that $N(T) = N(T')$. For any $x \in V$, say $$T(x) = b_1y_1 + ... + b_iy_i + ... + b_jy_j + ... + b_ny_n.$$ Then since $T'$ is just rows swapped $$T'(x) = b_1y_1 + ... +b_jy_j + ... + b_iy_i + ... b_ny_n.$$ Thus if $T(x) = 0$, $T'(x) = 0$ and vice versa. So $N(T) = N(T')$.

For (ii), think about if we multiply the $i$th row by $\beta$, then if the $i$th scalar for $T(x)$ is $c_i$, then the $i$th scalar for $T'(i)$ is $\beta c_i$. So if $T(x) = 0$, then $c_i = 0$, so $\beta c_i = 0$. All other scalars stay the same, thus $T'(x) = 0$. And if $T'(x) = 0$, $\beta^{-1}c_i = 0$, so $T(x) = 0$. Once again $N(T) = N(T')$.

I leave (iii) to you.

-

For what it's worth, I think the following way of thinking about why row operations do not change the null space is worthwhile:

An important observation to make:

One may observe that multiplication of a matrix $A$ by a column vector $\bf x$ amounts to taking a linear combination of the columns of $A$. The coefficients of the particular linear combination are the coordinates of $\bf x$.

For example: $$\tag{1} \underbrace{\left[ \matrix{a_{11}&a_{12}&a_{13} \cr a_{21}&a_{22}&a_{23}\cr a_{31}&a_{32}&a_{33} }\right]}_{A} \left[\matrix{x\cr y\cr z}\right] =\left[\matrix{x a_{11} +ya_{12}+ z a_{13} \cr x a_{21} +ya_{22}+ z a_{23} \cr x a_{31} +ya_{32}+ z a_{33}} \right] = x\underbrace{\left[\matrix{\color{maroon}{a_{11}}\cr\color{darkgreen}{ a_{21}}\cr \color{darkblue}{a_{31}}}\right]}_{\bf a_1} +y\underbrace{\left[\matrix{\color{maroon}{a_{12}}\cr\color{darkgreen}{ a_{22}}\cr \color{darkblue}{a_{32}}}\right]}_{\bf a_2} +z\underbrace{\left[\matrix{\color{maroon}{a_{13}}\cr\color{darkgreen}{ a_{23}}\cr\color{darkblue}{ a_{33}}}\right]}_{\bf a_3}$$

A second important observation to make:

$\bf x$ is in the null space of $A$ if and only if $A{\bf x}=\bf0$. This means that the linear combination of the columns of $A$ whose coefficients are the coordinates of ${\bf x}=\Bigl[{\textstyle{x\atop y}\atop\scriptstyle z }\Bigr]$ is the zero vector:

$$\tag{2} x\underbrace{\left[\matrix{\color{maroon}{a_{11}}\cr\color{darkgreen}{ a_{21}}\cr \color{darkblue}{a_{31}}}\right]}_{\bf a_1} +y\underbrace{\left[\matrix{\color{maroon}{a_{12}}\cr\color{darkgreen}{ a_{22}}\cr \color{darkblue}{a_{32}}}\right]}_{\bf a_2} +z\underbrace{\left[\matrix{\color{maroon}{a_{13}}\cr\color{darkgreen}{ a_{23}}\cr\color{darkblue}{ a_{33}}}\right]}_{\bf a_3} =\bf0$$

Now on to row operations:

Here, we make our third and final observation:

If one performs a row operation on $A$, then the corresponding right hand side of $(1)$ is obtained by performing the same row operation to each of ${\bf a_1}$, ${\bf a_2}$, and ${\bf a_3}$.

It follows from all of this that multiplying a row of $A$ by a non-zero number does not affect the null space. For example if row 1 of $A$ were multiplied by 2 then the right hand side of (1) would be: $$x\underbrace{\left[\matrix{\color{maroon}{2a_{11}}\cr\color{darkgreen}{ a_{21}}\cr \color{darkblue}{a_{31}}}\right]}_{\bf a_1} +y\underbrace{\left[\matrix{\color{maroon}{2a_{12}}\cr\color{darkgreen}{ a_{22}}\cr \color{darkblue}{a_{32}}}\right]}_{\bf a_2} +z\underbrace{\left[\matrix{\color{maroon}{2a_{13}}\cr\color{darkgreen}{ a_{23}}\cr\color{darkblue}{ a_{33}}}\right]}_{\bf a_3} =\bf z$$ If (2) holds, it is easily seen that ${\bf z}=\bf0$.

It should be fairly obvious that interchanging two rows of $A$ does not affect the null space. For example if rows 1 and 3 of $A$ were interchanged, the right hand side of (1) would become $$x\left[\matrix{\color{darkblue}{ a_{31}}\cr \color{darkgreen}{ a_{21}}\cr \color{maroon}{ a_{11}}}\right] +y\left[\matrix{\color{darkblue}{ a_{32}}\cr \color{darkgreen}{ a_{22}}\cr \color{maroon}{ a_{12}}}\right] +z\left[\matrix{\color{darkblue}{ a_{33}}\cr\color{darkgreen}{ a_{23}}\cr\color{maroon}{ a_{13}}}\right] =\bf z$$ If (2) holds, then $\bf z$ would be $\bf 0$.

Finally, if a multiple of a row of $A$ were added to another row of $A$, the null space would be unchanged. For example if twice row 1 of $A$ were added to to row 2, then the right hand side of $(1)$ would become:

$$\tag{3} x\left[\matrix{\color{maroon}{ a_{11}}\cr \color{darkgreen}{ a_{21}}+2\color{maroon}{ a_{11}}\cr\color{darkblue} a_{31}}\right] +y\left[\matrix{\color{maroon}{ a_{12}}\cr\color{darkgreen}{ a_{22}}+2 \color{maroon}{a_{12}}\cr\color{darkblue} a_{32}}\right] +z\left[\matrix{\color{maroon}{ a_{13}}\cr\color{darkgreen}{ a_{23}}+2 \color{maroon}{a_{13}}\cr\color{darkblue} a_{33}}\right] =\bf z$$

If $(2)$ holds, then $\bf z=0$. In particular, looking at the second component of the left hand side of $(3)$: \eqalign{ x(\color{darkgreen}{a_{21}}+2\color{maroon}{a_{11}})+ y(\color{darkgreen}{a_{22}}+2\color{maroon}{a_{12}})+ z(\color{darkgreen}{a_{23}}+2\color{maroon}{a_{13}}) &= (x \color{darkgreen}{a_{21}}+ y \color{darkgreen}{a_{22}}+ z \color{darkgreen}{a_{23}} )\cr &\ \ \ \ \ \ \ +2( x\color{maroon}{a_{11}} + y\color{maroon}{a_{12}}+ z\color{maroon}{a_{13}} )\cr&=0+2\cdot0\cr&=0}.

-

I think the most natural way to think about this is to note that the kernel of a matrix is also the orthogonal complement to the column-space of it's transpose. (this is the fundamental theorem of linear algebra)

So when you do row operations on a matrix, this is the same as doing linear combinations of the columns in it's transpose. This doesn't change the overall space spanned by those columns in the transpose, so it doesn't change the kernel of the original matrix.

-


# Is it more practice and intuition or rather algorithmic to solve third degree polynomials of this type?

Consider

$x^3 - 6x^2 + 11x - 6 = 0$

I can not reasonably factor this intuitively in any short amount of time with my skill level. Is this the only hope to solving such equations by hand? What tools can I use to help ease the pain or make it more clear to myself?

I try to:

$(x + ?)(x^2 - 6x)$ but it does not seem promising, in my eyes

I cant do anything, that I know about, with:

$x(x^2 - 6x + 11) = 6$

I don't want to give up, but I do anyway and ask my calculator, there is three solutions, alas I have no idea how that helps me (with my knowledge, it does not)!

Should I just practice with smaller polynomials more, and this one might look easier?

Any suggestions are appreciated, I will tag this as homework because it should be.

-
Note that trying to factorize anything as $x(x^2-6x+11)=6$ is almost useless, since $6$ need not factor nicely. The rare instance when such a factorization is useful, is for example $(x+1)(x+2)(x+3)=6$, in which case we can observe that $x=0$ is a root. –  Calvin Lin Jan 14 '13 at 20:21
Do you mean $6x^2$ instead of $6x$? –  Git Gud Jan 14 '13 at 20:22
Yes, sorry forgot to square that one. –  Leonardo Jan 14 '13 at 20:23
You should also know that there are closed formulas to get the roots of polynomials of degree up to 4. –  Git Gud Jan 14 '13 at 20:28

If you have a polynomial with integer coefficients of the form $$p(x) = x^n + a_{n-1} x^{n-1} + a_{n-2} x^{n-2} + \cdots + a_1 x + a_0$$ and if you have any hope of factorizing this "nicely", you first need to check if the divisors of the constant term, $a_0$, are factors. In your case, I assume the correct polynomial you are interested in is $p(x) = x^3 - 6x^2+11x-6$. The divisors of $-6$ are $\{\pm1,\pm2, \pm3, \pm6\}$. A quick check reveals that $x^*=1,2,3$ satisfy $p(x^*) = 0$. Hence, we have $$x^3 - 6x^2 + 11x - 6 =(x-1)(x-2)(x-3)$$

-
Luckily this is a nice equation, thank you I have at least one extra tool in my belt and I will need to read up more on the rational root theorem among other things. Your answer is very clear and concise. –  Leonardo Jan 14 '13 at 20:27

Your equation is $$x^3-6x^2+11x-6=0$$ The coefficients of the equation are $1,-6,+11,-6$ and the summation of them is $$1-6+11-6=0$$ Whenever you face to this fact, you always have $x=1$ as one solution. In fact the equation has a factor as form $x-1$. It means that $$x^3-6x^2+11x-6=(x-1)(ax^2+bx+c)$$ for some proper available constants $a,b,c$.

-
I kind of get what you and Will Jagy are saying, but it will take time to absorb. The only thing that is immediately obvious from your last equations is that c = 6. I appreciate your helps. –  Leonardo Jan 14 '13 at 20:22
@Leonardo: Look at Marvis's. I noted some points just for starting. He gave you the answer in detailed. –  Babak S. Jan 14 '13 at 20:25

$x=1$ is an evident solution. Therefore we can write $$x^3 - 6 x^2 + 11 x - 6 = (x-1)(a x^2 + b x + c)$$ and solve for $a,b,c$ carefully. Then the rest is the quadratic formula.

I suppose the main advice is to check for integer roots and rational roots before factoring, when you have no feeling for what is going on in the problem. There is a Rational Roots Theorem that applies here.

-

$$x^3 - 6x^2 + 11x - 6 =0$$ $$x^3 -1-( 6x^2 - 11x + 6)+1 =0$$ $$x^3 -1-( 6x^2 - 11x + 5) =0$$ $$x^3 -1-( 6x^2 - 6x-5x + 5) =0$$ $$(x-1)(x^2+x+1)-( 6x(x-1)-5(x-1) =0$$ $$(x-1)(x^2+x+1)-(x-1)(6x-5) =0$$ $$(x-1)(x^2+x+1-6x+5) =0$$ $$(x-1)(x^2-5x+6) =0$$ $$(x-1)(x^2-2x-3x+6=0$$ $$(x-1)(x(x-2)-3(x-2)=0$$ $$(x-1)(x-2)(x-3)=0$$ $$x_1=1,x_2=2,x_3=3$$

-
Nice Adi,nice. ;-) –  Babak S. Jan 14 '13 at 20:26
My brain does not work like yours, but I hope it starts to soon. –  Leonardo Jan 14 '13 at 20:29
thank you Babak –  Adi Dani Jan 14 '13 at 23:31

You need to know a few things. For example if $p(x)$ is a polynomial of odd degree with rational coefficients it will necessarily have a real root.

Another useful fact is that if $a$ is a root of $p(x)=x^3+px^2+qx+r=0$ then $(x-a)$ is a factor of $p(x)$. This works because: $x^3-a^3=(x-a)(x^2+ax+a^2)$ and $x^2-a^2=(x-a)(x+a)$ so if $p(a)=0$ we can write:$$p(x)=p(x)-p(a)=[x^3-a^3]+p[x^2-a^2]+q[x-a]=(x-a)([x^2+ax+a^2]+p[x+a]+q)$$

We also note that if $p,q,r,a \in \mathbb Z$, then if $p(a)=a(a^2+pa+q)+r=0$ then $a$ must be a factor of $r$.

[There are various generalisations and extensions of these comments].

So one thing we do when faced with a cubic with integer coefficients to factorise is to try the factors ($\pm$) of the constant term as "easy candidates" - and once we have one factor we can divide through and solve the remaining quadratic.

-


# Which Grows Faster: Factorial or Double Exponentiation

Which of the functions among $$2^{3^n}$$ or $$n!$$ grows faster?

I know that $$n^n$$ grows faster than $$n!$$ and $$n!$$ grows faster than $$c^n$$ where $$c$$ is a constant, but what is it in my case?

• It isn't a proof, but evaluate the expressions with $n$ in the range 1 to 10 and see just how phenomenally fast $2^{3^n}$ grows compared to $n!$ – John Coleman Nov 26 '19 at 0:20
• Write down the values for 1 ≤ n ≤ 10. You can't? Why can't you? – gnasher729 Nov 26 '19 at 13:18
• Why is this in CS instead of Mathematics? – Barmar Nov 26 '19 at 21:08
• @Barmar because it's related to CS in terms of time complexity. Indeed, in this question, there is not a hard border between math and CS. – OmG Nov 27 '19 at 15:14
• – Will Ness Nov 27 '19 at 16:36

You can find the result by taking a $$\log$$. Hence:

$$\log(2^{3^n}) = 3^n$$ $$\log(n!) \leqslant \log(n^n) = n\log n$$

(In the latter equation, we have used the fact that $$n! \leqslant n^n$$, as you note in the question.)

Of course $$3^n$$ grows faster than $$n \log n$$. As $$\log$$ is an increasing function, we can say $$2^{3^{n}}$$ grows faster than $$n^n$$, and also $$n!$$.

• Beware, however, that $\log(f) = O(\log(g))$ does not imply $f = O(g)$, in general. For instance, take $f(n)=n^2$ and $g(n)=n$. – chi Nov 26 '19 at 19:07
• @chi You are right. But, it is true if $\log(f) = o(\log(g))$. – OmG Nov 26 '19 at 19:56
• Another question related with taking log and solving and its danger is given in this link--> cs.stackexchange.com/questions/117584/… – Turing101 Nov 28 '19 at 15:19

Another way to directly compare the two expressions is to take the ratio of consecutive terms:

$$\frac{2^{3^{n+1}}}{2^{3^n}}=2^{2\cdot 3^n}\gg 3^n\gg n+1=\frac{(n+1)!}{n!}$$

(for positive integers $$n$$), and clearly also $$2^{3^1}=8>1!$$, so $$2^{3^n}$$ indeed grows more rapidly than $$n!$$.

• The discussion of $2^{3^1}$ is unnecessary. – leftaroundabout Nov 27 '19 at 1:56
• @leftaroundabout, I guess that's true if you assume the >> signs are significantly greater than, but that's not very rigorous (and if they are only > signs it would then depend on your definition of "grows more rapidly") – boboquack Nov 27 '19 at 7:43
• Well, they only need to be “significantly” greater in a very weak sense, namely the ratio needs to be $>1+\varepsilon$. That is clearly given in this case, specifically $\frac{3^n}{n+1} > 1.5\quad \forall n>0$. – leftaroundabout Nov 27 '19 at 12:05

You noted in your question that $$n^n$$ grows faster than $$n!$$, and that’s a great starting point for comparing the growth of $$2^{3^n}$$ and $$n!$$. Specifically, let’s ask - of $$n^n$$ and $$2^{3^n}$$, which grows faster?

To answer that, let’s try rewriting $$n^n$$ so that it has the same exponential base as $$2^{3^n}$$. Since $$n = 2^{\log_2 n}$$, we have that

$$n^n = (2^{\log_2 n})^n = 2^{n \log_2 n}.$$

Now, is it easier to see how $$n^n$$ and $$2^{3^n}$$ relate?

As a note, this approach is similar to taking the base-2 logs of both expressions. I thought it would be good to include this here because it gives a slightly different perspective on how to arrive at the answer given your initial observation.

Induction.

Base case: $$n=1$$ gives $$2^{3^1}=8$$ and $$1!=1$$ which clearly holds.

Hypothesis: suppose that $$2^{3^k}>k!$$ for some $$k\in\Bbb N$$.

Consider $$n=k+1$$. Then $$2^{3^{k+1}}=2^{3^k\cdot3}>(k!)^3=(k+1)!\cdot\frac{k!(k-1)!}{1+\frac1k}>(k+1)!$$ which is true $$\forall k>1$$ and thus the result follows.

• I tend to interpret "which grows faster?" questions as "whose big-Oh set is bigger?". With that interpretation, this post answers something different. (E.g. $x \mapsto x$ and $x \mapsto (x+1)$ are in the same big-Oh set, but in the spirit of this post the latter grows faster.) – ComFreek Nov 26 '19 at 12:02
• @ComFreek I would really have to question that interpretation. Which grows faster, $f(x) = x$ or $g(x) = 2x$? I think by any reasonable meaning of the words "grow" and "faster", $2x$ grows faster than $x$. My definition of grows faster would be $f(x)$ grows faster than $g(x)$ if there exists an $x_0$ beyond which $f'(x)$ is always greater than $g'(x)$. – Apollys supports Monica Nov 27 '19 at 23:36
• That being said, this proof certainly doesn't prove anything about growth rates. Plug in the functions $f(x) = -1/x$ and $g(x) = 0$ (on the domain $x > 0$) into your proof and you conclude that $g(x)$ grows faster than $f(x)$. This is obviously wrong since $g(x)$ never grows and $f(x)$ never doesn't grow! – Apollys supports Monica Nov 27 '19 at 23:42


# Bounding an expression involving digamma function

Let $\psi$ be the digamma function. I have a conjecture that

$$\frac ax > \log(x) - \psi(x)$$

holds for all $x > 0$ if (and only if) $a \ge 1$. I do not know how to prove it. Please help.

-

Let

$$f(x) = \frac{1}{2}\coth\left(\frac{x}{2}\right) - \frac{1}{x}.$$

Then for $x > 0$, we have

$$f'(x) = \frac{1}{x^2} - \frac{1}{4\sinh^2(x/2)} = \frac{1}{x^2}\left(1 - \left(\frac{x/2}{\sinh (x/2)} \right)^2 \right) > 0.$$

This shows that $f(x)$ is increasing. Also, it is easy to find that $f(0+) = 0$ and $\lim_{x\to\infty} f(x) = \frac{1}{2}$. Thus we find that $0 < f(x) < \frac{1}{2}$ for $0 < x < \infty$ and hence the Laplace transform $\mathcal{L}f(s) = \int_{0}^{\infty} f(x) \, e^{-sx} \; dx$ of $f(x)$ satisfies

$$0 < \mathcal{L}f(s) < \int_{0}^{\infty} \frac{1}{2} \, e^{-sx} \; dx = \frac{1}{2s}.$$

But we also have

\begin{align*} \mathcal{L}f(s) &= \int_{0}^{\infty} \left( \frac{1}{2}\coth\left(\frac{x}{2}\right) - \frac{1}{x} \right) e^{-sx} \; dx\\ &= \left[ \left( \log \sinh \left(\frac{x}{2} \right) - \log x + \log 2 \right) e^{-sx} \right]_{0}^{\infty} \\ &\qquad + s \int_{0}^{\infty} \left( \log \sinh \left(\frac{x}{2} \right) - \log x + \log 2 \right) e^{-sx} \; dx \\ &= s \int_{0}^{\infty} \left( \frac{x}{2} - \log (sx) + \log s + \log \left(1 - e^{-x} \right) \right) e^{-sx} \; dx \\ &= \frac{1}{2s} + \gamma + \log s - s \int_{0}^{\infty} \sum_{n=1}^{\infty} \frac{e^{-(n+s)x}}{n} \; dx \\ &= \frac{1}{2s} + \gamma + \log s - \sum_{n=1}^{\infty} \frac{s}{n(n+s)} \\ &= \frac{1}{2s} + \log s - \psi_0(1+s), \end{align*}

where we have used the fact that $\int_{0}^{\infty} e^{-x} \log x \; dx = -\gamma$ and

$$\psi_0(1+x) = -\gamma + \sum_{n=1}^{\infty} \frac{x}{n(n+x)}.$$

Finally, since $\psi_0(1+s) = \frac{1}{s} + \psi_0 (s)$, we have

$$\frac{1}{2s} < \log s - \psi_0(s) < \frac{1}{s}.$$

Therefore the inequality holds if $a \geq 1$ and only if $a > \frac{1}{2}$.

Now we prove that $a = 1$ is the sharp bound. We are to calculate the limit

$$\alpha = \lim_{x\to 0} x(\log x - \psi_0(x)).$$

But by our previous calculations,

\begin{align*}\alpha &= \lim_{s\to 0} s(\log s - \psi_0(s)) \\ &= \lim_{s\to 0} s\left( \frac{1}{2s} + \mathcal{L}f(s) \right) \\ &= \frac{1}{2} + \lim_{s\to 0} s \int_{0}^{\infty} f(x) \, e^{-sx} \; dx \\ &= \frac{1}{2} + \lim_{s\to 0} \int_{0}^{\infty} f(u/s) \, e^{-u} \; du \qquad (u = sx) \\ &= \frac{1}{2} + \int_{0}^{\infty} \lim_{s\to 0} f(u/s) \, e^{-u} \; du \\ &= \frac{1}{2} + \int_{0}^{\infty} \frac{1}{2} \, e^{-u} \; du \\ &= 1. \end{align*}

Thus if $\frac{a}{x} > \log x - \psi_0 (x)$ is true for all $x > 0$, then we must have $a \geq \alpha = 1$, as desired.

-
This is a cool technique. (There's a typo after you switch summation and integral.) –  Tunococ Aug 16 '12 at 18:25
@Tunococ, Thanks. Also I fixed the typo. Even I cannot believe how I made such a mistake! :) –  sos440 Aug 17 '12 at 3:36

Recently I happened to find out that Qi et al (J. Math. Anal. Appl. 310 (2005) 303–308) proved the following inequality, among others, for digamma function $\psi(x)$ when $x>0$:

$$\frac{1}{2x} < \log x - \psi(x) < \frac{1}{2x} + \frac{1}{12x^2}$$

This inequality is sharper than the one given by @sos440 above when x>1/6.

-