# How to find answer to the sum of series $\sum_{n=1}^{\infty}\frac{n}{2^n}$

I have put his on wolfram and obtained answer as follows:

$\sum_{n=1}^{\infty}\frac{n}{2^n} = 2$

And the series is convergent too because $\lim_{n\to\infty} \frac {n}{2^n} = 0$

However I am wondering if there is a convenient way to solve this; I don't think you can represent it by a geometric progression either. So how do we have to do it on paper?

• Of course the fact that $\lim_{n \to \infty} \frac{n}{2^n} \to 0$ doesn't imply that the series is convergent. – Amateur Apr 17 '14 at 2:49
• Differentiate the geometric series. – Bitrex Apr 17 '14 at 2:50

Let $S$ be our sum. Then $S=\frac{1}{2}+\frac{2}{2^2}+\frac{3}{2^3}+\frac{4}{2^4}+\cdots$. Thus \begin{align}2S&=1+&\frac{2}{2}+\frac{3}{2^2}+\frac{4}{2^3}+\frac{5}{2^4}+\cdots\\ S&=&\frac{1}{2}+\frac{2}{2^2}+\frac{3}{2^3}+\frac{4}{2^4}+\cdots\end{align} Subtract. We get $$S=1+\frac{1}{2}+\frac{1}{2^2}+\frac{1}{2^3}+\frac{1}{2^4}+\cdots=2.$$

Hint:

$$\sum_{k=1}^{\infty} x^k = \frac{x}{1-x} \implies \sum_{k=1}^{\infty} kx^k=\frac{d}{dx} \frac{x}{1-x} .$$

• Want to understand why we can differentiate. – deostroll Apr 17 '14 at 4:14
• @deostroll: We can differentiate a power series within its radius of convergence. – Mhenni Benghorbal Apr 17 '14 at 4:21
• @deostroll The technical result allowing us to do this is the following: First, power series $\sum \alpha_n x^n$ converge absolutely and uniformly on any closed subset of their (open) interval of convergence. (This follows from the $M$-test.) Second, the (formal) series of their termwise derivative, $\sum n\alpha_n x^{n-1}$, has the same radius of convergence. (Cont.) – Andrés E. Caicedo Apr 19 '14 at 3:11
• @deostroll Third, and this is the technical part, if a sequence $f_n$ of differentiable functions defined on some closed interval satisfies that (1) $f_n'\to g$ uniformly, and (2) $f_n(x_0)$ converges (as $n\to\infty)$ for some $x_0$, then (a) $f_n$ converges uniformly to some differentiable function $f$, and (b) $f'=g$. To apply this, take as $f_n$ the partial sums of the given power series. A proof of this theorem appears for instance in Rudin's Principles of mathematical analysis, see Theorem 7.17. (Cont.) – Andrés E. Caicedo Apr 19 '14 at 3:15
• @deostroll The assumption is technical, but cannot really be relaxed: Even if we assume that $f_n\to f$ uniformly, that $f$ is differentiable, and that $f_n'\to g$ pointwise, we may have that $f'(x)\ne g(x)$ for all $x$. This is a (remarkably recent!) theorem of Darji, see here. – Andrés E. Caicedo Apr 19 '14 at 3:17

Another way to do the problem is to note that $$\left(\sum_{k=1}^\infty \frac{1}{2^k}\right)^2 = \sum_{k=1}^\infty \frac{k-1}{2^k}$$ so that the desired series is really just $$\left(\sum_{k=1}^\infty \frac{1}{2^k}\right)^2 + \sum_{k=1}^\infty \frac{1}{2^k}$$

If $\displaystyle S=\sum_{n=1}^\infty\frac{n}{2^n}$, then $$S-\frac12=\sum_{n=1}^\infty\frac{n+1}{2^{n+1}}=\frac12\sum_{n=1}^\infty\frac{n+1}{2^n}=\frac12\left(S+\sum_{n=1}^\infty\frac1{2^n}\right)=\frac12(S+1),$$ so $2S-1=S+1$, or $S=2$.

All that remains is to justify that the series converges. But $n<1.1^n$ for $n$ large enough, so a tail of $S$ is bounded above by a tail of the convergent geometric series $\sum_n\left(\frac{1.1}2\right)^n$.

In this answer we go for the 'one trick pony' approach - all we know is that for $$k \ge 0$$,

$$\tag 1 \sum_{n=k}^{\infty}\frac{1}{2^n} = 2^{1-k}$$

We decompose the summands of $$\sum_{n=1}^{\infty}\frac{n}{2^n}$$ in a natural/straightforward manner, arranging these numbers into a table:

$$\begin{pmatrix} \frac{1}{2} & \frac{1}{4} & \frac{1}{8} & \frac{1}{16} & \frac{1}{32} & \dots \\ 0 & \frac{1}{4} & \frac{1}{8} & \frac{1}{16} & \frac{1}{32} & \dots \\ 0 & 0 & \frac{1}{8} & \frac{1}{16} & \frac{1}{32} & \dots \\ 0 & 0 & 0 & \frac{1}{16} & \frac{1}{32} & \dots \\ 0 & 0 & 0 & 0 & \frac{1}{32} & \dots \\ 0 & 0 & 0 & 0 & 0 & \dots \\ . \\ . \\ . \\ \end{pmatrix}$$

Using $$\text{(1)}$$ we add up the entries in each row,

$$\begin{pmatrix} 1 \\ \frac{1}{2} \\ \frac{1}{4} \\ \frac{1}{8} \\ \frac{1}{16} \\ . \\ . \\ . \\ \end{pmatrix}$$

And now we add up the entries of our column vector, giving


# Math Help - [SOLVED] Differential Equation Geometry/Word Problem Help!

1. ## [SOLVED] Differential Equation Geometry/Word Problem Help!

Hi everyone, I'm currently having trouble mentally grasping this question I have:

Find the equation of the curve that goes through (1,3) for which any tangent and the line from the origin to the point of contact make with the ordinate a triangle having area A.

I have been trying several approaches to this, but to no avail. I assume it can be set up as a first-order differential equation of some sort. I've defined the curve as a, the tangent line as b, and the line from the point of tangency to the origin as c. I also defined a random point along the curve (alpha, beta). Thus,

$b(x)=beta+a'(alpha)*(x-alpha)$
$c(x)=beta/alpha * x$

EDIT: The area of the triangle, A, could also be found with one of the following:
$A_1=int(b(x))-int(c(x))$
$A_2=(1/2)(b)(h)=(1/2)(b(0))(alpha)=(1/2)(beta+a'(alpha)*(x-alpha))$

I have verified that, in fact, $A_1=A_2$.

Any insight would be greatly appreciated!

2. [According to Wikipedia, the ordinate is another name for the y-axis. I never came across that terminology before.]

I find that a, b, c, alpha, beta, ... notation hard to follow, so I'll use other letters. Suppose the curve is given by y=f(x), and let $(x_0,y_0)$ be a point on the curve. The tangent at this point has equation $y-y_0=f'(x_0)(x-x_0)$. It meets the y-axis at the point $(0,y_1)$, where y_1 is given by $y_1-y_0 = -f'(x_0)x_0$.

If we take the triangle to have its base along the y-axis then its base is $\pm y_1$ ( the +/- is needed because we don't know whether y_1 is positive or negative) and its height is x_0. So its area is given by $\textstyle A=\pm\frac12x_0y_1 = \pm\frac12x_0(y_0-x_0f'(x_0))$.

At this stage we need to change the notation. Up until now, $(x_0,y_0)$ has been fixed. But in order to get a differential equation for f(x), we need to see what happens as $(x_0,y_0)$ varies. The best thing to do is to drop the zero subscripts and to replace f'(x_0) by dy/dx (or just y'). Then the previous equation becomes $x(y-xy') = \pm2A$. At last, we have a differential equation!

You'll need to use an integrating factor to solve the equation, and then to use the initial condition that y=3 when x=1. There are two solutions, corresponding to the +/- sign in the equation.

3. Hello, bherila!

Find the equation of the curve that goes through (1,3)
for which any tangent and the line from the origin to the point of contact
make with the ordinate a triangle having area $A$.
Code:
        |
*                 * y = f(x)
|    *
|        *       *
|             *  P(p,q)
|           o /
|       o   /
|   o     /
B o       /
|     /
|   /
| /
- - * - - - - - - - - - - -
|O
|

We have a function: $y \,=\,f(x)$

Let $P(p,q)$ be a point on $y \,=\,f(x).$

$OP$ is the segment from the origin to point $P.$

$BP$ is the tangent at $P$.
. . The slope of this tangent is $y'$ and it contains $P(p,q).$
. . Its equation is: . $y - q \:=\:y'(x - p)\quad\Rightarrow\quad y \:=\:y'x - y'p + q$
. . Its y-intercept is: . $B(0,\,q - py')$

The base of $\Delta OBP$ is: . $OB \:=\:q - py'$
The height of the triangle is: . $p$

The area of $\Delta OBP\!:\;\;\frac{1}{2}(q - py')p \;=\;A$

\. . which simplifies to: . $p^2y' - pq \:=\:-2A$

Divide by $p^2\!:\;\;y' - \frac{1}{p}\,q \:=\:-\frac{2A}{p^2}$

Hence, we have: . $\frac{dy}{dx} - \frac{1}{x}\,y \;=\;-\frac{2A}{x^2}$

Integrating factor: . $I \:=\:e^{\int\left(-\frac{1}{x}\right)dx} \:=\:e^{-\ln x} \:=\:e^{\ln\frac{1}{x}} \:=\:\frac{1}{x}$

So we have: . $\frac{1}{x}\,\frac{dy}{dx} - \frac{1}{x^2}\,y \;=\;-\frac{2A}{x^3}$

Then: . $\frac{d}{dx}\left(\frac{1}{x}\!\cdot\!y\right) \;=\;-2Ax^{-3}$

Integrate: . $\frac{1}{x}\!\cdot\!y \;=\;-Ax^{-2} + C$

Multiply by $x\!:\;\;y \;=\;-\frac{A}{x} + Cx$

Since $(1,3)$ is on the curve,
. . $3 \;=\;-\frac{A}{1} + C\quad\Rightarrow\quad C \:=\:A + 3$

Therefore: . $\boxed{y \;=\;-\frac{A}{x} + (A + 3)x}$

4. The other solution is $\boxed{y =\frac{A}{x} + (3-A)x}$.

5. Originally Posted by Soroban
Hello, bherila!

Code:
        |
*                 * y = f(x)
|    *
|        *       *
|             *  P(p,q)
|           o /
|       o   /
|   o     /
B o       /
|     /
|   /
| /
- - * - - - - - - - - - - -
|O
|

We have a function: $y \,=\,f(x)$

Let $P(p,q)$ be a point on $y \,=\,f(x).$

$OP$ is the segment from the origin to point $P.$

$BP$ is the tangent at $P$.
. . The slope of this tangent is $y'$ and it contains $P(p,q).$
. . Its equation is: . $y - q \:=\:y'(x - p)\quad\Rightarrow\quad y \:=\:y'x - y'p + q$
. . Its y-intercept is: . $B(0,\,q - py')$

The base of $\Delta OBP$ is: . $OB \:=\:q - py'$
The height of the triangle is: . $p$

The area of $\Delta OBP\!:\;\;\frac{1}{2}(q - py')p \;=\;A$

\. . which simplifies to: . $p^2y' - pq \:=\:-2A$

Divide by $p^2\!:\;\;y' - \frac{1}{p}\,q \:=\:-\frac{2A}{p^2}$

Hence, we have: . $\frac{dy}{dx} - \frac{1}{x}\,y \;=\;-\frac{2A}{x^2}$

Integrating factor: . $I \:=\:e^{\int\left(-\frac{1}{x}\right)dx} \:=\:e^{-\ln x} \:=\:e^{\ln\frac{1}{x}} \:=\:\frac{1}{x}$

So we have: . $\frac{1}{x}\,\frac{dy}{dx} - \frac{1}{x^2}\,y \;=\;-\frac{2A}{x^3}$

Then: . $\frac{d}{dx}\left(\frac{1}{x}\!\cdot\!y\right) \;=\;-2Ax^{-3}$

Integrate: . $\frac{1}{x}\!\cdot\!y \;=\;-Ax^{-2} + C$

Multiply by $x\!:\;\;y \;=\;-\frac{A}{x} + Cx$

Since $(1,3)$ is on the curve,
. . $3 \;=\;-\frac{A}{1} + C\quad\Rightarrow\quad C \:=\:A + 3$

Therefore: . $\boxed{y \;=\;-\frac{A}{x} + (A + 3)x}$

very nice. that was a lot easier than i thought it would be. Good stuff as always, Soroban!!!


# 5.3: Properties of Set Operations

PREVIEW ACTIVITY $$\PageIndex{1}$$: Exploring a Relationship between Two Sets

Let $$A$$ and $$B$$ be subsets of some universal set $$U$$.

1. Draw two general Venn diagrams for the sets $$A$$ and $$B$$. On one, shade the region that represents $$(A \cup B)^c$$, and on the other, shade the region that represents $$A^c \cap B^c$$. Explain carefully how you determined these regions.
2. Based on the Venn diagrams in Part (1), what appears to be the relationship between the sets ((A \cup B)^c\) and $$A^c \cap B^c$$?

Some of the properties of set operations are closely related to some of the logical operators we studied in Section 2.1. This is due to the fact that set intersection is defined using a conjunction (and), and set union is defined using a disjunction (or). For example, if $$A$$ and $$B$$ are subsets of some universal set $$U$$, then an element $$x$$ is in $$A \cup B$$ if and only if $$x \in A$$ or $$x \in B$$.

1. Use one of De Morgan’s Laws (Theorem 2.8 on page 48) to explain carefully what it means to say that an element $$x$$ is not in $$A \cup B$$.
2. What does it mean to say that an element $$x$$ is in $$A^c$$? What does it mean to say that an element $$x$$ is in $$B^c$$?
3. Explain carefully what it means to say that an element $$x$$ is in $$A^c \cap B^c$$.
4. Compare your response in Part (3) to your response in Part (5). Are they equivalent? Explain.
5. How do you think the sets $$(A \cup B)^c$$ and $$A^c \cap B^c$$ are related? Is this consistent with the Venn diagrams from Part (1)?

PREVIEW ACTIVITY $$\PageIndex{2}$$: Proving that Statements Are Equivalent

1. Let $$X$$, $$Y$$, and $$Z$$ be statements. Complete a truth table for
$$[(X \to Y) \wedge (Y \to Z)] \to (X \to Z)$$.

2. Assume that $$P$$, $$Q$$, and $$R$$ are statements and that we have proven that the following conditional statements are true:

$$\bullet$$ If $$P$$ then $$Q (P \to Q)$$.
$$\bullet$$ If $$R$$ then $$P (R \to P)$$.
$$\bullet$$ If $$Q$$ then $$R (Q \to R)$$.

Explain why each of the following statements is true.

(a) $$P$$ if and only if $$Q (P \leftrightarrow Q$$.
(b) $$Q$$ if and only if $$R (Q \leftrightarrow R$$.
(c) $$R$$ if and only if $$P (R \leftrightarrow P$$.
Remember that $$X \leftrightarrow Y$$ is logically equivalent to $$(X \to Y) \wedge (Y \to X)$$.

## Algebra of Sets – Part 1

This section contains many results concerning the properties of the set operations. We have already proved some of the results. Others will be proved in this section or in the exercises. The primary purpose of this section is to have in one place many of the properties of set operations that we may use in later proofs. These results are part of what is known as the algebra of sets or as set theory.

Theorem 5.17

Let $$A$$, $$B$$, and $$C$$ be subsets of some universal set $$U$$. Then

• $$A \cap B \subseteq A$$ and $$A \subseteq A \cup B$$.
• If $$A \subseteq B$$, then $$A \cap C \subseteq B \cap C$$ and $$A \cup C \subseteq B \cup C$$.
Proof

The first part of this theorem was included in Exercise (7) from Section 5.2. The second part of the theorem was Exercise (12) from Section 5.2.

The next theorem provides many of the properties of set operations dealing with intersection and union. Many of these results may be intuitively obvious, but to be complete in the development of set theory, we should prove all of them. We choose to prove only some of them and leave some as exercises.

Theorem 5.18: Algebra of Set Operations

Let $$A$$, $$B$$, and $$C$$ be subsets of some universal set $$U$$. Then all of the following equalities hold.

Proporties of the Empty Set $$A \cap \emptyset = \emptyset$$ $$A \cap U = A$$ and the Universal Set $$A \cup \emptyset = A$$ $$A \cup U = U$$

Idempotent Laws $$A \cap A = A$$ $$A \cup A = A$$

Commutative Laws $$A \cap B = B \cap A$$ $$A \cup B = B \cup A$$

Associative Laws $$(A \cap B) \cap C = A \cap (B \cap C)$$
$$(A \cup B) \cup C = A \cup (B \cup C)$$

Distributive Laws $$A \cap (B \cup C) = (A \cap B) \cup (A \cap C)$$
$$A \cup (B \cap C) = (A \cup B) \cap (A \cup C)$$

Before proving some of these properties, we note that in Section 5.2, we learned that we can prove that two sets are equal by proving that each one is a subset of the other one. However, we also know that if $$S$$ and $$T$$ are both subsets of a universal set $$U$$, then

$$S = T$$ if and only if for each $$x \in U$$, $$x \in S$$ if and only if $$x \in T$$.

We can use this to prove that two sets are equal by choosing an element from one set and chasing the element to the other set through a sequence of “if and only if” statements. We now use this idea to prove one of the commutative laws.

Proof of One of the Commutative Laws in Theorem 5.18

We will prove that $$A \cap B = B \cap A$$. Let $$x \in A \cap B$$. Then

$x \in A \cap B \text{ if and only if } x \in A \text{ and } x \in B.$

However, we know that if $$P$$ and $$Q$$ are statements, then $$P wedge Q$$ is logically equivalent to $$Q \wedge P$$. Consequently, we can conclude that

$x \in A \text{ and } x \in B \text{ if and only if } x \in B \text{ and } x \in A.$

Now we know that

$x \in B \text{ and } x \in A \text{ if and only if } x \in B \cap A.$

This means that we can use (5.3.1), (5.3.2) and (5.3.3) to conclude that

$$x \in A \cap B$$ if and only if $$x \in B \cap A$$,

and, hence, we have proved that $$A \cap B = B \cap A$$.

$$\square$$

Progress Check 5.19: Exploring a Distributive Property

We can use Venn diagrams to explore the more complicated properties in Theorem 5.18, such as the associative and distributive laws. To that end, let $$A$$, $$B$$, and $$C$$ be subsets of some universal set $$U$$.

1. Draw two general Venn diagrams for the sets $$A$$, $$B$$, and $$C$$. On one, shade the region that represents $$A \cup (B \cap C$$, and on the other, shade the region that represents $$(A \cup B) \cap (A \cup C)$$. Explain carefully how you determined these regions.
2. Based on the Venn diagrams in Part (1), what appears to be the relationship between the sets $$A \cup (B \cap C$$ and $$(A \cup B) \cap (A \cup C)$$?

Add texts here. Do not delete this text first.

Proof of One of the Distributive Laws in Theorem 5.18

We will now prove the distributive law explored in Progress Check 5.19. Notice that we will prove two subset relations, and that for each subset relation, we will begin by choosing an arbitrary element from a set. Also notice how nicely a proof dealing with the union of two sets can be broken into cases.

Proof. Let $$A$$, $$B$$, and $$C$$ be subsets of some universal set $$U$$. We will prove that $$A \cup (B \cap C) = (A \cup B) \cap (A \cup C)$$ by proving that each set is a subset of the other set.

We will first prove that $$A \cup (B \cap C) \subseteq (A \cup B) \cap (A \cup C$$. We let $$x \in A \cup (B \cap C)$$. Then $$x \in A$$ or $$x \in B \cap C$$.

So in one case, if $$x \in A$$, then $$x \in A \cup B$$ and $$x \in A \cup C$$. This means that $$x \in (A \cup B) \cap (A \cup C)$$.

On the other hand, if $$x \in B \cap C$$, then $$x \in B$$ and $$x \in C$$. But $$x \in B$$ implies that $$x \in A \cup B$$, and $$x \in C$$ implies that $$x \in A \cup C$$. Since $$x$$ is in both sets, e conclude that $$x \in (A \cup B) \cap (A \cup C)$$. So in both cases, we see that $$x \in (A \cup B) \cap (A \cup C)$$, and this proves that $$A \cup (B \cap C) \subseteq (A \cup B) \cap (A \cup C$$.

We next prove that $$(A \cup B) \cap (A \cup C) \subseteq A \cup (B \cap C)$$. So let $$y \in (A \cup B) \cap (A \cup C)$$. Then, $$y \in A \cup B$$ and $$y \in A \cup C$$. We must prove that $$y \in A \cup (B \cap C)$$. We will consider the two cases where $$y \in A$$ or $$y \notin A$$. In the case where $$y \in A$$, we see that $$y \in A \cup (B \cap C)$$.

So we consider the case that $$y \notin A$$. It has been established that $$y \in A \cup B$$ and $$y \in A \cup C$$. Since $$y \not in A$$ and $$y \in A \cup B$$, $$y$$ must be an element of $$B$$. Similarly, since $$y \notin A$$ and $$y \in A \cup C$$, $$y$$ must be an element of $$C$$. Thus, $$y \in B \cap C$$ and, hence, $$y \in A \cup (B \cap C)$$.

In both cases, we have proved that $$y \in A \cup (B \cap C)$$. This proves that $$(A \cup B) \cap (A \cup C) \subseteq A \cup (B \cap C)$$. The two subset relations establish the equality of the two sets. Thus, $$A \cup (B \cap C) = (A \cup B) \cap (A \cup C)$$.

$$square$$

## Important Properties of Set Complements

The three main set operations are union, intersection, and complementation. The- orems 5.18 and 5.17 deal with properties of unions and intersections. The next theorem states some basic properties of complements and the important relations dealing with complements of unions and complements of intersections. Two relationships in the next theorem are known as De Morgan’s Laws for sets and are closely related to De Morgan’s Laws for statements.

Theorem 5.20

Let $$A$$, $$B$$, and $$C$$ be subsets of some universal set $$U$$. Then the following are true:

Basic Properties $$(A^c)^c = A$$
$$A - B = A \cap B^c$$

Empty Set and Universal Set $$A - \emptyset = A$$ and $$A - U = \emptyset$$
$$\emptyset ^c = U$$ and $$U^c = \emptyset$$

De Morgan's Laws $$(A \cap B)^c = A^c \cup B^c$$
$$(A \cup B)^c = A^c \cap B^c$$

Subsets and Complements $$A \subseteq B$$ if and only if $$B^c \subseteq A^c$$

Proof

We will only prove one of De Morgan’s Laws, namely, the one that was explored in Preview Activity $$\PageIndex{1}$$. The proofs of the other parts are left as exercises. Let $$A$$ and $$B$$ be subsets of some universal set $$U$$. We will prove that $$(A \cup B)^c = A^c \cap B^c$$ by proving that an element is in $$(A \cup B)^c$$ if and only if it is in $$A^c \cap B^c$$. So let $$x$$ be in the universal set $$U$$. Then

$x \in (A \cup B)^c \text{ if and only if } x \notin A \cup B.$

and

$x \notin A \cup B \text{ if and only if } x \notin A \text{ and } x \notin B.$

Combining (5.3.4) and (5.3.5), we see that

$x \in (A \cup B)^c \text{ if and only if } x \notin A \text{ and } x \notin B.$

$x \notin A \text{ and } x \notin B \text{ if and only if } x \in A^c \text{ and } x \in B^c.$

and this is true if and only if $$x \in A^c \cap B^c$$. So we can use (5.3.6) and (5.3.7) to conclude that

$$x \in (A \cup B)^c$$ if and only if $$x \in A^c \cap B^c$$.

and, hence, that $$(A \cup B)^c = A^c \cap B^c$$.

$$\square$$

Progress Check 5.21: Using the Algebra of Sets

1. Draw two general Venn diagrams for the sets $$A$$, $$B$$, and $$C$$. On one, shade the region that represents $$(A \cup B) - C$$, and on the other, shade the region that represents $$(A - C) \cup (B - C)$$. Explain carefully how you determined these regions and why they indicate that $$(A \cup B) - C = (A - C) \cup (B - C)$$.

It is possible to prove the relationship suggested in Part (1) by proving that each set is a subset of the other set. However, the results in Theorems 5.18 and 5.20 can be used to prove other results about set operations. When we do this, we say that we are using the algebra of sets to prove the result. For example, we can start by using one of the basic properties in Theorem 5.20 to write

$$A \cup B) - C = (A \cup B) \cap C^c$$.

We can then use one of the commutative properties to write

$\begin{array} {rcl} {(A \cup B) - C} &= & {(A \cup B) \cap C^c} \\ {} &= & {C^c \cap (A \cup B).} \end{array}$

2. Determine which properties from Theorems 5.18 and 5.20 justify each of the last three steps in the following outline of the proof that $$(A \cup B) - C = (A - C) \cup (B - C)$$.

$\begin{array} {rcl} {(A \cup B) - C} &= & {(A \cup B) \cap C^c \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \text{(Theorem 5.20)}} \\ {} &= & {C^c \cap (A \cup B) \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \text{(Commutative Property)}} \\ {} &= & {(C^c \cap A) \cup (C^c \cap B)} \\ {} &= & {(A \cap C^c) \cup (B \cap C^c)} \\ {} &= & {(A - C) \cup (B - C)} \end{array}$

Note: It is sometimes difficult to use the properties in the theorems when the theorems use the same letters to represent the sets as those being used in the current problem. For example, one of the distributive properties from Theorems 5.18 can be written as follows: For all sets $$X$$, $$Y$$, and $$Z$$ that are subsets of a universal set $$U$$,

$$(X \cap (Y \cup Z) = (X \cap Y) \cup (X \cap Z).$$

Add texts here. Do not delete this text first.

## Proving that Statements Are Equivalent

When we have a list of three statements P , Q, and R such that each statement in the list is equivalent to the other two statements in the list, we say that the three statements are equivalent. This means that each of the statements in the list implies each of the other statements in the list.

The purpose of Preview Activity $$\PageIndex{2}$$ was to provide one way to prove that three (or more) statements are equivalent. The basic idea is to prove a sequence of conditional statements so that there is an unbroken chain of conditional statements from each statement to every other statement. This method of proof will be used in Theorem 5.22.

Theorem 5.22

Let $$A$$ and $$B$$ be subsets of some universal set $$U$$. The following are equivalent:

1. $$A \subseteq B$$
2. $$A \cap B^c = \emptyset$$
3. $$A^c \cup B = U$$
Proof

To prove that these are equivalent conditions, we will prove that (1) implies (2), that (2) implies (3), and that (3) implies (1).

Let $$A$$ and $$B$$ be subsets of some universal set $$U$$. We have proved that (1) implies (2) in Proposition 5.14.

To prove that (2) implies (3), we will assume that $$A \cap B^c = \emptyset$$ and use the fact that $$\emptyset ^c = U$$. We then see that

$$(A \cap B^c)^c = \emptyset ^c$$.

Then, using one of De Morgan's Laws, we obtain

$begin{array} {rcl} {A^c \cup (B^c)^c} &= & {U} \\ {A^c \cup B} &= & {U.} \end{array}$

This completes the proof that (2) implies (3).

We now need to prove that (3) implies (1). We assume that $$A^c \cup B = U$$ and will prove that $$A \subseteq B$$ by proving that every element of $$A$$ must be in $$B$$.

So let $$x \in A$$. Then we know that $$x \notin A^c$$. However, $$x \in U$$ and since $$A^c \cup B = U$$, we can conclude that $$x \in A^c \cup B$$. Since $$x \notin A^c$$, we conclude that $$x \in B$$. This proves that $$A \subseteq B$$ and hence that (3) implies (1).

Since we have now proved that (1) implies (2), that (2) implies (3), and that (3) implies (1), we have proved that the three conditions are equivalent.

Exercises for Section 5.3

1. Let $$A$$ be a subset of some universal set $$U$$. Prove each of the following (from Theorem 5.20):

(a) $$(A^c)^c = A$$
(b) $$A - \emptyset = A$$
(c) $$\emptyset ^c = U$$
(d) $$U^c = \emptyset$$
2. Let $$A$$, $$B$$, and $$C$$ be subsets of some universal set $$U$$. As part of Theorem 5.18, we proved one of the distributive laws. Prove the other one. That is, prove that
$A \cap (B \cup C) = (A \cap B) \cup (A \cap C).$

3. Let $$A$$, $$B$$, and $$C$$ be subsets of some universal set $$U$$. As part of Theorem 5.20, we proved one of De Morgan’s Laws. Prove the other one. That is, prove that
$(A \cap B)^c = A^c \cup B^c.$

4. Let $$A$$, $$B$$, and $$C$$ be subsets of some universal set $$U$$.

(a) Draw two general Venn diagrams for the sets $$A$$, $$B$$, and $$C$$. On one, shade the region that represents $$A - (B \cup C)$$, and on the other, shade the region that represents $$(A - B) \cap (A - C)$$. Based on the Venn diagrams, make a conjecture about the relationship between the sets $$A - (B \cup C)$$ and $$(A - B) \cap (A - C)$$.
(b) Use the choose-an-element method to prove the conjecture from Exercise (4a).
(c) Use the algebra of sets to prove the conjecture from Exercise (4a).

5. Let $$A$$, $$B$$, and $$C$$ be subsets of some universal set $$U$$.

(a) Draw two general Venn diagrams for the sets $$A$$, $$B$$, and $$C$$. On one, shade the region that represents $$A - (B \cap C)$$, and on the other, shade the region that represents $$(A - B) \cup (A - C)$$. Based on the Venn diagrams, make a conjecture about the relationship between the sets $$A - (B \cap C)$$ and $$(A - B) \cup (A - C)$$.
(b) Use the choose-an-element method to prove the conjecture from Exercise (5a).
(c) Use the algebra of sets to prove the conjecture from Exercise (5a).

6. Let $$A$$, $$B$$, and $$C$$ be subsets of some universal set $$U$$. Prove or disprove each of the following:

(a) $$(A \cap B) - C = (A - C) \cap (B - C)$$
(b) $$(A \cup B) - (A \cap B) = (A - B) \cup (B - A)$$

7. Let $$A$$, $$B$$, and $$C$$ be subsets of some universal set $$U$$.

(a) Draw two general Venn diagrams for the sets $$A$$, $$B$$, and $$C$$. On one, shade the region that represents $$A - (B - C)$$, and on the other, shade the region that represents $$(A - B) - C$$. Based on the Venn diagrams, make a conjecture about the relationship between the sets $$A - (B - C)$$ and $$(A - B) - C$$.
(b) Prove the conjecture from Exercise (7a).

8. Let $$A$$, $$B$$, and $$C$$ be subsets of some universal set $$U$$.

(a) Draw two general Venn diagrams for the sets $$A$$, $$B$$, and $$C$$. On one, shade the region that represents $$A - (B - C)$$, and on the other, shade the region that represents $$(A - B) \cup (A - C^c)$$. Based on the Venn diagrams, make a conjecture about the relationship between the sets $$A - (B - C)$$ and $$(A - B) \cup (A - C^c)$$.
(b) Prove the conjecture from Exercise (8a).

9. Let $$A$$ and $$B$$ be subsets of some universal set $$U$$.

(a) Prove that $$A$$ and $$B - A$$ are disjoint sets.
(b) Prove that $$A \cup B = A \cup (B - A)$$.

10. Let $$A$$ and $$B$$ be subsets of some universal set $$U$$.

(a) Prove that $$A - B$$ and $$A \cap B$$ are disjoint sets.
(b) Prove that $$A = (A - B) \cup (A \cap B)$$.

11. Let $$A$$ and $$B$$ be subsets of some universal set $$U$$. Prove or disprove each of the following:

(a) $$A - (A \cap B^c) = A \cap B$$
(b) $$(A^c \cup B)^c \cap A = A - B$$
(c) $$(A \cup B) - A = B- A$$
(d) $$(A \cup B) - B = A - (A \cap B)$$
(e) $$(A \cup B) - (A \cap B) = (A - B) \cup (B - A)$$
12. Evaluation of proofs
See the instructions for Exercise (19) on page 100 from Section 3.1.

(a)

Let $$A$$, $$B$$, and $$C$$ be subsets of some universal set $$U$$, then $$A - (B - C) = A - (B \cup C)$$.

Proof

$\begin{array} {rcl} {A - (B - C)} &= & {(A - B) - (A - C)} \\ {} &= & {(A \cap B^c) \cap (A \cap C^c)}\\ {} &= & {A \cap (B^c \cap C^c)} \\ {} &= & {A \cap (B \cup C)^c} \\ {} &= & {A - (B \cup C)} \end{array}$

Theorem $$\PageIndex{1}$$

Let $$A$$, $$B$$, and $$C$$ be subsets of some universal set $$U$$, then $$A - (B \cup C) = (A - B) \cap (A - C)$$.

Proof

We first write $$A - (B \cup C) = A \cap (B \cup C)^c$$ and then use one of De Morgan's Laws to obtain

$$A - (B \cup C) = A \cap (B^c \cap C^c)$$.

We now use the fact that $$A = A \cap A$$ and obtain

$\begin{array} {rcl} {A - (B \cup C)} &= & {A \cap A \cap B^c \cap C^c} \\ {} &= & {(A \cap B^c) \cap (A \cap C^c)} \\ {} &= & {(A - B) \cap (A - C).} \end{array}$

Explorations and Activities

13. (Comparison to Properties of the Real Numbers). The following are some of the basic properties of addition and multiplication of real numbers

Commutative Laws: $$a + b = b + a$$, for all $$a, b \in \mathbb{R}$$.
$$a \cdot b = b \cdot a$$, for all $$a, b \in \mathbb{R}$$.

Associative Laws: $$(a + b) + c = a + (b + c)$$, for all $$a, b, c \in \mathbb{R}$$.
$$(a \cdot b) \cdot c = a \cdot (b \cdot c)$$, for all $$a, b, c \in \mathbb{R}$$.

Distributive Law: $$a \cdot (b + c) = a \cdot b + a \cdot c$$, for all $$a, b, c \in \mathbb{R}$$.

Additive Identity: For all $$a \in \mathbb{R}$$, $$a + 0 = a = 0 + a$$.

Multiplicative Identity: For all $$a \in \mathbb{R}$$, $$a \cdot 1 = a = 1 \cdot a$$.

Additive Inverses: For all $$a \in \mathbb{R}$$, $$a + (-a) = 0 = (-a) + a$$.

Multiplicative Inverses: For all $$a \in \mathbb{R}$$ with $$a \ne 0$$, $$a \cdot a^{-1} = 1 = a^{-1} \cdot a$$.

Discuss the similarities and differences among the properties of addition and multiplication of real numbers and the properties of union and intersection of sets.


## Definition

Factorization is the decomposition of an expression into a product of its factors.

The following are common factorizations.

1. For any positive integer $$n$$, $a^n-b^n = (a-b)(a^{n-1} + a^{n-2} b + \ldots + ab^{n-2} + b^{n-1} ).$ In particular, for $$n=2$$, we have $$a^2-b^2=(a-b)(a+b)$$.

2. For $n$ an odd positive integer, $a^n+b^n = (a+b)(a^{n-1} - a^{n-2} b + \ldots - ab^{n-2} + b^{n-1} ).$

3. $a^2 \pm 2ab + b^2 = (a\pm b)^2$

4. $x^3 + y^3 + z^3 - 3 xyz = (x+y+z) (x^2+y^2+z^2-xy-yz-zx)$

5. $(ax+by)^2 + (ay-bx)^2 = (a^2+b^2)(x^2+y^2)$. $(ax-by)^2 - (ay-bx)^2 = (a^2-b^2)(x^2-y^2)$.

6. $x^2 y + y^2 z + z^2 x + x^2 z + y^2 x + z^2 y +2xyz= (x+y)(y+z)(z+x)$.

Factorization often transforms an expression into a form that is more easily manipulated algebraically, that has easily recognizable solutions, and that gives rise to clearly defined relationships.

## Worked Examples

### 1. Find all ordered pairs of positive integer solutions $(x,y)$ such that $2^x+ 1 = y^2$.

Solution: We have $2^x = y^2-1 = (y-1)(y+1)$. Since the factors $(y-1)$ and $(y+1)$ on the right hand side are integers whose product is a power of 2, both $(y-1)$ and $(y+1)$ must be powers of 2. Furthermore, their difference is

$(y+1)-(y-1)=2,$

implying the factors must be $y+1 = 4$ and $y-1 = 2$. This gives $y=3$, and thus $x=3$. Therefore, $(3, 3)$ is the only solution.

### 2. Factorize the polynomial

$f(a, b, c) = ab(a^2-b^2) + bc(b^2-c^2) + ca(c^2-a^2).$

Solution: Observe that if $a=b$, then $f(a, a, c) =0$; if $b=c$, then $f(a, b, b)=0$; and if $c=a$, then $f(c,b,c)=0$. By the Remainder-Factor Theorem, $(a-b), (b-c),$ and $(c-a)$ are factors of $f(a,b,c)$. This allows us to factorize

$f(a,b,c) = -(a-b)(b-c)(c-a)(a+b+c).$

Note by Calvin Lin
7 years, 5 months ago

This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.

When posting on Brilliant:

• Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
• Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
• Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold
- bulleted- list
• bulleted
• list
1. numbered2. list
1. numbered
2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in $$ ... $$ or $ ... $ to ensure proper formatting.
2 \times 3 $2 \times 3$
2^{34} $2^{34}$
a_{i-1} $a_{i-1}$
\frac{2}{3} $\frac{2}{3}$
\sqrt{2} $\sqrt{2}$
\sum_{i=1}^3 $\sum_{i=1}^3$
\sin \theta $\sin \theta$
\boxed{123} $\boxed{123}$

Sort by:

For the worked example - 1 : there are 2 solutions : (3,3) and (3,-3)

(y+1)-(y-1) = 2

implies y + 1 = -2 or y + 1 = 4 and y -1 = -4 or y-1 = 2

Thus, the two solutions you have are (3,3) and (3,-3)

- 7 years, 3 months ago

Thanks. I added in "positive integers".

Staff - 6 years, 3 months ago

Thanks for this.

- 7 years, 3 months ago

I did not understand why should (y+1) - (y-1) = 2 ?
Can anyone explain ?

- 6 years, 3 months ago

What do you not understand?

What do you think $(y+1) - (y-1)$ is equal to ?

Staff - 6 years, 3 months ago

I did not see it correctly . My fault ! Sir, I have a problem. I want to learn Number theory as is organized here on Brilliant but I don't follow anything beginning from modular inverses.I have tried the wikis but I still don't follow .Please suggest something.

- 6 years, 3 months ago

How is their (y+1)-(y-1) difference 2?

- 7 years, 3 months ago

$(y+1) - (y-1)$ $= y +1 - y + 1$ $= 1+1= \boxed{2}$

- 7 years, 3 months ago

(Y+1)-(y-1) = y+1-y+1= 2

- 7 years, 3 months ago

2

- 7 years, 3 months ago

How to think that both difference is 2. What is the main moto behind thinking such that????

- 7 years, 3 months ago


# Markov chain transition matrix

Consider the Markov chain with the following transition matrix:

$$P = \pmatrix{0& 0.5 &0 &0 &0 &0.5\\ 0.25 &0 &0.25 &0.25 &0 &0.25\\ 0 &0.5 &0 &0.5 &0 &0\\ 0 &0.25 &0.25 &0 &0.25 &0.25\\ 0 &0 &0 &0.5 &0 &0.5\\ 0.25 &0.25 &0 &0.25 &0.25 &0}$$

I'm trying to show that this chain is irreducible and aperiodic, and finding the stationary probability distribution of the chain by showing that the chain is reversible.

My attempt is to draw the state space of this, and aperiodic if gcd = 1 and irreducible if there is a path from state 1 to 2 but not vice verca.

The problem is from here, problem #2.

-

Irreducibility means that you can get from any state to any state. Here it's easy to check that we can get from state 1 to 2 to 3 to 4 to 5 to 6 to 1: the transition probabilities, in that order, are $0.5,0.25,0.5,0.25$, and $0.25$, appearing on the first superdiagonal and in the lower lefthand corner. Here's a graph of the transitions; each goes both ways, so I didn't have to worry about arrows.

                   1       3
|\     /|
| \   / |
|  \ /  |
|   2   |
|  / \  |
| /   \ |
|/     \|
6-------4
\     /
\   /
\ /
5

From it you can easily check that no matter where you start, you can return to that state in either $2$ or $3$ steps; since $\gcd(2,3)=1$, the chain is aperiodic.

To show that the chain is reversible, you must find a probability distribution $$\pi=\langle\pi_1,\pi_2,\pi_3,\pi_4,\pi_5,\pi_6\rangle$$ such that $\pi_ip_{ij}=\pi_jp_{ji}$ for $1\le i,j\le 6$. Clearly the equations with $i=j$ are satisfied no matter what $\pi_i$ is, so we can ignore them. We can also ignore any pair for which $p_{ij}=p_{ji}=0$, since $0=0$ gives no information about $\pi$. That leaves the following system of equations:

$$\begin{array}{} 0.5\pi_1=0.25\pi_2&&0.5\pi_1=0.25\pi_6\\ 0.25\pi_2=0.5\pi_3&&0.25\pi_2=0.25\pi_4&&0.25\pi_2=0.25\pi_6\\ 0.5\pi_3=0.25\pi_4\\ 0.25\pi_4=0.5\pi_5&&0.25\pi_4=0.25\pi_6\\ 0.5\pi_5=0.25\pi_6 \end{array}$$

After the fractions are cleared, we have this system:

$$\begin{array}{} 2\pi_1=\pi_2&&2\pi_1=\pi_6\\ \pi_2=2\pi_3&&\pi_2=\pi_4&&\pi_2=\pi_6\\ 2\pi_3=\pi_4\\ \pi_4=2\pi_5&&\pi_4=\pi_6\\ 2\pi_5=\pi_6 \end{array}$$

Clearly $\pi_2=\pi_4=\pi_6=2\pi_1=2\pi_3=2\pi_5$. Finally, we know that $\sum_{i=1}^6\pi_i=1$, so $$1=\sum_{i=1}^6\pi_i=3\pi_1+3\pi_2=9\pi_2\;,$$ and therefore $$\pi_1=\pi_3=\pi_5=\frac19\text{ and }\pi_2=\pi_4=\pi_6=\frac29\;.$$ In other words, the distribution $$\pi=\frac19\langle 1,2,1,2,1,2\rangle$$ satisfies the detailed balance condition and is therefore reversible. Of course this distribution is stationary.

-
To prove the reversibility, one can also note that this is the random walk on the electric network where every existing nonoriented edge has conductance 1. A bonus of this approach is then that every measure which assigns to each vertex a weight proportional to the sum of the conductances of the edges adjacent to it, is stationary. Since there are 2 edges adjacent to vertices 1, 3, 5, and 4 edges adjacent to vertices 2, 4, 6, this confirms your formula, with no computation. –  Did May 5 '12 at 5:57


# The Union of Two Open Sets is Open

#### G-X

##### New member
Let $$\displaystyle x ∈ A1 ∪ A2$$ then $$\displaystyle x ∈ A1$$ or $$\displaystyle x ∈ A2$$

If $$\displaystyle x ∈ A1$$, as A1 is open, there exists an r > 0 such that $$\displaystyle B(x,r) ⊂ A1⊂ A1 ∪ A2$$ and thus B(x,r) is an open set.

Therefore $$\displaystyle A1 ∪ A2$$ is an open set.

How does this prove that $$\displaystyle A1 ∪ A2$$ is an open set. It just proved that $$\displaystyle A1 ∪ A2$$ contains an open set; not that the entire set will be open? This is very similar to the statement: An open subset of R is a subset E of R such that for every x in E there exists ϵ > 0 such that Bϵ(x) is contained in E.

Last edited:

#### castor28

##### Well-known member
MHB Math Scholar
The point is that the argument is valid for every $x\in A_1\cup A_2$.

If $C = A_1\cup A_2$, we have proved that, for every $x\in C$, there is an open ball $B(x,r)\subset C$ (where $r>0$ depends on $x$). That is precisely the definition of an open set.

#### Klaas van Aarsen

##### MHB Seeker
Staff member
If $$\displaystyle x ∈ A1$$, as A1 is open, there exists an r > 0 such that $$\displaystyle B(x,r) ⊂ A1⊂ A1 ∪ A2$$ and thus B(x,r) is an open set.

Therefore $$\displaystyle A1 ∪ A2$$ is an open set.
Hi G-X, welcome to MHB!

As castor28 's pointed out, it's about the definition of an open set, which he effectively quoted.

Additionally that proof is not entirely correct and it is incomplete.
It should be for instance:

If $$\displaystyle x ∈ A1$$, as $A1$ is open, there exists an $r > 0$ such that $$\displaystyle B(x,r) ⊂ A1$$ (from the definition of an open set), which implies that $$\displaystyle B(x,r)⊂ A1 ∪ A2$$.
If $$\displaystyle x ∈ A2$$, as $A2$ is open, there exists an $r > 0$ such that $$\displaystyle B(x,r) ⊂ A2⊂ A1 ∪ A2$$.
Therefore for all $$\displaystyle x ∈ A1∪ A2$$, there exists an $r > 0$ such that $$\displaystyle B(x,r) ⊂ A1 ∪ A2$$.

Thus $$\displaystyle A1 ∪ A2$$ is an open set.

#### G-X

##### New member
I see, I think I had the misunderstanding that something from A2 might close A1.

But I don't think that is an issue you technically need to wrap your head around.

Because the definition states: We define a set U to be open if for each point x in U there exists an open ball B centered at x contained in U.

So, essentially looping over A1, A2 - making the reference that open balls exist at each of these points then all points in A1 ∪ A2 have open balls contained in the union thus by the definition it must be open.

Last edited:


What is the best way of resolving an expression with square roots in denominator?

I was resolving the following question from my textbook:

Write each of the following expressions as a single fraction, simplifying your answer where possible:

$4 - \frac{1}{\sqrt{12}} + \frac{10}{\sqrt{3}}$

I have resolved it this way:

$\frac{4\sqrt{12}\sqrt{3}}{\sqrt{12}\sqrt{3}} - \frac{\sqrt{3}}{\sqrt{12}\sqrt{3}} + \frac{10\sqrt{12}}{\sqrt{12}\sqrt{3}} = \frac{4\sqrt{36} - \sqrt{3}+10\sqrt{4}\sqrt{3}}{\sqrt{36}}=\frac{24 - \sqrt{3} + 20\sqrt{3}}{6}$

while in the textbook it is resolved like this:

$4 - \frac{1}{\sqrt{4 \times 3}} + \frac{10}{\sqrt{3}} = 4 - \frac{1}{2\sqrt{3}} + \frac{10}{\sqrt{3}} = \frac{8\sqrt{3} - 1 + 20}{2\sqrt{3}}= \frac{8\sqrt{3} + 19}{2\sqrt{3}}$

I am wondering did I do it correctly and if so, which way is better?

• Yes, your answer is correct. The only difference is a factor $\sqrt 3\over \sqrt 3$ in your answer vs. that in the book, and adding $-\sqrt 3$ to $20\sqrt 3$. – abiessu Oct 19 '15 at 18:26
• This indeed answerd my question. Would you mind posting it as an answer so i can mark the thread as answered. – Pawel Oct 19 '15 at 18:45

1 Answer

Your answer of $$\frac{24 - \sqrt{3} + 20\sqrt{3}}{6}=\frac{24 + 19\sqrt{3}}{6}$$

matches the answer given by the book within a factor of $\sqrt 3\over \sqrt 3$:

$$\frac{24 + 19\sqrt{3}}{6}=\frac{8\sqrt3+19}{2\sqrt 3}$$

Your method was effective in solving the problem, although putting $\sqrt{12}\sqrt 3$ as the denominator does not follow the "usual" method of coming up with a "least common multiple" for the final denominator; in this case, we have $(12,3)=3$, and therefore we would use $\sqrt {12}=2\sqrt 3$ as the final denominator and avoid a couple extra multiplications in the process. But another intent in solving problems like this is often to "rationalize the denominator", which your method achieves quite effectively. In the end, you'll want to first make sure that you understand the problem and the solution, and then follow the guidelines of the instructor you are working under: if you have a professor or teacher, match what their expectations are in the final answer form; if it's just a book or self-learning, try to match "common" notation and approaches that you see.


# Conditional probability question with cards where the other side color is to be guessed

A box contains three cards. One card is red on both sides, one card is green on both sides, and one card is red on one side and green on the other. One card is selected from the box at random, and the color on one side is observed. If this side is green, what is the probability that the other side of the card is also green?

I think the answer should be $\frac{1}{2}$ as once the card is selected with one side green, there remain only two possibilities for the other side: either red or green.

But the answer to this question is $\frac{2}{3}$.

So,where am I wrong?Why the answer $\frac{2}{3}$ is the $\frac{1}{2}$ wrong?

• There are three green sides. In 2 cases, the other side is green; in one, the other side is red. – Gerry Myerson Oct 3 '13 at 9:44
• Possible duplicate of Probability problem – shoover Jun 25 '18 at 18:56

Go out from 6 sides. In 3 cases a green side shows up, and in 2 of these 3 cases the other side is green as well.

You can work this out directly from the definition of conditional probability:

$$P(G_2\mid G_1) = \frac{P(G_1 \cap G_2)}{P(G_1)}$$

Exactly one of the three cards has two green sides, so $P(G_1 \cap G_2) = 1/3$. Exactly three of the six sides that could be seen initially are green, so $P(G_1)=1/2$. Thus

\begin{align*} P(G_2\mid G_1) &= \frac{1/3}{1/2} \\ &= \frac{2}{3}. \end{align*}

When you see a green side then it's more likely that you have the double-green card, since this has twice as many green sides as the red-green card.

• I like this as a nice, intuitive way of coming to the correct answer. – mattdm Jan 26 '15 at 14:00

The two-sided green card can be observed to have a green side in two distinct ways.

Let's suppose the three cards are C1(with both sides green), C2(with one side green and another red) and C3(both sides are red). Each has two sides (mark A and B)

Now, condition is that the card selected has one side green. So, probability of C3 selection is 0.

Now, Collect the total cases with one side green:

1. C1-A
2. C1-B
3. C2-A (suppose, 'A' as green and 'B' as red)

And, favourable cases (other side should be green too) are:

1. C1-A
2. C1-B

so, probability is: 2 / 3

Say the cards are labelled as $C_1,C_2,C_3$ with $C_1$ being red on both sides, $C_2$ being green on both sides and $C_3$ being green on one side and red on the other. Also, let $S$ be the color of the side that was picked. Then, $$P(C_2|S=G) = \frac{P(S=G|C_2)P(C_2)}{P(S=G)} = \frac{1\times\frac{1}{3}}{\frac{1}{2}} = \frac{2}{3}$$


# Math Help - Newbie help please

1. ## Newbie help please

I have used some basic inferential statistics at work but have not really done much on probability before. (School was a long time ago!) I was wondering if someone could help me with the following:

I have 2 normal decks of cards. I pull out 6 cards at random from the first deck and then pull out 6 cards at random from the second deck.

I wanted to know two things.

1) What the probability is of one of the six cards drawn from deck B being a match with one of the six cards drawn from deck A.

2) What the probability is of two of the six cards drawn from deck B being a match with two of the cards drawn from deck A

I calculated the first problem by working out the probability of not having a match and then subtracting it from 1. i.e for the first card drawn from deck B there is 46 in 52 chance that the card wont match, for the second card drawn there will be a 45 in 51 chance (as there is now one less card in the deck.) and so on.

Eg 46/52 x 45/51 x 44/50 x 43/49 x 42/48 x 41/47 = .46 therefore 1-.46 = .54. Hence the probability of having one card match is 54%

Although I think this is correct, I can’t quite figure out how to go about working out the second problem.

Can anyone give me a point in the right direction please.
Cheers

2. Originally Posted by emersong
1) What the probability is of one of the six cards drawn from deck B being a match with one of the six cards drawn from deck A.
I understand this question as:

Given 6 cards, what is probability there is at least one pair.

He have the following cases,
Code:
MMXXXX
MXMXXX
...
Where "M" stands for match and "X" stands for any. There are 14 cases if you write out the list. In each of these cases the probability is:
(52/52) ---> The first card being any card.
(3/51) ---> The next card got to match.
(50/50) ---> The next can be anything.
(49/49) ---> The next can be anything.
(48/48) ---> The next can be anything.
(47/47) ---> The next can be anything.
Multiply then out to get,
3/51 = 1/17
Now multiply this by 12 because that is the number of disjoint cases:
(12/17)

3. Originally Posted by galactus
Oops, I see PH got something different.
It does not mean you are wrong. Perhaps we understand the problem differently, or perhaps I did it wrong.

My understanding is this.

6 cards are dealt. What is the probability that 2 of those cards match (have same number).

4. There are C(52,6) possible 6-card hands from deck A. Pick any one of those.
There are C(46,6) possible 6-card hands from deck B that have no card in common with the hand we picked from deck A.
Therefore the probability of at least one match is: $1 - \frac{C(46,6)}{C(52,6)} = 0.5399$

That agrees with emersong.

5. Originally Posted by Plato
Therefore the probability of at least one match is: $1 - \frac{C(46,6)}{C(52,6)} = 0.5399$

That agrees with emersong.
I think that is why my answer does not agree with yours. If you follow what I did, I am sure it was perfectly right. I partitioned the cases into disjoint sets and summed each one up. But still that does not do the "at least" part.

6. Hi guys and thanks for the help. Unfortunately I am still confused.

Sorry for not explaining it too well.

The reason for two decks is that I was treating each card as unique, not just looking to see if it was the same number. So...

(Where H = Hearts, C = Clubs, S = Spades, D = Diamonds)

Deck 1... 1H,2D,3S,4C,5S,6D
Deck 2... 8H,9S,1S,3S,7S,4H

In the above example the 3 of spades (3S) repeats.

I also wanted to know the probability of getting 2 cards to repeat.

Deck 1... 1H,2D,8H,4C,5S,9S
Deck 2... 7H,9S,1S,8H,7S,4H

In the above example the 8 of hearts and the 9 of spades both repeat.

I did a little program in excel and ran 10,000 trials, For the first problem I got a probability of .545. This is very near to the probability of .54 that I calculated.

Although I am not sure how to work out the second case, I did the simulation and the probability came out as .142.

So I know the answer to the question, I just would like to understand how I got there!

Thanks again for your help.

7. Hello, emersong!

We need some clarification . . .

I have two normal decks of cards.
I pull out 6 cards at random from the first deck
and then pull out 6 cards at random from the second deck.

1) What is the probability that one of the cards drawn from deck B
matches one of the cards from deck A?

2) What is the probability that two of the cards drawn from deck B
matches two of the cards from deck A?
In part (1), if you mean exactly one match, that's a different game entirely.

Six cards are drawn from deck A.
. . They can be any six cards.
There are: . $C(52,6) = 20,358,520$ possible six-card hands.

1) Among the six cards from deck B, there must be exactly one match
. . . (and five non-matches).

There are: . $C(6,1)$ ways to get one match.
There are: . $C(46,5)$ ways to get five non-matches.

Hence, there are: . $C(6,1)\cdot C(46,5) \:=\:(6)(1,370,754) \:=\:8,224,425$ ways.

Therefore: . $P(\text{exactly 1 match}) \;=\;\frac{8,224,524}{20,358,520} \:=\:0.403984376 \:\approx\:40.4\%$

2) Among the six cards from deck B, there must be exactly two matches
. . . (and four non-matches).

There are: . $C(6,2)$ ways to have two matches.
There are: . $C(46,4)$ ways to have four non-matches.

Hence, there are: . $C(6,2)\cdot C(46,4) \:=\:(15)(163,185) \:=\:2,447,775$ ways.

Therefore: . $P(\text{exactly 2 matches}) \:=\:\frac{2,447,775}{20.358,520} \:=\:0.120233445 \:\approx\:12.0\%$

8. Do you understand what we said about “at least one” matching pair?
The 54% accounts for anywhere from one to six matching pairs.
In you first example there is exactly one matching pair. The probability of that happening is $\frac {6C(46,5)} {C(52,6)} \approx 40.3\%$

For exactly two matching pairs, the probability of that happening is $\frac {C(6,2)C(46,4)} {C(52,6)} \approx 12\%$

9. Firstly, thanks to everyone for their help.

I think I get it, just to recap...

For exactly 3 matches it would be:

C(6,3)xC(46,3)= 20 x 15,180 = 30,360 ways

Hence:

P(exactly 3 matches) = 30,360 / 20,358,520 = 0.0149

And P(one or more matches) = 0.54

Just out of interest, what would;

P(two or more matches) be?

10. The probability of two or more matches is $\sum\limits_{k = 2}^6 {\frac{{C(6,k)C(46,6 - k)}}{{C(52,6)}}}.$

The probability of N or more matches is $\sum\limits_{k = N}^6 {\frac{{C(6,k)C(46,6 - k)}}{{C(52,6)}}}.$

11. Originally Posted by Plato
The probability of two or more matches is $\sum\limits_{k = 2}^6 {\frac{{C(6,k)C(46,6 - k)}}{{C(52,6)}}}.$

The probability of N or more matches is $\sum\limits_{k = N}^6 {\frac{{C(6,k)C(46,6 - k)}}{{C(52,6)}}}.$

It's sunk in now. (Doh!) Well it's been a long day!

Thanks
EmersonG

12. Originally Posted by emersong
The probability of two or more matches is .262 right?
No, I get 0.136.

$\frac{{C(6,k)C(46,6 - k)}}{{C(52,6)}} = \frac{{\left( {\frac{{6!}}{{k!\left( {6 - k} \right)!}}} \right)\left( {\frac{{46!}}{{\left[ {\left( {6 - k} \right)!} \right]\left[ {\left( {k + 40} \right)!} \right]}}} \right)}}{{\frac{{52!}}{{6!(46!)}}}}$


what's the equation of helix surface?

I know for the helix, the equation can be written: $$x=R\cos(t)$$ $$y=R\sin(t)$$ $$z=ht$$ this is the helix curve, and there are two parameters: outer radius $R$ and the pitch length $2\pi h$. However, I would like to generate the 3D helix with another minor radius $r$. This is not the helix curve, but a 3D object something like spring. I don't know exactly the name of such structure, but when I search helix equation, they usually give the equations for helix curve but not for the 3D helix object (spring). Does anyone know the equation of such object? Thank you so much for any help and suggestions.

ps. the shape looks like the following way:

• Do you mean a second helix of radius $r$ curling around the path of the helix with radius $R$? – Neal Aug 7 '13 at 3:05
• You might include a picture of the structure you want in your question. – Neal Aug 7 '13 at 3:10
• I would start trying with the parametrization $$(x(t),y(t),z(t))+r(\cos u) \vec{n}(t)+r(\sin u)\vec{b}(t),$$ where $\vec{n}(t)$ and $\vec{b}(t)$ are the normal and binormal of the helix curve respectively. IIRC those are both continuous, so no problems. Need to check. – Jyrki Lahtonen Aug 7 '13 at 4:20
• @JyrkiLahtonen, yes, that's correct. For $r$ small enough the resulting surface is not just continuous but (real) analytic. It appears he is calling your $r=a.$ – Will Jagy Aug 7 '13 at 4:33
• @Will: I was a bit worried about the possibility of the normal or binormal "switching sides", but the helix has constant curvature and torsion, so can't happen (I think). Typing an answer together with Mathematica graphics... – Jyrki Lahtonen Aug 7 '13 at 4:40

We can use a local orthonormal basis of a parametrized curve to get a surface of the desired type.

A helix running around the $x$-axis has a parametrization like $$\vec{r}(t)=(ht,R\cos t, R\sin t).$$ Its tangent vector can be gotten by differentiating $$\vec{t}=\frac{d\vec{r}(t)}{dt}=(h,-R\sin t,R\cos t).$$ We note that this has constant length $\sqrt{h^2+R^2}$. With a more general curve this is not necessarily the case, and we would normalize this to unit length, and switch to using the natural parameter $s=$ the arc length. This time $ds/dt=\sqrt{h^2+R^2}$, and we can keep using $t$ as long as we remember to normalize.

We get a (local) normal $\vec{n}(t)$ vector by differentiating the (normalized) tangent $$\vec{n}(t)= \frac{\frac{d\vec{t}}{dt}}{\left\Vert\frac{d\vec{t}}{dt}\right\Vert}=(0,-\cos t,-\sin t).$$ As the name suggests this is orthogonal to the tangent vector (in the direction of change of the tangent). The third basis vector is the binormal $$\vec{b}(t)=\frac1{\Vert\vec{t}\Vert}\vec{t}\times\vec{n}=\frac{1}{\sqrt{R^2+h^2}}(R,h\sin t,-h\cos t).$$ This is, of course, orthogonal to both $\vec{t}$ and $\vec{n}$.

The key is that we get the desired surface by drawing (3D-)circles with axis direction determined by the direction of the curve, i.e. the tangent. Equivalently, we draw a circle of radius $a$ in the plane spanned by $\vec{n}$ and $\vec{b}$. Hence we get the entire surface $S$ parametrized as $$S(t,u)=\vec{r}(t)+a\vec{n}(t)\cos u+ a\vec{b}(t)\sin u$$ with $t$ ranging over as many loops as you wish, and $u$ ranging over the interval $[0,2\pi]$.

Here's what Mathematica-output looks like with parameters $h=1$, $R=3$, $a=0.4$:

Here's the effect of the change to $a=1.0$. The lines on the surface correspond to constant values of $t$ and $u$. These are now more clearly defined.

• So amazing answers, so beautiful plots, Thank you so much for your answers and help, it is very helpful. – Hui Zhang Aug 7 '13 at 5:24
• The formulas for the normal and binormal are simpler, if you use the natural parameter of the curve. If you use this same process for another curve, you need to make adjustments for that. – Jyrki Lahtonen Aug 7 '13 at 5:24
• One more questions, for such surface, is it possible to reduce the equations to in the form? $$f(x,y,z)=g(h,R,a)$$ – Hui Zhang Aug 7 '13 at 5:25
• Like eliminate the parameters $t$ and $u$? I'm not sure how easy that would be. Haven't thought about it. I would think it's simpler to use the parametrization for most things: calculating tangent planes, normals and such. – Jyrki Lahtonen Aug 7 '13 at 5:41
• Thank you so much. You answers are very helpful. Actually I have two questions, and this post is in fact the 1st question of generating the surface. My 2nd question is, given a fixed point $(x_0,y_0,z_0)$, how to determine whether this point is inside or outside the object with such surface? That's why I thought whether the equation can reduce to the form $f(x,y,z)=g(h,R,a)$. However, anyway, you have solved the 1st question and it is very helpful. Thank you again. – Hui Zhang Aug 7 '13 at 16:33


# Why does $U(f,P) - L(f,P) < \epsilon$ make a good criterion for integrability?

That is

$f$ is integrable on $[a,b] \iff \forall\epsilon>0, \exists P$ of $[a,b]$ such that

$$U(f,P) - L(f,P) < \epsilon$$

I was thinking that a better definition would be if $U(f,P) = L(f,P)$, but I was corrected that it wouldn't work well for a curve like $f(x) = x$. The geometry just doesn't work.

On the other bound, saying that given any positive number, I can find a partition such that the difference $U(f,P) - L(f,P) < \epsilon$ is bounded doesn't feel like a strong enough condition for integrability. Isn't the goal of analysis is always to make $\epsilon$ as small as possible, and possibly $0$?

Please see my other question on A terminology to analysts for possible relevance. Thank you

• Saying that for all $\varepsilon > 0$, there exists a partition $P$ such that $U(f,P)-L(f,P) < \varepsilon$ is saying exactly what you are looking for. No matter how small we make $\varepsilon$, we will be able to find some partition that makes the upper and lower sums differ by at most that value. – Cameron Williams Jun 26 '13 at 1:10
• But we still an error of epsilon. I was hoping for a more error free definition. I was satisified with $\sup (L) = \inf (U)$ – Hawk Jun 26 '13 at 1:19
• If $U(f,P) \neq L(f,P)$ for all $P$, then $U(f,P) - L(f,P) > 0$.Thus, given $\epsilon < \inf( U(f,P) - L(f,P) )$, there is no $P$ that will satisy $U(f,P)-L(f,p) < \epsilon$. So, the above two definitions mean the same thing. – AnonSubmitter85 Jun 26 '13 at 1:23
• @CameronWilliams, want to post that as an answer? – Hawk Jun 26 '13 at 1:36
• @sidht But you can make the error as small as you want. – Pedro Tamaroff Jun 26 '13 at 1:37

As per my comment above: Saying that for all $\varepsilon>0$, there exists a partition P such that $U(f,P)−L(f,P)<\varepsilon$ is saying exactly what you are looking for. No matter how small we make $\varepsilon$, we will be able to find some partition that makes the upper and lower sums differ by at most that value.

Isn't the goal of analysis is always to make $\epsilon$ as small as possible, and possibly 0?

You seem to have a misunderstanding of what $\epsilon$ stand for here. You are given $\epsilon>0$ and you want to make something smaller than this $\epsilon >0$. Maybe this can clear some of this out.

Why does $U(f,P) - L(f,P) < \epsilon$ make a good criterion for integrability?

Because

THM Let $x,y$ be arbitrary real numbers. If $x<y+\epsilon$ for each $\epsilon >0$, then $x\leq y$.

P By contradiction. Suppose $x>y$. Then $x-y>0$. Take $\epsilon=x-y$. The above gives $x<y+\epsilon=y+x-y=x$ which is impossible. It must be the case $x\leq y$.

Note that since $\sup L\leq \inf U$ is always true, the criterion gives that $\inf U\leq \sup L$ which means $\sup L=\inf U$ and $f$ is integrable.

Now, proving that for each $\epsilon >0$ there exists $P=P_\epsilon$ such that $$U(f,P)-L(f,P)<\epsilon$$ is usually easier than proving $\sup L=\inf U$ directly, in particular when the function is not given explicitly (say, if we want to prove $f$ is integrable when it is continuous) or any other cases where $f$ is in incognito.

This is another extended comment, rather an answer.

I would just like to point out the the following two statements are totally different:

• (1) $\forall \epsilon > 0$, $\exists$ partition $P$ such that $$U(f,P) - L(f,P ) < \epsilon$$

• (2) $\exists$ partition $P$ such that $\forall \epsilon > 0$: $$U(f,P) - L(f,P) < \epsilon.$$

In (1), the partition $P$ depends on $\epsilon$. It might be more accurate to write $P$ as $P_\epsilon$ to remind ourselves of this fact.

In (2), there is a single partition $P$ -- independent of $\epsilon$ -- such that for all $\epsilon > 0$: $U(f,P) - L(f,P) < \epsilon$ is satisfied. In this situation, because the partition $P$ is independent of $\epsilon$, we can conclude that $U(f,P) = L(f,P)$.

Example: Contrast the following two statements. Think about how they are radically different:

• (A) For all $x > 0$, there exists $y > 0$ such that $x < y$.

• (B) There exists $y > 0$ such that for all $x > 0$: $x < y$.

Note that (A) is obviously true (for any $x> 0$, there's always some number that's bigger), while (B) is obviously false (there is no single number $y$ bigger than every real number).


# Thread: Quadratic equations using the formula method

1. ## Quadratic equations using the formula method

Can anyone solve the following quadratic equation using the formula method...

Xsquared - 10x + 3 = 0

Please show working out so it is possible for me to follow and see where i am going wrong

Thanks

2. Originally Posted by duckegg911
Can anyone solve the following quadratic equation using the formula method...

Xsquared - 10x + 3 = 0

Please show working out so it is possible for me to follow and see where i am going wrong

Thanks
Let me try again...

$x^2 - 10x + 3 = 0$

It seems he's allowed to use the quadratic formula.

All quadratic equations are written in the format of $ax^2 + bx + c = 0$

That means that $a$ is the co-efficient of the $x^2$ ; $b$ is the co-efficient of $x$ ; and $c$ is the constant.

According to the quadratic formula:

$x = \frac{ -b \pm \sqrt{b^2 - 4ac} }{2a}$

All you have to do is substitute the corresponding co-efficients into the formula.

3. A standard quadratic equation is in the form
$ax^2 + bx + c = 0$
a, b and c being the coefficients.

The formula for the discriminant ( $\Delta$) is
$\Delta = b^2 - 4ac$

If $\Delta > 0$, there are 2 different roots.
If $\Delta = 0$, there are 2 equivalent roots. ( $x_1=x_2$)
If $\Delta < 0$, there are no real roots.

The roots are,

$x_1 = \frac{-b - \sqrt{\Delta}}{2a}$

$x_2 = \frac{-b + \sqrt{\Delta}}{2a}$

Now plug a, b and c in these formulas.

4. Let's say we write your equation this way.

$ax^2+bx+c=0$
where:
$a=1$
$b=-10$
$c=3$

now we have the coefficients we use in the equation.

$x_{1,2}=\frac{-b\pm \sqrt{b^2-4ac}}{2a}$

Now you just put a,b and c into the equation and that's it.

There are usually 2 results for x.

5. Sorry, was writing the answer while you posted them.

6. Originally Posted by Pinsky
Sorry, was writing the answer while you posted them.
No problem, at least now (s)he has 3 explanations to choose from...

7. Originally Posted by Pinsky
Sorry, was writing the answer while you posted them.
Thanks to you both, ill take a long hard look at these explanations and let you both know how i get on ,

thanks again

8. Originally Posted by janvdl
No problem, at least now (s)he has 3 explanations to choose from...
Not to mention the explanations accompanying the examples s/he should have in their class notes .....

9. Originally Posted by janvdl
Let me try again...

$x^2 - 10x + 3 = 0$

It seems he's allowed to use the quadratic formula.

All quadratic equations are written in the format of $ax^2 + bx + c = 0$

That means that $a$ is the co-efficient of the $x^2$ ; $b$ is the co-efficient of $x$ ; and $c$ is the constant.

According to the quadratic formula:

$x = \frac{ -b \pm \sqrt{b^2 - 4ac} }{2a}$

All you have to do is substitute the corresponding co-efficients into the formula.
Are the answers for -9.6904 and -3.095 ???

10. Originally Posted by duckegg911
Are the answers for -9.6904 and -3.095 ???
I get positive answers, not negative. That's the only problem with your answers.

11. Originally Posted by janvdl
I get positive answers, not negative. That's the only problem with your answers.
This is because - plus a - = a + ???

12. Originally Posted by duckegg911
This is because - plus a - = a + ???
sorry that sound silly....

its just i cant follow why you get possitive answers...

the answers you have are 9.6904 and 3.095 ?

13. After substitution into the formula, your formula should look like this:

$x = \frac{ +10 \pm \sqrt{100 - 4(1)(3)} }{2}$

Does it?

14. Here's the full solution. Ask me about any step you do not understand/

$x = \frac{ +10 \pm \sqrt{100 - 4(1)(3)} }{2}$

$x = \frac{ +10 \pm \sqrt{100 - 12} }{2}$

$x = \frac{ +10 \pm \sqrt{88} }{2}$

BUT $\sqrt{88} = \sqrt{4} \times \sqrt{22}$

AND we know $\sqrt{4} = 2$

$x = \frac{ +10 \pm \sqrt{4} \cdot \sqrt{22} }{2}$

$x = \frac{ +10 \pm 2 \sqrt{22} }{2}$

Divide 10 by 2, and divide $2 \sqrt{22}$ by 2

$x = +5 \pm \sqrt{22}$

15. Originally Posted by janvdl
Here's the full solution. Ask me about any step you do not understand/

$x = \frac{ +10 \pm \sqrt{100 - 4(1)(3)} }{2}$

$x = \frac{ +10 \pm \sqrt{100 - 12} }{2}$

$x = \frac{ +10 \pm \sqrt{88} }{2}$

BUT $\sqrt{88} = \sqrt{4} \times \sqrt{22}$

AND we know $\sqrt{4} = 2$

$x = \frac{ +10 \pm \sqrt{4} \cdot \sqrt{22} }{2}$

$x = \frac{ +10 \pm 2 \sqrt{22} }{2}$

Divide 10 by 2, and divide $2 \sqrt{22}$ by 2

$x = +5 \pm \sqrt{22}$
I have -10 all the way through rather than +10 ???

Page 1 of 2 12 Last


# Find the last digit of $3^{1006}$

The way I usually do is to observe the last digit of $3^1$, $3^2$,... and find the loop. Then we divide $1006$ by the loop and see what's the remainder. Is it the best way to solve this question? What if the base number is large? Like $33^{1006}$? Though we can break $33$ into $3 \times 11$, the exponent of $11$ is still hard to calculate.

• It's a good way to solve it. The loop is pretty short. But if you know Eulers formula or fermats little formula you don't have to "find" the loop. You can calculate it with certainty. At any rate $3^2 \equiv -1 \mod 10$ so $3^4 \equiv 1 \mod 10$ so the loop is 4 and $1006$ has remainder $2$ so... it's not hard. – fleablood Dec 7 '16 at 21:09
• Are you familiar with modular arithmetic, i.e. congruences, e.g. $\,3^2\equiv -1\pmod{10}\,?\ \$ – Bill Dubuque Dec 7 '16 at 21:19
• I think this falls under this umbrella question explaining how to do this and related problems. Please search the site for similar questions before asking. – Jyrki Lahtonen Dec 7 '16 at 21:39
• See also these posts: Find the last two digits of $7^{81}$ and Find the last two digits of $3^{45}$. And perhaps other posts linked there – Martin Sleziak Dec 8 '16 at 3:09

You have $$3^2=9\equiv -1\pmod{10}.$$

And $1006=503\times 2$, so

$$3^{1006}=(3^2)^{503}\equiv (-1)^{503}\equiv -1\equiv 9\pmod{10}.$$

So the last digit is $9$.

And for something like $11$, you can use the fact that $11\equiv 1\pmod {10}.$

$3^{1006}$ or $33^{1006}$

doesn't really matter

$33\equiv 3\pmod {10}\\ 33^{1006}\equiv 3^{1006}\pmod {10}$

$3^4 = 81$

You might say this as $3^4\equiv 1 \pmod{10}$

The last digit of $3^n$ is the same last digit as $3^{n+4k}$ that is:

$(3^{n+4k}) = (3^n)(3^{4k})\equiv (3^n)(1) \pmod{10}$

$1006 = 251\cdot 4 + 2$

the last digit of $3^{1006}$ is the same as the last digit of $3^2$

You have

\begin{cases}3^1& =3\\ 3^2& =9 \\ 3^3&=27\\3^4&= 81\\3^5&= 243\end{cases} Thus the last digit repeats after $4$ steps. Since $1006=251\cdot 4+2$ it is

$$3^{1006}=(3^4)^{251}\cdot 3^2.$$ The last digit of $(3^4)^{251}$ is $1$ and the last digit of $3^2=9.$ So the answer you are looking for is $9.$

To compute the last digit of $33^{1006}$ you are in the right way. Since $33=3\cdot 11$ and the last digit of $11^n$ is $1$ you have that the last digit of $33^{1006}$ is the same of $3^{1006}.$

HINT:

Find the last digit of $3^{1006\bmod4}$.

Adding a formal solution, just in case anyone will find it useful:

You are looking for $3^{1006}\pmod{10}$.

Since $\gcd(3,10)=1$, by Euler's theorem, $3^{\phi(10)}\equiv1\pmod{10}$.

We know that $\phi(10)=\phi(2\cdot5)=(2-1)\cdot(5-1)=4$.

Therefore $3^{4}\equiv1\pmod{10}$.

Therefore $3^{1006}\equiv3^{4\cdot251+2}\equiv(\color\red{3^4})^{251}\cdot3^2\equiv\color\red{1}^{251}\cdot3^2\equiv1\cdot9\equiv9\pmod{10}$.

The powers of $3$ cycle from $1\to3\to9\to7$, depending upon the exponent's modulus with respect to $4$. Since $1006\equiv 2\pmod{4}$, the last digit of $3^{1006}$ is $9$.

You can still use this tactic for larger bases. Suppose we want the last digit of $33^{1006}$, as you suggest. Since $33=30+3$, the powers of $33$'s last digit are completely determined by the powers of $3$.

Very soon you will learn Euler's theorem:

If the greatest common factor of $a$ and $n$ then $a^{\phi{n}} \equiv 1 \mod n$ where $\phi(n)$ is the number of numbers relatively prime to $n$ that are less than $n$.

As $1,3,7$ and $9$ are relatively prime to $10$, and $\gcd(3,10) = 1$ we know $\phi(10) = 4$ and $3^4 \equiv 1 \mod 10$ so $3^{1006} = 3^{4*251 + 2} \equiv 3^2 \equiv 9 \mod 10$.

As $33 = 3*10 + 3$ $33^n = (30 + 3)^n = 10*something + 3^n$ will have the same last digit. But $\gcd(33,10) = 1$ so $3^4 \equiv 1 \mod 10$. And everything is the same.

What would be harder is the last two digits of $33^{1006}$. $\gcd(33,100) =1$ so $33^{\phi(100)} \equiv 1 \mod 100$. But what is $\phi(100)$?

There is a thereom that $\phi(p) = p-1$ and that $\phi(p^k) = p^{k-1}(p-1)$ and then $\phi(mn) = \phi(m)\phi(n)$ so $\phi(100)=\phi(2^2)\phi(5^2) = 2*1*5*4 = 40$. So there are $40$ numbers less than $100$ relatively prime to $100$.

and $33^{40} \equiv 1 \mod 100$ so $33^{1006 = 40*25 +6} \equiv 33^6 \mod 100 \equiv 30^2 + 2*3*30 + 3^2 \equiv 189 \equiv 89 \mod 100$. The last two digits are $89$.

See:

https://en.wikipedia.org/wiki/Modular_arithmetic

https://en.wikipedia.org/wiki/Euler%27s_theorem

https://en.wikipedia.org/wiki/Euler%27s_totient_function


Question

# $$100$$ surnames were randomly picked up from a local telephone directory and the frequency distribution of the number of letters in the English alphabets in the surnames was obtained as follows: Number of letters$$1-4$$$$4-7$$$$7-10$$$$10-13$$$$13-16$$$$16-19$$Number of surnames$$6$$$$30$$$$40$$$$16$$$$4$$$$4$$Determine the median number of letters in the surnames. Find the mean number of letters in the surnames? Also, find the modal size of the surnames.

Solution

## Let us prepare the following table to compute the median :Number of letters  Number of surnames (Frequency) Cumulative frequency $$1-4$$$$6$$ $$6$$  $$4-7$$$$30$$ $$36$$  $$7-10$$$$40$$ $$76$$  $$10-13$$$$16$$ $$92$$  $$13-16$$$$4$$ $$96$$  $$16-19$$$$4$$ $$100=n$$ We have, $$n = 100$$$$\Rightarrow \dfrac n2 = 50$$The cumulative frequency just greater than $$\dfrac n2$$ is $$76$$ and the corresponding class is $$7 – 10$$. Thus, $$7 – 10$$ is the median class such that$$\dfrac n2 = 50, l = 7, f = 40, cf = 36$$ and $$h=3$$Substitute these values in the formulaMedian, $$M = l+\left(\dfrac{\dfrac n2 - cf}{f}\right)\times h$$$$M = 7+\left(\dfrac{50-36}{40}\right)\times 3$$$$M = 7+\dfrac{14}{40}\times3 = 7 + 1.05 = 8.05$$Now, calculation of mean: Number of letters Mid-Point $$(x_i)$$Frequency $$(f_i)$$ $$f_ix_i$$ $$1-4$$$$2.5$$$$6$$ $$15$$  $$4-7$$$$5.5$$ $$30$$ $$165$$  $$7-10$$$$8.5$$ $$40$$ $$340$$  $$10-13$$$$11.5$$ $$16$$ $$184$$  $$13-16$$$$14.5$$ $$4$$ $$58$$  $$16-19$$$$17.5$$ $$4$$ $$70$$  Total $$100$$ $$832$$ Therefore, Mean, $$\bar x = \dfrac{\sum f_ix_i}{\sum f_i} = \dfrac{832}{100} = 8.32$$Calculation ofMode:The class $$7 – 10$$ has the maximum frequency therefore, this is the modal class.Here, $$l = 7, h = 3, f_1 = 40, f_0 = 30$$ and $$f_2 = 16$$Now, let us substitute these values in the formulaMode $$= l+ \left(\dfrac{f_1-f_0}{2f_1-f_0-f_2}\right)\times h$$$$= 7+\dfrac{40-30}{80-30-16}\times3$$$$= 7 + \dfrac{10}{34}\times 3 = 7+0.88 = 7.88$$Hence, median $$= 8.05$$, mean $$= 8.32$$ and mode $$= 7.88$$Mathematics

Suggest Corrections

0

Similar questions
View More

People also searched for
View More


## Spring 2016, problem 15

A lattice point is defined as a point in the $2$-dimensional plane with integral coordinates. We define the centroid of four points $(x_i,y_i )$, $i = 1, 2, 3, 4$, as the point $\left(\frac{x_1 +x_2 +x_3 +x_4}{4},\frac{y_1 +y_2 +y_3 +y_4 }{4}\right)$. Let $n$ be the largest natural number for which there are $n$ distinct lattice points in the plane such that the centroid of any four of them is not a lattice point. Show that $n = 12$.

2 years ago

To prove that any set of 13 lattice points contains a 4-point subset with a lattice-point centroid, first we prove that any set of at least 5 lattice points contains a 2-point subset with a lattice-point centroid: Apply the pigeonhole principle to the four classes of lattice points (even,odd), (odd,even), (even,even), (odd,odd) to find a class which contains two of the 5 points. (For example, we might find that there are two points each of which have first coordinate even and second coordinate odd.) The sum of these two points is (even,even) so their centroid is a lattice point, as desired.

Next consider an arbitrary set $A$ of 13 lattice points. Apply the above result to find a pair in $A$ with a lattice-point centroid. Apply it again to the remaining 11 points of $A$, then to the remaining 9, and yet twice more, so that we find a total of 5 such pairs in $A$. Finally, apply it one more time, to the set of lattice-point centroids of these 5 pairs. This gives us a pair of pairs, whose 4 points have a lattice-point centroid, as desired.

Now we exhibit a set of 12 lattice points, no 4 of which have a lattice-point centroid: Take $B$ such that three of its points are $(0,0)$ modulo 4 (in each coordinate), three are $(0,1)$, three are $(1,0)$, and three are $(1,1)$. Suppose that $S$ is a 4-point subset of $B$ whose centroid is a lattice point. Then the sum of the points of $S$ is $(0,0)$ modulo 4. Thus all 4 points of $S$ must have the same first coordinate (modulo 4): otherwise we are summing a number of $1$'s which lies strictly between 0 and 4. Similarly all 4 points of $S$ share the same second coordinate (modulo 4). But this calls for four points of $B$ which are the same modulo 4, whereas $B$ was chosen to have no more than three such.

This solution introduces the idea of a centroid for 2 points which I don't think is valid. I guess the terminology for 2 points would be the centre of the line joining them.

philboyd 2 years ago

dbrown uses the expression "centroid of two points" exactly the way you just defined it. If that constitutes a slight misuse of terminology, well... So what. It would be fair to say, that pretty much all posts on this board are guilty in this respect. Note also, that when $C(a,b ,c, ...)$ denotes the centroid of $a, b, c,...$, then:

$C(a,b ,c, d)=C(C(a, b), C( c, d))$

This is used by dbrown implicitly, when he says:

Finally, apply it one more time, to the set of lattice-point centroids of these 5 pairs. This gives us a pair of pairs, whose 4 points have a lattice-point centroid, as desired.

I think dbrown's argument is entirely sound. And very elegant on top!

Nelix 2 years ago

@philboyd

I think the term "centroid" is pretty standard for any number of points, but you're right that I was sloppy not to define my terms. Sorry about that. I was using the term to mean the average of a set of points, in the sense that each coordinate of the centroid is given by the average of that coordinate over all the points in the set. This agrees with the definition given in the problem.

I think the term is standard even for solid shapes, where you use a ratio of integrals instead of a finite average.

dbrown 2 years ago
2 years ago

By iterating dbrown's argument you can show that if $n$ is a power of two, then:

In every set of $4n - 3$ integer points you can find a subset of $n$ points with integer centroid.

Questions:

• Is this true for general $n$?
• Is $4n - 3$ minimal?

I was wondering the same thing.

• I was able to prove the $4n-3$ result for $n = 3$, in an ad hoc way, just considering cases; I don't remember the details now. It follows that the $4n-3$ result holds for any $n$ which is a power of 2 times a power of 3. (I didn't get anywhere for $n = 5$ though.)
• $4n-3$ is minimal for every $n$, using a very similar example to the 12-point example for $n = 4$. Just take $n-1$ points in each of the classes $(0,0)$, $(0,1)$, $(1,0)$, $(1,1)$ modulo $n$, to get a set of $4n-4$ points no $n$ of which have a lattice-point centroid.
dbrown 2 years ago
2 years ago

Why have we had no submissions?

Is it because, like me, no one understands it?

It's fairly obvious that we only need to consider the set of points [0..3, 0..3] since if the problem is satisfied with x1=z, say, then we can replace z with z MOD 4, and so on for all 16 points.

Are we saying that it is possible to select any set of 12 points from the 16 and that all selections of 4 points from the 12 has the property that the centroid is not is a lattice point?

I think not.

I have written a program to test this and it seems that with 8 points it is possible to select 4 where SOME of the selections do not have a centroid which is a lattice point, but certainly not all.

As soon as we select 9 points (or more) it is always possible to find a set of 4 which does have a centroid which is a lattice point.

It is possible to choose 12 of those 16 points such that the selection of any 4 have the property that the centroid is not a lattice point, so long as you don't require that the 12 points are distinct mod 4. Since we are working mod 4, in your setup, it is entirely possible that we have identified points that were originally distinct before working mod 4. In fact it is easy to find a collection of 12 non-distinct points mod 4 that satisfy the requisite property, giving a lower bound of 12 on n.

NickM 2 years ago

Could you list such a set of 12 points please? I have rechecked my code and it still seems that it is possible to select 8 points which satisfy the requirement, but 9 points does not. e.g. for 8 points we can have (0,0) (0,0) (0,0) (0,0) (0,0) (1,1) (1,2) (1,3) where the various (0,0) points would be (4,8) (20, 32) and the like.

philboyd 2 years ago

We couldn't have 4 points with $(0,0)$ mod 4 in such a set since their sum would then have both coefficients divisible mod 4. A collection satisfying the requirement would be something like 3 copies each of points with mod 4 representatives given by $(0,0)$, $(0,1)$, $(1,0)$, and $(1,1)$. You can check that the sum of any choice of 4 of these points will have a centroid which is not equivalent to $(0,0)$ mod 4.

NickM 2 years ago

Whoops !

Yes, program has confirmed result for 12 points exactly as you said.

As expected it is unable to find a selection of 13 which satisfy the same condition.

However, I see that we still don't actually have a proof that 12 is the largest value for n.

philboyd 2 years ago


You started with one chip. You need to get 4 chips to win. What is the probability that you will win?

This is very similar to the question I've just asked, except now the requirement is to gain $$4$$ chips to win (instead of $$3$$)

The game is:

You start with one chip. You flip a fair coin. If it throws heads, you gain one chip. If it throws tails, you lose one chip. If you have zero chips, you lose the game. If you have four chips, you win. What is the probability that you will win this game?

I've tried to use the identical reasoning used to solve the problem with three chips, but seems like in this case, it doesn't work.

So the attempt is:

We will denote $$H$$ as heads and $$T$$ as tails (i.e $$HHH$$ means three heads in a row, $$HT$$ means heads and tails etc)

Let $$p$$ be the probability that you win the game. If you throw $$HHH$$ ($$\frac{1}{8}$$ probability), then you win. If you throw $$HT$$ ($$\frac{1}{4}$$ probability), then your probability of winning is $$p$$ at this stage. If you throw heads $$HHT$$ ($$\frac{1}{8}$$ probability), then your probability of winning $$\frac{1}{2}p$$

Hence the recursion formula is

\begin{align}p & = \frac{1}{8} + \frac{1}{4}p+ \frac{1}{8}\frac{1}{2}p \\ &= \frac{1}{8} + \frac{1}{4}p +\frac{1}{16}p \\ &= \frac{1}{8} + \frac{5}{16}p \end{align}

Solving for $$p$$ gives

$$\frac{11}{16}p = \frac{1}{8} \implies p = \frac{16}{88}$$

Now, to verify the accuracy of the solution above, I've tried to calculate the probability of losing using the same logic, namely:

Let $$p$$ denote the probability of losing. If you throw $$T$$ ($$\frac{1}{2}$$ probability), you lose. If you throw $$H$$ ($$\frac{1}{2}$$ probability), the probaility of losing at this stage is $$\frac{1}{2}p$$. If you throw $$HH$$($$\frac{1}{4}$$ probability), the probability of losing is $$\frac{1}{4}p$$. Setting up the recursion gives

\begin{align}p & = \frac{1}{2} + \frac{1}{4}p+ \frac{1}{8}\frac{1}{2}p \\ &= \frac{1}{2} + \frac{1}{4}p +\frac{1}{16}p \\ &= \frac{1}{2} + \frac{5}{16}p \end{align}

Which implies that

$$\frac{11}{16}p = \frac{1}{2} \implies p = \frac{16}{22} = \frac{64}{88}$$

Which means that probabilities of winning and losing the game do not add up to $$1$$.

So the main question is: Where is the mistake? How to solve it using recursion? (Note that for now, I'm mainly interested in the recursive solution)

And the bonus question: Is there a possibility to generalize? I.e to find the formula that will give us the probability of winning the game, given that we need to gain $$n$$ chips to win?

• Can you share the calculation for losing probability? – Dhanvi Sreenivasan Jan 9 at 6:23
• @DhanviSreenivasan, I updated the post. – Ilya Stokolos Jan 9 at 6:31
• But you don't have a finite number of throws, no? – Dhanvi Sreenivasan Jan 9 at 6:35
• @DhanviSreenivasan True, I don't. – Ilya Stokolos Jan 9 at 6:36
• Sorry, the game stops if you win. Didn't remember that – Dhanvi Sreenivasan Jan 9 at 6:40

This answer only addresses what's wrong with your recursion, since the other answers (both in this question and your earlier question) already gave many different ways to set up the right recursions (or use other methods).

The key mistake is what you highlighted. When you throw $$HHT$$, you now have $$2$$ chips. For the special case of this problem, $$2$$ chips is right in the middle between $$0$$ and $$4$$ chips, so the winning prob is obviously $$\color{red}{\frac12}$$ by symmetry. But you had it as $$\color{red}{\frac12 p}$$ which is wrong. Thus the correct equation is:

$$p = P(HHH) + P(HT) p + P(HHT) \color{red}{\frac12}= \frac18 + \frac14 p + \frac18 \color{red}{\frac12}$$

Let $$p(n)$$ be the probability that you win the game when you have $$n$$ chips in the pocket. Then $$p(0)=0$$, $$\>p(4)=1$$. Having $$1\leq n\leq3$$ chips one makes a further move, and one then has $$p(n)={1\over2}p(n-1)+{1\over2}p(n+1)\qquad(1\leq n\leq3)\ ,$$ so that $$p(n+1)-p(n)=p(n)-p(n-1)\qquad(1\leq n\leq3)\ .$$ These circumstances immediately imply that $$p(1)={1\over4}$$.

Let $$p_0, p_1, \ldots, p_4$$ be the probability of winning if you start with $$0, 1, \ldots, 4$$ chips, respectively. Of course, $$p_0 = 0$$ and $$p_4 = 1$$.

There are a few different ways to approach this question.

Start with $$p_2$$

This seems to be the approach you're asking for, but it's not the easiest approach.

To calculate $$p_2$$, consider what happens if the coin is flipped twice. There is a $$1/4$$ chance of getting $$TT$$ (instant loss), a $$1/4$$ chance of getting $$HH$$ (instant win), and a $$1/2$$ chance of getting either $$HT$$ or $$TH$$ (back to $$p_2$$). So we have

$$p_2 = \frac14 + \frac12 p_2,$$

which we can solve to find that $$p_2 = 1/2$$.

Now that we know $$p_2$$, we can directly calculate $$p_1$$ as the average of $$p_0$$ and $$p_2$$, which is $$1/4$$.

Examine the sequence

Notice that in the sequence $$p_0, p_1, p_2, p_3, p_4$$, each element (besides the first and the last) is the average of its two neighbors. This implies that the sequence is an arithmetic progression. Given that $$p_0 = 0$$ and $$p_4 = 1$$, we can use any "find a line given two points" method to find that for all $$n$$, $$p_n = n/4$$.

Conservation of expected value

I'm an investor and an advantage gambler (which are the same thing, really), so I like to think of things in terms of expected value.

I start the game with $$1$$ chip, and it's a perfectly fair game; in the long run, I am expected neither to lose nor to win. So if I play the game until it ends, the expected value of the game must be $$1$$ chip. (More detail is needed to make this argument formal, but it's sound.)

The value if I lose is $$0$$, and the value if I win is $$4$$, so the expected value can also be written as $$(1 - p_1) \cdot 0 + p_1 \cdot 4$$, which simplifies to $$4 p_1$$.

These two ways of calculating the expected value must agree, meaning that $$4 p_1 = 1$$, so $$p_1 = 1/4$$.

In general

The latter two of the above arguments can each be generalized to show that if you start with $$a$$ chips, and the game ends when you reach either $$0$$ or $$b$$ chips, then the probability of winning is $$a/b$$.


# Splitting integers and taking differences, how can the sum be constant?

Start with the set of integers from $$1$$ up to $$2n$$, where $$n$$ is a natural number. Split this set into two disjoint subsets of equal size, say $$\{a_1 and $$\{b_1>b_2>\cdots>b_n\}$$ (with the elements ordered WLOG). What is the value of the following expression in terms of $$n$$? $$|a_1-b_1|+|a_2-b_2|+\cdots+|a_n-b_n|$$

Source (link contains spoilers)

• I don't think ordering the elements is WLOG. Jan 2, 2022 at 14:14
• @justforplaylists It's not WLOG for the final expression, of course, but it is WLOG for defining the sets: i.e. we define $a_1$ to be the smallest element, $a_2$ the next smallest, and so on. Jan 2, 2022 at 14:16
• Two disjoint and exhaustive subsets? If $n=10$, we could have $\{1,2\}$ and $\{19,20\}$, which gives $36$, or $\{1,2\}$ and $\{3,4\}$, which gives $2$. Jan 3, 2022 at 5:40
• I was trying to think of a more precise term than "split", and reading the answers I was reminded of the word "partition", which more clearly indicates exhaustion. Jan 3, 2022 at 6:10
• @Randal'Thor This is not WLOG but rather you are defining $a_i$ and $b_i$ in this way. Jan 3, 2022 at 7:14

## 4 Answers

Jaap Sherpuis's comment hints at a perhaps more intuitive explanation.

We need to consider how many a's are $$\le n$$ and how many b's are $$\gt n$$.

Let's name $$k$$ the number of $$a_i$$'s that are $$\le n$$.
$$a_1 \dots a_k$$ occupy $$k$$ values from 1 to n, leaving $$(n-k)$$ holes.
These holes are filled by $$(n-k)$$ of the $$b_j$$'s. The remaining $$b_j$$ are $$\gt n$$.

So we have $$a_1 \dots a_k \le n$$ and $$a_{k+1} \dots a_n \gt n$$.
And we have $$b_1 \dots b_k \gt n$$ and $$b_{k+1} \dots b_n \le n$$.
This implies $$a_i < b_i$$ if and only if $$i \le k$$

From there we can compute

$$|a_1-b_1|+|a_2-b_2|+\cdots+|a_n-b_n|$$
$$= |a_1-b_1|+\cdots+|a_k-b_k|+|a_{k+1}-b_{k+1}|+\cdots+|a_n-b_n|$$
$$= (b_1-a_1)+\cdots+(b_k-a_k)+(a_{k+1}-b_{k+1})+\cdots+(a_n-b_n)$$

On the plus side you have all values $$\gt n$$ and on the minus side the values $$\le n$$
So the expression becomes:
$$= (n+1) + \cdots + 2n - (1 + \cdots + n) = n^2$$

This is just an "optimised" version of Gareth's answer which I couldn't resist making. Please keep upvoting him and also prefer his answer over mine for acceptance.

For any index $$i$$ let us denote $$M_i$$ the larger of $$a_i,b_i$$ and $$m_i$$ the smaller. Then the given sum of absolute differences can be rewritten as

$$\displaystyle\sum_i M_i - \sum_i m_i$$

We will now prove that for any pair of indices $$i,j$$ we have $$M_i>m_j$$:

Proof:

Case 1, $$i=j$$: obvious from definition
Case 2, $$i: $$M_i\ge b_i>b_j\ge m_j$$
Case 3, $$i>j$$: $$M_i\ge a_i>a_j\ge m_j$$

It follows that all the $$m_i$$ are smaller than all the $$M_i$$. This is the same as saying

the $$m_i$$ must be a permutation of $$1,...,n$$ and the $$M_i$$ a permutation of $$n+1,...,2n$$

The sum is therefore

$$\displaystyle\sum_{i=1}^n(n + i) -\sum_{i=1}^n i = \sum_{i=1}^n n = n^2$$

and indeed independent of how the numbers are split into $$a$$ and $$b$$.

• I don't think this is just an optimized version of my answer, although of course there's some overlap. And I think it's a very nice argument. I've upvoted it and would encourage anyone reading this to do likewise. (And if Rand chooses to accept this one rather than mine, then despite loopy walt's first sentence I think that would be an extremely reasonable decision.) Jan 2, 2022 at 20:14
• There is a related principle used in some magic tricks. If you have one suit of cards in order Ace to King, and another suit in reverse order King to Ace, and combine those two piles using a single riffle shuffle, then the top thirteen cards will contain every card value exactly once, as will the bottom thirteen cards. Jan 3, 2022 at 8:55

So, first of all, let's

do it one way and see what sum we get. Let the $$a$$s be (in order) $$1,2,\ldots,n$$ and the $$b$$s be (in order) $$2n,2n-1,\ldots,n+1$$. Then the differences are, in order, $$2n-1,2n-3,\ldots,1$$ whose sum is $$n^2$$.

In view of

the title, presumably this is always the answer.

But why? I offer first a rather routine, prosaic solution, the sort of thing someone who's done this sort of thing before knows they will be able to get to work. (This is the first solution I found.) Then something slicker. (This is the second solution I found.) Then a way to streamline the second part of the slicker argument. And then a way to streamline the first part, found not by me but by user loopy walt in comments. I prefer to leave all these things in, rather than just presenting the slickest version so far found, because that's a more honest representation of how things typically work in mathematics; see also this related 3blue1brown video about calculation versus slick insight.

Here is a prosaic solution; I suspect there is something better (and am thinking about that). We can turn any valid partition into any other by repeatedly performing operations of the form "find two consecutive numbers one of which is an $$a$$ and the other a $$b$$, and swap them". What happens when we do this? Suppose $$a_i$$ and $$b_j$$ are consecutive. Then none of the other order relations change when we switch them, so our new sequences in order are the same as the old except that $$a_i'=b_j$$ and $$b_j'=a_i$$. If $$i=j$$ then the expression we're interested in doesn't change at all. Otherwise, say that $$i. Then $$b_j \simeq a_i where $$\simeq$$ means "differ by 1", and therefore $$a_j>b_j$$; and $$a_i\simeq b_j, and therefore $$a_i. So increasing $$a_i$$ by 1 and decreasing $$b_j$$ by 1 reduces $$|a_i-b_i|$$ by 1 and increases $$a_j-b_j$$ by 1, and vice versa if instead we decrease $$a_i$$ and increase $$b_j$$. In either case our expression doesn't change.

OK, now let's see if we can do something simpler.

We have all these intervals from $$a_i$$ to $$b_i$$. Every number $$k$$ from $$1$$ to $$2n$$ is an endpoint of exactly one of these intervals; I claim that the first $$n$$ are all left endpoints and the last $$n$$ are all right endpoints. Why? Well, colour all the $$a$$s amber and all the $$b$$s blue; suppose $$k$$ is amber; if $$k=a_i$$ then there are $$i-1$$ amber numbers to its left, hence $$k-i$$ blue numbers to its left, hence $$n-k+i$$ blue numbers to its right, the first of which is $$b_{n-k+i}$$. So $$b_i$$ is right of $$a_i$$ iff $$i\leq n-k+i$$, iff $$k\leq n$$. Likewise if $$k$$ is blue.

And now

our sum is just the sum over all $$k$$ of the number of these intervals it's in (counting 1/2 when it's exactly at an endpoint), which depends only on the number of left and right endpoints on either side of $$k$$, and we've just seen that this never changes.

Or (a basically-equivalent replacement for the foregoing paragraph):

our sum is just the sum of all the right endpoints minus the sum of all the left endpoints, which is to say $$\bigl[(n+1)+\cdots+2n\bigr]-\bigl[1+\cdots+n\bigr]=n^2$$.

This is definitely slicker than the first proof above, but I would be unsurprised to find that one can streamline things further.

In comments, loopy walt suggests another way to do the first bit:

i.e., proving that $$1,...,n$$ are left endpoints and $$n+1,...,2n$$ are right endpoints. Consider the interval whose endpoints are $$a_i,b_i$$. We'll prove that its right-hand endpoint is $$>n$$. Note that $$a_i$$ is bigger than $$i-1$$ smaller $$a$$s, and $$b_i$$ is bigger than $$n-i$$ smaller $$b$$s. So whichever of them is larger is bigger than the other one (1), and $$i-1$$ smaller $$a$$s, and $$n-i$$ smaller $$b$$s, all of those sets being disjoint; hence bigger than at least $$1+i-1+n-i=n$$ other numbers; hence it's $$>n$$.

(To my mind this is neater than my argument but more rabbit-out-of-hat-ish.)

• Correct answer and reasonable proof, but there's a(nother) surprising fact that makes the proof even simpler. Jan 2, 2022 at 14:27
• As mentioned in the answer, I am currently looking for slicker proofs and have some plausible ideas of where to look. There is something of an analogy with a famous question about coins, but that pathway doesn't seem like it really produces something much simpler so far. Jan 2, 2022 at 14:29
• How about: ai is larger than i-1 elements (a1,...,a{i-1}), bi is larger than n-i elements (b{i+1},...,bn). The larger of ai and bi is larger than the other one and both these sets, that is 1 + i-1 + n-i elements. Jan 2, 2022 at 15:30
• ... and possibly other things too, but at least n elements, which means that all the right endpoints are >= n+1, and as there are n right endpoints that tells us what they all are? Yeah, that works. Jan 2, 2022 at 15:34
• The last spoilertag is the kind of argument I was thinking of. Nice example of a surprising non-obvious mathematical fact. Jan 2, 2022 at 17:48

This problem doesn't really have anything to do with the integers from 1 to 2n. Fix any set consisting of 2n real numbers (repetitions allowed); then split them into a_1 <= a_2 <= .... <= a_n and b_1 >= b_2 >= ... >= b_n. Then the sum |a_1 - b_1| + |a_2 - b_2| + ... + |a_n - b_n| is constant, that is, it doesn't depend on the partition.

• Nice generalisation, and I suppose the same proof works in this case too, but can you edit your answer to include a quick proof of this fact? Jan 3, 2022 at 4:48
• @Randal'Thor Since the loopy walt's answer (up to the words "It follows that all the $m_i$ are smaller than all the $M_i$") does not use the fact that the numbers given are integers from 1 to 2n, if we replace $1\leqslant2\leqslant\dots\leqslant2n$ with any numbers $q_1\leqslant q_2\leqslant\dots\leqslant q_{2n}$, the assertion about the constant sum still holds (and it will be equal $\sum_{i=1}^n q_{n+i} - \sum_{i=1}^n q_i$). Jan 3, 2022 at 6:47
• @trolley813 I know how the proof would go, I'm just asking pmw to include it so that this answer is self-contained. Jan 3, 2022 at 8:23