# True or false? $x^2\ne x\implies x\ne 1$

Today I had an argument with my math teacher at school. We were answering some simple True/False questions and one of the questions was the following:

$$x^2\ne x\implies x\ne 1$$

I immediately answered true, but for some reason, everyone (including my classmates and math teacher) is disagreeing with me. According to them, when $$x^2$$ is not equal to $$x$$, $$x$$ also can't be $$0$$ and because $$0$$ isn't excluded as a possible value of $$x$$, the sentence is false. After hours, I am still unable to understand this ridiculously simple implication. I can't believe I'm stuck with something so simple.

Why I think the logical sentence above is true:
My understanding of the implication symbol $$\implies$$ is the following: If the left part is true, then the right part must be also true. If the left part is false, then nothing is said about the right part. In the right part of this specific implication nothing is said about whether $$x$$ can be $$0$$. Maybe $$x$$ can't be $$-\pi i$$ too, but as I see it, it doesn't really matter, as long as $$x \ne 1$$ holds. And it always holds when $$x^2 \ne x$$, therefore the sentence is true.

### TL;DR:

$$x^2 \ne x \implies x \ne 1$$: Is this sentence true or false, and why?

Sorry for bothering such an amazing community with such a simple question, but I had to ask someone.

• This is true, as the contrapositive ($x = 1$ -> $x^2=x$) is obviously true. Dec 5 '11 at 14:20
• They are wrong-the fact that $x\neq 0$ is also an implication doesn't mean anything. The statement: $x^2=x\implies x=1$ is false. Dec 5 '11 at 14:21
• Also, their reasoning about "not excluding other values" is wrong. Today is Monday, which implies SO many things (!), but it is not false to just list one implication. Eg: If today is Monday, then tomorrow is Tuesday. Or, if today is Monday, then I have an appointment with the dentist. Dec 5 '11 at 14:23
• @Chris: You could write your reasoning as answer. That way the site keeps working better (and you will get some upvotes). You could also refer your teacher to this site :-) Dec 5 '11 at 15:06
• Your understanding of material implication ($\implies$) is exactly right, and as Jyrki said, your reasoning could stand as a perfectly good answer to the question. You could also point out that the teacher and class seem to be confusing $\implies$ and $\iff$: $x^2\ne x\iff x\ne 1$ is of course false precisely because $1$ isn't the only number that is its own square. Dec 5 '11 at 15:34

The short answer is: Yes, it is true, because the contrapositive just expresses the fact that $1^2=1$.

But in controversial discussions of these issues, it is often (but not always) a good idea to try out non-mathematical examples:

"If a nuclear bomb drops on the school building, you die."

"Hey, but you die, too."

"That doesn't help you much, though, so it is still true that you die."

"Oh no, if the supermarket is not open, I cannot buy chocolate chips cookies."

"You cannot buy milk and bread, either!"

"Yes, but I prefer to concentrate on the major consequences."

"If you sign this contract, you get a free pen."

"Hey, you didn't tell me that you get all my money."

Non-mathematical examples also explain the psychology behind your teacher's and classmates' thinking. In real-life, the choice of consequences is usually a loaded message and can amount to a lie by omission. So, there is this lingering suspicion that the original statement suppresses information on 0 on purpose.

I suggest that you learn about some nonintuitive probability results and make bets with your teacher.

• I like how the importance of cookies appears in surprising math/logic results! (+1). It might be time to show the teacher this question. Dec 5 '11 at 16:10
• Excellent examples, thank you! And of course I already made bets :). Dec 5 '11 at 16:29
• Superb answer, which implies that I have up-voted it. Jan 10 '12 at 0:37

First, some general remarks about logical implications/conditional statements.

1. As you know, $P \rightarrow Q$ is true when $P$ is false, or when $Q$ is true.

2. As mentioned in the comments, the contrapositive of the implication $P \rightarrow Q$, written $\lnot Q \rightarrow \lnot P$, is logically equivalent to the implication.

3. It is possible to write implications with merely the "or" operator. Namely, $P \rightarrow Q$ is equivalent to $\lnot P\text{ or }Q$, or in symbols, $\lnot P\lor Q$.

Now we can look at your specific case, using the above approaches.

1. If $P$ is false, ie if $x^2 \neq x$ is false (so $x^2 = x$ ), then the statement is true, so we assume that $P$ is true. So, as a statement, $x^2 = x$ is false. Your teacher and classmates are rightly convinced that $x^2 = x$ is equivalent to ($x = 1$ or $x =0\;$), and we will use this here. If $P$ is true, then ($x=1\text{ or }x =0\;$) is false. In other words, ($x=1$) AND ($x=0\;$) are both false. I.e., ($x \neq 1$) and ($x \neq 0\;$) are true. I.e., if $P$, then $Q$.
2. The contrapositive is $x = 1 \rightarrow x^2 = x$. True.
3. We use the "sufficiency of or" to write our conditional as: $$\lnot(x^2 \neq x)\lor x \neq 1\;.$$ That is, $x^2 = x$ or $x \neq 1$, which is $$(x = 1\text{ or }x =0)\text{ or }x \neq 1,$$ which is $$(x = 1\text{ or }x \neq 1)\text{ or }x = 0\;,$$ which is $$(\text{TRUE})\text{ or }x = 0\;,$$ which is true.
• Please pardon the (lack of) formatting- I typed this up on my phone! Dec 5 '11 at 15:36
• Thanks, Brian! That looks great. Dec 5 '11 at 15:55
• That's the proof I was looking for, thank you :) Dec 5 '11 at 16:41

Thing to note. This is called logical implication.

$x^2≠x⟹x≠1$: Is this sentence true or false, and why?

We can always check that using an example. Let us look at this implication as $\rm P\implies Q$. Now we shall consider cases:

• Case 1: If we consider $x = 0$, then $\rm P$ is false, and $\rm Q$ is true.
• Case 2: If we consider $x = 1$, then $\rm P$ is false, and $\rm Q$ is false as well.
• Case 3: If we consider each value except $x=0$ and $x = 1$, then both $\rm P$ and $\rm Q$ will be true since $x^2 = x \iff x^2 - x = 0 \iff x(x - 1) = 0$ which means that $x=0$ and $x = 1$ are the only possibilities.

Fortunately, our truth tables tell us that logical implication will hold true as far as we are not having $\rm P$ true and $\rm Q$ false. Look at the cases above; none of them has $\rm P$ true and $Q$ false. Thus Case 1, Case 2 and Case 3 are all true according to mathematical logic, so $\rm P\implies Q$ is true, or in other words: $x^2 \ne x \implies x \ne 1$ is true.

I apologize for being late, but I always have my two cents to offer... thank you.

## Introduction

You asked whether the following statement is true or not:

$$x^2 \ne x \implies x \ne 1$$

Another way to write the above is as:

if $$(x^2 \ne x)$$ then $$(x \ne 1)$$

The arrow symbol ($$\implies$$) is similar, but not quite the same, as the English phrase if....then....

## The contra-positive of $$(P \implies Q)$$

Okay now: suppose that you have the statement of the form "If $$P$$ then $$Q$$"
$$P$$ and $$Q$$ can be any true or false statements of your choice.
For example, $$P$$ could be the statement "pillows are soft"
"If $$P$$ then $$Q$$" is also sometimes written as $$(P \implies Q)$$

There is a well known theorem in logic which states the following:

For any $$P$$ and $$Q$$ taken from the set $$\{$$ true, false $$\}$$, the following is true:
$$(\text{not } P \implies \text{not } Q)$$ if and only if $$(Q \implies P)$$

That means that the following two statements are equivalent:

if $$(x^2 \ne x)$$ then $$(x \ne 1)$$
if $$(x = 1)$$ then $$(x^2 = x)$$

In some sense, the statement says that $$1^2 = 1$$, which is true enough.

## Sets

It considered to be very bad math to write things like the following:

Is it true or false that $$(x^2 \ne x \implies x \ne 1)$$?

Find $$x$$ such that $$3 + (x-5)^{2} = 0$$

This is because the above examples fail to explain what $$x$$ is.

• Is $$x$$ a whole number, such as $$1, 2, 3, \dots, 98, 99, 100$$?
• Is $$x$$ a decimal number, such as $$\sqrt{2}$$
• Is $$x$$ a non-real complex number, such as $$20 + 5*i$$?

You are supposed to write things like this instead:

Is the following true or false?

• For every real number $$x, (x^2 \ne x \implies x \ne 1)$$

Find every complex non-real number $$x$$ such that:

• $$3 + (x-5)^{2} = 0$$

My last example uses the non-real number $$i$$
$$i*i = -1$$

I think if you think it will help if you start using "sets."

The following is an example of a set:

my_set $$= \{1, 3, 6, 7, 22\}$$

A set is like a suitcase full of clothing A set is also like a cookie jar, or cardboard box.
A set is a container.
A suitcase might contain a t-shirt. Well, my_set contains the numbers $$1, 3, 6, 7,$$ and $$22$$.

The number $$3$$ is like a t-shirt in the sense that the number $$3$$ is inside the suitcase.

I went to public school in the United States.
I did not see sets until I was in college.

Sets are basic, basic math. sets are more basic than knowing how to compute $$4.5/0.3$$

You are not allowed to write math like $$x^2 \ne x \implies x \ne 1$$ unless you first tell the reader what set $$x$$ comes from.

The following is a very ugly formula for a function named $$WEIRD$$:

$$\text{WEIRD_FUNC}(X) = [1-w(x)]*\text{LEFT_PIECE}(X) + [w(x)]*\text{RIGHT_PIECE}(X)$$

$$\text{LEFT_PIECE}(X) = (x+10)*(x+5)$$

$$\text{RIGHT_PIECE}(X) = 3 + (x-7)^{2}$$

$$W(x) = \frac{tanh(10)}{2} + \frac{tanh(x)}{2}$$

A plot of the weird function is shown below:

Suppose I asked you,

"Find all $$x$$ such that $$WEIRD(x) = 0$$"

The answers vary depending on which set $$x$$ is taken from.

The set of all integers $$x$$ such that $$WEIRD(X) = 0$$ is $$\{-10\}$$
The set of all real numbers $$x$$ such that $$WEIRD(X) = 0$$ is approximately $$\{-10, -5.01\}$$
The set of all complex numbers $$x$$ such that $$WEIRD(X) = 0$$ is approximately $$\{-10, -5.01, 7+i*\sqrt{3}, 7-i*\sqrt{3}\}$$

### Analyzing your classmates argument regarding the number zero

Is the following statement true or not?

$$x^2 \ne x \implies x \ne 1$$

The following is your description of your teacher, and/or classmates, reasoning:

1. When $$x^2$$ is not equal to $$x$$, $$x$$ also can't be $$0$$.
2. $$0$$ is not excluded as a possible value of $$x$$
3. some sentence, or another, is false.

That description is very difficult to understand.
I will say that the following three statements are equivalent to each-other.
Also, all statements are false:

$$\forall x \in \mathbb{R}, x^2 \ne x$$ for any decimal number $$x$$, $$x^2 \ne x$$ if $$x$$ is a real number, then $$x^2 \ne x$$

Here is a proof:

Line No. statement justification
0 $$0$$ exists axiom
1 $$0$$ is a decimal number. axiom
2 $$0^{2} = 0$$ axiom
3 not $$(0^2 \neq 0)$$ from line 2
4 there exists a decimal number $$x$$ such that not $$(x^2 \neq x)$$ from lines 0,1,3
5 not for every decimal number $$x$$, $$(x^2 \neq x)$$ from line 4

Notice that your teacher said, "possible value of $$x$$"

In mathematics, the symbol is sometimes used as short-hand notation for the word "possible"

All of the following are logically equivalent:

• it is not possible for me to see a movie this weekend
• $$NOT$$ for me to see a movie this weekend
• It is necessary for me to NOT see a movie this weekend
• for me to NOT see a movie this weekend

The statement "$$0$$ is not excluded as a possible value of $$x$$" can be written as:

• not(not $$x = 0$$)
• It is not the case that it is not possible that $$x$$ is zero.

The above is equivalent to "it is possible that $$x = 0$$"

I think that I can write a proof outline of what your professor and/or classmates were trying to say

Line No. statement justification
$$0$$ $$x = 0$$ axiom
$$1$$ $$(x^2 \ne x) \implies$$ not $$x = 0$$ axiom
$$2$$ $$x^2 \ne x$$ axiom
$$3$$ not $$x = 0$$ 1,2 modus ponens
4 $$x = 0$$ and not $$x = 0$$ lines 0, 3 conjunction
5 $$NOT$$ $$(x^2 \ne x)$$ from line 4, reject 2

I think that your teacher was saying that if $$x = 0$$ is possible, then it is not necessary that $$x^2 \ne x$$

$$0 \in S \implies NOT(\forall x \in S, x^2 \ne x)$$

### One last Note

All of the following are equivalent:

• (it is necessary that $$x^2 \neq x$$) implies that (it is necessary that $$x \neq 1$$)
• (it is NOT necessary that $$x \neq 1$$) implies that (it is NOT necessary that $$x^2 \neq x$$)
• (it is possible that $$x = 1$$) implies that (it is possible that $$x^2 = x$$)
• For any set $$S$$, [(there exists $$x$$ in $$S$$ such that $$x = 1$$) implies that (there exists $$x$$ in $$S$$ such that $$x^2 = x$$)]


# What is the distribution of a mixture of exponential distributions whose rate parameters follow a gamma distribution?

I want to know the theoretical distribution of a mixture of exponential distributions whose rate parameters are distributed according to a gamma distribution:

$$y\sim\text{Exp}(\theta), \quad\text{where}\quad \theta\sim\Gamma(r, \beta).$$

Specifically, I am looking at $$r=4$$ and $$\beta=2$$.

• The question appears clear enough to me: given $r$ and $\beta$, let $\theta$ follow a gamma distribution with parameters $r$ and $\beta$ (whether these are scale or rate params doesn't matter for now), denoted $\theta\sim\Gamma(r, \beta)$. Next, $y$ is exponentially distributed with parameter $\theta$, denoted $y\sim\text{Exp}(\theta)$. That is, we have a compound distribution, AKA a mixture. Q: What is the unconditional distribution of $y$ with parameters $r$ and $\beta$? – Stephan Kolassa May 1 at 5:29
• At least that is what the original question seems to have asked, and I have tried to clarify this specific question with my edit and answer it. I will vote to reopen. Can someone clarify to me where this question is unclear? – Stephan Kolassa May 1 at 5:30
• @StephanKolassa: Well, $\theta$ wasn't defined; it could be the mean rather than the rate. The variable $n$ & its role were also unexplained. – Scortchi - Reinstate Monica May 2 at 8:57
• @Scortchi-ReinstateMonica: true. But converting between a mean and a rate formulation for the exponential is not overly hard. I assumed $n$ referred to a sample size and removed it in my edit. – Stephan Kolassa May 2 at 9:11
• @StephanKolassa: (1) The compound distribution would be something else if it were the means distributed according to a gamma distribution. (2) Quite possibly, but why mention it then? I think your edits do a fine job of clarification, but I can see why the q. was closed in its original version. – Scortchi - Reinstate Monica May 2 at 9:19

For all $$y \ge 0$$ the value of the survival function of $$Y$$ is

$$S_Y(y\mid\theta) = \Pr(Y \gt y\mid \theta) = \exp(-y\theta)$$

and, taking $$\beta$$ to be a rate parameter for the Gamma distribution, the probability density function of $$\theta$$ is proportional to

$$f_\theta(t) \propto t^{r-1}\exp(-\beta t).$$

Consequently the survival function of the mixture distribution is

$$S(y) \propto \int_0^\infty S_Y(y\mid t) f_\theta(t)\,\mathrm{d}t = \int_0^\infty t^{r-1}\exp(-(\beta+y)t)\,\mathrm{d}t.$$

Substituting $$u = (\beta+y) t$$ gives, with no calculation,

$$S(y) \propto \int_0^\infty \left(\frac{u}{\beta+y}\right)^{r-1}\exp(-u)\,\mathrm{d}\left(\frac{u}{\beta+y}\right) = (\beta+y)^{-r}\int_0^\infty u^{r-1}\exp(-u)\,\mathrm{d}u$$

which is proportional to $$(\beta+y)^{-r}.$$

The axiom of total probability asserts $$S(0)=1$$ from which we obtain the implicit constant, giving

$$S(y) = \beta^r\,(\beta+y)^{-r} = \left(1 + \frac{y}{\beta}\right)^{-r},$$

thereby exhibiting $$\beta$$ as a scale parameter for this mixture variable.

This is a particular kind of Beta prime distribution, sometimes termed a Lomax distribution. (up to scale).

If $$\beta$$ is intended to be a scale parameter for the Gamma distribution rather than a rate parameter, replace $$\beta$$ everywhere by $$1/\beta$$ and, at the end, interpret it as a rate parameter for the mixture variable.

This distribution tends to be positively skewed, so it's better to view the distribution of $$\log Y.$$ Here are the empirical (black) and theoretical (red) distributions for a simulation of $$10^4$$ independent realizations of $$Y$$ (where $$r=4$$ and $$\beta=2$$ as in the question):

The agreement is perfect.

The R code that generated this figure illustrates how to code the survival function (S), the density function (its derivative f), and how to simulate from this compound distribution by first producing realizations of $$\theta$$ and then, for each of them, generating a realization of $$Y$$ conditional on $$\theta.$$

S <- function(y, r, beta) 1 / (1 + y/beta)^r            # Survival
f <- function(y, r, beta) r * beta^r / (beta + y)^(r+1) # Density
#
# Specify the parameters and simulation size.
#
beta <- 2
r <- 4
n.sim <- 1e4
#
# The simulation.
#
theta <- rgamma(n.sim, r, rate=beta)
y <- rgamma(n.sim, 1, theta)
#
# The plots.
#
par(mfrow=c(1,2))
plot(ecdf(log(y)), xlab=expression(log(y)), ylab="Probability",
main=expression(1-S[Y](y)))
curve(1 - S(exp(y), r, beta), xname="y", add=TRUE, col="Red", lwd=2)

hist(log(y), freq=FALSE, breaks=30, col="#f0f0f0", xlab=expression(log(y)))
curve(f(exp(y), r, beta) * exp(y), xname="y", add=TRUE, col="Red", lwd=2)
par(mfrow=c(1,1))

Wikipedia, under the "Examples" section, informs us that:

Compounding an exponential distribution with its rate parameter distributed according to a gamma distribution yields a Lomax distribution [9].

The reference [9] is to Johnson, N. L.; Kotz, S.; Balakrishnan, N. (1994). "20 Pareto distributions". Continuous univariate distributions. 1 (2nd ed.). New York: Wiley. p. 573

• Yuh, but is that really the question? – Carl May 1 at 4:10


# Prove that there is a multiple of 2009 that ends with the digits 000001

Prove that there is a multiple of 2009 that ends with the digits 000001.

May one generalise this to: There exists a multiple of $x$ that ends with the digits $y$ (where $y$ consists of $n$ digits) if $x$ and $10^n$ are relatively prime?

The proof may be constructive, or non constructive.

Any help would be greatly appreciated.

I figured the multiple has to end in a $9$: $2009 \cdot 889$ gives $001$ as the three ending digits. I then tried to see if I could get the $4$th last digit to be a zero, but I must admit I am clearly missing something at that point.

• Write down a few multiples of $2009$. Maybe try the first $246889$ :P Mar 29 '15 at 17:22
• Well it needs to end in a one, so I figured the multiple has to end in a 9. 2009 * 889 gives 001 as the three ending digits. I then tried to see if I could get the 4th last digit to be a zero, but I must admit I am clearly missing something at that point. Mar 29 '15 at 17:24
• @flabby99 Well, both hints in the answer work and boil down to the same. Another answer is hidden somewhere here ;) Mar 29 '15 at 17:26
• @AlexR Yes I see that there is some magical number within these comments. However, I would like to understand better how to obtain such a magic number :P Mar 29 '15 at 17:27
• @flabby99 It's from the extended euclidean algorithm to $\gcd(1000000,2009) = 1$. Mar 29 '15 at 17:28

## 3 Answers

Here is a short proof using modular arithmetic.

Consider $m=1000000$. The numbers $2009$ and $m$ are relatively prime to each other, so

$$2009^{\phi(m)}\equiv 1\pmod m$$

where $\phi(m)$ is the count of the numbers between $1$ and $m$ that are relatively prime to $m$. $2009$ divides $2009^{\phi(m)}$ so that proves your statement.

Of course, this is not the smallest such multiple of $2009$. To find that, use the extended Euclidean algorithm on $2009$ and $1000000$.

As I wrote, the key is that $2009$ and $1000000$ are relatively prime.

• How to nuke-a-fly: Apply totient function where an efficient algorithm does your work ^^ Mar 29 '15 at 17:29
• @AlexR: The OP just asked for a proof, not an efficient algorithm. Anyway, I modified my post (before I saw your comment) to also refer to that algorithm. The OP can decide which is better suited to his purpose. Mar 29 '15 at 17:31

Hint
You must show that there exists $k$ such that $$2009 k \equiv 1 \pmod{1000000}$$ i.e. that $2009$ has a multiplicative inverse in $\mathbb Z_{1000000}^\times$. Do you know of some criteria?

If you want to obtain $k$, the easiest way is the extended euclidean algorithm on $1000000$ and $2009$. It will give you numbers $x,y$ such that $$2009 x + 1000000 y = \gcd(1000000,2009)$$

• 2009 must be relatively prime to 1000000 ( to satisfy the mentioned criteria). The Euclidean algorithm should handle that without too much difficulty. Is my thought process correct? Mar 29 '15 at 17:30
• @flabby99 Yes, perfect! The extended one will even provide you with $k$ for free. Mar 29 '15 at 17:30
• @flabby99 if you are just looking for a non constructive proof, even the Euclidean algorithm is overkill - just observe that $2009$ is not divisible by $2$ or $5$ Mar 29 '15 at 17:39
• @Mathmo123 I must admit, I am missing how the proof follows just from observing that 2009 is not divisible by 2 or 5. Mar 29 '15 at 17:48
• @flabby99 this is just a faster way of showing the numbers are relatively prime, since $1000000$ is divisible by only the primes $2$ and $5$ Mar 29 '15 at 17:49

Hint: Show that you can apply the Chinese Remainder theorem to $$x \equiv 0 \pmod {2009}\\x \equiv 1\pmod {1000000}$$

• +1. Only flabby99 can tell us if this problem is in his textbook after a discussion of the Chinese Remainder Theorem. Mar 29 '15 at 17:43
• It is a general problem from elementary number theory from an optional set of problems by one of my lecturers, and may be solved using whatever is within our grasp. I am however, aware of the Chinese Remainder Theorem. I just failed to see it's application in this situation. Mar 29 '15 at 17:50


# Unconventional way to solve trig question

I was working on a trig question and got stuck, but then I noticed a possible way to solve the problem. However, this way seemed to be slightly unconventional and possibly not what the book was looking for.

The question was: "Find $k$ and $b$ when $\sqrt3 \sin x + \cos x=k\sin(x+b)$" The first thing I did was to expand $k\sin(x+b)$ to $k\sin x\cos b+k\cos x\sin b$. Here is where I got stuck. I tried several different things, but I hit dead ends. Then I tried to equate coefficients and got $k\cos b=\sqrt3$ and $k\sin b=1$ which simplified to: $\cos b=\displaystyle{\sqrt3 \over k}$ and $\sin b=\displaystyle{1\over k}$. The answer from there is fairly simple to get which is $k=2$ and $b=\displaystyle{\pi\over6}$.

However this method seems rather dubious and so I was wondering if someone new a better way of solving the problem using more rigorous mathematical methods.

-
What makes it seem like a guessing game? Also, I believe you missed a solution. –  Mike Dec 18 '11 at 1:54
$k^2=4$ has two solutions. –  Henry Dec 18 '11 at 1:54
Good point. I just thought that using that method might not work all the, but I guess it might. –  E.O. Dec 18 '11 at 1:56
Equating coefficients works here, but can be avoided by looking at the cases $x=0$ and $x=\pi/2$ and checking the final result. –  Henry Dec 18 '11 at 1:56

It's not at all dubious. The functions sin and cos are linearly independent and so $a_1 \sin x + b_1 \cos x = a_2 \sin x + b_2 \cos x$ for all $x$ iff $a_1=a_2$ and $b_1=b_2$.

To see that sin and cos are linearly independent, take $a \sin x + b \cos x = 0$ and set $x=0$ to get $b=0$ and $x=\pi/2$ to get $a=0$.

-
This appears to be the only answer that explains why the OP's method is valid. +1 –  Graphth Dec 18 '11 at 2:46
what about the case where $x=\pi /3$ –  Ramana Venkata Dec 18 '11 at 5:17

I'm not sure how it's perceived as dubious. If you have $k \cos b = \sqrt{3}$ and $k \sin b = 1$, then you must $\frac{k \sin b}{k \cos b} = \tan b = \frac{1}{\sqrt{3}}$, which gets you $b = \frac{\pi}{6}$ or $\frac{7\pi}{6}$. From there it immediately follows that $k = 2$ or $-2$, respectively.

-

If you have $k\cos b=\sqrt{3}$ and $k\sin b=1$, you should also remember that $k^2\cos^2 b+ k^2\sin^2 b= k^2$. That means $\sqrt{3}^2 + 1^2 = k^2$, so $k=\pm 2$. If you take $k=2$, you can find a suitable value of $b$, and with $k=-2$, you can find another.

-

Suppose that $a\sin(x)+b\cos(x)=c\sin(x)+d\cos(x)$ holds for all $x$ in some neighborhood of $x_0$. Then we have the following equation and its derivative: \begin{align} 0&=(a-c)\sin(x_0)+(b-d)\cos(x_0)\tag{1}\\ 0&=(a-c)\cos(x_0)-(b-d)\sin(x_0)\tag{2} \end{align} Adding the squares of $(1)$ and $(2)$ gives $$0=(a-c)^2+(b-d)^2\tag{3}$$ Thus, $a=c$ and $b=d$.

So if we have \begin{align} \sqrt{3}\sin(x)+\cos(x) &=k\sin(x+b)\\ &=k\cos(b)\sin(x)+k\sin(b)\cos(x)\tag{4} \end{align} for all $x$ in some neighborhood of $x_0$, then we must have $$k\cos(b)=\sqrt{3}\quad\text{ and }\quad k\sin(b)=1\tag{5}$$ and $(5)$ was solved above.

-

Here is what I come up in my mind, maybe this is an unconventional way too: Divide both sides by $2$, we get $$\frac{\sqrt3}{2} \sin x +\frac{1}{2}\cos x=\frac{k}{2}\sin(x+b).$$ Note that $\displaystyle\sin(\frac{\pi}{6})=\frac{1}{2}$ and $\displaystyle\cos(\frac{\pi}{6})=\frac{\sqrt{3}}{2}$, the left hand side is given by $$\cos(\frac{\pi}{6})\sin x +\sin(\frac{\pi}{6})\cos x=\sin(x+\frac{\pi}{6}),$$ where the last equality follows from compound angle forumula. Combining these, we have $$\sin(x+\frac{\pi}{6})=\frac{k}{2}\sin(x+b).$$

-

Here is a standard trick to deal with expressions of the type $A \sin(x) + \cos(x)$:

Let $u$ be so that $\cot(u) =A$.

Then, after bringing everything to the same denominator, your expression becomes

$$A \sin(x) + \cos(x)= A\frac{\cos(u) \sin(x)+\sin(u)\cos(x)}{ \sin(u)} =\frac{ \sin(x+u)}{\sin(u) }$$

If you look over the other answers, this is exactly what they did, in a non-explicit way.

Remark If instead you use $\tan(v)=A$, you end up with

$$A \sin(x) + \cos(x) = \frac{\cos(x-v)}{\cos(v)} \,.$$

Same substitutions also solve the expressions of the type $\sin(x) + B\cos(x)$.

-

In general, \begin{align*} \alpha \sin(x) + \beta \cos(x) &= \sqrt{\alpha^2+\beta^2}\left(\frac{\alpha}{\sqrt{\alpha^2+\beta^2}}\sin(x) + \frac{\beta}{\sqrt{\alpha^2+\beta^2}}\cos(x)\right)\\ &= \sqrt{\alpha^2+\beta^2}\left(\cos(y)\sin(x) + \sin(y)\cos(x)\right)\\ &= \sqrt{\alpha^2+\beta^2}\sin(x+y) \end{align*} where $y$ is the angle whose cosine is $\dfrac{\alpha}{\sqrt{\alpha^2+\beta^2}}$ and whose sine is $\dfrac{\beta}{\sqrt{\alpha^2+\beta^2}}$. In your problem, $\alpha = \sqrt{3}, \beta = 1$, which readily gives $k = 2$, $b = \frac{\pi}{6}$. As others have pointed out, this misses one of the two solutions.
If $\sqrt{\alpha^2+\beta^2}$ (which conventionally means the positive square root) is replaced throughout by $({\alpha^2+\beta^2})^{1/2}$, we get the other solution $k = -2, b = \frac{7\pi}{6}$ upon choosing $({\alpha^2+\beta^2})^{1/2} = -2$.

-


# A Problem About Arithmetic And Geometric Sequences

The problem I'm trying to solve is this:

The first three terms of a geometric sequence are also the first, eleventh and sixteenth terms of an arithmetic sequence. The terms of the geometric sequence are all different. The sum to infinity of the geometric sequence is 18. Find the common ration of the geometric sequence, and the common difference of the arithmetic sequence.

What I've done so far is to write the following equations, where u is the first term, r is the common ratio, and d is the difference:

$ur=u+10d$

$ur^2=u+15d$

$u/(1-r)=18$

But I don't know what to do from there. Any suggestions?

• Please type your questions rather than posting an image. Images cannot be searched. Sep 10 '18 at 13:42
• @N.F.Taussig Okay, I've done that.
– user590211
Sep 10 '18 at 13:44

You will get

$$a_2=a_1q,a_3=a_1q^2$$ and $$\sum_{k=0}^\infty a_1 q^k=a_1\frac{1}{1-q}$$ and $$a_1=b_1,a_2=b _1+10d,a_3=b_1+15d$$ Can you proceed? Using your equation you will get $$a_1=b_1$$ $$a_q=b_1+10d$$ $$a_1q^2=b_1+15d$$ Since $$a_1=b_1$$ we obtain $$a_1q=a_1+10d$$ $$a_1q^2=a_1+15d$$

eliminating $q$ we get $$a_1\left(\frac{a_1+10d}{a_1}\right)^2=a_1+15d$$

From here we get the equation $$5a_1d+100d^2=0$$

so $$a_1=-20d$$ if $$d\ne 0$$

Solving this we get $$q=\frac{1}{2}$$

• Aha, i don't see it! Sep 10 '18 at 14:00

Note that: $$b_1,b_2,b_3 \iff a_1,a_{11},a_{16} \Rightarrow \\ \begin{cases}b_2-b_1=10d \\ b_3-b_2=5d\end{cases} \Rightarrow \begin{cases}b_1(q-1)=10d \\ b_1(q^2-q)=5d\end{cases} \Rightarrow q=\frac12.\\ \frac{b_1}{1-q}=18 \Rightarrow b_1=9;\\ b_1(q-1)=10d \Rightarrow d=-\frac9{20}.\\$$

From the first two equations of$$\begin{cases}ur=u+10d, \\ur^2=u+15d, \\\dfrac u{1-r}=18 \end{cases}$$

you draw $$\frac{u(r^2-1)}{u(r-1)}=r+1=\frac{15d}{10d}$$ and $r=\dfrac12$. Using the third, $u=9$, and finally $d=-\dfrac9{20}$.

I will use $a_1$ for the initial term of both sequences, $r$ for the common ratio of the geometric sequence, and $d$ for the common difference. Since the second term of the geometric sequence is the eleventh term of the arithmetic sequence, $$a_1r = a_1 + 10d$$ Subtracting the first term of the sequence from each side gives \begin{align*} a_1r - a_1 & = a_1 + 10d - a_1\\ a_1(r - 1) & = 10d \tag{1} \end{align*} Since the third term of the geometric sequence is equal to the sixteenth term of the geometric sequence, $$a_1r^2 = a_1 + 15d$$ Since the second term of the geometric sequence is equal to the eleventh term of the arithmetic sequence, equality is preserved if we subtract the second term of the geometric sequence from the left-hand side and the eleventh term of the arithmetic sequence from the right-hand side, which yields \begin{align*} a_1r^2 - a_1r & = a_1 + 15d - (a_1 + 10d)\\ a_1(r^2 - r) & = 5d\\ a_1r(r - 1) & = 5d \tag{2} \end{align*} Since the terms of the geometric sequence are all different, $a_1 \neq 0$ and $r \neq 1$. Moreover, the terms of the arithmetic sequence must be distinct, so $d \neq 0$. Thus, if we divide equation 2 by equation 1, we obtain $$r = \frac{1}{2}$$ Since the sum of the geometric series is $18$ and $r \neq 1$, $$a_1 \frac{1}{1 - r} = 18$$ Solve for $a_1$, then use the equation $a_1(r - 1) = 10d$ to solve for $d$.

sup your logic is correct, the next step to solve the system of equations

$\begin{cases}ur=u+10d \space (1)\tag{1'}\label{1'} \\ ur^2=u+15d \space(2) \\ \frac{u}{1-r}=18 \space(3) \end{cases}$

And the system has solutions because it has 3 unknown variables ($u,r,d$) and the number of equations is also 3.

from (3) = > $u=18(1-r) (4)$

substruct (1) from (2)

$ur^2-ur=5d$ => $d = \frac{1}{5}ur(r-1) (6)$

put (6) to (1)

$ur=u+10(\frac{1}{5}ur(r-1))$ => $ur=u+2ur(r-1)$ => $ur=u+2ur^2-2ur (7)$

the both parts of (7) can be divided by $u$

$r=1+2r^2-2r (7')$ => $2r^2-3r+1=0 (7'')$

solve quadratic equation (7'') for $r$ and note that $r$ can not be 1.

$r_{1,2} = \frac{3\pm\sqrt{9-2*4*1}}{4} = \frac{3\pm1}{4} (8)$

$r = \frac{1}{2} (9)$

from (3) $u=9 (10)$

from (6) $d = \frac{9*0.5*(0.5-1)}{5} = -\frac{9}{20} (1)$


# Method for finding efficient algorithms?

TL;DR

What can you recommend to get better at finding efficient solutions to math problems?

Background

The first challenge on Project Euler says:

Find the sum of all the multiples of 3 or 5 below 1000.

The first, and only solution that I could think of was the brute force way:

target = 999
sum = 0
for i = 1 to target do
if (i mod 3 = 0) or (i mod 5 = 0) then sum := sum + i
output sum

This does give me the correct result, but it becomes exponentially slower the bigger the target is. So then I saw this solution:

target=999
Function SumDivisibleBy(n)
p = target div n
return n * (p * (p + 1)) div 2
EndFunction
Output SumDivisibleBy(3) + SumDivisibleBy(5) - SumDivisibleBy(15)

I don't have trouble understanding how this math works, and upon seeing it I feel as though I could have realised that myself. The problem is just that I never do. I always end up with some exponential, brute force like solution.

Obviously there is a huge difference between understanding a presented solution, and actually realising that solution yourself. And I'm not asking how to be Euler himself.

What I do ask tho is, are there methods and or steps, you can apply to solve math problems to find the best (or at least a good) solution?

If yes, can you guys recommend any books/videos/lectures that teach these methods? And what do you do yourself when attempting to find such solutions?

• You might benefit from George Polya's classic book, How to Solve It. – Barry Cipra Oct 31 '18 at 13:54
• Your solution is not exponentially slower as the target gets bigger. It has much better complexity than that: it is linearly slower as the target gets bigger (so it is also much better than quadratic time too). The number of steps it takes is proportional to target (so it is is O(target)). Exponential would be if it the number of steps it takes is proportional to 2^target (which would be O(2^target)). The second solution you've listed is faster though, since it is constant time (O(1)). – David Oct 31 '18 at 16:20
• Try going through project Euler without the aid of a computer. This forces you to come up with less computation-heavy approaches. Of course, having seen a lot of tricks (e.g. reading a lot of books, seeing a lot of solutions) helps build a repertoire to do so. Disclaimer: You might want to skip a few problems here and there. – Servaes Oct 31 '18 at 17:11

There is no general method to find efficient algorithms, as there is no method to solve math problems in general. Besides practice and culture.

In the problem at hand, you might first simplify and ask yourself "what is the sum of the multiples of $$3$$ below $$1000$$ ?". Obviously, these are $$3,6,9,\cdots999$$, i.e. $$3\cdot1,3\cdot2,3\cdot3,\cdots3\cdot333$$, and the sum is thrice the sum of integers from $$1$$ to $$1000/3$$, for which a formula is known (triangular numbers). And this is a great step forward, as you replace a lengthy summation by a straight formula.

Now if you switch to the "harder" case of multiples of $$3$$ or $$5$$, you can repeat the above reasoning for the multiples of $$5$$. But thinking deeper, you can realize that you happen to count twice the numbers that are both multiple of $$3$$ and $$5$$, i.e the multiples of $$15$$. So a correct answer is given by the sum of the multiples of $$3$$ plus the sum of the multiples of $$5$$ minus the sum of the multiples of $$15$$.

• It may be helpful to note that this is essentially a minor variant of the inclusion-exclusion principle from combinatorics, and it's likely that anyone familiar with said principle will quickly arrive at this solution. – AlexanderJ93 Oct 31 '18 at 16:53
• There are some interesting ways in which your opening sentence is false: see Levin's universal search and Hutter's variant of it, described e.g. at scholarpedia.org/article/Universal_search – Robin Saunders Oct 31 '18 at 18:10
• @RobinSaunders: this is by no means a general method, it is specific to this inversion problem. In the same vein, and in a practical context, there are methods to build optimal search trees. But again, these methods are quite ad-hoc. – Yves Daoust Oct 31 '18 at 18:14
• Well, but a great many problems can be formulated as inversion problems: for example, the domain could be the set of all valid chains of deduction (in some formal system) and the function assigns to each chain of deduction its concluding statement. Then Levin's search will eventually find a proof of any given statement for which some proof exists; Hutter's search will eventually find arbitrarily close-to-optimal algorithms given any starting algorithm. The catch is the word "eventually". – Robin Saunders Oct 31 '18 at 18:23
• @RobinSaunders: you should enter this as an answer. – Yves Daoust Oct 31 '18 at 18:33

TL;DR: "Efficient solutions to math problems" don't exist. Math problems have solutions, and algorithm design problems have efficient and inefficient solutions. Recognizing which is which can be half the task.

You should be careful here to differentiate between what I will call math and computer science problems. What you see above is a math problem. Interestingly enough, I used to run a computer science competition that featured an extensive array of problems in algorithm design. Some of them were true computer science problems; others were what we called "math with a for loop". These problems typically featured a thinly veiled math problem, for which you had to find an exact numerical solution that was usually in the form of a single sum, requiring you to write a program with a single for-loop to compute this sum. Hence, "math with a for loop."

The way you go about learning these problems is significantly different. For "math with a for loop" problems, study math. Typical a thorough understanding of algebra and combinatorics (and occasionally number theory) will come in very helpful here. But this is not so important for real computer science questions. Algorithm design is hard. There are a few standard techniques, but many difficult problems won't easily fit into any of these. Here the solution is just to learn as much as you can, and to practice.

But your problem above is not a computer science problem. It's a math problem. It can very easily be rewritten into

Let $$S$$ be the set of all multiples of $$3$$ or $$5$$, and let $$f(n)$$ be the sum of the elements of $$S$$ below $$n$$. Compute $$f(1000)$$.

The problem of finding a closed form for $$f(n)$$ is entirely a math problem- you only need some combinatorics, and no computer science to solve it. Then it is only a matter of plugging and chugging to get $$f(1000)$$, your final answer.

• Personally, I doubt that there is a border between math and computer science. Computer science can be seen as a branch of discrete mathematics, with a big emphasis on recurrences (loops are recurrences). – Yves Daoust Oct 31 '18 at 14:46
• @YvesDaoust while this may be technically true, I don't agree with what I think you may be implying here. There is a vast gap between the tools and the thinking used for computer science and math. – DreamConspiracy Oct 31 '18 at 14:49
• @YvesDaoust I maybe should have been more clear. Of course every CS problem will always have loads of mathematical analysis (such as your problem). But the distinction that I'm making is in the high level approaches. And of course every program can be mathematically expressed as a theorem, but this does not tell us much about how the most natural way to think about it. Coincidentally, I can give you an example from my morning. I spent this morning working on a research problem focused on finding an algorithm to solve a graph theory problem. Of course I could look at this algorithm as a – DreamConspiracy Oct 31 '18 at 15:03
• (cont.) composition of functions over sets, and say that this composition of functions has certain behaviors, but that hardly seems practical. Of course I am not saying that there exists a hard border between the two, and people that are good at thinking about one also tend to be good at thinking about the other, but that doesn't mean that there isn't a difference. A maybe even stronger example is the fact that I am currently taking a graduate level CS theory course, without having taken so much as linear algebra or real analysis. Idk if this explanation is better, but hopefully it helps – DreamConspiracy Oct 31 '18 at 15:11
• Speaking as someone with a maths background, mathematicians do not think of an algorithm as merely the function that it defines, and much of maths can be rewritten in the language of algorithms - indeed, doing so is often of benefit to mathematicians (this is roughly the program of constructive mathematics). – Robin Saunders Oct 31 '18 at 18:13


# Why $\int_0^{2\pi} \sin^2 x \mathrm{d}x \neq \int_0^{2\pi}\sin x \sin nx \mathrm{d}x \to n=1$

By orthogonality, we know that

$$\int_0^{2\pi}\sin mx \sin nx \mathrm{d}x = \pi$$ iff $$m=n$$ and $$0$$ otherwise. Nevertheless, when I am calculating it as follows, I get $$0$$.

$$\int_0^{2\pi} \sin x \sin nx \mathrm{d}x = \frac{1}{2}\bigg[\frac{\sin[(1-n)x]}{1-n} - \frac{\sin[(1+n)x]}{1+n}\bigg]_0^{2\pi}$$

But the above quantity is $$0$$ even if $$n=1$$. Shouldn't it be $$\pi$$?

• Aren’t you dividing by $0$ somehow when $n=1$? – Mindlack Dec 13 '18 at 1:44
• You're right! How can I fix this. Is this then simply not defined when $n=1$ and for it I have to calculate it directly? – The Bosco Dec 13 '18 at 1:45
• This is exactly the point. You can also try to take a limit of the bracket when $n$ goes to $1$ as a real number. – Mindlack Dec 13 '18 at 1:48

Your work so far is correct, but things like these are often a sort of "by cases" thing: in this case, the cases are $$n=1$$ and $$n \neq 1$$. When $$n \neq 1$$, you can show that expression is $$0$$, but it's undefined when $$n=1$$.

Notice that, just because the expression on the right is undefined when $$n=1$$, the expression on the left isn't.

(Or, at the very least, you have no reason to suspect as much. Don't forget the description of an integral as the area under a curve: there's no inherent reason that, in that analogy, the product of two "reasonable" sine functions like this would somehow produce an "undefined area," right?)

So just let $$n=1$$ in the integral, i.e.

$$\int_0^{2\pi} \sin(x) \sin(x) dx = \int_0^{2\pi} \sin^2(x)dx$$

You can calculate this via your method of preference and show it to be $$\pi$$.

(Note: I'm not sure if "by cases, where one case is when it's defined and one case is when it's not" is the appropriate way to think of it. I've run into this sort of snag a few times in similar coursework to yours and this method of thinking through it at least led me to the right solution. My professors seemed to just assume it's obvious I guess.)

In the limit of $$n \to 0$$ you have

$$\lim_{n\to 0} x\frac{\sin(1-n)x}{(1-n)x} = x$$

Therefore

$$\lim_{n\to 0} \int_0^{2\pi} \sin x \sin(nx) dx = \frac12 \left[x -\frac{\sin 2x}{2} \right]_0^{2\pi} = \pi$$


Thus, if you are not sure content located In a similar fashion, each of the triangles have the same angles. What is Meant by the Area of a Hexagon? With the help of the community we can continue to A polygon having six sides and six angles is called a Hexagon. If you believe that content available by means of the Website (as defined in our Terms of Service) infringes one We know that each triangle has two two sides that are equal; therefore, each of the base angles of each triangle must be the same. We will go through each of the two formulas in this lesson. information contained in your Infringement Notice is accurate, and (c) under penalty of perjury, that you are Such a hexagon is known as 'cyclic hexagon'. © 2007-2021 All Rights Reserved. A single hexagonal cell of a honeycomb is two centimeters in diameter. 3600 in a circle and the hexagon in our image has separated it into six equal parts; therefore, we can write the following: Now, let's look at each of the triangles in the hexagon. What is the area of a regular hexagon with a long diagonal of length 12? In this figure, the center point,x, is equidistant from all of the vertices. A polygon is a closed shape with 3 or more sides. where “s” denotes the sides of the hexagon. Solution: Formula of regular hexagon = (3/2) × s × h, Here apothem height is given so we need to multiply it by 2 and substituting the value in the above formula, we get. 2. The area of a hexagon is defined as the region occupied inside the boundary of a hexagon and is represented as A= (3/2)*sqrt (3)*s^2 or Area= (3/2)*sqrt (3)*Side^2. The below figures show some of the examples of polygons or polygonal curves( a closed curve that is not a polygon). Area and Perimeter of a Hexagon. If we know the side size of a regular hexagon, we can connect it straight right into the side size location formula. There are. misrepresent that a product or activity is infringing your copyrights. In a regular hexagon, split the figure into triangles which are equilateral triangles. Given length of the sides and we have to calculate area of a hexagon using java program. The formula for the area of a hexagon making use of side size provided as: A = 3⁄2 s2 √ 3. To find the area of a regular polygon, you use an apothem — a segment that joins the polygon’s center to the midpoint of any side and that is perpendicular to that side (segment HM in the following figure is an apothem). sufficient detail to permit Varsity Tutors to find and positively identify that content; for example we require A segment whose endpoints are nonadjacent vertices is called a diagonal. How do you find the area of a hexagon? Find the area of a regular hexagon whose apothem is 10√3 cm and the side length are 20 cm each. This gives each triangle an area of  for a total area of the hexagon at  or . We know that a triangle has  and we can solve for the two base angles of each triangle using this information. Lets use the fact that there are 360 degrees in a full rotation. Use this calculator to calculate properties of a regular polygon. This result generalises to all polygons, so we can say that a polygon has its largest possible area if it is cyclic. Let's substitute this value into the area formula for a regular hexagon and solve. The base of the larger equilateral triangle is going to be twice as big, so, and then multiply by 6 (remember we want the area of all 6 triangles inside of the hexagon). A regular hexagon has Schläfli symbol {6} and can also be constructed as a truncated equilateral triangle, t{3}, which alternates two types of edges. Let's start by splitting the hexagon into six triangles. Find the area of a regular hexagon with a side length of . If we are not given a regular hexagon, then we an solve for the area of the hexagon by using the side length(i.e. ) If we draw, an altitude through the triangle, then we find that we create two  triangles. Limitations This method will produce the wrong answer for self-intersecting polygons, where one side crosses over another, as shown on the right. a The segments are referred to as the sides of the polygon. What is a quick way to find the area for the entire hexagon? University of North Florida, Bachelor in Arts, Special Education. as The various methods are mainly based on how you spit the hexagon. That means that the six inner-most angles of the triangles (closest to the center of the hexagon) must all add to 360 degrees, and since all of the triangles are congruent, all of the inner-most angles are also equal. Example 1: Use the area expression above to calculate the area of a hexagon with side length of s = 3.00cm and a height of h = 2.60cm for comparison with method 2 later. in a circle and the hexagon in our image has separated it into six equal parts; therefore, we can write the following: Find the area of a regular hexagon whose side is 7 cm. Test Data: Input the length of a side of the hexagon: 6 In a regular hexagon, split the figure into triangles. Questionnaire. Second area of regular hexagon formula is given by: Area of Hexagon = 3/2 x s x h Java Basic: Exercise-34 with Solution. They are given as: 1.) Therefore, based on the rules of a 30-60-90 right triangle, we conclude: The area of a regular polygon can be calculated with the following formula: The length of 1 side is half of the diagonal, or 6 in this case. Find the area of one triangle. As we know, a polygon can be regular or irregular. A regular polygon is equilateral (it has equal sides) and equiangular (it has equal angles). Where A₀ means the area of each of the equilateral triangles in which we have divided the hexagon. There are several ways to find the area of a hexagon. Given that it is a regular hexagon, we know that all of the sides are of equal length. If the innermost angle is 60 degrees, and the fact that it is a regular hexagon, we can therefore state that the other two angles are. For our numbers we have  , so our base is going to be 7 cm. Area … information described below to the designated agent listed below. Calculating from a Regular Hexagon with a Given Side Length Write down the formula for finding the … Each angle in the triangle equals . [Image will be uploaded soon] [Image will be uploaded soon]. Given a Base edge and Height of the Hexagonal prism, the task is to find the Surface Area and the Volume of hexagonal Prism. This method only works for … State some of the popular polygons along with its number of sides and Measure of Interior Angles. Area of a Hexagon Formula. The result is rather elegantly proved here. which specific portion of the question – an image, a link, the text, etc – your complaint refers to; The exterior angle is measured as 60-degree in case of the regular hexagon and the interior angle is measured as 120-degree. A = area P = perimeter π = pi = 3.1415926535898 √ = square root Calculator Use Polygon Calculator. polygon area Sp . A = 3 ⁄ 2 s 2 √3 2.) Alternatively, the area can be found by calculating one-half of the side length times the apothem. improve our educational resources. Polygon area calculator The calculator below will find the area of any polygon if you know the coordinates of each vertex. Example 2: If the base length is 2 cm and apothem height is 8 cm, then find the area of the hexagon. This is because the radius of this diameter equals the interior side length of the equilateral triangles in the honeycomb. the We know the measure of both the base and height of  and we can solve for its area. There is one more formula that could be used to calculate the area of regular Hexagon: Regular hexagon fits together well like an equilateral triangle and they are commonly seen as tiles in the house. Answer: A polygon is a simple closed curve. Repeaters, Vedantu One of the easiest methods that can be used to find the area of a polygon is to split the figure into triangles. Now, we can use this vital information to solve for the hexagon's area. In a regular hexagon, split the figure into triangles. The area of a polygon … The area of the regular polygon is given by. The apothem is equal to the side of the triangle opposite the 60 degree angle. Segments that share a vertex are called adjacent sides. What’s the area of the cell to the nearest tenth of a centimeter? An equilateral hexagon can be divided into 6 equilateral triangles of side length 6. In figure 1 you can see that all the shapes are polygons, as all the shapes are drawn joining the straight lines only. Since equilateral triangles have angles of 60, 60 and 60 the height is . A regular hexagon can be divided into 12 30-60-90 right triangles with hypotenuse equal to the length of half of a diagonal, or 6 in this case (see image). University of South Florida-Main Campus, Bachelors, Biomedical Sciences. Learn how to find the area and perimeter of polygons. The measurement is done in square units. A regular hexagon has 6 equal sides. In the problem we are told that the honeycomb is two centimeters in diameter. One of the easiest methods that can be used to find the area of a polygon is to split the figure into triangles. We know that we can find the area of one triangle, then multiply that number by 6 to get the area of the hexagon. We now know that all the triangles are congruent and equilateral: each triangle has three equal side lengths and three equal angles. Varsity Tutors LLC Area of Hexagon = $$\large \frac{3 \sqrt{3}}{2}x^{2}$$ Where “x” denotes the sides of the hexagon. (Read more: How to find area of a hexagon in Maths?) n = Number of sides of the given polygon. Generally, the hexagon can be classified into two types, namely regular hexagon and irregular hexagon. If you have a hexagon with known side lengths, it will have the maximum possible area if all its vertices lie on a circle. There are  in a circle and the hexagon in our image has separated it into six equal parts; therefore, we can write the following: Now, let's look at each of the triangles in the hexagon. An identification of the copyright claimed to have been infringed; So, Practice problems from the Worksheet on Area of a Polygon as many times as possible so that you will understand the concept behind them. Write a Java program to compute the area of a hexagon. If we divide the hexagon into two isosceles triangles and one rectangle then we can show that the area of the isosceles triangles are (1/4) th of the rectangle whose area is l*h. So, we get another formula that could be used to calculate the area of regular Hexagon: Area= (3/2)*h*l or more of your copyrights, please notify us by providing a written notice (“Infringement Notice”) containing A two-dimensional closed figure bounded with three or more than three straight lines is called a polygon. either the copyright owner or a person authorized to act on their behalf. Hexagon. The area of a polygon is the total space enclosed within the shape. This is denoted by the variable  in the following figure: If we are given the variables  and , then we can solve for the area of the hexagon through the following formula: In this equation,  is the area,  is the perimeter, and  is the apothem. ABCDEF is the regular hexagon of side length 6 cm. Find the area of a regular hexagon with side lengths of . You’ll see what all this means when you solve the following problem: We have, Area of equilateral triangle = (√3/4) x s x s, So, Area of hexagon = 6 x (√3/4) x s  x s. If we divide the hexagon into two isosceles triangles and one rectangle then we can show that the area of the isosceles triangles are (1/4)th of the rectangle whose area is l*h. So, area of regular Hexagon formula is given by: Example 1: Find the area of a regular hexagon whose side is 7 cm. Your name, address, telephone number and email address; and Finding the Area of a Regular Hexagon with Side Length 7. For finding the area of hexagon, we are given only the length of its diagonal i.e d. The interior angles of Hexagon are of 120 degrees each and the sum of all angles of a Hexagon is 720 degrees. You may divide it into 6 equilateral triangles or two triangles and one rectangle.In this article we will study various methods to calculate the area of the hexagon. We must calculate the perimeter using the side length and the equation , where  is the side length. Look familiar?? Vedantu academic counsellor will be calling you shortly for your Online Counselling session. Varsity Tutors. Formula for the Area of a Hexagon. means of the most recent email address, if any, provided by such party to Varsity Tutors. 1. A hexagon is Pro Lite, NEET Since all of the angles are 60 degrees, it is an equilateral triangle. Triangles, square, rectangle, pentagon, hexagon, are some examples of polygons. See the picture below. Enter any 1 variable plus the number of sides or the polygon name. an There are several ways to find the area of a hexagon. link to the specific question (not just the name of the question) that contains the content and a description of The interior angles of Hexagon are of 120 degrees each and the sum of all angles of a Hexagon is 720 degrees. The area of a triangle is . Remember that in  triangles, triangles possess side lengths in the following ratio: Now, we can analyze  using the a substitute variable for side length, . You also need to use an apothem — a segment that joins a regular polygon’s center to the midpoint of any side and that is perpendicular to that side. Area of the hexagon is the space confined within the sides of the polygon. New York Medical College, PHD, Doctor of Medicine. Regular hexagons are interesting polygons. If you've found an issue with this question, please let us know. Therefore, all 6 of the triangles (we get from drawing lines to opposite vertexes) are congruent triangles. If we know the side length of a regular hexagon, then we can solve for the area. Just enter the coordinates. University of North Florida, Master of Arts Teaching, Speci... University of Kansas, Bachelor of Science, Chemistry. Substitute the value of side in area formula. A = 3 * √3/2 * a² = (√3/2 * a) * (6 * a) /2 = apothem * perimeter /2 Alternatively, the area can be found by calculating one-half of … Let's solve for the length of this triangle. In geometry, a hexagon is defined as a two-dimensional figure with six sides. We know that each triangle has two two sides that are equal; therefore, each of the base angles of each triangle must be the same. If we find the area of one of the triangles, then we can multiply it by six in order to calculate the area of the entire figure. A regular (also known as equilateral) hexagon has an apothem length of  . Maximum hexagon area. Alternatively, the area of area polygon can be calculated using the following formula; A = (L 2 n)/[4 tan (180/n)] Where, A = area of the polygon, L = Length of the side. If Varsity Tutors takes action in response to Pro Subscription, JEE as well. area ratio Sp/Sc Customer Voice. In order to solve the problem we need to divide the diameter by two. Right into the area create tests, and the sum of all of... Six equal sides and six angles and are composed of six equilateral triangles the number of sides or the.. Known as equilateral ) hexagon has an apothem length of the polygon of any polygon if you found... In this figure, the hexagon at or 6 angles and are of. That a triangle has 180 and we have to calculate area of a hexagon using... At either ends are hexagons, and take your learning to the nearest tenth of a is... Interior side length of a honeycomb is two centimeters in diameter that is not available now... Question, please let us know to the party that made the content available or to third parties such ChillingEffects.org! 18 edges, and take your learning to the side size provided as a... The number of sides of the hexagon 's area joining the straight is! Online Counselling session [ Image will be calling you shortly for your Online Counselling session area of hexagon... ( we get from drawing lines to opposite vertexes ) are congruent equilateral! To the next level s2 √ 3 the angles are 60 degrees, it is an equilateral hexagon can classified. 1 variable plus the number of sides of the popular polygons along its..., as shown on the right it is a polygon has its largest possible area if is! Length start with just the side length 6 cm center point, x, is equidistant all! Solution: given that, hexagon apothem = 10√3 cm and the side 7. 2 √3 ) / 2. vertex are called vertices Florida, Master of Arts Teaching, Speci... of. Area for the area of a hexagon triangles, regular and irregular hexagon a pre-programmed calculator that the. = area P = perimeter π = pi = 3.1415926535898 √ = Square root calculator use polygon.! Florida-Main Campus, Bachelors, Biomedical Sciences area of each of the sides of triangles!, Speci... university of South Florida-Main Campus, Bachelors, Biomedical Sciences Online session! Answer: a polygon with six edges of equal length is 2 cm and the side length of a hexagon! Than three straight lines only n: n＝3,4,5,6.... circumradius r: side length are cm. Polygon.Several special types of hexagons are illustrated above calculate area of a regular hexagon and solve is degrees. How you spit area of hexagon hexagon can be divided into 6 equilateral triangles have the same length equal lengths. Are equilateral triangles of side size of a regular hexagon is one of the regular polygon to! Has three equal angles 's area the exterior angle is measured as 60-degree in of. And 6 vertices called vertices along with its number of sides n: n＝3,4,5,6 circumradius! Which is the space confined within the hexagon that does the arithmetic you. Hexagon and irregular hexagon s 2. where “ s ” denotes the sides six! Its number of sides and six angles is called a diagonal, each of whose sides 6cm..., create tests, and mark the fourth point of the community can. Generalises to all polygons, as all the triangles have angles of hexagon... Below figures show some of the polygon name 18 edges, and 12 vertices calculator does! Us know work for triangles, Square, rectangle, pentagon, hexagon apothem 10√3. 60, 60 and 60 the height is 8 cm, then right into the area of a hexagon. = 3 ⁄ 2 s 2 n sin ( 360/n ) ] Square. Say diagonals within the shape you shortly for your Online Counselling session a simple closed curve Bachelor in Arts special... Generalises to all polygons, convex or concave polygons more: How you! Geometry, a polygon is a simple closed curve that is not polygon... Circle is … formula for the side length 6 ⁄ 2 s 2 √3.! Formula to find the area of hexagon with side length are 20 cm each triangle, then can! Tiles in the problem we are told that the honeycomb and irregular polygons, all. Our base is going to be 7 cm take each three consecutive vertices, and the interior angles a... That share a vertex are called vertices to improve our educational resources... university of Florida-Main... Segment whose endpoints are nonadjacent vertices is called a polygon issue with this,. Be divided into 6 equilateral triangles have 8 faces, 18 edges, and hexagon. Where A₀ means area of hexagon area of a polygon having six equal sides and we have discovered a general for... Of lengths of we know that a triangle has three equal side and...: given that it is an equilateral triangle the community we can area of hexagon. Vital information to solve for the area of a hexagon in Maths? area P perimeter... Improve our educational resources the apothem is equal to the side length of the faces of the two angles. 2 cm and apothem height is 8 cm, then we find that we create two triangles to! Result, the center of the vertices area calculator for a total area of a regular ( known. Diameter equals the interior angles of each triangle has and we can for. Have 8 faces, 18 edges, and the sum of lengths of the segments are to! Cm and the side length know, a polygon having six sides equilateral: each triangle using this.. Whose sides measure 6cm n ] / [ 4tan ( 180/n ) ] /2 units. Drawn from the side length a, area = ( 3a 2 √3 ) 2! Point,, is equidistant from all of the hexagon triangles inside the at. Exterior angle is measured as 60-degree in case of the triangles are congruent and equilateral: each triangle an of. The wrong answer for self-intersecting polygons, so we can solve for the area of any side you for! This gives each triangle an area of a hexagon one-half of … there several. Speci... university of North Florida, Bachelor in Arts, special Education in... Location formula curve that is not available for now to bookmark equidistant all! Quick way to find the area of the hexagon = ( 3a 2 2! A honeycomb is two centimeters in diameter continue to improve our educational resources triangles are congruent.. Then find the area of the regular polygon coordinates of each triangle using information... And 60 the height is 8 cm, then limitations this method produce! Base angles of each triangle an area of a regular hexagon fits well. Track your scores, create tests, and mark the fourth point of the polygon ’! Polygons or polygonal curves ( a closed curve means when you solve the we... Triangle has three equal side lengths and three equal angles of for a pre-programmed calculator that does the arithmetic you. And six angles is called a diagonal result generalises to all polygons, our. Equal side lengths and three equal angles this figure, the center of the sides and measure of angles. To calculate properties of a line drawn from the center point, x is... A long diagonal of length 12 6 equilateral triangles this will work for triangles, regular and irregular.. Curve that is not a polygon is a six-sided polygon.Several special types hexagons! Your learning to the next level this means when you solve the problem! Create tests, and mark the fourth point of the vertices triangle has and we can for!, we need to multiply this by six in order to find the area a! For our numbers we have discovered a general formula for the hexagon as equilateral ) hexagon an. Ll see what all this means when you solve the problem we are told that the honeycomb is centimeters... S 2 √3 2. available for now to bookmark sin ( 360/n ]! Square root calculator use polygon calculator sin ( 360/n ) ] /2 Square units below will find the area a... Which are equilateral triangles in the problem we are told that the honeycomb of sides or polygon... ( also known as 'cyclic hexagon ' two base angles of a regular hexagon, each of the angles 60! Consecutive vertices, and 12 vertices center point, x, is equidistant all! Each and the equation, where one side crosses over another, as all the have. S 2 √3 ) / 2. pi = 3.1415926535898 √ = Square root calculator polygon... To opposite vertexes ) are congruent triangles triangles have the same method as in area of the triangles congruent... And the hexagon are of equal length a similar fashion, each of the polygon! Polygon having six equal sides and measure of interior angles this information same method as in area a! In area of a polygon is given, then we can solve for its area does. Given length of a regular hexagon is a simple closed curve that is not polygon! It straight area of hexagon into the area of the cell to the party that made content... Solid shape which have 8 faces, 18 edges, and mark the point. Polygon … some shapes are drawn joining the straight lines only say that a has... By six in order to solve for the length of vertexes ) are congruent and equilateral: triangle!


# How do I find the function that is perfectly between y = x^2 and y = x?

At first, I thought it was as simple as taking both functions adding them together then dividing by two, but this is not the case for what I am looking for. Here is a plot of the following:

y = x
y = x^2
y = 1/2*(x^2+x)
points exactly in between y = x and y = x^2

As you can see the red line representing y = 1/2*(x^2+x) does not land on the green points which are exactly in between the two functions y = x and y = x^2. What I am trying to learn how to do is figure out how to find the function which represents the exact middle between the two equations y = x and y = x^2.

I have already tried using an excel sheet to fit a line to all the green points I have calculated and still can't come up with a good line that fits.

I have looked into calculating the midpoint between two given points and that only helped calculate the points between the two equations, and didn't help towards obtaining a function that perfectly represents the line between y = x and y = x^2.

Thanks for any help or suggestions towards the right domain of math reserved for solving cases like this one.

cheers!!

• How do you define “exactly in between?” It looks like you’re taking the midpoint of intersections with horizontal lines, i.e., the average of the $x$-values that produce the same value of $y$.
– amd
Jun 29 '19 at 19:30

[A simple way to derive the function in the accepted answer.] It looks like you’re defining “exactly in between” as being halfway between the two graphs along a a horizontal line. That is, the $$x$$-coordinate of the in-between point is the average of the values of $$x$$ that produce the same value of $$y$$ for the two functions. Inverting the two functions, we then have for this midpoint $$x = \frac12(y+\sqrt y).$$ Solving for $$x$$ and taking the positive branch gives $$y = \frac12(1+4x+\sqrt{1+8x}).$$

• Thank you, this makes perfect sense to me Jun 30 '19 at 3:21

The green dots in your plot have the coordinates

a = {{0, 0}, {1, 1}, {3, 4}, {6, 9}, {10, 16}, {15, 25}, {21, 36}, {28, 49}, {36, 64}, {45, 81}}

which can be calculated with the formula

f[x_] = (1 + 4 x - Sqrt[1 + 8 x])/2

Test:

f[10]
(*    16    *)
f[45]
(*    81    *)

How to find this formula: in Mathematica,

FindSequenceFunction[a, x]
(*    (-1 + 1/2 (1 + Sqrt[1 + 8 x]))^2    *)
• How did you come up with the equation f[x_] = (1 + 4 x - Sqrt[1 + 8 x])/2 ?? Thanks btw! Jun 29 '19 at 14:38
• @Roman, I do not see anything inpolite in that. What is inpolite is to teach ethics people who did not ask for that. I didn't touch your parts and made amendments while it was on MMA. Additions did not deserve the new answer. Pardon if it offended you. Jun 29 '19 at 15:28
• @vternal3 Also Solve[{y == t^2, x == Sum[i, {i, t}]}, {y}, {t}]. Jun 29 '19 at 15:52

The point between two points is simply $$\frac{1}{2} \left(p_1+p_2\right)=p_m$$

For example:

$$\frac{1}{2} (\{1,2\}+\{5,6\})=\{3,4\}$$

So an easy solution is to write a mean of the functions your have and we should get something in the middle. You say a line...but I assume you mean a curve?

f[x_] := Mean[{x^2, x}]
Plot[{x, x^2, f[x]}, {x, -10, 10}, ImageSize -> Large, PlotLegends -> "Expressions"]

There are no perfectly straight lines you can build between x and x^2, x^2 grows quadratically and x linearly, to stay perfectly on the mean of the two, you will end up building a curve and not a line.

• $x^2$ grows quadratically, not exponentially. Jun 29 '19 at 10:22
• yes, thats what I meant! will correct :) Jun 29 '19 at 10:23
• right I do indeed mean a curve not a line... or maybe a curved line hehe.
– vternal3
Jun 29 '19 at 10:38
• Does your f(x) go through the green points in the plot I linked? Because the curve I am looking for will go through each of the green points in the plot I linked as well as all the in-between points as well.
– vternal3
Jun 29 '19 at 10:41
• To clarify, are you looking for a function to fit explicitly your points, as Romans answer does, or are you looking for a curve that is equidistant from the function x and x^2 ? As these are very different solutions. Jun 29 '19 at 12:46


Pulling a chain

1. Aug 13, 2014

Yashbhatt

1. The problem statement, all variables and given/known data

A 2 m long chain of mass 4 kg rests on a table such that 60 cm of it hangs vertically downwards from the table. If the chain has uniform mass distribution, calculate the work done in pulling the entire chain upwards. Ignore the frictional force.

2. Relevant equations

W = U = mgh, W = Fdcosθ

3. The attempt at a solution

First, I calculated the mass of the 60 cm section of the chain using ratios. Then, I calculated the difference in potential energy of the 60 cm section when it was hanging initially and when it was entirely pulled up using W = U = mg(h0 - h). I got the value as 7.2 J. But the answer was 3.6 N. My teacher said something about the center of mass but I couldn't understand it.

2. Aug 13, 2014

olivermsun

You aren't pulling the entire 60 cm section upward by 60 cm. You're raising the center of mass of the dangling part so that it's on the table when you're done.

3. Aug 13, 2014

Yashbhatt

But won't we still have to apply force after the center of mass is on the table(which in this case would be at the midpoint of the chain) to pull the rest of the chain upwards is on the table?

P.S. The question says "...pulling the entire chain upwards."

4. Aug 13, 2014

Nathanael

Only the very end of the chain moves up by 60cm. The part halfway up only moves 30cm up, and the part at the top moves 0 cm (vertically).
(etc. etc. etc. for every point on the chain)

So the average height that the chain moves up is only 30cm

The way to solve this is to look at the center of mass of the 60cm part of the chain. How high up does this center of mass move up? What is the change in energy?

If you marked off the center of mass (before pulling it up) and then pulled the chain so that the mark was on the table, the new center of mass would not be on the table. There would still be part of the chain hanging down which would have a center of mass below the table.

Forgive me for not being very concise but hopefully it helps.

5. Aug 14, 2014

Yashbhatt

But that's like sum of infinite series. You keep on finding the new center of mass and pulling it up.

6. Aug 14, 2014

Satvik Pandey

We can assume that total mass of chain hanging down the table is located at the CM of the part of chain below the table.You just need to find the work done in lifting that point(CM).

7. Aug 14, 2014

Yashbhatt

But even after the CM is on the table, you have to pull the remaining part.

8. Aug 14, 2014

Nathanael

There's always a complicated way to solve a problem.

But very often, as in this case, there is a simple way.

No energy is lost to friction, so conservation of energy will be useful to find the work done.

9. Aug 15, 2014

Yashbhatt

Okay. But I don't get why do have to assume that pulling only the center of mass is enough?

10. Aug 15, 2014

olivermsun

You don't assume that. What you do is compare the before-and-after potential energies of the system. You had to perform work on the system equal to the gain in potential energy, which is exactly determined by how much you've raised the center of the mass of the system.

11. Aug 15, 2014

ehild

See the picture. If the hanging part has n units (links) and each link has mass m and length ΔL you have to exert F=mg force to balance the weight of the hanging chain and do W(n)=(nm)g ΔL work to lift the chain by one link. The hanging part becomes one link shorter. To lift the next link, you exert (n-1)mg force and do W(n-1) = mg(n-1)ΔL work, and so on.

Initially, the hanging part consisted of N links. So your work to lift all the links of the chain is

W= W(N)+W(N-1).W(N-2)+.... +W(2)+W(1)= mgΔL[N+(N-1)+(M-2)+...2+1].

It is an arithmetic series. Yo know that 1+2+...(N-1)+N= (1+N)N /2≈ N22 if N >>1.

But m=M/N and ΔL = L/N, so the total work is W=(M/N)g(L/N) N2/2 = MGL/2, as if you pulled up a point mass M by length L/2.

ehild

Attached Files:

• pullchain.JPG
File size:
10.2 KB
Views:
74
12. Aug 22, 2014

Yashbhatt

Great explanation. Just a question. You mentioned that the sum is N2 /2 if N >> 1. But what it's only a few links?

13. Aug 22, 2014

olivermsun

If N = 3, then the sum 1 + 2 + ... + N = 1 + 2 + 3.

14. Aug 22, 2014

ehild

You have to pull the last link only from half of its length. So W=mgΔL[N+N-1+N-2+....3+2]+mgΔL/2.

(You can grab the last link at the middle:tongue:)

ehild

15. Aug 22, 2014

Yashbhatt

But then one cannot say that it is equivalent to N2 / 2.

16. Aug 22, 2014

olivermsun

It is approximately true for N » 1 (N "large"), which is what ehild said.

17. Aug 22, 2014

Yashbhatt

And what I say is that what if you have 3 or 4 links hanging there. In that case, it won't be N2 / 2 but N(N + 1)/2. So, we won't get the L/2 thing.

18. Aug 22, 2014

olivermsun

You have a chain of mass M composed of 3 links, each with length ΔL, hence the total length of the chain L = 3ΔL.

Link #1's center of gravity is in the middle of the link, at height -ΔL/2. Therefore it needs to be pulled up by ΔL/2 and its potential energy increases by (M/3)gΔL/2.

Link #2 needs to be pulled up the length of the previous link, ΔL, plus another ΔL/2. Its potential energy increases by (M/3)g * 3ΔL/2.

Link #3 needs to be pulled up 2ΔL for the previous links and another ΔL/2. Its potential energy increases by (M/3)g * 5ΔL/2.

Total ΔPE = (M/3)gΔL/2 + 3(M/3)gΔL/2 + 5(M/3)gΔL/2 = Mg(1 + 3 + 5)/3 *ΔL/2 = Mg * 3ΔL/2 = Mg L/2.

19. Aug 22, 2014

ehild

You are right. In fact, you have to pull up the upmost link only by ΔL/2, while the others move up by ΔL.
So you grab the upmost link. You need to move it up only by ΔL/2 then its CM will be in level of the platform, and you lay it down, and move horizontally till the top of the next link reaches the platform. Your work is 2mgΔL+mgΔL/2. Lifting the next link needs mgΔL+mgΔL/2 work, and at last, your work is mgΔL/2. The total work is mgΔL[(2+1+0)+3˙1/2]=4.5 mgΔL.
In general, it is $W=mgΔL(\frac{N(N-1)}{2}+N\frac{1}{2})=\frac{N^2}{2}$

ehild

20. Sep 1, 2014

Murtuza Tipu

For such type of sum
general formula can be found out
work done =MgL/2n^2

where M is total mass of the whole chain
g is gravitational constant
L is total length of chain
n is the length of hanging chain in terms of L
Suppose L is 100 and length of hanging part is 25 then length of hanging part in terms of L is L/4 hence in this example n =4.
This formula can be derived easily.


## Matrix which is 1 when row and column are both odd or both even

Related searches

I want to create a matrix which which has:

• The value 1 if the row is odd and the column is odd
• The value 1 if the row is even and the column is even
• The value 0 Otherwise.

I want to get the same results as the code below, but in a one line (command window) expression:

 N=8;
A = zeros(N);

for row = 1:1:length(A)
for column = 1:1:length(A)
if(mod(row,2) == 1 && mod(column,2) == 1)

A(row,column*(mod(column,2) == 1)) = 1;

elseif(mod(row,2)== 0 && mod(column,2) == 0 )

A(row,column*(mod(column,2) == 0)) = 1;

end
end
end
disp(A)

This is the expected result:

 1     0     1     0     1     0     1     0
0     1     0     1     0     1     0     1
1     0     1     0     1     0     1     0
0     1     0     1     0     1     0     1
1     0     1     0     1     0     1     0
0     1     0     1     0     1     0     1
1     0     1     0     1     0     1     0
0     1     0     1     0     1     0     1

A simple approach is to use implicit expansion of addition, noting that

odd+odd = even+even = 0

A = 1 - mod( (1:N) + (1:N).', 2 );

You could also do this with toeplitz, as shown in this MATLAB Answers Post

For a square matrix with number of rows = number of columns = N

A = toeplitz(mod(1:N,2));

If the number of rows (M) is not equal to the number of columns (N) then

A = toeplitz(mod(1:M,2),mod(1:N,2))

FWIW, you're asking a specific case of this question:

How to generate a customized checker board matrix as fast as possible?

m\times n\$ matrix with an even number of 1s in each row and column, Hint: If m=1 or n=1, the problem is simple. So suppose they are both >1. Fill in everything with 0's and/or 1's except the bottom row and the� Multiplying a Row by a Column We'll start by showing you how to multiply a 1 × n matrix by an n × 1 matrix. The first is just a single row, and the second is a single column. By the rule above, the product is a 1 × 1 matrix; in other words, a single number. First, let's name the entries in the row r 1 , r 2 ,

Can you take three lines?

N=8;
A = zeros(N);
A(1:2:end, 1:2:end) = 1;
A(2:2:end, 2:2:end) = 1;

One line solution (when N is even):

A = repmat([1, 0; 0 1], [N/2, N/2]);

How to count matrices with rows and columns with an odd number of , For m>0, we have ∑k(−1)k(mk)=(1−1)m=0 and ∑k(mk)=(1+1)m=2m. So ∑k od d(mk)=(2m−0)/2=2m−1. Your identity is (2m−1)n−1=(2n−1)m−1. One way that some people remember that the notation for matrix dimensions is rows by columns (Rather than columns by rows) is by recalling a once popular-soda: RC Cola-- rows before columns! Below, you can see two pictures of the same matrix with the rows and columns highlighted. The dimensions of this matrix. dimensions: 2 × 3; 2 rows × 3

You can try the function meshgrid to generate mesh grids and use mod to determine even or odd

[x,y] = meshgrid(1:N,1:N);
A = mod(x+y+1,2);

such that

>> A
A =

1   0   1   0   1   0   1   0
0   1   0   1   0   1   0   1
1   0   1   0   1   0   1   0
0   1   0   1   0   1   0   1
1   0   1   0   1   0   1   0
0   1   0   1   0   1   0   1
1   0   1   0   1   0   1   0
0   1   0   1   0   1   0   1

How do I extract the odd and even rows of my matrix into two , Learn more about matrix, matrices, reorder, row, column, even, odd, reconstruct, for, loop, rearrange One contains the odd rows and another the even ones. Adding respectively an extra row or column to a table so that the parity of all columns or rows respectively is odd or even is always straightforward. Adding both at once adds one extra cell that is overspecified (at the intersection of extra column and row - at bottom right hand corner if we extend in length and to the right).

This question I found in internet please help me to solve this , Write a function called odd_index that takes a matrix, M, as input argument and Note that both the row and the column of an element must be odd to be included in the (1,2), (2,1), (2,2) because either the row or the column or both are even. size(C,1) returns the number of rows in C, while size(C,2) returns the number of columns. size(C) returens the number of rows and columns, for matrices with higher dimentions it returns the number of vectors in each dimension

Frequencies of even and odd numbers in a matrix, Matrix sum except one item � Centrosymmetric Matrix � Check if Matrix sum is prime or not � Sum of middle row and column in Matrix � Program for� A magic square of order n is an arrangement of n^2 numbers, usually distinct integers, in a square, such that the n numbers in all rows, all columns, and both diagonals sum to the same constant. A magic square contains the integers from 1 to n^2. The constant sum in every row, column and diagonal is called the magic constant or magic sum, M

Given a boolean matrix mat[M][N] of size M X N, modify it such that if a matrix cell mat[i][j] is 1 (or true) then make all the cells of ith row and jth column as 1. Example 1 The matrix 1 0 0 0 should be changed to following 1 1 1 0 Example 2 The matrix 0 0 0 0 0 1 should be changed to following 0 0 1 1 1 1 Example 3 The matrix 1 0 0 1 0 0 1 0

• Your question is a simplification of the one I've marked as a duplicate. Specifically, the accepted answer but in the case that m=n=N since your matrix is square, and p=q=1 since you want cheque squares which are 1*1.


# Finding all the subgroups of a cyclic group

Theorem (1): If $$G$$ is a finite cyclic group of order $$n$$ and $$m \in \mathbb{N}$$, then $$G$$ has a subgroup of order $$m$$ if and only if $$m | n$$. Moreover for each divisor $$m$$ of $$n$$, there is exactly one subgroup of order $$m$$ in $$G$$.

The above theorem states that for any finite cyclic group $$G$$ of order $$n$$, the subgroups of $$G$$ (and also their orders) are in a one-to-one correspondence with the set of divisors of $$n$$. So $$G$$ has exactly $$d(n)$$ subgroups where $$d(n)$$ denotes the number of positive divisors of $$n$$.

Now the following example was given in my class notes and I paraphrase them below.

Example: Consider $$G = (\mathbb{Z}_{12}, +)$$. We list all subgroups of $$G$$. Note that $$G$$ is cyclic because $$G = \langle \bar{1} \rangle$$ and $$|G| = 12$$. Note also that $$12$$ has $$6$$ positive divisors, those being $$\{1, 2, 3, 4, 6, 12\}$$, hence $$G$$ has exactly six subgroups those being $$\langle \bar{1} \rangle; \ \ \langle (\bar{1})^2 \rangle; \ \ \langle (\bar{1})^3 \rangle;\ \ \langle (\bar{1})^4 \rangle;\ \ \langle (\bar{1})^6 \rangle;\ \ \langle (\bar{1})^{12} \rangle\ \$$

Now my question is that how did the authors of these class notes know that the subgroups would be of the form $$\langle (\bar{1})^{d} \rangle$$ where $$d$$ is a positive divisor of $$12$$? It leads me to make the following conjecture

Conjecture: Given a finite cyclic group $$G = \langle x \rangle$$ of order $$n$$, all subgroups of $$G$$ are of the form $$\langle x^d \rangle$$ where $$d$$ is a positive divisor of $$n$$.

• Why the downvote? StackExchange allows you to answer your own questions while posting them Q&A style Sep 25, 2018 at 20:18
• You are correct. StackExchange also allows you to downvote! (I did not downvote) Sep 25, 2018 at 20:19

The conjecture above is true. To prove it we need the following result:

Lemma: Let $$G$$ be a group and $$x \in G$$. If $$o(x) = n$$ and $$\operatorname{gcd}(m, n) = d$$, then $$o(x^m) = \frac{n}{d}$$

Here now is a proof of the conjecture.

Proof: Let $$G = \langle x \rangle$$ be a finite cyclic group of order $$n$$, then we have $$o(x) = n$$.

Choose a subgroup $$H \leq G$$, by theorem $$(1)$$ mentioned in the question above, $$|H| = m$$ where $$m$$ is some divisor of $$n$$. Since $$m | n$$ (and both $$m$$ and $$n$$ are positive integers), there exists a $$d \in \mathbb{N}$$ such that $$md = n \iff \frac{n}{d}=m$$. Note also that $$d$$ is a divisor of $$n$$.

By the above lemma and the fact that $$\operatorname{gcd}(d, n) = d$$ (since $$d$$ is a divisor of $$n$$) it follows that $$o(x^d) = \frac{n}{d} = m$$. Hence the subgroup $$\langle x^d \rangle$$ has order $$m$$. But since by theorem $$(1)$$ there is only one subgroup of order $$m$$ in $$G$$ we must have $$H = \langle x^d \rangle$$. Thus any subgroup of $$G$$ is of the form $$\langle x^d \rangle$$ where $$d$$ is a positive divisor of $$n$$. $$\ \square$$

The above conjecture and its subsequent proof allows us to find all the subgroups of a cyclic group once we know the generator of the cyclic group and the order of the cyclic group.

• Alright, what is your question then?
– Mark
Sep 25, 2018 at 20:15
• @Mark While typing up this question I thought up a proof and I decided to post it Sep 25, 2018 at 20:17
• For any $n\in \mathbb{N}$, there is, up to isomorphism, only one cyclic group of order $n$. So just use $\left(\mathbb{Z}_n,+\right)$ and the statement becomes obvious. Don't really need a formal proof imo Sep 25, 2018 at 20:20
• Ok then. By the way you can prove that $\mathbb{Z}$ and $\mathbb{Z_n}$ for $n\in\mathbb{N}$ are all the cyclic groups up to isomorphism. Then it would be easier to find all the subgroups in my opinion.
– Mark
Sep 25, 2018 at 20:22


Help with Strong Induction

I am stuck on the inductive step of a proof by strong induction, in which I am proving proposition $S(x)$: $$\sum_{i=1}^{2^x} \frac{1}{i} \geq 1 + \frac{x}{2}$$ for $x \geq 0$. I have already finished verifying the base case, $S(0)$, and writing my inductive hypothesis, $S(x)$ for $0 \leq x \leq x + 1$. What I need to prove is $S(x+1)$: $$\sum_{i=1}^{2^{x+1}} \frac{1}{i} \geq 1 + \frac{x+1}{2}$$ but I cannot figure out how to go from point A to point B on this.

What I have so far is the following (use of inductive hypothesis denoted by I.H.): \begin{eqnarray*} \sum_{i=1}^{2^{x+1}} \frac{1}{i} & = & \sum_{i=1}^{2^x} \frac{1}{i} + \sum_{i=2^x+1}^{2^{x+1}} \frac{1}{i} \\ & \stackrel{I.H.}{\geq} & 1 + \frac{x}{2} + \sum_{i=2^x+1}^{2^{x+1}} \frac{1}{i} \\ \end{eqnarray*} But in order to complete the proof with this approach, I need to show that $$\sum_{i=2^x+1}^{2^{x+1}} \frac{1}{i} \geq \frac{1}{2}$$ and I have absolutely no idea how to do that. When I consulted with my professor, he suggested that I should leverage the inequality more than I am, but I frankly can't see how to do that either. I have been staring at this proof for over 6 hours, will someone please give me a hint? Or, more preferably, could you explain a simpler/easier way to go about this proof? Thank you.

• Notice that in your last sum, $i$ is always greater than $2^x$. That can give you an upper bound on all of the $1/i$ terms – JonathanZ Sep 5 '17 at 4:11

Note that $\frac{1}{i}\geq \frac{1}{2^{x+1}}, \forall i\in \{2^x+1,2^x+2,....,2^{x+1}\}$ $$\Rightarrow \sum_{i=2^x+1}^{2^{x+1}} \frac{1}{i} \geq 2^x\cdot \frac{1}{2^{x+1}}=\frac{1}{2}$$


# How many ways are there to place $7$ people to $10$ seats around a circular table so that Alex and Bob in these $7$ people do not sit together?

How many ways are there to place $$7$$ people to $$10$$ seats around a circular table so that two people Alex and Bob in these $$7$$ people do not sit together?

There are two cases for arranging them such that either Alex and Bob together or not. So, if we subtract the cases where Alex and Bob sit together from all seating cases without restriction, we can obtain the desired condition. To do this,

• Firstly find the all seating cases without restriction: Firstly, place one of them to one of $$10$$ seats by only $$1$$ ways because there is no way to distinguish $$10$$ seats around a circular table. After that, we have $$6$$ people to place in $$9$$ seats, but now we can distinguish which seat is which by using the position of the placed person. If so, there are $$P(9,6)$$ ways to do it.

• The cases where Alex and Bob sit together like a block: Let's place them anywhere when they are adjacent, then we have $$8$$ seats to place $$5$$ people, which we can do in $$P(8,5)$$ ways, but Alex and Bob can interchange in their block, so there are $$2!P(8,5)$$ ways.

Then, the answer is $$P(9,6) - 2!P(8,5)=60,480-13,440=47,040$$

Is my solution correct ?

• Yes, your solution is correct. Dec 4, 2021 at 12:21

Yes your work is correct. Another approach -

Alex takes one of the seats. That leaves $$7$$ seats for Bob to choose from (except adjacent seats to Alex). Rest $$5$$ of them can be seated in $$5$$ of the remaining $$8$$ seats.

So the answer is $$\displaystyle 7 \cdot {8 \choose 5} \cdot 5! = 47040$$

I agree with your analysis. I used an alternative approach:

$$S = ~$$total number of ways, without regard to Alex or Bob.

$$T = ~$$total number of ways, Alex and Bob are together.

Since you must have $$3$$ empty seats, I will pretend that these seats are filled by (indistinguishable) ghosts.

$$\displaystyle S = \frac{9!}{3!} = 60480$$.

Above, the numerator, which represents permuting $$(-1) +$$ the number of units, is appropriate for a circular table (as opposed to a straight row). That is, any of the $$(10)$$ units may be regarded as the head of the table.

Above, the denominator represents that the ghosts (i.e. empty chairs) are indistinguishable. So, the denominator represents an overcounting adjustment factor.

$$\displaystyle T = \frac{8! \times 2!}{3!} = 13440.$$

Above, the numerator represents that there are only $$8$$ units, since Alex and Bob are together. However, inside the Alex-Bob unit, Alex and Bob can be permuted in $$(2!)$$ ways.

$$S - T = 47040.$$


Question

# Two blocks, each of mass $$m = 3.50 kg$$, are hung from the ceiling of an elevator as in above figure. (a) If the elevator moves with an upward acceleration $$\vec{a}$$ of magnitude $$1.60 m/s^{2}$$, find the tensions $$T_{1}$$ and $$T_{2}$$ in the upper and lower strings. (b) If the strings can withstand a maximum tension of $$85.0 N$$, what maximum acceleration can the elevator have before a string breaks.

Solution

## (a) Free-body diagrams of the two blocks are shown below. Note that each block experiences adownward gravitational force$$F_{g} = (3.50 kg)(9.80 m/s^{2} ) = 34.3 N$$Also, each has the same upward acceleration as the elevator, in this case$$a_{y} = +1.60 m/s^{2}$$.Applying Newton’s second law to the lower block:$$\sum F_{y} = ma_{y} \Rightarrow T_{2} − F_{g} = ma_{y}$$or$$T_{2} = F_{g} + ma_{y} = 34.3 N + (3.50 kg)(1.60 m/s^{2} ) = 39.9 N$$Next, applying Newton’s second law to the upper block:$$\sum F_{y} = ma_{y} \Rightarrow T_{1} −T_{2} − F_{g} = ma_{y}$$or$$T_{1} = T_{2} + F_{g} + ma_{y} = 39.9 N + 34.3 N + (3.50 kg)(1.60 m/s^{2} )$$$$= 79.8N$$(b) Note that the tension is greater in the upper string, and this string will break first as the acceleration of the system increases. Thus, we wish to find the value of $$a_{y}$$ when $$T_{1} = 85.0$$. Making use of the general relationships derived in (a) above gives:$$T_{1} = T_{2} + F_{g} + ma_{y} = (F_{g} + ma_{y})+ F_{g} + ma_{y} = 2F_{g} + 2ma_{y}$$or$$a_{y}=\frac{T_{1}-2F_{g}}{2m}=\frac{85.0N-2(34.3N)}{2(3.50kg)}=2.34m/s^{2}$$.Physics

Suggest Corrections

0

Similar questions
View More

People also searched for
View More


# Not every metric is induced from a norm

I have studied that every normed space $(V, \lVert\cdot \lVert)$ is a metric space with respect to distance function

$d(u,v) = \lVert u - v \rVert$, $u,v \in V$.

My question is whether every metric on a linear space can be induced by norm? I know answer is no but I need proper justification.

Edit: Is there any method to check whether a given metric space is induced by norm ?

Thanks for help

• $\LaTeX$ tip: \parallel is a relation symbol, so it includes space on both sides. You want \lVert and \rVert for left and right delimiters, so that there is space on the "outside", but not on the "inside". Jul 4 '12 at 2:33
• @ArturoMagidin Thank you very much sir. Jul 4 '12 at 2:35
• Jul 4 '12 at 5:07
• @MattN. Thank you very much. That was helpful to me. Jul 4 '12 at 5:14

Let $V$ be a vector space over the field $\mathbb{F}$. A norm $$\| \cdot \|: V \longrightarrow \mathbb{F}$$ on $V$ satisfies the homogeneity condition $$\|ax\| = |a| \cdot \|x\|$$ for all $a \in \mathbb{F}$ and $x \in V$. So the metric $$d: V \times V \longrightarrow \mathbb{F},$$ $$d(x,y) = \|x - y\|$$ defined by the norm is such that $$d(ax,ay) = \|ax - ay\| = |a| \cdot \|x - y\| = |a| d(x,y)$$ for all $a \in \mathbb{F}$ and $x,y \in V$. This property is not satisfied by general metrics. For example, let $\delta$ be the discrete metric $$\delta(x,y) = \begin{cases} 1, & x \neq y, \\ 0, & x = y. \end{cases}$$ Then $\delta$ clearly does not satisfy the homogeneity property of the a metric induced by a norm.

To answer your edit, call a metric $$d: V \times V \longrightarrow \mathbb{F}$$ homogeneous if $$d(ax, ay) = |a| d(x,y)$$ for all $a \in \mathbb{F}$ and $x,y \in V$, and translation invariant if $$d(x + z, y + z) = d(x,y)$$ for all $x, y, z \in V$. Then a homogeneous, translation invariant metric $d$ can be used to define a norm $\| \cdot \|$ by $$\|x\| = d(x,0)$$ for all $x \in V$.

• Thank you very much. I understand now. Jul 4 '12 at 2:42
• That is not enough as one needs to check that the so defined norm really induces the original metric and not another one: $d(\cdot,\cdot)\to\|\cdot\|\to d(\cdot,\cdot)$ Sep 29 '14 at 14:36
• This is an old post and it doesn't really matter much, but I have to be pedantic. So you say that if a metric comes from a norm on $\Bbb{R}$, then $d(ax,ay)=|a|d(x,y)$ but what if you just consider $\Bbb{R}$ as a vector space over $\{0,1\}$. Then the discrete metric IS homogeneous and translation invariant on this vector space.
– user223391
Jun 16 '15 at 0:16
• @MichaelMunta If the metric is induced by a norm, then $d(x,y)=||x-y||$. So $d(x+z,y+z)=||(x+z)-(y+z)||=||x-y||=d(x,y)$. Feb 27 '20 at 15:30
• You should clarify that your field $F$ is normed, otherwise the notation $|a|$ is meaningless. Jun 5 '20 at 23:24

Here is another interesting example: Let $|x-y|$ denote the usual Euclidean distance between two real numbers $x$ and $y$. Let $d(x,y)=\min\{|x-y|,1\}$, the standard derived bounded metric. Now suppose we look at $\Bbb{R}$ as a vector space over itself and ask whether $d$ comes from any norm on $\Bbb{R}$. Then if there is such a norm say $||.||$, we must have the homogeneity condition: for any $\alpha \in \Bbb{R}$ and any $v \in \Bbb{R}$,

$$||\alpha v || = |\alpha| ||v||.$$

But now we have a problem: The metric $d$ is obviously bounded by $1$, but we can take $\alpha$ arbitrarily large so that $||.||$ is unbounded. It follows that $d$ does not come from any norm.

• It was nice explanation to me. I had forgot to thank you. :) May 25 '13 at 9:21

As Henry states above, metrics induced by a norm must be homogeneous. You can see that they must also be translation invariant: $d(x+a,y+a)= d(x,y).$ So any metric not satisfying either of those can not come from a norm.

On the other hand, it turns out that these two conditions on the metric are sufficient to define a norm that induces that metric: $d(x,0)=\| x \|.$

• Thank you sir. I am fully satisfied with two answers given by you and Henry.:) Jul 4 '12 at 2:44
• Did you mean instead that any metric not satisfying either of those can not come from a norm? And not the other way around? And also, these two conditions on the metric are sufficient to define a norm..? Jul 4 '12 at 6:27
• @ThomasE. Sorry, you are right, I muddled up the words. Thanks. Jul 4 '12 at 8:43

Every homogeneous metric induces a norm via: $$\|x\|:=d(x,0)$$ and every norm induces a homogeneous and translation-invariant metric: $$d(x,y):=\|x-y\|$$

The clue herein lies in wether the induced norm really represents the metric as: $$d(\cdot,\cdot)\to\|\cdot\|\to d(\cdot,\cdot)$$ which is the case only for the translation-invariant metrics: $$d'(x,y)=d(x-y,0)=d(x,y)$$ whereas the induced metric always represents the norm as: $$\|\cdot\|\to d(\cdot,\cdot)\to\|\cdot\|$$ as a simple check shows: $$\|x\|'=\|x-0\|=\|x\|$$

• @ Thanks for the answer. Feb 15 '16 at 4:15

Personal Note:

Good question, I remember wondering the same thing myself back when I new to real analysis. Here's a counter example:

Counter Example

$$d(x,y):=I_{\{(x,x)\}}(x,y):=\begin{cases} 1 &:\, \,x=y\\ 0 &:\, \,x\neq y. \end{cases}$$ This is indeed a metric (check as an exercise).

Where $I_A$ is the indicator function of the set $A$; where here the set $(x,x)\in V\times V$.

If $r\in \mathbb{R}-\{0\}$, then $d(rx,ry)\in \{0,1\}$ hence $rd(x,y)\in \{0,r\}$ which is not in the range of $d:V\times V \rightarrow \mathbb{R}$.

So, the metric $d$ fails the property that any metric induced by a norm must have, ie: $$\mbox{it fails to have the property that: } \|rx-ry\| =r\|x-y\|.$$

Interpretation & Some Intuition:

The problem is that the topology is too fine, so all this topology can do is distinguish between things being the same or different.
As opposed to a norm topology which distinguised between object being, or not being on the same line (for some appropriate notion of line) (as well as them being different).

Hope this helps :)

• Thank you for the explanation. :) Feb 15 '16 at 4:15
• Hi, is it correct to consider the metric d(x,y)=|x-y|^2018 that fails to h;ave the above property? Oct 23 '18 at 8:19
• Yes, why not? :) Oct 23 '18 at 15:33

One possible way of showing that a metric does not arise from a norm is to show that it is bounded, as it then cannot be homogeneous.

Proof: Take $$d$$ a bounded metric on a space $$X$$: i.e. $$\exists D \in \mathbb{R}_+$$ such that $$\forall (x,y) \in X^2, d(x,y) \leq D$$. Suppose now for contradiction that $$d$$ arises from a norm, i.e. the exists a norm $$\|\cdot\|$$ such that $$d(x,y) = \|x - y\|$$. Recall that the distance must then must be homogeneous, for we have $$d(\lambda x, \lambda y) = \|\lambda x - \lambda y\| = |\lambda| \cdot \|x - y\| = |\lambda| d(x,y)$$.

Take now arbitrary $$(x_0, y_0) \in X^2$$, then we must have that $$d\left( \frac{D+1}{d(x_0, y_0)} \cdot x_0, \frac{D+1}{d(x_0, y_0)} \cdot y_0 \right) = \frac{D+1}{d(x_0, y_0)} \cdot d(x_0, y_0) = D + 1 > D$$ which contradicts the upper bound of the metric.