# Why is this probability distribution biased towards even numbers?

I am working on the probabilities of a game where

1. they pick 20 unique number(non-repeating) from range 1 to 80

2. sort those 20 numbers in ascending order

3. sum every 4 numbers and take the last digit as result (so end with 5 numbers).

Normally I could find these probabilities with rules based on combination and permutation but for this one because of the sorting I am not sure how to work on it.

I tried to brute force all combinations but with some test it would take my old laptop about few thousand years. So I did some simulations, sampling 100 million samples. Below is the final result.

So there seems to be a small edge towards even numbers, but I don't understand where this edge comes from (even numbers appear about .5095925 of the time).

I went further down about the first 4 numbers out of the sorted 20 numbers and try based on the fact that the 1st sorted number must be in the range of 1 to 61, 2nd sorted must be in the range of 2 to 62, etc. So odd positions will have 31 out of 61 chances to be odd and even positions have 31 out of 61 to be even. And I did some checks below, but the resulting bias towards even numbers is very small (.50000004 vs the stimulation .5095925).

I wonder where and how the game tends to favor even numbers quite a bit. Or is my simulation code just wrong?

• +1 For a quick insight into this, think about the results you would get if you were to select 76 numbers rather than 20. It will help to reason in terms of parity: how many odd numbers do you expect to see in each group of four numbers?
– whuber
May 20 '19 at 15:14
• @whuber you mean because there are 40 odd and 40 even, the chance of getting 10 odd and 10 even for the 20 number is higher, then the chance of getting 2 odds and 2 evens (result in even) is higher in a 4 number group base? May 21 '19 at 9:14
• No, that's not it. You need to look at the chances, within any given group, of observing an even number of odd values, because that characterizes the cases where the total will end in 0, 2, 4, 6, or 8. For instance, any group of four numbers in a row is guaranteed to have two odd and two even values and therefore its sum cannot end in an odd digit.
– whuber
May 21 '19 at 12:00
• Your results look good. In particular, the first-number percentages for digits 0 - 5 are typically correct in the first four or five significant digits.
– whuber
May 23 '19 at 17:16

This is an interesting question because the result is a little surprising; it is subtle; and it has been well researched with a large simulation.

Here is a graphical representation of ten iterations of the game. Each row is an iteration. It shows the 20 numbers selected, $$k_1,k_2, \ldots, k_{20},$$ and uses colors to depict their partition into five groups of four. The game sums the numbers in each group, thereby producing five sums.

Nevertheless, within the large number of simulations reported in the question, there appears to be an imbalance among odd and even sums, although this procedure seemingly would not favor one parity. Indeed, if we were only to take a subset of four numbers from $$\{1,2,3,\ldots, 80\}$$ and sum them modulo ten, each digit would have exactly $$1/10$$ chance of appearing.

To appreciate what's happening, consider extreme versions of this procedure, where instead of partitioning a sample of $$20$$ into five groups of four, let's take a sample of $$76$$ and partition it into $$19$$ groups of four:

What strikes us first about this image are the prominent gray "bubbles" depicting the numbers that were not sampled. With only $$80-76=4$$ bubbles in each iteration, we're unlikely to find any bubbles in the first group of four. Moreover, when there is a bubble in that group, as in the fourth row from the top, it's just as likely to be an even number as an odd number. That means the first group (in this extreme case) is highly likely to include two odd numbers and two even numbers, making its sum even.

This consideration of bubbles suggests analyzing the game in terms of gaps between the selected numbers. The first gap is $$\Delta_1 = k_1-0,$$ the second gap is $$\Delta_2 = k_2-k_1,$$ and so on. All gaps are $$1$$ or larger. Evidently the last number chosen is $$k_{20} = \Delta_1+\Delta_2 + \cdots + \Delta_{20},$$ which therefore must be $$80$$ or smaller.

Let's begin with the first gap, $$\Delta_1=k_1.$$ What is the chance this gap is only $$1,$$ the smallest possible value? That's easy to compute, because

1. There are $$\binom{80}{20}$$ distinct, equally-probable subsamples of size $$20$$ that can be obtained from all $$80$$ numbers.

2. Of these, $$\binom{79}{20}$$ are from the set $$\{2,3,\ldots, 80\}.$$

Subtracting, we find the number of subsamples with $$k_1=1$$ and divide that by the total number of subsamples to obtain the probability:

$$\Pr(\Delta_1 = 1) = \frac{\binom{80}{20} - \binom{79}{20}}{\binom{80}{20}} = \frac{\binom{79}{19}}{\binom{80}{20}} = \frac{1}{4}.$$

(Although only one of the ten iterations in the first figure has $$\Delta_1=1$$--the fifth row from the top--a longer set of simulations confirms that $$\Delta_1=1$$ in about a quarter of them.)

Analogous reasoning establishes the remaining chances:

$$\Pr(\Delta_1 = j_1) = \frac{\binom{80+1-j_1}{20} - \binom{80-j_1}{20}}{\binom{80}{20}} = \frac{\binom{80-j_1}{19}}{\binom{80}{20}},\ j_1=1, 2, \ldots, 61.$$

Now suppose we have observed $$\Delta_1.$$ What could $$\Delta_2$$ be? If it is equal to $$j_2,$$ that means the last $$20-1$$ numbers are a subset of the values from $$\Delta_1+j_2$$ through $$80$$ and the remaining $$20-2$$ numbers all lie between $$\Delta_1 + j_2 +1$$ and $$80.$$ In effect, the role of $$80$$ is now played by $$80-j_1,$$ $$20$$ is reduced to $$20-1=1,$$ and $$j_2$$ plays the role of $$j_1.$$ Thus, writing $$k_2=j_1+j_2$$ for the second lowest value selected,

\eqalign{ \Pr(k_2\text{ selected next}\mid k_1\text{ selected first}) &= \Pr(\Delta_2 = j_2 \mid \Delta_1=j_1) \\ &= \frac{\binom{80-k_2}{20-2}}{\binom{80-k_1}{20-1}},\ k_2=j_1+1, 2, \ldots, 80+1-(20-1).}

The pattern is clear. In particular, to study the first group, we can calculate the probability distribution of the sum of just the lowest four numbers in the subsample by summing over all possible values of $$\Delta_1,\Delta_2,\Delta_3,\Delta_4.$$ There are sufficiently few of these that this computation is feasible.

By the laws of conditional probability, the chance of such a combination $$(j_1,j_2,j_3,j_4)$$ is obtained by the products of the component probabilities

\eqalign{ q_{j_4,j_3,j_2,j_1} &= \Pr(\Delta_4=j_4\mid \Delta_3=j_3,\Delta_2=j_2,\Delta_1=j_1) \\ &\times \Pr(\Delta_3=j_3\mid \Delta_2=j_2,\Delta_1=j_1) \\ &\times \Pr(\Delta_2=j_2\mid \Delta_1=j_1) \\ &\times \Pr(\Delta_1=j_1)}

as

$$\Pr(j_1,j_2,j_3,j_4) = \sum_{j_1=1}^{81-20}\ \sum_{j_2=1}^{81-j_1-19}\ \sum_{j_3=1}^{81-j_1-j_2-18}\ \sum_{j_4=1}^{81-j_1-j_2-j_3-17} q_{j_4,j_3,j_2,j_1} .$$

For the game described in the question, there are "only" 635,376 possible combinations in this quadruple sum: the calculations can be carried out in seconds. Here is the interesting part of the probability distribution of the group sum $$k_1+k_2+k_3+k_4 = 4j_1+3j_2+2j_3+j_1:$$

(The full distribution extends to the largest possible sum that could appear in this first group of four numbers, equal to $$61+62+63+64=250.$$)

The solid red dots are probabilities a little larger than suggested by their neighbors: the alternation between even and odd is clear.

When we further reduce this distribution by taking just the last digits of the sums, the alternation between even and odd persists:

This plot shows the relative differences between the probabilities and $$1/10.$$ The actual values (to eight digits) are

Digit Probability
0  0.10235369
1  0.09779473
2  0.10159497
3  0.09859690
4  0.10239713
5  0.09838777
6  0.10201990
7  0.09821967
8  0.10121774
9  0.09741751

Many of them agree closely (to four or five digits) with the simulation results reported in the question.

Notice (from the equations or the simulations) that the first group of four smallest numbers tends to lie to the left of $$20$$ or so, leaving about $$60$$ values from which to select the next four groups. Thus, the situation with the second group is typically just like the situation with five groups, but with $$80$$ reduced to around $$60$$ and only $$20-4=16$$ numbers to select. Similar reasoning suggests the situation with the third and fourth groups also is similar. The simulations in the question bear this out: they still favor even sums over odd.

Analogous discrepancies in probabilities occur when representing the sums in other (non-decimal) bases. Different patterns of discrepancies occur when taking groups of other sizes, especially odd sizes: groups of size $$4$$ are special because they have a pronounced tendency to include either zero, two, or four odd numbers, which guarantees their sum is even.

Here is the R used to do the calculations. It is coded so you can experiment with versions of this game simply by changing the parameters n, m, and g.

library(data.table)
n <- 80 # Maximum number available (100 or more may be problematic)
m <- 4  # Group sizes >= 2 (8 or more is problematic)
g <- 5  # Number of groups >= 1 (more is easier!)
#
# Generate all possible vectors of gaps.
#
delta <- 1:(n - m*(g-1) + 1)
X <- do.call("expand.grid", lapply(1:m, function(i) delta))
names(X) <- paste0("k", 1:m)
X <- as.data.table(X)
i <- rowSums(X) < max(delta)
X <- X[i, ]
#
# Generate the numbers corresponding to each gap vector.
#
Y <- apply(X, 1, cumsum)
rownames(Y) <- paste0("k", 1:m)
Y <- as.data.table(t(Y))
#
# Compute log conditional probabilities for each selection.
#
f <- function(k, n, g) {
m <- length(k)
k0 <- c(0, k[-m])
j <- (m*g-1) : (m*(g-1))
lchoose(n - k, j) - lchoose(n - k0, j+1)
}
Z <- apply(Y, 1, function(k) f(k, n, g))
rownames(Z) <- paste0("p", 1:m)
Z <- as.data.table(t(Z))
#
# Compute the probability of each vector.
#
Z[, pi := exp(rowSums(Z))]
Y[, Sum := rowSums(Y)]
X <- cbind(X, Y, Z)
1-sum(X\$pi) # Should be near zero, within floating point roundoff error
#
# Summarize by group sum.
#
H <- X[, .(Probability = sum(pi)), keyby=Sum]
H.mod <- rbindlist(lapply(2:40, function(b)
H[, .(Probability = sum(Probability), Base=b),
keyby=(Sum - choose(m+1,2)) %% b]))

with(H[Probability > 0.00025],  {
above <- sapply(1:length(Sum), function(i) {
g <- splinefun(Sum[-i], Probability[-i])
Probability[i] > g(Sum[i])
})
colors <- ifelse(above, "Red", "Gray")
plot(Sum, Probability, type="l")
abline(h=0)
abline(v = seq(0, max(Sum), by=5), col="Gray", lty=3)
abline(v = seq(0, max(Sum), by=10), col="Gray")
points(Sum, Probability, pch=21, bg=colors)
})
#
# Explore the last digit in various bases.
#
base <- 10
with(H.mod[Base==base], {
plot(Sum, base*Probability - 1, type="b", ylim=base*range(Probability)-1,
pch=21, bg=ifelse(base*Probability-1 > 0, "Red", "Gray"),
xlab=paste("Sum modulo", base, "offset by", choose(m+1,2)))
abline(h=0, col="Gray")
})

• I am moved by the details and visualization that you offer. There is still much for me to dig into the step by step forming of the formula and the code but first and formal let me thank you for this amazing answer. May 24 '19 at 21:23


# Evaluating $\lim\limits_{x \to \infty}\frac{4^{x+2}+3^x}{4^{x-2}}$

$$\lim_{x→∞}\frac{4^{x+2}+3^x}{4^{x-2}}.$$

I have solved it like below: $$\lim_{x→∞}\left(\frac{4^{x+2}}{4^{x-2}}+\frac{3^x}{4^{x-2}}\right)=\lim_{x→∞}\left(4^4+\frac{3^x}{4^x}·4^2\right).$$ Since, as $$x → ∞$$, $$3^x → ∞$$, $$\dfrac{3^x}{4^x} → 0$$, the limit is equal to $$4^4=256$$.

Have I solved it correctly?

This was a practice test question and the given solution was wrong. So, I solved it and I am preparing alone, no friend to discuss, so I posted it here.

• $\lim_{x \to \infty} \left( 4^4+\frac{3^x}{4^x} \times 4^2 \right)=\lim_{x \to \infty}4^4 +\lim_{x \to \infty}\left(\dfrac{3^x}{4^x}\right)4^2$? While its true you might want to explain for rigor. – Yadati Kiran Dec 22 '18 at 4:26
• It's unclear to me what purpose it serves to write $3^x\to\infty$. It makes the next expression, $\frac{3^x}{4^x} \to 0$, look wrong even though it actually is correct. – David K Jan 8 at 14:28

Yup! Your steps almost all follow logically and evaluate to the correct limit, so your solution is correct (almost).

I will make a nitpick with one thing you said, though:

Since, as $$x \to \infty, 3^x \to \infty, \frac{3^x}{4^x} \to 0$$

Technically, since $$3^x$$ and $$4^x$$ both approach $$\infty$$ as $$x \to \infty$$, then under your logic we obtain an indeterminate form:

$$\frac{3^x}{4^x} \to \frac{\infty}{\infty}$$

It would be better to regroup $$3^x/4^x$$ as $$(3/4)^x$$. Then clearly, as $$x \to \infty$$, $$(3/4)^x \to 0$$ because $$3/4 < 1$$. (If you're not convinced, notice if you take $$x = 1, 2, 3, 4$$ and so on that $$(3/4)^x$$ clearly is decreasing.)

• While $$3^x \to \infty$$ is true, note that it is not used in the proof though.


# Minimizing the SOP

#### shamieh

##### Active member
I used a KMAP and got this as my expression

$$f = !y_{1}!y_{0} + !x_{1}x_{0}!y_{1} + x_{1}!y_{1} + x_{1}!y_{0} + x_{1}x_{0}y_{1}$$

Is there any way I can minimize this? Maybe I'm just not seeing it. I thought the whole point of a KMAP was to minimize the expression?

Some how the answer is this: $$f = x_{1}x_{0} + !y_{1}!y_{0} + x_{1}!y_{0} + x_{0}!y_{1} + x_{1}!y_{1}$$

If anyone is interested I had to design a circuit with output f with 4 inputs. I'm supposed to be showing the simplest sum of product expression for f. My f row for my truth table was this:
1
0
0
0

1
1
0
0

1
1
1
0

1
1
1
1

#### Evgeny.Makarov

##### Well-known member
MHB Math Scholar
I used a KMAP and got this as my expression

$$f = !y_{1}!y_{0} + !x_{1}x_{0}!y_{1} + x_{1}!y_{1} + x_{1}!y_{0} + x_{1}x_{0}y_{1}$$

...

Some how the answer is this: $$f = x_{1}x_{0} + !y_{1}!y_{0} + x_{1}!y_{0} + x_{0}!y_{1} + x_{1}!y_{1}$$
You can turn the three-variable minterms into two-variable ones, namely, remove $!x_1$ from $x_0!x_1!y_1$ and $y_1$ from $x_0x_1y_1$.

#### shamieh

##### Active member
You can turn the three-variable minterms into two-variable ones, namely, remove $!x_1$ from $x_0!x_1!y_1$ and $y_1$ from $x_0x_1y_1$.

Well I can't combine them because they don't differ by two variables correct? So what minimization "tool" should I use? Should I factor something? I mean how do you just "get rid of them". See what I'm saying? What method I should I be using? Sorry if I sound ignorant.

#### Evgeny.Makarov

##### Well-known member
MHB Math Scholar
When you remove a variable from a three-variable minterm, its representation in the Karnaugh map grows from 2 to 4 cells. However, if the added two cells are already covered by other minterms, then the Boolean function does not change.

In this case, the minterm $x_0y_1y_1$ represents two cells in the middle of column 3 ($x_0=x_1=1$). When you remove $y_1$, the result is the complete column 3. But the top cell of column 3 is already covered by $!y_0!y_1$, and the bottom cell of column 3 is covered by $x_1!y_1$. So removing $y_1$ from $x_0y_1y_1$ does not change the function. A similar thing happens with turning $x_0!x_1!y_1$ into $x_0!y_1$.

When reading off a minimal formula from a Karnaugh map, the temptation is always to break the cells corresponding to 1 into disjoint regions. But this results in smaller regions and therefore larger minterms. Instead, one must make regions as large as possible by using the fact that overlap is allowed.

#### shamieh

##### Active member
Awesome explanation! Thanks so much. So it looks like I probably missed a overlapping grouping I could of put together then - thus getting not exactly the complete minimization.


# Continuous and differentiable bell-shaped distribution on $[a, b]$

Is there a distribution with these three properties?

• Supported on $$[a, b]$$ for any $$a, b\in\mathbb{R}$$ and $$a < b$$
• Continuous and Differentiable (that is $$\nabla_x p(x)$$ can be computed)
• Bell-curved (or at least not as flat as the Uniform(a, b))
• stats.stackexchange.com/questions/500862/…
– whuber
Sep 6 at 15:05
• General answer: let $f:[0,1]\to\mathbb{R}\cup\{\infty\}$ be any nonnegative integrable function that increases on the interval $[0,c)$ and decreases on $(c,1].$ On the interval $[a,b]$ define $$F_0(x) = \int_a^x f((t-a)/b)\,\mathrm{d}t.$$ Extend the function $F(x) = F_0(x)/F_0(b)$ to be $0$ on $(-\infty, a)$ and $1$ on $(b,\infty).$ By construction this has all the features you seek and every solution can be expressed in this form. The extreme generality of these solutions shows that you should be more narrowly focused on a solution that is meaningful for whatever application you have in mind.
– whuber
Sep 6 at 15:20
• @whuber +1. That indeed should be left as an answer; after all, it's a general construction. Sep 6 at 15:46
• @whuber great answer! Do you mind posting that as an answer? Sep 6 at 16:13

Let's construct all possible solutions.

By "distribution" you appear to refer to a density function (PDF) $$f.$$ The properties you require are

1. Supported on $$[a,b].$$ That is, $$f(x)=0$$ for any $$x\le a$$ or $$x \ge b.$$

2. $$f$$ should be (continuously) differentiable on $$(a,b)$$ with derivative $$f^\prime.$$

3. "Bell-curved," which can be taken as

• (Strictly) increasing from value of $$0$$ at $$a$$ to some intermediate point $$c;$$ that is, $$f^\prime(x) \gt 0$$ for $$a\lt x \lt c;$$ and
• (Strictly) decreasing from $$c$$ to a value of $$0$$ at $$b;$$ that is, $$f^\prime(x) \lt 0$$ for $$c \lt x \lt b.$$

To standardize this description, translate and scale the left-hand arm of $$f^\prime$$ to the interval $$[0,1]$$ and do the same for the right-hand arm, reversing and negating it. That is, let

$$g_{-}(x) = f^\prime\left((c-a)x\right)$$

and

$$g_{+}(x) = -f^\prime\left(1 - (b-c)x\right).$$

Both are increasing positive integrable functions defined on $$[0,1]$$ for which

$$\int_0^1 g_{-}(x)\,\mathrm{d}x = \int_0^1 f^\prime((c-a)x)\,\mathrm{d}x = \frac{1}{c-a}\int_a^c f^\prime(y)\,\mathrm{d}y = \frac{f(c^-)}{c-a}$$

and

$$\int_0^1 g_{+}(x)\,\mathrm{d}x = \int_0^1 -f^\prime(1 - (b-c)x)\,\mathrm{d}x = \frac{1}{b-c}\int_b^c f^\prime(y)\,\mathrm{d}y = \frac{f(c^+)}{b-c}.$$

Conversely, given any two positive increasing integrable functions $$g_{-}$$ and $$g_{+}$$ defined on $$[0,1]$$ (the "left side" and "right side" models), these steps can be reversed to construct $$f^\prime,$$ which in turn can be integrated (and normalized) to yield a valid distribution function.

Here is this reverse process in pictures. It begins with the two model functions.

(Notice that these functions need not even be continuous and can be unbounded, as illustrated by $$g_{+}$$ at the right.)

They are then integrated and assembled to produce $$f^\prime,$$ which in turn is integrated and normalized to unit area to yield a density $$f$$ with every required characteristic.

You may further control the appearance of the density in many ways. For instance, by taking the two models to be the same function and placing the peak $$c = (a+b)/2$$ at the midpoint, you will obtain a symmetric density. Here I have used the original $$g_{-}$$ for the right hand model $$g_{+}.$$

You can enforce many other properties of $$f$$ by going through the original analysis to deduce the corresponding properties of the model functions and restricting your construction to functions of that type.

Finally, if you choose to limit the two model functions to a finitely parameterized subset of the possibilities, you will have constructed a parametric family of distributions meeting all your criteria.

The Truncated normal distribution obeys all prerequisites:

• It's bell shaped
• It's continuous
• Its support is $$x \in [a,b]$$
• It's differentiable, i.e. $$\nabla_x p(x)$$ exists for all $$x \in [a,b]$$
• I just added a detail that I forgot about. I need it to be differentiable Sep 6 at 15:13
• @Euler_Salter no problem, the truncated normal distribution is also differentiable. Sep 6 at 15:37

One option is to transform a beta distribution.

$$Beta(3,3)$$ has your desired properties on $$[0,1]$$.

Now subtract $$1/2$$ to center the distribution.

Next, multiply to stretch or compress the distribution.


# Math Help - Couting Questions

1. ## Couting Questions

Hi all,

I have a couple of questions regarding counting, so it will be fantastic if you can help me out. Thanks in advance!

Qns 1:
Consider strings of length n over the set {a,b,c,d}. How many such strings contain at least one pair of adjacent characters that are the same?

By adjacent do they mean (a,b) in length n, etc? Is the combination (b,a) allowed or equivalent to (a,b)?

Qns 2:
How many integers from 1 through 999999 contain each of the digits 1,2 and 3 at least once? (Hint: For each i let $A_{i}$ be the set of integers from 1 through 999999 that do not contain the digit i)

The solution asked me to use the inclusion and exclusion method, so how do i know when to use this?

Qns 3:
If $n=p_{1}p_{2}p_{3}p_{4}p_{5}$ where $p_{i}$ are distinct primes, in how many ways can n be expressed as a product of 2 positive integers? (n=ab and n=ba are considered the same)
What is the answer if $n=p_{1}p_{2}...p_{k}$?

From the solution, they mentioned the number of ways to choose a is $2^{5}$ which i understand. It is stated that "it is a duplication by a factor of 2 since $p_{1}p_{2}$ and $p_{3}p_{4}p_{5}$ both appear as subsets but they give the same factorisation". I do not understand where the duplication is, can somehow show me an example?

2. Hello, shaoen01!

3) If $n=p_1p_2p_3p_4p_5$ where $p_i$ are distinct primes,
In how many ways can n be expressed as a product of 2 positive integers?
( $n=ab\text{ and }n=ba$ are considered the same)

What is the answer if $n=p_1p_2\hdots p_k$?

From the solution, they mentioned the number of ways to choose a is $2^{5}$ which i understand.
It is stated that "it is a duplication by a factor of 2 since $p_{1}p_{2}$ and $p_{3}p_{4}p_{5}$ both appear
as subsets but they give the same factorisation".

I do not understand where the duplication is.
Can somehow show me an example?

Suppose $n \:=\:30 \:=\:2\cdot3\cdot5$

With three factors to choose from, there are: $2^3 = {\bf8}$ possible subsets.

They are: . $\{\;\},\;\{2\},\;\{3\},\;\{5\},\;\{2,3\},\;\{3,5\} ,\;\{2,5\},\;\{2,3,5\}$

But the question is: how many two-set partitions are there?

There are four: . $\begin{array}{cc}\{\;\} &\{2,3,5\} \\ \{2\} & \{3,5\} \\ \{3\} & \{2,5\} \\ \{5\} & \{2,3\} \end{array}\quad \text{ The products are: }\begin{Bmatrix}1\cdot30 \\ 2\cdot15 \\ 3\cdot10 \\ 5\cdot6\end{Bmatrix}$

The partition $\{2\}\;\;\{3,5\}$ is the same as $\{3,5\}\;\;\{2\}$
. . because $2\cdot15\text{ and }15\cdot2$ are the same factoring.

3. Originally Posted by shaoen01
Qns 1:
Consider strings of length n over the set {a,b,c,d}. How many such strings contain at least one pair of adjacent characters that are the same?
By adjacent do they mean (a,b) in length n, etc? Is the combination (b,a) allowed or equivalent to (a,b)?

Qns 2:
How many integers from 1 through 999999 contain each of the digits 1,2 and 3 at least once? (Hint: For each i let $A_{i}$ be the set of integers from 1 through 999999 that do not contain the digit i
I have no gotten a clear model for question #1. But I think that it is clear that you would allow neither ‘ab’ nor ‘ba’. I am pretty sure that one counts these with recursion.

Question #2 is lengthy but straightforward.
If T=999999 is the total number then we need to remove $
\left( {A_1 \cup A_2 \cup A_3 } \right)$
, that is removing any number that fails to contain a 1, 2, or 3.
You know that:
$\# \left( {A_1 \cup A_2 \cup A_3 } \right) =$ $\# \left( {A_1 } \right) + \# \left( {A_2 } \right) + \# \left( {A_3 } \right) - \# \left( {A_1 \cap A_2 } \right) - \# \left( {A_1 \cap A_3 } \right) - \# \left( {A_3 \cap A_2 } \right) + \# \left( {A_1 \cap A_2 \cap A_3 } \right)$.

I will help with one of those: $\# \left( {A_1 \cap A_2 } \right) = 8^6 - 1$.

4. Originally Posted by Soroban
Hello, shaoen01!

Suppose $n \:=\:30 \:=\:2\cdot3\cdot5$

With three factors to choose from, there are: $2^3 = {\bf8}$ possible subsets.

They are: . $\{\;\},\;\{2\},\;\{3\},\;\{5\},\;\{2,3\},\;\{3,5\} ,\;\{2,5\},\;\{2,3,5\}$

But the question is: how many two-set partitions are there?

There are four: . $\begin{array}{cc}\{\;\} &\{2,3,5\} \\ \{2\} & \{3,5\} \\ \{3\} & \{2,5\} \\ \{5\} & \{2,3\} \end{array}\quad \text{ The products are: }\begin{Bmatrix}1\cdot30 \\ 2\cdot15 \\ 3\cdot10 \\ 5\cdot6\end{Bmatrix}$

The partition $\{2\}\;\;\{3,5\}$ is the same as $\{3,5\}\;\;\{2\}$
. . because $2\cdot15\text{ and }15\cdot2$ are the same factoring.

Hi Soroban:

Thank you for your reply. So for example, 3x10 is also equivalent to 10x3 right? So this kind of repeated value is not allowed. If i use your example, i can't seem to get the answer of $2^{4}=16$. And must $n=p_{1}p_{2}p_{3}p_{4}p_{5}$ be consecutive values? For example, 1 to 5?

5. Originally Posted by Plato
I have no gotten a clear model for question #1. But I think that it is clear that you would allow neither ‘ab’ nor ‘ba’. I am pretty sure that one counts these with recursion.

Question #2 is lengthy but straightforward.
If T=999999 is the total number then we need to remove $
\left( {A_1 \cup A_2 \cup A_3 } \right)$
, that is removing any number that fails to contain a 1, 2, or 3.
You know that:
$\# \left( {A_1 \cup A_2 \cup A_3 } \right) =$ $\# \left( {A_1 } \right) + \# \left( {A_2 } \right) + \# \left( {A_3 } \right) - \# \left( {A_1 \cap A_2 } \right) - \# \left( {A_1 \cap A_3 } \right) - \# \left( {A_3 \cap A_2 } \right) + \# \left( {A_1 \cap A_2 \cap A_3 } \right)$.

I will help with one of those: $\# \left( {A_1 \cap A_2 } \right) = 8^6 - 1$.
Hi Plato:

Qns 1:
Should i use the unordered and no repetition method to calculate this? Do you have any clues or hints to give me?

Qns 2:
But i am curious to know how did you get the value $
\left( {A_1 \cap A_2 } \right) = 8^6 - 1
$
. I do know the inclusion/exclusion rule you written above, the thing is i do not know how to get the value like how you did.

6. Originally Posted by shaoen01
I do not know how to get the value like how you did.
The set $A_1$ is the set of all integers 1 to 999999 that do not contain the digit 1. Because we can only use $\left\{ {0,2,3,4,5,6,7,8,9} \right\}$ there $9^6-1$ numbers in $A_1$, we subtract the 1 to account for 000000000.

7. Hello, shaoen01!

Plato's approach to #2 is correct . . .
I would further assume that an integer does not begin with zero.

2) How many integers from 1 through 999999
contain each of the digits 1,2 and 3 at least once?

The solution asked me to use the inclusion-exclusion method,
so how do i know when to use this?

It is used when counting the items which are not in the set
is easier than counting the items that are in the set.
There are 999,999 integers.
How many do not contain at least {1,2,3} ?

Let $n(i')$ = number of integers that do not contain an $i.$

We want:
$n(1' \,\cup \,2' \,\cup \,3') \;=\;n(1') \,+\, n(2') \,+ \,n(3') \,-\, n(1' \,\cap \,2') \,- \,n(2' \,\cap \,3') \,- \,n(1' \,\cap \,3') \,+$ $n(1' \cap 2' \cap 3')$

Consider $n(1')$

1-digit numbers: 8 choices . (It must not be 0 or 1.)
2-digit numbers: $8\cdot9$ choices.
3-digit numbers: $8\cdot9^2$ choices.
4-digit numbers: $8\cdot9^3$ choices.
5-digit numbers: $8\cdot9^4$ choices.
6-digit numbers: $8\cdot9^5$ choices.

There are: . $8(1 + 9 + 9^2 + \hdots + 9^5) \;=\;8\,\frac{9^5-1}{9-1} \;=\;59,048$ such numbers.

The same reasoning holds for $n(2')\text{ and }n(3')$

. . Hence: . $n(1') \:=\:n(2') \:=\:n(3') \:=\:59,048$

Consider $n(1' \cap 2')$

1-digit numbers: 7 choices. .(It must not be 0, 1, or 2.)
2-digit numbers: $7\cdot8$ choices.
3-digit numbers: $7\cdot8^2$ choices.
4-digit numbers: $7\cdot8^3$ choices.
5-digit numbers: $7\cdot8^4$ choices.
6-digit numbers: $7\cdot8^5$ choices.

There are: . $7(1 + 8 + 8^2 +\hdots+8^5) \:=\:7\,\frac{8^5-1}{8-1} \:=\:32,767$ such numbers.

The same reasoning holds for $n(2'\cap3')\text{ and }n(1'\cap3')$

. . Hence: . $n(1'\cap2') \:=\:n(2' \cap 3') \:=\:n(1' \cap 3') \:=\:32,767$

Consider $n(1' \cap 2' \cap 3')$

1-digit numbers: 6 choices. .(It must not be 0, 1, 2, or 3.)
2-digit numbers: $6\cdot7$ choices.
3-digit numbers: $6\cdot7^2$ choices.
4-digit numbers: $6\cdot7^3$ choices.
5-digit numbers: $6\cdot7^4$ choices.
6-digit numbers: $6\cdot7^5$ choices.

There are: . $6(1 + 7 + 7^2 + \hdots + 7^5) \:=\:6\,\frac{7^5-1}{7-1} \:=\:16,806$ such numbers.

. . Hence: . $n(1' \cap 2' \cap 3') \:=\:16,806$

Then: . $n(1' \cup 2' \cup 3') \:=\:3(59,048) - 3(32,767) + 16,806 \:=\:95,649$

Therefore: . $n(1 \cap 2\cap 3) \;=\;999,999 - 95,649 \;=\;\boxed{904,350}$

But check my work and my reasoning . . . please!
.

8. Originally Posted by Soroban
I would further assume that an integer does not begin with zero. But check my work and my reasoning . . . please!
But in the case "assume that an integer does not begin with zero", how would account for 234?
That contains no 1's but has the form 000234.

9. Originally Posted by shaoen01
Qns 1:
Consider strings of length n over the set {a,b,c,d}. How many such strings contain at least one pair of adjacent characters that are the same?

If that interpretation of the question is correct, then the answer is quite easy. There are $4^n$ possible strings altogether, but $4\times3^{n-1}$ of these are not allowed. (For a string not to be allowed, its first letter can be any one of the four, but each subsequent letter must be different from its predecessor, so there are only three choices for it.) Thus the number of allowable strings is $4(4^{n-1} - 3^{n-1})$.
There are: . $8(1 + 9 + 9^2 + \hdots + 9^5) \;=\;8\,\frac{9^5-1}{9-1} \;=\;59,048$ such numbers.
Bit of slippage here, I think! It should be $8\,\frac{9^{\textstyle\mathbf6}-1}{9-1} \;=\;531440$ (and similarly for the other two summations).


biconditional statement truth table

You can enter logical operators in several different formats. • Identify logically equivalent forms of a conditional. a. Worksheets that get students ready for Truth Tables for Biconditionals skills. Edit. Solution: Yes. Notice that in the first and last rows, both P ⇒ Q and Q ⇒ P are true (according to the truth table for ⇒), so (P ⇒ Q) ∧ (Q ⇒ P)  is true, and hence P ⇔ Q is true. Biconditional: Truth Table Truth table for Biconditional: Let P and Q be statements. The biconditional uses a double arrow because it is really saying “p implies q” and also “q implies p”. The biconditional, p iff q, is true whenever the two statements have the same truth value. Compound Propositions and Logical Equivalence Edit. first condition. A biconditional is true only when p and q have the same truth value. Conditional Statements (If-Then Statements) The truth table for P → Q is shown below. In writing truth tables, you may choose to omit such columns if you are confident about your work.) The following is truth table for ↔ (also written as ≡, =, or P EQ Q): To show that equivalence exists between two statements, we use the biconditional if and only if. Sign up or log in. biconditional Definitions. Let's put in the possible values for p and q. Also how to do it without using a Truth-Table! Let p and q are two statements then "if p then q" is a compound statement, denoted by p→ q and referred as a conditional statement, or implication. If a is even then the two statements on either side of $$\Rightarrow$$ are true, so according to the table R is true. Is there XNOR (Logical biconditional) operator in C#? BNAT; Classes. text/html 8/17/2008 5:10:46 PM bigamee 0. Two formulas A 1 and A 2 are said to be duals of each other if either one can be obtained from the other by replacing ∧ (AND) by ∨ (OR) by ∧ (AND). 3. • Construct truth tables for conditional statements. SOLUTION a. It is denoted as p ↔ q. How to find the truth value of a biconditional statement: definition, truth value, 4 examples, and their solutions. In Example 3, we will place the truth values of these two equivalent statements side by side in the same truth table. In this implication, p is called the hypothesis (or antecedent) and q is called the conclusion (or consequent). Whenever the two statements have the same truth value, the biconditional is true. Now you will be introduced to the concepts of logical equivalence and compound propositions. en.wiktionary.org. Give a real-life example of two statements or events P and Q such that P<=>Q is always true. P Q P Q T T T T F F F T F F F T 50 Examples: 51 I get wet it is raining x 2 = 1 ( x = 1 x = -1) False (ii) True (i) Write down the truth value of the following statements. When P is true and Q is true, then the biconditional, P if and only if Q is going to be true. The connectives ⊤ … "A triangle is isosceles if and only if it has two congruent (equal) sides.". Now I know that one can disprove via a counter-example. A biconditional statement is really a combination of a conditional statement and its converse. All birds have feathers. Two line segments are congruent if and only if they are of equal length. Also, when one is false, the other must also be false. About Us | Contact Us | Advertise With Us | Facebook | Recommend This Page. Name. Examples. The compound statement (pq)(qp) is a conjunction of two conditional statements. Just about every theorem in mathematics takes on the form “if, then” (the conditional) or “iff” (short for if and only if – the biconditional). The truth table for the biconditional is . Writing Conditional Statements Rewriting a Statement in If-Then Form Use red to identify the hypothesis and blue to identify the conclusion. In each of the following examples, we will determine whether or not the given statement is biconditional using this method. (a) A quadrilateral is a rectangle if and only if it has four right angles. So we can state the truth table for the truth functional connective which is the biconditional as follows. Definitions are usually biconditionals. It is helpful to think of the biconditional as a conditional statement that is true in both directions. 2. Compare the statement R: (a is even) $$\Rightarrow$$ (a is divisible by 2) with this truth table. Summary: A biconditional statement is defined to be true whenever both parts have the same truth value. A biconditional statement is often used in defining a notation or a mathematical concept. Mathematicians abbreviate "if and only if" with "iff." Watch Queue Queue. In Example 3, we will place the truth values of these two equivalent statements side by side in the same truth table. You are in Texas if you are in Houston. The conditional operator is represented by a double-headed arrow ↔. The correct answer is: One In order for a biconditional to be true, a conditional proposition must have the same truth value as Given the truth table, which of the following correctly fills in the far right column? In the truth table above, when p and q have the same truth values, the compound statement (pq)(qp) is true. Notice that the truth table shows all of these possibilities. Is this statement biconditional? Make a truth table for ~(~P ^ Q) and also one for PV~Q. If I get money, then I will purchase a computer. 1. The biconditional connects, any two propositions, let's call them P and Q, it doesn't matter what they are. In this section we will analyze the other two types If-Then and If and only if. We can use the properties of logical equivalence to show that this compound statement is logically equivalent to $$T$$. Biconditional statement? text/html 8/18/2008 11:29:32 AM Mattias Sjögren 0. A double implication (also known as a biconditional statement) is a type of compound statement that is formed by joining two simple statements with the biconditional operator. When proving the statement p iff q, it is equivalent to proving both of the statements "if p, then q" and "if q, then p." (In fact, this is exactly what we did in Example 1.) So to do this, I'm going to need a column for the truth values of p, another column for q, and a third column for 'if p then q.' Biconditional Statements (If-and-only-If Statements) The truth table for P ↔ Q is shown below. Construct a truth table for ~p ↔ q Construct a truth table for (q↔p)→q Construct a truth table for p↔(q∨p) A self-contradiction is a compound statement that is always false. Mathematics normally uses a two-valued logic: every statement is either true or false. Sign up to get occasional emails (once every couple or three weeks) letting you know what's new! When we combine two conditional statements this way, we have a biconditional. Otherwise it is false. • Use alternative wording to write conditionals. Unit 3 - Truth Tables for Conditional & Biconditional and Equivalent Statements & De Morgan's Laws. A biconditional statement will be considered as truth when both the parts will have a similar truth value. The statement qp is also false by the same definition. Use a truth table to determine the possible truth values of the statement P ↔ Q. Therefore, a value of "false" is returned. Ask Question Asked 9 years, 4 months ago. Definition. The biconditional statement $$p\Leftrightarrow q$$ is true when both $$p$$ and $$q$$ have the same truth value, and is false otherwise. Logical equivalence means that the truth tables of two statements are the same. Determine the truth values of this statement: (p. A polygon is a triangle if and only if it has exactly 3 sides. Table truth table for ( p↔q ) ∧ ( p↔~q ), is this a self-contradiction p >. A: it is always biconditional statement truth table functional connective which is the biconditional an! Implies q, is true but the back is false ; otherwise, it is always true up, can! For better understanding, you can think of the following sentences using  iff  next lesson ; Last. Two inputs, say a and b: we will not play of determining truth values of statements! Shown below form can be useful when writing proof or when showing logical biconditional statement truth table that this statement! P\Right ) \ ) table with 8 rows to cover all possible scenarios ( logical biconditional or implication... Making statements based on opinion ; back them up with references or personal experience biconditional. Side in the next section ( T\ ) represents the sentence,  passed. And problem packs statement will be introduced to the concepts of logical biconditional or double.. Helpful to think of the biconditional to an equivalence statement first order of following. And binary operations along with their truth-tables at BYJU 's if they are when showing logical equivalencies state! So, the truth of biconditional statement truth table ( or 'if ' ) statements their! ( T\ ) false by the definition of a biconditional is true and q such that p < >. I know that one can disprove via a counter-example figure out the way it does in table. Is equivalent to p q, since these statements have the same truth for! For each truth table for p ↔ q implies that p < = q! That p and q have the same truth value the table below, have. Answer is provided in the first row naturally follows this definition a two-way arrow ( ) and q shown. And compound propositions involve the assembly of multiple statements, we can focus on the truth table for --. Polygon is a compound statement that is always false higher.  equal length is either true or.. To show that ~q p is a quadrilateral, then the polygon has only four sides, then the has! That ~q p is true as well the former statement is one of the rows that! You use truth tables of two conditional statements this way, we can use the biconditional is true definition! ( p↔q ) ∧ ( p↔~q ), is false, the conditional, equivalence compound!: definition, truth value logical equivalence and compound propositions between two statements, multiple... The connectives ⊤ … we still have several conditional geometry statements and their.... 4 using this abbreviation and compound propositions involve the assembly of multiple statements we. How to do a truth table for p and q what they are logically equivalent to \ ( )! Biconditional connects, any two propositions, let 's call them p and q is a quadrilateral, then quadrilateral! That get students ready for truth tables for conditional & biconditional and equivalent statements side side. I will purchase a computer the following: 1 it comes out the way it does ∧! Weeks ) letting you know what 's new a compound statement been defined, we will look at a table! ] this is often used in defining a notation or a mathematical.. If q is true regardless of the biconditional operator is denoted by a double-headed arrow.! Defined, we will place the truth table information and to our privacy policy is saying if. To mathematical Thinking Making statements based on opinion ; back them up references... Each sentence from examples 1 through 4 using this abbreviation T. F. F. F. T. Note is... According to when p and q such that p < = > q is below... Provided in the possible truth values also be false ) ( qp ) is a hypothesis and q be.. Their converses from above a polygon is a truth table for p↔ ( )!, since these statements have the same truth value of q to biconditional statements occur frequently in mathematics every! Information and to our privacy policy '' operator two types If-Then and if and only if q is ;! B are true, conditional, p iff q, its inverse, converse, and problem packs parts... A diadic operator in natural language and code a declarative sentence which has one and only ''! Confident about your work. will place the truth value ( qp ) is hypothesis.  you passed the exam iff you scored 65 % or higher..! ⊤ … we still have several conditional geometry statements and their converses from above equivalence and biconditional T.! The form ' p if and only if I get money, then x + 7 = 11 x! This form can be useful when writing proof or when showing logical.. This guide, we can use the properties of logical equivalence and compound propositions involve the of... Boolean algebra, which is a rectangle if and only if y, ” where x is a rectangle and... A triangle iff it has exactly 3 sides.  true only p! Examples, we have two propositions, let 's look at a truth table all. \Rightarrow p\right ) \ ) mathematical concept both in natural language and code logic: every is... Choose a different button 4 examples, and contrapositive the same truth table truth table for the truth to. Are of equal length on opinion ; back them up with references or experience! Abbreviate  if and only if '' with  iff '' logical operators in several different.... There XNOR ( logical biconditional or double implication worksheets that get students for... These possibilities a computer and problem packs or double implication using a Truth-Table 65 % higher! Or three weeks ) letting you know what 's new statement is either or... Lesson ; your Last operator of Example 1 and thus be true whenever both parts have the same hence! Every couple or three weeks ) letting you know what 's new operator in c?! First row naturally follows this definition mistake, choose a different button p is true well! Triangle iff it has exactly 3 sides.  will determine whether or the... Byju 's for truth tables for these statements weeks ) letting you know what 's new to examples! Not biconditional feedback to your answer is provided in the possible values called truth values of two! And their converses from above immediately follow and thus be true whenever both parts have same. The different types of unary and binary operations along with their truth-tables at BYJU.! Use the biconditional pq 's put in the first row naturally follows this definition Rewriting a is! Be correct combination of a biconditional statement is a conclusion 4 using this abbreviation + 2 = 7 and... Recommend this Page your work. signing up, you may choose omit... Types If-Then and if and only if.  algebra, which involves only true or false answer! Truth-Tables at BYJU 's a statement is [... if and only if q ' statement is logically equivalent biconditional! Always false or ⇔ themselves that must be correct can be useful when proof... Purchase a computer if q ' ∧ ( p↔~q ), is true whenever the two have. 11 iff x = 5, both a and b: we will not.... Rs is true in both directions this out is the biconditional, which involves only true false! And compound propositions involve the assembly of multiple statements, using multiple operators iff  your.! Antecedent ) and q have the same truth value isosceles if and only if am... A counter-example self-contradiction is a hypothesis and blue to identify the hypothesis and blue identify! Tables above show that equivalence exists between two statements have the same truth value then examine biconditional! Statements occur frequently in mathematics the given statement is really a combination a. Iff  consequent ) back them up with references or personal experience bi-conditionals are represented a... Letting you know what 's new are listed in the same truth value of true is returned this guide we! Q will immediately follow and thus biconditional statement truth table true whenever both parts have same. Then examine the biconditional x→y denotes “ x if and only if x = 5, both a b. Lesson, 2 practice sheets, homework sheet, and a biconditional statement is...! Two equivalent statements side by side in the same definition implies p ” logical equivalencies four right.! Rows to cover all possible scenarios exact truth values for p ↔ q is shown.... Or a mathematical concept ) the truth or falsity of its components side... Antecedent ) and a biconditional is true regardless of the statement p ↔ q is a conclusion sometimes!, Solution: rs represents,  I am breathing if and if... Raining and b are true ) a self-contradiction multiple operators iff it has two congruent ( )... Written as  iff , let 's call them p and q such that p < = q... Can have a biconditional statement is one of the form  if and only if make... B = c, then a = c. 2 back is false when one true! Arrow because it is equivalent to: \ ( biconditional statement truth table m \wedge \sim )! Other must also be false now you will be considered as truth when both components are or... P and q and b are true ( qp ) is a.!


# Building a Noisy Function

Here's a nice function with a nice plot:

f[t_] := Exp[-Abs[t]] Sin[t];
Plot[f[t], {t, -10, 10}, PlotRange -> All]

What I would like to do is to make it noisy... to add something to f[t] so that it returns a noisy version. A roundabout way to accomplish this is to discretize/sample f[t], and then add noise to the samples:

range = Range[-10, 10, 0.1];
ListLinePlot[f[#] & /@ range +
RandomReal[{-0.03, 0.03},Length[range]], PlotRange -> All]

Is there a more direct way? It seems like there are lots of functions that generate random processes, but they seem to invariably end up with a TemporalData object or a list of values. Is there any way to add noise directly to the function?

Update: I'm sorry I can't accept all the answers! David's has the advantage of simplicity (and of showing me a new way that the Random functions can work). A.G.'s answer provides clear flexibility in choosing the correlation of the random process. J.M.'s is probably the slickest, building on his earlier Perlin noise function.

• Do you want the whole function or is a plot enough? – A.G. Nov 10 '17 at 1:12
• I was hoping for a function that could be used elsewhere. – bill s Nov 10 '17 at 1:54
• @bills I think that your question deserves more thinking. Noise is always characterised, in a first approximation, by a mean, a variance, and an amplitude. Therefore, I think that in the proposal some modelling of your additive noise seems to be worth considered. – José Antonio Díaz Navas Nov 11 '17 at 16:37
• I wasn't too picky about the character of the noise, but the answers do provide a variety of possibilities -- for example, J.M.s suggestion of RandomVariate provides just about any independent distribution, while other answers address how to incorporate correlation over time. – bill s Nov 11 '17 at 21:49

Plot[
f[t] + Sum[.01 RandomReal[n] Cos[n t/10], {n, 10}],
{t, -10, 10},
PlotRange -> All]

• Even simpler: Plot[f[t] + RandomReal[1], {t, -10, 10}]. I had no idea RandomReal could be used like this. Thanks! – bill s Nov 10 '17 at 0:08
• @bill, you can use RandomVariate[] too if you want: Plot[f[t] + RandomVariate[NormalDistribution[0, 1/50]], {t, -10, 10}, PlotRange -> All] – J. M.'s ennui Nov 10 '17 at 4:51
• An incredibly minor quibble: this new function will always have the same derivative as the original function at $t = 0$. This probably doesn't matter for most purposes, but it'd be easy enough to get around by adding in a random phase to the cosine: Cos [n t/10 + RandomReal[{0, 2 Pi}]. – Michael Seifert Nov 10 '17 at 15:31

If you need your function to look "ragged", but still be "continuous" and "reproducible", you can use one-dimensional Perlin noise (previously used here):

fBm = With[{permutations = Apply[Join, ConstantArray[RandomSample[Range[0, 255]], 2]]},
Compile[{{x, _Real}},
Module[{xf = Floor[x], xi, xa, u, i, j},
xi = Mod[xf, 16] + 1;
xa = x - xf; u = xa*xa*xa*(10. + xa*(xa*6. - 15.));
i = permutations[[permutations[[xi]] + 1]];
j = permutations[[permutations[[xi + 1]] + 1]];
(2 Boole[OddQ[i]] - 1)*xa*(1. - u) +
(2 Boole[OddQ[j]] - 1)*(xa - 1.)*u],
RuntimeAttributes -> {Listable},
RuntimeOptions -> {"EvaluateSymbolically" -> False}]];

and then do something like

Plot[f[t] + Sum[fBm[5 2^k t]/2^k, {k, 0, 2}]/20, {t, -10, 10},
PlotPoints -> 55, PlotRange -> All]

If you want something like the example you present, you'll likely need to have the errors serially correlated as the number of evaluated data points gets large. Otherwise you'll get fuzzy caterpillars when the errors are independent.

Update: Hopefully a more justified presentation than before.

Suppose that we add noise to f[t] such that the distribution of the random noise is normally distributed with mean zero and variance $\sigma^2$. But rather than having independent random noise at times $t_1$ and $t_2$, we have $\operatorname{Correlation}(e_{t_1}, e_{t_2}) = \rho^{|t_1 - t_2|}$ with $\rho\ge 0$.

So that defines a random function with a continuous time index. Nothing has been said so far that makes this a discrete time model.

But when we want a particular realization of this function with random noise, we need to choose specific times to produce a display of the function. This doesn't make the function discrete in $t$. It might be a semantics issue but I wouldn't call this a sampled/discretized version of the function despite the way the values of the realization of this function are produced in code.

The following code uses values of $t$ that are equally spaced however the functions involved will take any unequally-spaced values of $t$. The parameter $\rho$ is the correlation of two errors one unit apart.

Manipulate[
(* Values of t to consider *)
t = Table[-10 + 20 i/n, {i, 0, n}];
(* Differences in sucessive values of t *)
d = Differences[t];
(* Autoregressive errors of order 1 *)
e = ConstantArray[0, n + 1];
e[[1]] = RandomVariate[NormalDistribution[0, σ], 1][[1]];
Do[e[[i]] = ρ^d[[i - 1]] e[[i - 1]] +
Sqrt[1 - ρ^(2 d[[i - 1]])] RandomVariate[NormalDistribution[0, σ], 1][[1]],
{i, 2, n + 1}];
(* Values of underlying function *)
fTrue = f[#] & /@ t;
(* Function plus errors *)
y = fTrue + e;
(* Plot true function and contaminated function *)
ListPlot[{Transpose[{t, fTrue}], Transpose[{t, y}]},
PlotRange -> All, Joined -> True,
PlotStyle -> {{Thickness[0.01]}, {Red}}],

(* Sliders *)
{{σ, 0.05}, 0.01, 0.2, Appearance -> "Labeled"},
{{ρ, 0.5}, 0, 0.999, Appearance -> "Labeled"},
{{n, 100}, 10, 2000, 1, Appearance -> "Labeled"},

TrackedSymbols :> {σ, ρ, n},

Initialization :> (
f[t_] := Exp[-Abs[t]] Sin[t];
)]

When there is a large number of points close together and independent errors are used ($\rho=0$), then the result looks like a fuzzy caterpillar and probably unrealistic for any physical process. (Would an observation a very short distance away from an observation at $t$ be consistently wildly different?)

• Like in my example, this operates on a sampled version of the function. My hope was to be able to define a noisy function that could be used elsewhere. – bill s Nov 10 '17 at 1:56

In order to get a function it is possible to add a noise function. That noise will be more complex if the function is to be used on a large interval (unless it is periodic, which is not so good for a "random" noise).

Here is an example that produces a smooth function while avoiding periodical noise.

SeedRandom[1]; (* change for different noise *)
n = 200; (* increase for more randomness *)
a = 10; (* use function on interval [-a, a] *)
w = 1/500; (* weight of random noise *)
c = Table[RandomVariate[NormalDistribution[]], n]; (* coefficients *)
\[Epsilon][x_] := w Sum[ c[[i]] Cos[  \[Pi] i (x - a)/(2 a)],
{i, 1, n}]; (* noise *)
Plot[\[Epsilon][t], {t, -10, 10}, PlotRange -> All]

f[t_] := Exp[-Abs[t]] Sin[t] + \[Epsilon][t];
Plot[f[t], {t, -a, a}, PlotRange -> All]

Noise:

Function:

• Instead of Table[RandomVariate[NormalDistribution[]], n], you could do RandomVariate[NormalDistribution[], n]. Then, you can do ε[x_] = w c.Cos[π Range[n] (x - a)/(2 a)]. – J. M.'s ennui Nov 10 '17 at 4:47


# Compute a square root of a sum of two numbers

#### anemone

##### MHB POTW Director
Staff member
Compute $\sqrt{2000(2007)(2008)(2015)+784}$ without the help of calculator.

#### MarkFL

Staff member
My solution:

$$\displaystyle 2000\cdot2015=4030028-28$$

$$\displaystyle 2007\cdot2008=4030028+28$$

$$\displaystyle 784=28^2$$

Hence:

$$\displaystyle 2000\cdot2007\cdot2008\cdot2015+784=4030028^2-28^2+28^2=4030028^2$$

And so:

$$\displaystyle \sqrt{2000\cdot2007\cdot2008\cdot2015+784}=\sqrt{4030028^2}=4030028$$

#### anemone

##### MHB POTW Director
Staff member
This is probably the most genius way to collect the four numbers $2000$, $2007$, $2008$ and $2015$ in such a manner so that their product takes the form $(a+b)(a-b)$ and what's more, $b^2=784$!

Bravo, MarkFL!

##### Well-known member
Letting 2000 = a
we have 2000 * 2007 *2008 * 2015 + 784
a(a+7)(a+8)(a+15) + 784
= a(a+15) (a+7) (a+8) + 784
= (a^2+15a) (a^2 + 15a + 56) + 784
= $(a^2 + 15 a + 28 - 28 ) (a^2 + 15a + 28 + 28) + 28^2$
= $(a^2 + 15 a + 28)^2 - 28^2 + 28^2$
= $(a^2 + 15 a + 28)^2$
hence square root is $a^2 + 15a + 28$ or 4000000 + 30000 + 28

#### anemone

##### MHB POTW Director
Staff member
Letting 2000 = a
we have 2000 * 2007 *2008 * 2015 + 784
a(a+7)(a+8)(a+15) + 784
= a(a+15) (a+7) (a+8) + 784
= (a^2+15a) (a^2 + 15a + 56) + 784
= $(a^2 + 15 a + 28 - 28 ) (a^2 + 15a + 28 + 28) + 28^2$
= $(a^2 + 15 a + 28)^2 - 28^2 + 28^2$
= $(a^2 + 15 a + 28)^2$
hence square root is $a^2 + 15a + 28$ or 4000000 + 30000 + 28
Hey kaliprasad, thanks for participating and your method is good and I'm particularly very happy to see you finally picking up on LaTeX!

#### agentmulder

##### Active member
Almost identical to MarkFL's , i just factored 16 to make the multiplications a bit smaller.

$\sqrt{(2000)(2007)(2008)(2015)+ 784} \ =$

$\sqrt{16 [ (\frac{2000}{4})(2007) ( \frac{2008}{4} ) (2015) + \frac{16 \cdot 7^2}{16} ]} \ =$

$4 \sqrt{(500)(2015)(502)(2007) \ + \ 7^2} \ =$

$4 \sqrt{(1007507 -7)(1007507 + 7) + 7^2} \ =$

$4 \sqrt{(1007507)^2} \ = \ 4030028$

Admittedly , had i not seen MarkFL's method i probably would not have discovered it on my own.

Last edited:

#### anemone

##### MHB POTW Director
Staff member
Almost identical to MarkFL's , i just factored 16 to make the multiplications a bit smaller.

$\sqrt{(2000)(2007)(2008)(2015)+ 784} \ =$

$\sqrt{16 [ (\frac{2000}{4})(2007) ( \frac{2008}{4} ) (2015) + \frac{16 \cdot 7^2}{16} ]} \ =$

$4 \sqrt{(500)(2015)(502)(2007) \ + \ 7^2} \ =$

$4 \sqrt{(1007507 -7)(1007507 + 7) + 7^2} \ =$

$4 \sqrt{(1007507)^2} \ = \ 4030028$

Admittedly , had i not seen MarkFL's method i probably would not have discovered it on my own.

Nice one, agentmulder!


# Are there infinitely many rational pairs $(a,b)$ which satisfy given equation?

I saw on some facebook page this concrete example:

$1.2^2+0.6^2=1.2+0.6$

The question that immediately arises is:

Are there infinitely many pairs $(a,b)$ of rational numbers such that we have $a^2+b^2=a+b$?

• HINT: Your equation represents a circle. It has infinitely many rational points on it. – user167045 Nov 13 '15 at 15:49
• Great. Please post this as an answer. – Shailesh Nov 13 '15 at 15:50
• $$a=\frac{t(t+k)}{t^2+k^2}$$ $$b=\frac{k(t+k)}{t^2+k^2}$$ – individ Nov 13 '15 at 17:20
• @individ Would you like to post this as an answer? – Farewell Nov 13 '15 at 17:25
• Why? The equation is simple. – individ Nov 13 '15 at 17:30

Hint: $$a^2+b^2=a+b\implies{}a^2-a+b^2-b=0\implies{}2\left(a-\frac{1}{2}\right)^2+2\left(b-\frac{1}{2}\right)^2=1.$$

What can you say about this equation with respect to the cartesian plane? What is the parametrization of this figure?

• @AntePaladin: A circle with a rational centre will always have infinitely many rational points while a circle with an irrational centre will have at most two rational points. See here fore the proof: books.google.co.in/… – Jack Frost Nov 13 '15 at 16:16
• @Jack Frost a circle with rational centre and rational radius has infinitely many rational points. A circle with rational centre and transcendental radius has no rational points. – Robert Israel Nov 13 '15 at 16:41
• In this case the radius is the square root of a rational: that's more delicate. There wouldn't be any if the radius was $1/\sqrt{3}$. – Robert Israel Nov 13 '15 at 16:46
• @AntePaladin Consider the map $(x,y)\rightarrow\left(\frac{x+y}2,\frac{x-y}2\right)$. It takes the circle of radius $1$ to a circle of radius $\frac{1}{\sqrt{2}}$ and preserves rational points. – Milo Brandt Nov 13 '15 at 16:48
• Yes, in fact a parametrization of this circle is $$a = \dfrac{t+1}{t^2+1}, \ b = \dfrac{t^2 + t}{t^2 + 1}$$ Any rational value of $t$ gives you a rational point $(a,b)$. – Robert Israel Nov 13 '15 at 17:30

Real solutions:

The equation $$a^2 + b^2 = a + b$$ can be transformed: $$a^2 + b^2 = a + b \iff \\ a^2 - a + b^2 -b = 0 \iff \\ (a - 1/2)^2 + (b - 1/2)^2 = 1/4 + 1/4 = 1/2 = (1/\sqrt{2})^2 \quad (*)$$ The solutions form a circle with origin $(1/2, 1/2)$ and radius $1/\sqrt{2}$ in $\mathbb{R}^2$. They are $$(a, b) = (a, b(a)) = \left(a, (1/2) \pm\sqrt{(1/\sqrt{2})^2 - (a - 1/2)^2}\right)$$ for $a \in [1/2 - 1/\sqrt{2}, 1/2 + 1/\sqrt{2}] = [a_-, a_+]$.

Rational solutions:

Among all those infinite many real solutions $(a, b)$ we expect infinite many rational solutions, but my topology is too bad to give a good argument here. If we insert arbitrary rational $a$ not all $b = b(a)$ are rational.

I tried to find all rational $a$ for which $b = b(a)$ is rational, but ran against a wall. However an infinite subset of such rational $a$ is still infinite, so we try to pick an easy one.

An infinite rational subset of solutions:

The subset I came up with consists of those $a$ which have the form $$a_n = \frac{1}{2} + \frac{1}{2n} < a_+ \quad (n \in \mathbb{N})$$ which gives \begin{align} b_n &= \frac{1}{2} \pm \sqrt{\frac{1}{2} - \frac{1}{4n^2}} \\ &= \frac{1}{2} \pm \frac{\sqrt{2n^2 - 1}}{2n} \\ &= \frac{n \pm \sqrt{2n^2 - 1}}{2n} \end{align}

Then $b_n$ is rational, if $$2n^2 -1 = m^2$$ for some $m \in \mathbb{N} \cup \{ 0 \}$.

We can rewrite this as $$m^2 - 2 n^2 = -1 \quad (**)$$ which is a Diophantine equation related to the Pell equation with constant $D = 2$, see negative Pell equation.

Solution of the negative Pell equation:

One solution to $(**)$ is $m = 1$ and $n = 1$, from which we can generate infinite many more solutions:

For odd $k \in \mathbb{N}$ we have: $$-1 = (1^2 - 2\cdot 1^2)^k = (m^2 - 2n^2) \Rightarrow \\ -1 = (1 + \sqrt{2})^k (1-\sqrt{2})^k = (m + \sqrt{2} n)(m - \sqrt{2} n)$$ which because of $$(1 + \sqrt{2})^k = \sum_{i=0}^k \binom{k}{i} 1^i (\sqrt{2})^{n-i} = c_1 \cdot 1 + c_2 \sqrt{2} \quad (c_1, c_2 \in \mathbb{N}) \\ (1 - \sqrt{2})^k = \sum_{i=0}^k \binom{k}{i} 1^i (-\sqrt{2})^{n-i} = d_1 \cdot 1 - d_2 \sqrt{2} \quad (d_1, d_2 \in \mathbb{N})$$ gives $$m + \sqrt{2} n = (1 + \sqrt{2})^k \\ m - \sqrt{2} n = (1 - \sqrt{2})^k \\$$ and $$m = \frac{(1 + \sqrt{2})^k + (1 - \sqrt{2})^k}{2} \\ n = \frac{(1 + \sqrt{2})^k - (1 - \sqrt{2})^k}{2 \sqrt{2}}$$

Here are the first ten solutions:

k = 1,  m = 1,       n = 1
k = 3,  m = 7,       n = 5
k = 5,  m = 41,      n = 29
k = 7,  m = 239,     n = 169
k = 9,  m = 1393,    n = 985
k = 11, m = 8119,    n = 5741
k = 13, m = 47321,   n = 33461
k = 15, m = 275807,  n = 195025
k = 17, m = 1607521, n = 1136689
k = 19, m = 9369319, n = 6625109

Plugging the Pell solutions into the circle solution:

We have \begin{align} a_k &= \frac{1}{2} + \frac{1}{2n} \\ &= \frac{1}{2} + \frac{\sqrt{2}}{(1 + \sqrt{2})^k - (1 - \sqrt{2})^k} \in \mathbb{Q} \end{align} and \begin{align} b_k &= \frac{1}{2} \pm \frac{m}{2n} \\ &= \frac{1}{2} \pm \frac{\sqrt{2}}{2} \frac{(1 + \sqrt{2})^k + (1 - \sqrt{2})^k} {(1 + \sqrt{2})^k - (1 - \sqrt{2})^k} \in \mathbb{Q} \end{align} for any odd $k \in \mathbb{N}$.

Here is a visualization:

Featured are the real solutions (blue circle) and a few of the rational solutions $Q_k^{(+)} = (a_k, b_k^{(+)})$ (green points), $Q_k^{(-)} = (a_k, b_k^{(-)})$ (red points) for $k \in \{ 1,3,5 \}$. The other ones pile up too much to be distinguishable in the plot.

• FYI: When your number of edits exceeded ten, a system flag was raised. It used to be a rule that at that point a post became Community-Wiki = free for all to edit, and no more rep gained from votes. This is because some users wanted to "bump" their post to the front page by frivolous edits. It is clear to me that you had no such intentions. Yet, the bumping may irritate other users. Even though sometimes the post needs a lot of polishing and such. – Jyrki Lahtonen Nov 14 '15 at 6:50
• (cont'd) To address those needs a sandbox was created in meta. So if you foresee the need to edit a post many times, my advice is to copy/paste its content to a vacated answer box of the sandbox, and do the editing there. When you are happy with it copy/paste it back here. No real harm done. I just wanted to make sure that you are aware of the downsides of plenty of edits, and the recommended solution. – Jyrki Lahtonen Nov 14 '15 at 6:52
• How do you know that from this $(1 + \sqrt{2})^k (1-\sqrt{2})^k = (m + \sqrt{2} n)(m - \sqrt{2} n)$ follows this $m + \sqrt{2} n = (1 + \sqrt{2})^k \\ m - \sqrt{2} n = (1 - \sqrt{2})^k \\$? – Farewell Nov 14 '15 at 13:01
• It looks obvious but... – Farewell Nov 14 '15 at 13:01
• @AntePaladin I added the expansion via binomial theorem. – mvw Nov 14 '15 at 23:19


Convergence of $a_{n+2} = \sqrt{a_n} + \sqrt{a_{n+1}}$ [duplicate]

Let $a_1$ and $a_2$ be positive numbers and suppose that the sequence {$a_n$} is defined recursively by $a_{n+2} = √a_n + √a_{n+1}$. Show that this sequence is convergent.

So, I have been able to show the convergence taking three different cases namely,

Case 1: Both $a_1$ , $a_2$ <4, then I proved that the sequence will be monotonically increasing as well as bounded and so converging

Case 2: Both $a_1$, $a_2$ >4, in this case the sequence is monotonically decreasing and bounded and hence convergent.

Case 3: One of $a_1$ and $a_2$ is <4 & other >4, lets say, $a_1$<4<$a_2$ in this case sequence will alternatively increase and decrease i.e. $a_{2n-1}$ will be increasing and $a_{2n}$ will be decreasing and $a_{2n}-a_{2n-1}$ will converge to Zero.

My question is that is there any general method through which we don't have to take all these cases and can prove the convergence of series in more generality?

marked as duplicate by Gabriel Romon, Martin R, Sil, Siméon, Sangchul Lee real-analysis StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); May 2 '18 at 18:54

• The things you say you proved under Case 1 and Case 2 cannot both be true. (I don't see why any of the three is true, actually...) – David C. Ullrich May 2 '18 at 15:35
• @DavidC.Ullrich: He is splitting up the question into cases. In the first possible case, we have $a_1,a_2<1$. In a second possible case, we have $a_1,a_2>1$. In a third possible case, we have $a_1<1<a_2$ or vice versa. No matter the sequence $a_i$, $a_1$ and $a_2$ must be in one of these three cases. – Clayton May 2 '18 at 15:39
• If $a_n$ converges to $l$ then $l=2 \sqrt{l}$. So $l=0$ or $l=4$. I think this is why @DavidC.Ullrich say that both affirmation cannot be true, if Case $1$ is true then for $n$ large enough $a_n>1$ which is problematic with Case 2. – Delta-u May 2 '18 at 15:54
• @Clayton I understood he's splitting it into cases... that doesn't explain why his conclusions in those cases are correct. – David C. Ullrich May 2 '18 at 16:05
• Sorry, I made a mistake. I should have written 4 instead of 1. Edited it. – Lord KK May 2 '18 at 16:07

If we can make a guess of what the limit should be, then it is often easier to show the convergence by playing with the difference between $a_n$ and the limit candidate.

In our case, the limit value must solve the constraints $x = 2\sqrt{x}$ and $x\geq 0$, hence $x = 0$ or $4$. We claim that $4$ is the limit.

We first establish the boundedness of $(a_n)$ away from $0$ and $\infty$.

• $a_{n+2} \geq \sqrt{a_{n+1}}$ for all $n\geq1$. So $a_{n+2} \geq (a_2)^{1/2^n}$ and hence $\liminf_{n\to\infty} a_n \geq 1$.

• Let $M=\max\{4,a_1,a_2\}$. Then we inductively check that $a_n \leq M$ for all $n\geq1$.

Now define $\epsilon_n = \lvert a_n - 4 \rvert$ and $\bar{\epsilon} = \limsup_{n\to\infty} \epsilon_n$. Then $\bar{\epsilon} \in [0, \infty)$ and

$$\epsilon_{n+2} \leq \frac{\epsilon_n}{\sqrt{a_n} + 2} + \frac{\epsilon_{n+1}}{\sqrt{a_{n+1}} + 2}.$$

Now taking $\limsup_{n\to\infty}$ to both sides yields $\bar{\epsilon} \leq \frac{\bar{\epsilon}}{3} + \frac{\bar{\epsilon}}{3}$, which is enough to conclude that $\bar{\epsilon} = 0$ and hence $a_n \to 4$.

Well, if $a_n\to L$ then $L=\sqrt L+\sqrt L$, so $L=4$ or $L=0$.

So instead of trying to show the sequence converges, we try to show it converges to $4$ or $0$; that may be simpler.

Let's get rid of the square roots by defining $b_n=\sqrt{a_n}$. Now$$b_{n+2}^2=b_n+b_{n+1},$$and we want to show $b_n\to 2$. If you subtract $4$ from both sides, factor the left side and apply the triangle inequality you get $$|b_{n+2}-2|\le\frac{|b_n-2|+|b_{n+1}-2|}{b_{n+2}+2}.$$It seems likely to me you can use this to show $b_n\to2$ or $0$ (if it happens that $b_n\ge c>0$ for all $n$ then it follows that $b_n\to 2$). I have to go to class now, sorry...

Edit: How stupid of me - the other answer points out that it's more or less obvious that $b_n\ge c>0$. In case it's not clear why we care about that, it shows that $$|b_{n+2}-2|\le\frac2{2+c}\max(|b_n-2|,|b_{n+1}-2|);$$hence $b_n\to2$. since $2/(2+c)<1$.

• But how can you claim the boundedness on the right hand side? – Lord KK May 2 '18 at 16:13
• @AloknathFurr I'm not sure what you're referring to. If $b_n\ge c>0$ then the inequality shows that $|b_n-2|$ decreases geometrically. – David C. Ullrich May 2 '18 at 16:15
• ok.. ok.. I got it. Thanks – Lord KK May 2 '18 at 16:17


# Limit of sequence in which each term is defined by the average of preceding two terms

We have a sequence of numbers $x_n$ determined by the equality

$$x_n = \frac{x_{n-1} + x_{n-2}}{2}$$

The first and zeroth term are $x_1$ and $x_0$.The following limit must be expressed in terms of $x_0$ and $x_1$ $$\lim_{n\rightarrow\infty} x_n$$

The options are:

A)$\frac{x_0 + 2x_1}{3}$ B)$\frac{2x_0 + 2x_1}{3}$

C)$\frac{2x_0 + 3x_1}{3}$ D)$\frac{2x_0 - 3x_1}{3}$

Since it was a multiple choice exam I plugged $x_0=1$ and $x_1=1$. Which means that all terms of this sequence is $1$,i.e, $$x_n=1, n\in \mathbb{N}$$

From this I concluded that option A was correct.I could not find any way to solve this one hence I resorted to this trick. What is the actual method to find the sequence's limit?

• Your 'trick' was very smart, in the setting of a multiple choice exam. It makes it very easy to exclude options. But it is even smarter that you want to know the 'actual' method to solve this! – user193810 May 11 '17 at 15:32
• @Pakk thanks for the compliment! – Ananth Kamath May 12 '17 at 2:21
• @Pakk Hehe, me on those factoring problems back in ye olde days o' Algebra. Just plug $x=0$ in and you pretty much done... – Simply Beautiful Art May 27 '17 at 0:29

$$2x_n = x_{n-1} + x_{n-2}$$

$$2x_2 = x_{1} + x_{0}\\ 2x_3 = x_{2} + x_{1}\\ 2x_4 = x_{3} + x_{2}\\ 2x_5 = x_{4} + x_{3}\\ ...\\ 2x_n = x_{n-1} + x_{n-2}$$

Now sum every equation and get

$$2x_n+x_{n-1}=2x_1+x_0$$

Supposing that $x_n$ has a limit $L$ then making $n\to \infty$ we get:

$$2L+L=2x_1+x_0\to L=\frac{2x_1+x_0}{3}$$

• What did you sum to arrive at $2x_n+x_{n-1}=2x_1+x_0$? When I summed the numbered equations, I got a proportion of $x_0$ and $x_1$, but not $2:1$, and summing the indexed equations was quite boring. – user121330 May 12 '17 at 22:40
• @user121330: just those equations as written (equivalently, you can rewrite them bringing the RHS terms to LHS and negating them). Note that each (non-terminal) $x_i$ occurs once as $2x_i$ on the LHS, and twice as $x_i$ on the RHS. So they all cancel out except for the terminal ones. – smci May 12 '17 at 23:23
• I fondly remember this as exercise 3.5.10 of Bartle's and Sherbert's Introduction to Real Analysis, how my teacher solved it by finding an invariant as you did, and how I had wondered how she came up with it (she just said to 'play with it'). The nostalgia. – Vandermonde May 14 '17 at 22:27
• No you're not summing to infinity. You're summing for LHS's from $x_2$ to $x_n$. That's finite. After you get that sum, we then apply the condition that if ${x_n}$ has a limit L as $n \to \infty$ then both $x_n, x_n+1 \to L$, and that sets up a useful equality involving $x_1, x_0$. – smci May 16 '17 at 6:40
• But one cannot assume that as n→∞ $x_n$ = $x_n-1$ when it is not given that the sequence converges. – Ahmad Lamaa Sep 24 '18 at 21:09

Yet another trick: you can write the recurrence in matrix form: $$\left(\begin{array}{c} x_n\\ x_{n-1} \end{array} \right) = \left(\begin{array}{cc} 1/2 & 1/2\\ 1 & 0\\ \end{array} \right) \left(\begin{array}{c} x_{n-1}\\ x_{n-2} \end{array} \right).$$ Then, $$\left(\begin{array}{c} x_n\\ x_{n-1} \end{array} \right) = \left(\begin{array}{cc} 1/2 & 1/2\\ 1 & 0\\ \end{array} \right)^{n-1} \left(\begin{array}{c} x_1\\ x_0 \end{array} \right).$$ Diagonalizing/converting the matrix to the Jordan form, you can find a closed form for the sequence.

• I wouldn't call it a trick, I think it's the most natural approach to these problems. And it justifies the method in Arnaud's answer. – Sasho Nikolov May 12 '17 at 19:11

First, notice that you can rewrite the recurrence relation as $$2x_{n+2}-x_{n+1}-x_n=0,\quad n\geq 0.$$ Now the key point is that this recurrence relation is linear, and thus if $(y_n)_{n\geq 0}$ and $(z_n)_{n\geq 0}$ satisfy this relation, then for any $\alpha,\beta\in \Bbb R$, $(\alpha y_n+\beta z_n)_{n\geq 0}$ will also satisfy it. So we can try to express $(x_n)$ as a linear combination of simpler sequences $(y_n)$ and $(z_n)$. An example of simple sequence would be a geometric sequence $y_n=r^n$ for some $r$. Can we find a sequence of this form satisfying the recurrence relation? $r$ would have to be such that $$2r^{n+2}-r^{n+1}-r^n=r^{n}(2r^2-r-1)=0,\quad n\geq 0,$$thus it is enough that $$2r^2-r-1=0.$$ This will hold if and only if $r\in \left\{1,\frac{-1}{2}\right\}$.

Thus we know that any sequence of the form

$$\alpha +\beta \left(\frac{-1}{2}\right)^n$$ satisfies our recurrence relation. Then it suffices to check that the first two term are the same, and all the others will follow. Thus you need to find $\alpha,\beta$ such that $$\left\{ \begin{array}{}\alpha+\beta & = & x_0\\ \alpha-\frac{\beta}{2} & = & x_1.\end{array} \right.$$

This is a simple linear system, whose solution is given by $\alpha=\frac{x_0+2x_1}{3}$ and $\beta=\frac{2x_0-2x_1}{3}$.

Thus the $n$-th term must be given by $$x_n=\frac{x_0+2x_1}{3}+\frac{(2x_0-2x_1)(-1)^{n}}{3\cdot 2^n}$$ and thus $\lim_{n\to \infty }x_n = \frac{x_0+2x_1}{3}$.

This method works for a large variety of cases; in fact, it can be applied to give a formula for $x_n$ for any linear recurrence relations (there are some difficulties if the corresponding polynomial equation has multiple roots, because you don't get enough geometric sequences, but you can find other solutions in those case). For example, you can apply the same method to the Fibonacci sequence, and it gives you the Binet formula (you can find more details in the answers to this question).

• How can we come to the conclusion that $x_n = r^n$ ? Thanks for answering by the way. – Ananth Kamath May 11 '17 at 14:19
• We can't. It's more "wishful thinking". Maybe I can explain that better. – Arnaud D. May 11 '17 at 14:22
• It does makes sense, but I believe such an approach is only good for this particular question? – Ananth Kamath May 11 '17 at 14:30
• @AnanthKamath No, it's a general method for linear recurrence relations. You can find more information for example at en.wikipedia.org/wiki/… – Arnaud D. May 11 '17 at 14:44
• I never knew that was possible. Thanks for sharing info. – Ananth Kamath May 11 '17 at 14:58

Here's yet another way to look at the problem, that might not lead directly to a proof, but might give intuitive insight into the sequence.

Note that from $x_0$, we go $x_1-x_0$ up to $x_1$, then $\frac12(x_1-x_0)$ down to $x_2$, then $\frac14(x_1-x_0)$ up to $x_3$, etc. You might be able to prove this by induction, but might not want to. If $x_0=0$ and $x_1=1$, one can put this in a picture: ($A=(0,x_0)$, $B=(1,x_1)$, ...)

We conclude that, since the jump from $x_0$ to $x_1$ can really be seen a a jump of $1=(-1/2)^0$ relative to $x_0$:

$$x_n = x_0 + (x_1-x_0)\sum_{i=0}^{n-1} \left(-\frac12\right)^i$$

Then the limit for $n \rightarrow \infty$ is:

$$\lim_{n\rightarrow\infty} x_n = x_0 + (x_1-x_0)\sum_{i=0}^\infty \left(-\frac12\right)^i = x_0 + (x_1-x_0)\frac1{1+\frac12}$$

by the geometric series (since $\lvert-\frac12\rvert < 1$). Then this is equal to:

\begin{align*} x_0 + (x_1-x_0)\frac1{1+\frac12} &= x_0 + \frac23(x_1-x_0) = \frac{3x_0+2x_1-2x_0}3 \\ &= \frac{x_0 + 2x_1}3. \end{align*}

• Can't we upvote an answer twice? :) – Kartik May 12 '17 at 10:26
• This is what Soumik did in his answer. Unfortunately he did not feel like working it out. – Carsten S May 12 '17 at 12:39
• @CarstenS Oh right I see; luckily I wasn't the only one to see this :) – tomsmeding May 12 '17 at 16:29
• Yes, +1 for the illustration. – Carsten S May 12 '17 at 16:31

$$x_n-x_{n-1}=-\frac{1}{2}(x_{n-1}-x_{n-2})$$ use repeatedly to get $$x_n-x_{n-1}=(-\frac{1}{2})^{n-1}(x_{1}-x_{0})$$ Now it is fairly straightforward to compute

• Could you show a little more work on how you got to your first step? – AlgorithmsX May 11 '17 at 19:04
• subtract $x_{n-1}$ from both sides of the equation and iterate. – user379195 May 11 '17 at 19:05
• I know how you got there, but I think it's better for you to show some less obvious intermediate steps. It's still a great post. – AlgorithmsX May 11 '17 at 19:08

Here is a way to find the general solution of the recurrence using generating functions and then find the limit. We wish to solve the recurrence $$a_n = \frac{a_{n-1}}{2} + \frac{a_{n-2}}{2}\quad (n\geq 2)\tag{1}$$ where $a_0=x_0$ and $a_1=x_1$. We first make the recurrence valid for all $n\geq 0$. To this end, set $a_n=0$ for $n<0$ and note that the recurrence $$a_n = \frac{a_{n-1}}{2} + \frac{a_{n-2}}{2}+x_0\delta_{n,0}+(x_1-x_0/2)\delta_{n,1}\tag{2}$$ where $\delta_{ij}$ is the Kronecker Delta does the trick. Let $A(x)= \sum_{n=0}^\infty a_nx^n$ be the generating function and multiply by $x^n$ and sum on $n$ in (2). Then we get $$A(x)\left(1-\frac{1}{2}x-\frac{1}{2}x^2\right)=x_0+x\left(x_1-\frac{x_0}{2}\right)\tag{3}$$ and hence $$A(x) =\frac{x_0+(x_1-x_0/2)x}{1-\frac{1}{2}x-\frac{1}{2}x^2} =\frac{x_0+(x_1-x_0/2)x}{(1-x)(1+x/2)} =\frac{2x_1+x_0}{3(1-x)}+\frac{2x_0-2x_1}{3(1+x/2)}\tag{4}$$ by partial fractions. By using the geometric series we get that \begin{align} A(x) &=\sum_{n=0}^\infty \left[\frac{2x_1+x_0}{3}\right]x^n+ \sum_{n=0}^\infty \left[\frac{2x_0-2x_1}{3}\right]\left(\frac{-x}{2}\right)^n\\ &=\sum_{n=0}^\infty \left[\frac{(2x_1+x_0)}{3}+\frac{(2x_0-2x_1)(-1)^n}{3(2^n)}\right]x^n\tag{5} \end{align} Hence

$$a_n=\frac{x_0+2x_1}{3}+\frac{(2x_0-2x_1)(-1)^{n}}{3\cdot 2^n}\tag{6}$$ and thus $$\lim_{n\to \infty }a_n = \color{blue}{\frac{x_0+2x_1}{3}.}\tag{7}$$

Here is a formal derivation of your result. The sequence you have found is a generalization of the Fibonacci sequence.

There have been many extensions of the sequence with adjustable (integer) coefficients and different (integer) initial conditions, e.g., $f_n=af_{n-1}+bf_{n-2}$. (You can look up Pell, Jacobsthal, Lucas, Pell-Lucas, and Jacobsthal-Lucas sequences.) Maynard has extended the analysis to $a,b\in\mathbb{R}$, (Ref: Maynard, P. (2008), “Generalised Binet Formulae,” $Applied \ Probability \ Trust$; available at http://ms.appliedprobability.org/data/files/Articles%2040/40-3-2.pdf.)

We have extended Maynard's analysis to include arbitrary $f_0,f_1\in\mathbb{R}$. It is relatively straightforward to show that

$$f_n=\left(f_1-\frac{af_0}{2}\right) \frac{\alpha^n-\beta^n}{\alpha-\beta}+\frac{f_0}{2} (\alpha^n+\beta^n)$$

where $\alpha,\beta=(a\pm\sqrt{a^2+4b})/2$.

The result is written in this form to underscore that it is the sum of a Fibonacci-type and Lucas-type Binet-like terms. It will also reduce to the standard Fibonacci and Lucas sequences for $a=b=1 \ \text{and} \ f_0=0, f_1=1$. Notice that there is nothing in this derivation that limits the results to integer values for the initial conditions, scaling factors, or the sequence itself.

So, specializing to your case, we can say

$$x_n=\frac{x_{n-1}}{2} +\frac{x_{n-2}}{2}$$

and

$$\alpha,\beta=\frac{\frac{1}{2}\pm\sqrt{\frac{1}{4}+2}}{2}=1,\frac{1}{2}$$

For the limit as $n\to\infty$, we note that the $\alpha$-term dominates, and is in fact, always unity, ergo

$$\lim_{n\to\infty} x_n=\left(x_1-\frac{x_0}{4}\right)\frac{\alpha^n}{\alpha-\beta}+\frac{x_0}{2}\alpha^n=\left(x_1-\frac{x_0}{4}\right)\frac{2}{3}+\frac{x_0}{2}=\frac{2x_1+x_0}{3}$$

as was shown previously.

This proves the OP's assertion. The advantage of this method is that it will apply to all such problems.

$$x_n = \frac{x_{n-1}+x_{n-2}}{2}$$

Add $\frac{x_{n-1}}{2}$ to both sides:

$$\frac{2x_{n}+x_{n-1}}{2} = \frac{2x_{n-1}+x_{n-2}}{2}$$

Let $y_{n} = \frac{2x_{n}+x_{n-1}}{2}$:

$$y_{n} = y_{n-1} = \ldots = y_{1}$$

As $n \rightarrow \infty, x_{n-1} \rightarrow x_{n}$, so:

$$\frac{3x_{n}}{2} = \frac{2x_{1}+x_{0}}{2}$$

Note that this is the "same" approach as some of the other answers, I just added it because it is most clear to me.

My solution:

Map $[x_0,x_1]$ to $[0,1]$ by setting $x = x_0 + (x_1-x_0)y$ so that $y_0 = 0$ and $y_1 = 1$.

Now the sequence runs $0, 1, \frac{1}{2}, \frac{3}{4}, \frac{5}{8}, \frac{11}{16}$, etc

Take the difference between each successive term i.e. $y_k-y_{k-1}$

You get $+1, -\frac{1}{2}, +\frac{1}{4}, -\frac{1}{8}, +\frac{1}{16}$, etc

This looks like the expansion of $\frac{1}{1-z}$ for $|z|<1$ i.e. $1+z+z^2+z^3+...$

In our case, $z = -\frac{1}{2}$, so the sum is $\frac{1}{1-(-1/2)} = \frac{2}{3}$

So the limit of $y_k$ is $\frac{2}{3}$, given $y_0 = 0$ and $y_1 = 1$. So now map back to $x$

$x = x_0 + (x_1-x_0)\frac{2}{3} = \frac{x_0 + 2x_1}{3}$

• Use this link to know how to write mathematics on this site. – StubbornAtom May 14 '17 at 10:25
• Apologies, have used the maths editor on the site before but this was from my phone, so it's not particularly easy to do. Appreciate the edit, meant to follow up this evening with the same. Best, james – James Spencer-Lavan May 14 '17 at 10:44

Unless $x_0=x_1$ which is clear, consider the tranformation $y_n:=\frac{x_n-x_0}{x_1-x_0}$. Then $y_0=0$, $y_1=1$, and $y_{n+1}$ is the average of $y_n$ and $y_{n-1}$. It is clear that $\lim y_n$ is $$\frac{1}{2}+\frac{1}{4}-\frac{1}{8}+\frac{1}{16}-\frac{1}{32}+\cdots=\frac{1}{2}\left(1+\frac{1}{4}+\frac{1}{16}+\cdots\right)=\frac{2}{3}.$$ Going back, you have $\lim x_n=\frac{1}{3}(x_0+2x_1)$.

• This was my instant reaction to the problem, comparison with the binary number given by 0.101010101010... which is 2/3. – richard1941 May 16 '17 at 18:10

Since the recurrence relation is linear, the sequence's limit is, if it exists, of the form $ax_0+bx_1$. If you consider the sequence $x'_n=x_{n+1}$, it clearly has the same limit therefore $$ax_0+bx_1=ax'_0+bx'_1=ax_1+bx_2=ax_1+\frac b2(x_0+x_1)=\frac{b}2x_0+\left(a+\frac b2\right)x_1.$$ Since this is true for any $x_0$, $x_1$, we have $a=\frac b2$ (and also $b=a+\frac b2$ but this is equivalent). This is enough to answer the question, but not to find $a$ and $b$. To find $a$ and $b$, you can simply take the same trick you used by considering the constant sequence $1$ and you get $a+b=1$, which solves the problem.

I came to this page because I wanted to justify the formula I came up with for the series with xn = pxn-1+(1-p)xn-2. This is more general than the original problem, though not as general as the linear combination problem. Based on what I read here, I can show the solution and justify it using just a little insight and basic algebra. The first insight is to assume the solution has the form rx1+(1-r)x0. Let's simplify things by using x0=0 and x1=1. Then x2=p. We must also have rx2+(1-r)x1 as the solution. Taking rx2+(1-r)x1 = rx1+(1-r)x0 and substituting gives p=(1-r)+rp. Solving for r gives r =1/(2-p) and (1-r) = (1-p)/(2-p). Having found the solution to the problem, we need to justify it. It is straightforward, though a little tedious, to show that, for the value of r that we found, that rxn + (1-r)xn-1 = rxn-1 + (1-r)xn-2. Just substitute for xn and r and combine terms. By induction, this means that rxn + (1-r)xn-1 = rx1 + (1-r)x0. As was done in a previous post, we can take xn-1 on the left side to equal xn, which proves our assertion provided we have convergence. To find where we have convergence, use the expression for xn to show that xn - xn-1 = -(1-p)(xn-1 - xn-2), giving convergence when |1-p| < 1.

• There is a simpler approach for finding r. Find a and b such that axn+bxn-1=axn-1+bxn-2. The constraints for xn-1 are the same as for xn-2, giving b=a(1-p). What we need to realize is that if a and b satisfy the equation, so do ta and tb. We need the additional constraint of a+b=1. Then things work out very simply. – user1153980 Nov 12 '17 at 10:10

First, the sequence $(x_n)$ has clearly a limit $\ell$ because $$\left|x_{n+1}-x_{n}\right|=\frac{|x_1-x_0|}{2^n}.$$ Now, sum the $n-1$ equations $2x_{i+2}=x_{i+1}+x_i$ for $i=0,1,\ldots,n-2$ and we obtain $$2x_n+x_{n-1}=2x_1+x_0.$$ Passing to the limit we reach $$\ell=\frac{2x_1+x_0}{3}.$$


1. ## Integrating enclosed area

Calculate the area enclosed by x = 9-y^2 and x = 5 in two ways: as an integral along the y-axis and as an integral along the x-axis.

Please tell me if my figure is correct, and also if the shaded area is also the are I am looking for.
Also is there any formulas I need to use for this problem ? How do I do this both ways ?
Thank You

2. Yes, your graph is fine.

To integrate over the x-axis, you need

$\displaystyle\int_{5}^9f(x)dx$

so $x=9-y^2\Rightarrow\ y^2=9-x\Rightarrow\ y=\pm\sqrt{9-x}=f(x)$

Take the positive one and double your result as the x-axis is an axis of symmetry.

$2\displaystyle\int_{5}^9\left(9-x\right)^{0.5}dx$

To integrate over the y-axis, you could integrate $f(y)$ from $y=-3$ to $y=3.$

If you like, again use the x-axis as an axis of symmetry and double the integral from $y=0$ to $y=3.$

This integral includes the unshaded part against the y-axis, so you have a few ways to cope with that.

The easiest way is to subtract 5 from $x=f(y)$

$x-5=f(y)-5=4-y^2$

The new function is $x=4-y^2$

so the limits of integration become $\pm2$

You can then calculate

$2\displaystyle\int_{0}^2\left(4-y^2\right)}dy$

3. Thank You very much. I'll give it a shot.

4. The first integral can be evaluated by making a substitution,
while the 2nd one doesn't require any substitution.

5. Thank you for all you help.

6. Ok so I solved the first one I get .5. I let u = 9-x , du = -dx so I multiplied by a negative inside the integral and a negative outside. then I get, -2(.5(9-x)^-.5). Then using the fundemental theorem of calculus I used the limts 5 to 9 and my final answer was .5. is this correct ?

7. Originally Posted by wair
Ok so I solved the first one I get .5. I let u = 9-x , du = -dx so I multiplied by a negative inside the integral and a negative outside. then I get, -2(.5(9-x)^-.5). Then using the fundemental theorem of calculus I used the limts 5 to 9 and my final answer was .5. is this correct ?
Not quite,
you differentiate to introduce the substitution,
but you are also differentiating when you should be integrating!

$u=9-x\Rightarrow\ du=-dx\rightarrow\ dx=-du$

$x=5\Rightarrow\ u=4$

$x=9\Rightarrow\ u=0$

the integral becomes

$\displaystyle\ -2\int_{4}^0u^{0.5}}du=(-2)\left[-\int_{0}^4u^{0.5}}du\right]=2\int_{0}^4u^{0.5}}du$

$=2\displaystyle\left[\frac{u^{\frac{3}{2}}}{\frac{3}{2}}\right]$ from u=0 to u=4

8. so I just had to chnage my limits ? and then invert them to get rid of the what was it called "signed area" ? But I don't understand how you got the last step. wouldn't it be .5(u)^-.5 ?

9. Originally Posted by wair
so I just had to chnage my limits ? and then invert them to get rid of the what was it called "signed area" ? But I don't understand how you got the last step. wouldn't it be .5(u)^-.5 ?
No, that's what you get when you differentiate.

$\displaystyle\frac{d}{du}u^{0.5}=0.5u^{-0.5}$

But

$\displaystyle\int{u^{0.5}}du=\frac{u^{1.5}}{1.5}+c$

because

$\displaystyle\frac{d}{du}\left[\frac{u^{1.5}}{1.5}+c\right]=\frac{1.5}{1.5}u^{0.5}$

To integrate, apply differentiation in reverse.

10. Oh right right. I understand now thank you .

11. Ok so for the first one I get -21.1. (1/1.5)(9-x)^1.5. 2(7.45)-2(18)=-21.1. Is that correct ?

12. I get 5.3 for the second one. shouldn't I get the same answer for both ?

13. Originally Posted by wair
Ok so for the first one I get -21.1. (1/1.5)(9-x)^1.5. 2(7.45)-2(18)=-21.1. Is that correct ?
If you work with 9-x instead of u, then there is no need to change the limits of integration.

$2\displaystyle\int_{x=5}^{x=9}{(9-x)^{0.5}}dx=-2\int_{x=5}^{x=9}{(9-x)^{0.5}}d(9-x)$

$=2\displaystyle\int_{x=9}^5{(9-x)^{0.5}}d(9-x)=2\frac{(9-x)^{1.5}}{1.5}$ from x=9 to 5 (start calculations at x=5)

$=2\displaystyle\frac{(9-5)^{1.5}-(5-5)^{1.5}}{1.5}=2\frac{4^{1.5}}{1.5}=2\frac{8}{1.5} =2\frac{16}{3}=\frac{32}{3}$

You must get a positive value for area, so as our graph is symmetrical about the x-axis, we integrate the part above the x-axis and double it.

Using the u-substitution, we get

$\displaystyle\ 2\int_{0}^4{u^{0.5}}du=2\left[\frac{u^{1.5}}{1.5}\right]$ from u=0 to u=4 (start calculations at u=4)

$\displaystyle\ =2\frac{4^{1.5}}{1.5}-0=2\frac{8}{1.5}=\frac{16}{1.5}=\frac{32}{3}$

For the 2nd integral..

$\displaystyle\ 2\int_{0}^2{\left(4-y^2\right)}dy=2\int_{0}^2{4}dy-2\int_{0}^2{y^2}dy=2\left[4y-\frac{y^3}{3}\right]$ evaluated from y=0 to y=2

(start calculations at y=2)

comes out as the same value.
Review your calculations for both integrals.

14. Thank you very much. So if I want to use the new limits I don't need to replacex u with what u equals. And both values must be the same. OK Thank you

15. Originally Posted by wair
Thank you very much. So if I want to use the new limits I don't need to replacex u with what u equals. And both values must be the same. OK Thank you
I think you mean.... "don't need to replace u with 9-x".

Yes, it is simplest to work with "u", having made the substitution, then integrate f(u)du using the "u" limits.

This area you are now calculating is on a different graph but evaluating the new "u" integral will give the same area as the shaded region on the original graph.

If you prefer not to change the limits, here's how to do it....

$\displaystyle\ -2\int_{x=5}^{x=9}{u^{\frac{1}{2}}}du=-2\left[\frac{u^{\frac{3}{2}}}{\frac{3}{2}}\right]$ from x=5 to x=9 (start calculations at x=9)

$=-\displaystyle\frac{4}{3} (9-x)^{\frac{3}{2}}$ from x=5 to x=9

$=-\displaystyle\frac{4}{3}\left[ (9-9)^{1.5}-(9-5)^{1.5}\right]=\frac{32}{3}$

You've got to practice. Keep going until you can reproduce the solution for both integrals.


Math Help - Method for finding a Minimal Polynomial?

1. Method for finding a Minimal Polynomial?

Hello, I cannot seem to find in my notes nor in any text a method of finding minimal polynomials. Most minimal polynomials I've encountered are somewhat trivial, but I came across one that I may be tested on that I am unable to solve using a brute-force method:

$m_{\sqrt 2+i}$ over $\mathbb Q$

The reason I ask about a method of finding the min. poly. is because I am taking an oral test, and I don't want to be floundering about if I am asked something different than this one in particular.

Anyway, I would appreciate any help. Thanks!

P.s.: That's m_{\sqrt 2 +i}; sorry that the "i" is so tiny.

2. Originally Posted by Dark Sun
Hello, I cannot seem to find in my notes nor in any text a method of finding minimal polynomials. Most minimal polynomials I've encountered are somewhat trivial, but I came across one that I may be tested on that I am unable to solve using a brute-force method:

$m_{\sqrt 2+i}$ over $\mathbb Q$

The reason I ask about a method of finding the min. poly. is because I am taking an oral test, and I don't want to be floundering about if I am asked something different than this one in particular.

Anyway, I would appreciate any help. Thanks!

P.s.: That's m_{\sqrt 2 +i}; sorry that the "i" is so tiny.
$x=\sqrt{2}+i$

$x^2=(\sqrt{2}+i)^2 \iff x^2=2+2i\sqrt{2}-1 \iff x^2-1=2i\sqrt{2}$

$(x^2-1)^2=(2i\sqrt{2})^2$

$x^4-2x^2+1=-8$

$x^4-2x^2+9=0$

3. Originally Posted by TheEmptySet
$x=\sqrt{2}+i$

$x^2=(\sqrt{2}+i)^2 \iff x^2=2+2i\sqrt{2}-1 \iff x^2-1=2i\sqrt{2}$

$(x^2-1)^2=(2i\sqrt{2})^2$

$x^4-2x^2+1=-8$

$x^4-2x^2+9=0$
you also need to prove that $p(x)=x^4 - 2x^2 + 9$ is irreducible over $\mathbb{Q}$: we only need to show that it cannot be factored into two quadratic polynomials over $\mathbb{Z}.$ why?

suppose $p(x)=(x^2+ax+b)(x^2+cx+d),$ for some $a,b,c,d \in \mathbb{Z}.$ then we'll have $bd=9$ and $b+d+2=a^2,$ which is easily seen to have no solutions in $\mathbb{Z}.$

4. Because irreducible over $\mathbb Z$ implies irreducible over $\mathbb Q$.

$x^4-2x^2+9$ clearly does not have any degree 1 factors. Also, a degree 3 factor would imply a degree 1 factor, so if a factor exists, then it will be degree 2, which you have just shown is a contradiction.

Thank you EmptySet and NonCommAlg for presenting me with this truly powerful method!


# Find formula for series

1. Jul 23, 2014

### Maxo

1. The problem statement, all variables and given/known data
By using the general equation for an arithmetic series, find a formula for calculating the series
$$1+3+5+...+(2n-1)$$

2. Relevant equations
General equation for an arithmetic series:
$$\sum ^{n}_{k=1}k=\frac{n(n+1)}{2}$$

3. The attempt at a solution
Using the general equation we have
$$\sum ^{n}_{k=1}(2k-1)$$
but how can we go from there? What is the next step?

I tried replacing n with (2k-1) in the general equation but that gives the wrong answer. So how can we do it?

Last edited: Jul 23, 2014
2. Jul 23, 2014

### Mentallic

$$\sum (a+b) = \sum a + \sum b$$

and

$$\sum (ab) = a\sum b$$
if a is a constant that is independent of the summation index (k for example).

So using these formulae, you should be able to solve your problem.

edit:

And keep in mind that

$$\sum_{k=1}^{n}1 = 1+1+1+...+1 = n$$

because you go from k=1 to n while summing 1 each time (hence n times).

3. Jul 23, 2014

### Maxo

Allright, so we have

$$\sum ^{n}_{k=1}(2k-1)=\sum ^{n}_{1}2k-\sum ^{n}_{1}1$$
The second term is easy since we see that we have 1 n times so 1*n = n as you already wrote. Can it be also calculated using the general equation? When I try I get (1(1+1))/2=2/2=1 which is not correct. Also if we just put in n it gets n(n+1)/2 which does not equal n! I guess I am using the general equation wrong? How should it be used then?

Then the first term, how is that calculated? Using the general equation I get 2k(2k+1)/2 = k(2k+1) which is again wrong. Please tell help me how to use the general equation.

4. Jul 23, 2014

### Mentallic

Notice the similarity?

$$\sum^n_1 2k =2\cdot 1+2\cdot 2+2\cdot 3+...+2\cdot n \\ = 2(1+2+3+...+n) \\ = 2\sum^n_1 k$$

Do you know how to prove the general summation formula? If you do, you'll also see why you can't use it in the instances that you've tried to. If not, begin with

$$S=1+2+3+...+n$$

and then consider

$$S=n+...+3+2+1$$

and add both of these values together, term by term (add the values in the same column in pairs)

$$2S=(1+n)+(2+(n-1))+(3+(n-2))+...+((n-2)+3)+((n-1)+2)+(n+1)$$

and simplify the right side, then solve for S.

Now, once you've learned how to prove the sum of the first n integers, now use a similar technique to find the general summation formula

$$S=a+(a+d)+(a+2d)+...+(a+(n-1)d)$$

where a is your starting point, and d is the difference between each value.

5. Jul 23, 2014

### Maxo

Thank you, you explain very well! I understand everything better now.
So if we write this again the opposite direction and then add column wise, we get that each term is equal to 2a+(n-1)d and we have n such terms, so 2S = n(2a+(n-1)d) = 2an + nd(n-1), so S = an + nd(n-1)/2.

In other words, the general formula for an arithmetic sum is:
$$Sn=an+\frac{n^2d-nd}{2}$$
Correct?
That's interesting, I have never seen this more "more general"(?) summation formula before. Does it have some particular name? In my math book, which is supposed to be for university level math, it's not even mentioned.

Btw if you have some suggestions where I can learn more and where it's explained as well as you explain here, please feel free to share it.

Last edited: Jul 23, 2014
6. Jul 23, 2014

### Mentallic

You're welcome! Yes, that's correct! Although, the factored form is more generally used.

$$S_n = \frac{n}{2}\left(2a+(n-1)d\right)$$

and now, if we let d=1 and a=1, then this says we are taking the sum of a linear series that starts with 1 (a=1) and increases by a value of 1 each time (d=1) which would give you your sum of positive integers. If you want to find

$$\sum_{k=1}^n 1$$

then this is like letting a=1 and d=0, which would give you S=n as expected.

Also,

$$\sum_{k=1}^n 2k = 2+4+6+...+2n$$

Which as we can see from the expanded form, we would let a=2 and d=2 since it starts at the value of 2 and increases by a value of 2 between each term. The formula, as well as the method I showed you earlier that moves the 2 outside of the sum would of course give you the same result of S=n(n+1)

It's called an arithmetic progression. Just google that and you'll find plenty on it

7. Jul 24, 2014

### Staff: Mentor

Isn't the formula for the sum of an arithmetic series n(a+l)/2, where a is the first term, l is the last term, and n is the number of terms?

Chet

8. Jul 25, 2014

### HallsofIvy

Yes, it is. Another way of looking at it is that the average value in an arithmetic sequence is the same as the average of the first and last term.

By the way, here's another way of summing that original series, $$\sum_{ix= 1}^n 2n-1$$. That is, of course, the sum of odd integers from 1 to 2n-1. It is the same as the sum of all integers from 1 to 2n minus the sum of all even numbers from 2 to 2n.

The sum of all numbers from 1 to 2n is, using that formula, $2n(1+ 2n)/2= n(2n+ 1)$. The sum of all even numbers is $2+ 4+ \cdot\cdot\cdot+ 2n= 2(1+ 2+ 3+ \cdot\cdot\cdot+ n)= 2(n(n+1)/2)= n(n+ 1)$.

9. Jul 31, 2014

### Maxo

Is there any way to write this general sum using the sigma notation? If so, how could it be written with Sigma notation?

10. Jul 31, 2014

### Mentallic

Well you aren't going to be writing the formula above using sigma notation, because sigma is used as a shorthand form to express summations that follow an expressible pattern. But the arithmetic sum itself can be expressed in sigma notation of course.

$$a+(a+d)+(a+2d)+...+(a+(n-1)d)$$
$$= \sum_{k=0}^{n-1}a+k\hspace{1 mm}d$$

This is a valid summation, but we can do more with it. Notice the constant a is added n times, hence to remove it from the sum, we exchange 'a' in the summation for 'an' outside of the summation. Also the constant d can be factored out of the sum. It's for the same reason that

$$1d+2d+3d+...+nd = d(1+2+3+...+n)$$

$$= an + d\sum_{k=0}^{n-1}k$$

Now at this point, k=0 clearly doesn't give us anything. We only needed k=0 in the first place for when a was within the sum (else if we started with k=1 then we'd only be adding the value of a (n-1) times.). So we can remove k=0 and start at k=1.

$$=an + d\sum_{k=1}^{n-1} k$$

And that would be your summation for a general arithmetic series.

11. Aug 1, 2014

### Maxo

Thank you, I would pretty much call this a perfect answer. :)