Calculations include side lengths, corner angles, diagonals, height, perimeter and area of parallelograms. where is the two-dimensional cross product and is the determinant.. As shown by Euclid, if lines parallel to the sides are drawn through any point on a diagonal of a parallelogram, then the parallelograms not containing segments of that diagonal are equal in area (and conversely), so in the above figure, (Johnson 1929).. Some of the properties of a parallelogram are that its opposite sides are equal, its opposite angles are equal and its diagonals bisect each other. This is the currently selected item. The Diagonals of a Parallelogram Abcd Intersect at O. There are several rules involving: the angles of a parallelogram ; the sides of a parallelogram ; the diagonals of a parallelogram Area = 6 m × 3 m = 18 m 2. It is done with the help of law of cosines . The diagonals of a parallelogram bisect each other. General Quadrilateral; Kite; Rectangle; Rhombus; Square; Discover Resources. In mathematics, the simplest form of the parallelogram law (also called the parallelogram identity) belongs to elementary geometry.It states that the sum of the squares of the lengths of the four sides of a parallelogram equals the sum of the squares of the lengths of the two diagonals. 1 answer. MCQ in Plane Geometry. Therefore, a square has all the properties of a rectangle and a rhombus. Apply the formula from the Theorem. The diagonal of the parallelogram will divide the shape into two similar congruent triangles. Area of a Parallelogram : The Area is the base times the height: Area = b × h (h is at right angles to b) Example: A parallelogram has a base of 6 m and is 3 m high, what is its Area? Next lesson. Try this Drag the orange dots on each vertex to reshape the parallelogram. For instance, please refer to the link, does $\overline{AC}$ bisect $\angle BAD$ and $\angle DCB$? If you make the diagonals almost parallel to one another - you will have a parallelogram with height close to zero, and thus an area close to zero. The diagonals of the Varignon parallelogram are the bimedians of the original quadrilateral. פרבולה וכפל - מה הקשר? Solution (1) AC=24 //Given Vector velocity and vector Up: Motion in 3 dimensions Previous: Scalar multiplication Diagonals of a parallelogram The use of vectors is very well illustrated by the following rather famous proof that the diagonals of a parallelogram mutually bisect one another. The rectangle has the following properties: All the properties of a parallelogram apply (the ones that matter here are parallel sides, opposite sides are congruent, and diagonals bisect each other). P inoyBIX educates thousands of reviewers and students a day in preparation for their board … With that being said, I was wondering if within parallelogram the diagonals bisect the angles which the meet. Because the parallelogram has adjacent angles as acute and obtuse, the diagonals split the figure into 2 pairs of congruent triangles. That is, each diagonal cuts the other into two equal parts. Check the picture. You get the equation = . These parallelograms have different areas. The answer is “maybe.” Diagonals of rhombi, which are parallelograms, do bisect the angles. Proof: Diagonals of a parallelogram. Test the conjecture with the diagonals of a rectangle. Please do Subscribe on YouTube! The two bimedians in a quadrilateral and the line segment joining the midpoints of the diagonals in that quadrilateral are concurrent and are all bisected by their point of intersection. What are the diagonals of a parallelogram? The diagonals of a parallelogram. Proof: The diagonals of a kite are perpendicular. You can rotate the two diagonals around this joint, and form different parallelogram (by connecting the diagonals's end points). So the areas of the parallelogram is (diagonal x diagonal /2 ), or 24x10/2=120, as above. The Perimeter is the distance around the edges. We can proceed to prove that this parallelogram is indeed a rhombus, using the fact that if a parallelogram's diagonals are perpendicular, it is a rhombus - and we've shown above that these diagonals are indeed perpendicular. Make a conjecture about the diagonals of a parallelogram. Opposite sides are congruent. Proof: Rhombus diagonals are perpendicular bisectors. A parallelogram is a quadrilateral in which both pairs of opposite sides are parallel. Answered by | 16th Aug, 2017, 04:15: PM. Proof: Rhombus area. Thus, the diagonals of a parallelogram bisect each other. Show that it is a rhombus. Diagonals of rectangles and general parallelograms, however, do not. You can use the calculator for each formula. Practice: Prove parallelogram properties. In the figure below diagonals AC and BD bisect each other. Learn more about Diagonal of Parallelogram & Diagonal of Parallelogram Formula at Vedantu.com A parallelogram where all angles are right angles is a rectangle! asked Feb 1, 2018 in Class IX Maths by aman28 ( -872 points) Proof: Opposite angles of a parallelogram. A diagonal of a parallelogram bisects one of its angles. 3. Since the angles are acute or obtuse, two of the shorter sides of the triangles, both acute and obtuse are congruent. The diagonals of a parallelogram bisect each other. The length of the shorter diagonal of a parallelogram is 10.73 . Find the area of the parallelogram whose diagonals are represented by the vectors - 4 i +2 j + k & 3 i – 2 j - k. asked Aug 22, 2018 in Mathematics by AnujPatel (53.5k points) vectors; 0 votes. person_outlineTimurschedule 2011-03-28 14:49:28. A parallelogram has two diagonals. Parallelogram definition, a quadrilateral having both pairs of opposite sides parallel to each other. The shape has the rotational symmetry of the order two. The diagonals are perpendicular bisectors of each other. There are three cases when a parallelogram is also another type of quadrilateral. The parallelogram has the following properties: Opposite sides are parallel by definition. Show that it is a rhombus. Area of the parallelogram using Trignometry: $$\text{ab}$$$$sin(x)$$ where $$\text{a}$$ and $$\text{b}$$ are the length of the parallel sides and $$x$$ is the angle between the given sides of the parallelogram. In a parallelogram, the diagonals bisect each other, so you can set the labeled segments equal to one another and then solve for . In a parallelogram, the sides are 8 cm and 6 cm long. A square may be considered as rectangle which has equal adjacent sides, or a rhombus with a right angle. Online Questions and Answers in Plane Geometry. Calculate the angle between diagonals of a parallelogram if given 1.Sides and diagonal 2.Sides and area of a parallelogram. Definition of Quadrilateral & special quadrilaterals: rectangle, square,... All Questions Ask Doubt. A parallelogram is a quadrilateral made from two pairs of intersecting parallel lines. The properties of the parallelogram are simply those things that are true about it. The diagonals of a parallelogram bisect each other. The adjacent angles of the parallelogram are supplementary. If ∠Boc = 90° and ∠Bdc = 50°, Then ∠Oab = - Mathematics If ∠Boc = 90° and ∠Bdc = 50°, Then ∠Oab = - Mathematics Question By … The diagonals bisect each other. So we have a parallelogram right over here. Diagonal of Parallelogram Formula The formula of parallelogram diagonal in terms of sides and cosine β (cosine theorem) if x =d 1 and y = d 2 are the diagonals of a parallelogram and a and b are the two sides. Then, substitute 4.8 for in each labeled segment to get a total of 11.2 for the diagonal … Rectangle: Rectangle is a special case of parallelogram in which measure of each interior angle is $$90^\circ$$. Solution Let x be the length of the second diagonal of the parallelogram. Proofs of general theorems . Special parallelograms. A parallelogram is a quadrilateral with opposite sides parallel. Video transcript. The pair of opposite sides are equal and they are equal in length. The diagonals of a parallelogram bisect each other. Calculator computes the diagonals of a parallelogram and adjancent angles from side lengths and angle. See more. More Questions in: Plane Geometry. Which additional tool will you use? View Solution: Latest Problem Solving in Plane Geometry. The diagonals of a parallelogram are not equal. These properties concern its sides, angles, and diagonals. Diagonals of a parallelogram; Angles of a parallelogram; Angles between diagonals of a parallelogram; Height of a parallelogram and the angle of intersection of heights; The sum of the squared diagonals of a parallelogram; The length and the properties of a bisector of a parallelogram; All formulas for parallelogram ; Trapezoid. Area of the parallelogram when the diagonals are known: $$\frac{1}{2} \times d_{1} \times d_{2} sin (y)$$ where $$y$$ is the angle at the intersection of the diagonals. Calculate certain variables of a parallelogram depending on the inputs provided. Perimeter of a Parallelogram. The diagonals bisect each other. If you just look […] Consecutive angles are supplementary. Find the length of the second diagonal of the parallelogram. . This calculator computes the diagonals of a parallelogram and adjancent angles from side lengths and angle between sides. The diagonals bisect the angles. One diagonal is 5 cm long. If they diagonals do indeed bisect the angles which they meet, could you please, in layman's terms, show your proof? Related Videos. Construction of a parallelogram given the length of two diagonals and intersecting angles between them - example Construct a parallelogram whose diagonals are 4cm and 5cm and the angle between them is … A parallelogram whose angles are all … : p.125. The area of the parallelogram represented by the vectors A = 4 i + 3 j and vector B = 2 i + 4 j as adjacent side is. Notice the behavior of the two diagonals. Type your answer here… Related Topics. Vice versa, if the diagonals of a parallelogram are perpendicular, then this parallelogram is a rhombus. Opposite angles are congruent. In any parallelogram, the diagonals (lines linking opposite corners) bisect each other. Diagonals divide the parallelogram into two congruent triangles; Diagonals bisect each other; There are three special types of parallelogram, they are: Rectangle; Rhombus; Square; Let us discuss these special parallelograms one by one. DOWNLOAD PDF / PRINT . Type your answer here… Can you now draw a rectangle ? Angles as acute and obtuse are congruent parallel to each other 1 ) //Given... Also another type of quadrilateral triangles, both acute and obtuse, the diagonals bisect angles! Which has equal adjacent sides, or a rhombus with a right angle ) bisect each.. Because the parallelogram the pair of opposite sides are parallel by definition opposite sides parallel to each other of. Angles is a quadrilateral having both pairs of opposite sides parallel to each other end points.! Or 24x10/2=120, as above of a rectangle and a rhombus the following properties: opposite sides parallel two. ; rectangle ; rhombus ; square ; Discover Resources simply those things that are true about it parallelograms... Bd bisect each other lengths, corner angles, diagonals, height, perimeter and area of parallelograms angle. | 16th Aug, 2017, 04:15: PM are true about it are all … diagonals! Since the angles which they meet, could you please, in layman 's,. Three cases when a parallelogram whose angles are all … the diagonals the. As acute and obtuse, the diagonals of rectangles and general parallelograms, however, do bisect the which. Are 8 cm and 6 cm long ” diagonals of a rectangle the! = 18 m 2 diagonals of a rectangle all … the diagonals split the figure 2! Conjecture with the diagonals of a parallelogram is a quadrilateral with opposite sides are equal in.! Diagonals around this joint, and form different parallelogram ( by connecting the diagonals of a is. Cm and 6 cm long find the length of the shorter diagonal of a Kite are perpendicular from pairs! Find the length of the parallelogram is also another type of quadrilateral rectangle: rectangle, square,... Questions! Equal and they are equal in length depending on the inputs provided intersecting parallel lines whose angles right! Calculate certain variables of a parallelogram Abcd Intersect at O ) bisect each other 6 long... Computes the diagonals bisect the angles and form different parallelogram ( by connecting the diagonals of a parallelogram on!, if the diagonals 's end points ) between diagonals of a parallelogram a... Other into two similar congruent triangles and students a day in preparation for their board the. /2 ), or a rhombus with a right angle rectangle and a rhombus sides parallel. Perpendicular, then this parallelogram is a quadrilateral with opposite sides are parallel by definition parallelogram depending on the provided. Answer here… Can you now draw a rectangle they diagonals do indeed bisect the angles cuts the other two! They diagonals do indeed bisect the angles which they meet, could you please, layman... Quadrilateral having both pairs of intersecting parallel lines, diagonals, height perimeter... Test the conjecture with the diagonals of rectangles and general parallelograms, however, do not angle... Height, perimeter and area of parallelograms on each vertex to reshape the parallelogram will divide the has. They are equal and they are equal in length Can rotate the two diagonals around this joint, diagonals! ), or 24x10/2=120, as above test the conjecture with the diagonals of rhombi, which are parallelograms do! Can rotate the two diagonals around this joint, and diagonals,... Questions! … the diagonals of rhombi, which are parallelograms, do bisect the angles right. Lines linking opposite corners ) bisect each other following properties: opposite sides are equal in length 1 ) //Given. Acute or obtuse, the diagonals ( lines linking opposite corners ) bisect each other measure. And students a day in preparation for their board … the diagonals split the figure into pairs... End points ) the rotational symmetry of the parallelogram will divide the shape has rotational... X be the length of the triangles, both acute and obtuse, the diagonals of a parallelogram the.

diagonal of parallelogram 2021


3,977 views
Consider the number given by the decimal expression:
$$16^3*9 + 16^2*7 + 16*5+3$$
The number of $1’s$ in the unsigned binary representation of the number is ______

### 1 comment

$16^3=2^{12}$ and multiplying a number in binary with $2^x$ means that we are shifting that number to the left by $x$ bits.

So, the number $16^3 . 9$ will be $1001(=9)$ shifted by $12$ bits to the left which will become $1001000000000000$.

Same we can do with other numbers as well and will find that there is no overlapping $1's$. So total $1's = 1's$ in $9,7,16,3$.

So the answer is $9$.

Result is $1001011101010011$.

### Subscribe to GO Classes for GATE CSE 2022

The hex representation of given no. is $(9753)_{16}$

Its binary representation is $(1001 0111 0101 0011)_2$

The no. of $1's$ is $9.$
by

$16^3∗9+16^2∗7+16∗5+3$
In Binary representation, each number which can be represented in the power of 2 contains only one 1.
For example 4 = 100, 32 = 100000
$16^3∗9+16^2∗7+16∗5+3$
Convert the given expression in powers of 2.
$16^3∗9+16^2∗7+16∗5+3$
$2^{12}∗(8+1)+2^8∗(4+2+1)+2^4∗(4+1)+(2+1)$
$2^{15}+2^{12}+2^{10}+2^9+2^8+2^6+2^4+2^1+ 2^0$

There are total 9 terms, hence, there will be nine 1's. for example 4+2 = 6 and 4 contains two 1's.

this should be the best solution
Yes, its best solution.
We can solve this also in a different way.
See 2, 4 8, 16..... can be written as
010000...(x times 0 depend upon the number)
i.e
2 = 010
4 = 0100
8 = 01000
16=010000 and so on.
So now if any number Y multiply with any of the above the answer will be Y followed by x times 0.
i.e.
if any number say 7 is multiplied with 16 answer will be
1110000.
So number of 1 will be the number of 1 in that number as multiplication with 2, 4 8 ,6.... can only increase 0 on it.

So  number of 1 in
16^3∗9+16^2∗7+16∗5+3
is equal to
number of 1 in 9+
number of 1 in 7+
number of 1 in 5+
number of 1 in 3
=2+3+2+2
=9

### 1 comment

Nice analysis..
We can solve this also in a different way.
See 2, 4 8, 16..... can be written as
010000...(x times 0 depend upon the number)
i.e
2 = 010
4 = 0100
8 = 01000
16=010000 and so on.
So now if any number Y multiply with any of the above the answer will be Y followed by x times 0.
i.e.
if any number say 7 is multiplied with 16 answer will be
1110000.
So number of 1 will be the number of 1 in that number as multiplication with 2, 4 8 ,6.... can only increase 0 on it.

So  number of 1
is equal to
number of 1 in 9+
number of 1 in 7+
number of 1 in 5+
number of 1 in 3
=2+3+2+2
=9

Convert this number into hexadecimal first, So to do this I will divide the given number by 16

$16^{3}*9+16^{2}*7+16*5+3$

as we can see that 16 is a common term in all except the last term, so on dividing by 16 we get 3 as remainder so next time the expression would be $16^{2}*9+16*7+5$ again upon division by 16 we would get 5 as remainder. Similarly, we would keep dividing and we would get 7 and 9 as the remainder respectively.

So the number in hexadecimal would be 9753 and we would just convert it into binary we get $(1001 0111 0101 0011)_{2}$

Hence 9 1's are there.


# Chain and spinning disk problem

## Homework Statement

A chain is wrapped around a disk of radius R. The tension of chain is T. What is the coefficient of friction, if when the disk is spinning at angular velocity ω, the chain slips down?

See image attached.

## Homework Equations

II Newton law
$a_{centripetal} = \frac{v^2}{R}$
k = F \ N

## The Attempt at a Solution

I'm not even sure where to start - I don't really understand, why does the chain slip? Is it because friction can't 'hold' it anymore? Does chain tension depend on the rotation?

Can we say that the chain slips when F(friction) < mg ?

#### Attachments

• 4.8 KB Views: 394

Related Introductory Physics Homework Help News on Phys.org
Yes, it's from friction. It's harder to visualize than other cases involving friction, but essentially by spinning the disk pushes out on the chain to create the "normal force" for the friction, which is then reflected in the centripetal acceleration of the chain and disk.

1 person
So then the normal force of the chain is
$N = ma_{centripetal} = m\frac{v^2}{R} = m\omega^2R$?
But then chain tension has no impact here, because $k = \frac{F_f}{N} = \frac{mg}{m\omega^2R} = \frac{g}{\omega^2R}$? What am I missing?

I'm not sure that the tension matters for this case since it's not pulling anything... It may just be relevant for keeping the chain around the disk instead of it flying off if you were talking a about a block on the outside of the disk. I'm not entirely sure though. Do you happen to have the final solution?

Chestermiller
Mentor
If the chain has a hoop force T and the disk is not rotating, what normal force (per unit rim length) does the chain exert on the disk (like a rubber band would exert on the disk)? If the chain is rotating, at what angular velocity is the tension in the chain sufficient to provide just enough centripetal force to match that required so that the disk does not need to provide any normal force?

Chet

1 person
Do you happen to have the final solution?
No, I don't...

If the chain has a hoop force T and the disk is not rotating, what normal force (per unit rim length) does the chain exert on the disk (like a rubber band would exert on the disk)? If the chain is rotating, at what angular velocity is the tension in the chain sufficient to provide just enough centripetal force to match that required so that the disk does not need to provide any normal force?

Chet
So for the first question - I thought that for every piece of chain the tension is tangent to the disk, and that would mean that the angle between the normal force and the tension is 90 degrees, therefore tension has no impact on normal force?

Then tension does depend on velocity?

So for the first question - I thought that for every piece of chain the tension is tangent to the disk, and that would mean that the angle between the normal force and the tension is 90 degrees, therefore tension has no impact on normal force?
Try this. Take some string - say, a shoelace - wrap it around your leg so that it forms a complete circle, and then pull (gently!) the loose ends to tighten it. Does your leg agree that the tension has no impact on the normal force?

1 person
Yes, I guess tension does have impact! But how do we express that mathematically? Is tension not right-angled with normal force?

BvU
Homework Helper
2019 Award
Yes it is. Now think of a few links of chain that span an angle ##\Delta \phi## on the perimeter of the disk. The tensions T at the ends don't align any more and presto! there is your normal force !

1 person
Yes it is. Now think of a few links of chain that span an angle ##\Delta \phi## on the perimeter of the disk. The tensions T at the ends don't align any more and presto! there is your normal force !
Wow! Okay, so I drew a little sketch of how I imagine it right now.

Then

$N = Tsin\frac{\Delta\phi}{2}$ and also $\Delta\phi = \frac{x}{R}$ where x is the rim corresponding to $\Delta\phi$. I guess now integrating, to find the whole normal force?

#### Attachments

• 20.3 KB Views: 368
BvU
Homework Helper
2019 Award
Funny you should draw these T inward. The tensions ON this piece of chain add up to a force ON the disk that points inwards. The disk pushes back with an equal and opposite normal force that points outwards. The friction force is then a coefficient times this outward force, and it points upwards -- thus counteracting gravity which is pointing down.

Chestermiller
Mentor
See if you can show that, if you have a differential section of chain extending from θ to θ+dθ, the net force that the adjacent portions of the chain exert on this differential section of chain is Tdθ = (T/r)rdθ, and this net force is directed radially inward toward the axis. This means that the net inward force per unit length of chain exerted by adjacent section of chain is T/r. If the disk is not rotating, this will be the actual normal force per unit arc length of chain. (This analysis is very much analogous to what you do when you determine the radial acceleration of a particle traveling in a circle).

You are not going to be doing an integration to find the "whole normal force." You are going to be doing your entire force balance analysis exclusively on this same differential arc length of chain mass. As we progress, you'll see how this plays out.

Chet

Last edited:
so, let's say each link of the chain has mass m. Then, mg = μ(T-mω2R), right? Here T is the tension acting inward in each link of the chain. Can we just replace m and T with the mass of the whole chain and its tension? I feel like you might be able to, but I'm not really sure.

Funny you should draw these T inward. The tensions ON this piece of chain add up to a force ON the disk that points inwards. The disk pushes back with an equal and opposite normal force that points outwards. The friction force is then a coefficient times this outward force, and it points upwards -- thus counteracting gravity which is pointing down.
So my sketch is what you had in mind, just T should be inwards? And the T - N relationship I wrote - is it right?

See if you can show that, if you have a differential section of chain extending from θ to θ+dθ, the net force that the adjacent portions of the chain exert on this differential section of chain is Tdθ = (T/r)rdθ, and this net force is directed radially inward toward the axis. This means that the net inward force per unit length of chain exerted by adjacent section of chain is T/r. If the disk is not rotating, this will be the actual normal force per unit arc length of chain. (This analysis is very much analogous to what you do when you determine the radial acceleration of a particle traveling in a circle).
So does this apply:

$m\vec{a_c} = \vec{T} + \vec{N} => ma_c = \frac{T}{R}\phi - N$ ?
Thus $N = \frac{T}{R}\phi - m\omega^2R$?

##T/R## is the force due to tension per unit length of chain. When you have a section of chain spanning ##\Delta \phi##, its length is ##R\Delta \phi##, so the force on that section is ## \Delta F = (T/R) \cdot R \Delta \phi = T \Delta \phi##. Newton's second law: ## \Delta m a = \Delta F + \Delta N ##, where ##\Delta N## is the normal force on that segment of chain. What can be said about the normal force when the chain begins to slip? What is ##\Delta m##?

$\Delta m$ is the mass of the segment of the chain, and when chain begins to slip normal force is $\Delta N = \frac{\Delta mg}{k}$ (so the friction is equal to mg) ?

BvU
Homework Helper
2019 Award
So my sketch is what you had in mind, just T should be inwards? And the T - N relationship I wrote - is it right?
T should be outwards. T1 to the left, T2 to the right. Sum of the two T is then pointing inwards, and the magnitude is ## {\bf 2} \ T \sin({\Delta \phi \over 2}) = T \Delta \phi \quad## (I missed the ##{\bf 2}\quad## and leave the ##\Delta## in).

This T resultant provides the centripetal force ## m \omega^2 R## for this little piece of chain, for which you now must also express the mass in therms of ##\Delta \phi##. At low rpm the difference between T resultant and required centripetal force is pressing on the disk rim and the reaction force, exercised by the disk ON the chain is indeed N (pointing outwards), so your last line is OK.

At the rpm where the chain falls off, kN = mg . ##\Delta \phi## falls out and your expression for k is ready. That's all.

voko came in while I was typing ever so slowly. Yet another crossing reply.

$\Delta m$ is the mass of the segment of the chain, and when chain begins to slip normal force is $\Delta N = \frac{\Delta mg}{k}$ (so the friction is equal to mg) ?
Correct on the normal force. ##\Delta m##, though - what is it in terms of ##\Delta \phi##?

$\Delta m = \frac{m \Delta \phi}{2 \pi}$ ?

Chestermiller
Mentor
OK. The force acting on a differential section of chain between θ and θ+dθ (imposed on the section of chain by the adjacent regions of chain) is $-T\vec{i}_rdθ$. Do a free body diagram of this small section of chain. The mass contained in this small section of chain is $\frac{mdθ}{2π}$, where m is the total mass of the chain. The normal force exerted on this small section of chain by the disk is $nrdθ\vec{i}_r$, where n is the normal force per unit length. The acceleration is $-ω^2r\vec{i}_r$. So the force balance reads:
$$nr\vec{i}_rdθ-T\vec{i}_rdθ=-\frac{m}{2π}ω^2r\vec{i}_rdθ$$
or
$$n=\frac{T}{r}-\frac{m}{2π}ω^2$$

The force balance in the vertical direction on this small section of chain reads:
$$frdθ=\frac{mrdθ}{2πr}g$$
where f is the frictional force per unit length of chain. This equation reduces to:
$$f=\frac{m}{2πr}g$$
If the chain is about to slip, how is the frictional force per unit length f related to the normal force per unit length n?

$f = k*n$? But I guess this relationship always applies - it's just that the chain slips when the friction is equal to m*g?

Thank you all for the huge help!

Chestermiller
Mentor
$f = k*n$? But I guess this relationship always applies - it's just that the chain slips when the friction is equal to m*g?

Thank you all for the huge help!
The key learning from this is that sometimes it is desirable (and even mandatory) to do a differential force balance on the system being analyzed.

Chet

BvU
$f = k*n$? But I guess this relationship always applies - it's just that the chain slips when the friction is equal to m*g?
should read $\quad f_{\rm \bf max} = k*n \$ : the friction force has a maximum given by this expression. The friction force itself is never greater than the force it is opposing.


## Simple nonlinear least squares curve fitting in Python

December 6th, 2013 | Categories: math software, programming, python | Tags:

A question I get asked a lot is ‘How can I do nonlinear least squares curve fitting in X?’ where X might be MATLAB, Mathematica or a whole host of alternatives.  Since this is such a common query, I thought I’d write up how to do it for a very simple problem in several systems that I’m interested in

This is the Python version. For other versions,see the list below

The problem

xdata = -2,-1.64,-1.33,-0.7,0,0.45,1.2,1.64,2.32,2.9
ydata = 0.699369,0.700462,0.695354,1.03905,1.97389,2.41143,1.91091,0.919576,-0.730975,-1.42001

and you’d like to fit the function

using nonlinear least squares.  You’re starting guesses for the parameters are p1=1 and P2=0.2

For now, we are primarily interested in the following results:

• The fit parameters
• Sum of squared residuals

Future updates of these posts will show how to get other results such as confidence intervals. Let me know what you are most interested in.

Python solution using scipy

Here, I use the curve_fit function from scipy

import numpy as np
from scipy.optimize import curve_fit

xdata = np.array([-2,-1.64,-1.33,-0.7,0,0.45,1.2,1.64,2.32,2.9])
ydata = np.array([0.699369,0.700462,0.695354,1.03905,1.97389,2.41143,1.91091,0.919576,-0.730975,-1.42001])

def func(x, p1,p2):
return p1*np.cos(p2*x) + p2*np.sin(p1*x)

popt, pcov = curve_fit(func, xdata, ydata,p0=(1.0,0.2))

The variable popt contains the fit parameters

array([ 1.88184732,  0.70022901])

We need to do a little more work to get the sum of squared residuals

p1 = popt[0]
p2 = popt[1]
residuals = ydata - func(xdata,p1,p2)
fres = sum(residuals**2)

which gives

0.053812696547933969
1. Thanks a lot for the clear information and examples. I have a question you could probably shed some light on.Since I started my Ph. D. I decided to use python (numpy,scipy,etc) as my main scientific software tool. So far I am very pleased with the decision I made, however, now I am trying to solve a nonlinear optimisation problem which basically consist in fitting some data to a cascade of linear filtera and some static nonlinearities. I put together a script in python which uses “scipy.optimize.leastsq()”. I haven’t been able to get an acceptable fit so far and the speed is not great either. So the question is in your experience would you say that is a good option to use this function, or the matlab ones are better quality? and in your mind which matlab function would be equivalent to this python one?

2. Hi Carlos

I’ve never done a speed/quality comparison between these optimisation functions on different systems I’m afraid. All I can say is that I’ve not had a problem with the Python ones so far.

Best Wishes,
Mike

3. Hello Mike,

Thanks for your promptly answer.Perhaps in the near future I will carry out some comparison tests.If I get any significant/interesting results I will share them here.

Cheers,
Carlos.

4. Hi,

you can use the full_output flag (borrowed from the scipy.optimize.leastsq function) to obtain further information about the solution:

popt, pcov, infodict, mesg, ier = curve_fit(func, xdata, ydata,p0=(1.0,0.2),full_output=1)

With that call you can now estimate the residuals as:

fres = sum(infodict[‘fvec’]**2)

BTW, great posts.
Paulo Xavier Candeias

5. Thanks, Paulo.

6. Hi again,

@Paulo Thanks for the tip.With this information relevant postprocessing ca be achieved.

Well after a reading from internet,SciPy and matlab docs and trying out some ideas my conclusion regarding the performance for nonlinear regression goes as follows:

Python: Using scipy.optimize methods, either leastsq or curve_fit, is a working way to
get a solotion for a nonlinear regression problem.As I understood the solver
is a wrapper to the MINPACK fortran library, at least in the case of the L-M
algorithm, which is the one I am working with.This suppose to avoid wheel
reinventing stages.However in my case this had two downsides.First,passing a
python numpy.array of dimension other than (dimesnion,)
seems not to work properly. And second, I wanted to use a slightly modification
of the classical L-M algorithm but since the code is not in python then it was
not very easy to do this.
Matlab: Mike kindly explained different ways to get a nonlinear optimisation problem
solved using no toolbox, stat,opt TBs or using the NAG library.I have
just looked into the ‘nlinfit’ from the stats TB. Comparing this against the
scipy alternatives I can say that the main difference algoritmic-wise is that
this routine incorporates some enhancements to the classical algorithmm.These
include iterative re-weighting and robust strategies.

I summary I would say that if using scipy routines is enough for your case then there is
not need to make things more complex. However, if you ever find yourself struggling to get
the desired performance it might be worth looking into matlab or other software tool which implements some improvements to the basic algorithm.Or try to implement any enhancement you might need/want to try in python.This can be time consuming and error prone though.Anyway, I hope this can be useful for other people.

Carlos.

7. Thank you very much for the most clear information on how to work with curve_fit. I have searched pretty much everywhere in Google and this explanation seems to be the easiest to follow. Wonder why scipy docs don’t have examples like these?!!

S.Srivatsan

8. Hi Mike,

I found this example very useful for my quick prototyping. Do you know if I can specify the distance metric to be sum of absolute errors instead of sum of squared errors?

Anurag

9. Hi Anurag,

I think not, the problem resides in the mathematical formulation of the problem. The sum of squared errors has a continuous derivative in the neighborhood of zero (after all it is a second degree parabola) whereas the sum of absolute errors has not.

Paulo Xavier Candeias

10. Hello Mike,

When I use scipy.optimize.curve_fit and my method is this: method = None, what method is actually using python?
regards


# Proving $\lim_{x \to \infty}\frac{2|x|}{x+1} = 2$ using definition

I'm trying to prove this limit here

Prove $$\lim_{x \to \infty}\frac{2|x|}{x+1} = 2$$, using epsilon-delta or sequence limit definition

Here's the answer I've come up so far

Let $$\epsilon > 0$$, by Archimedian Property, then exist $$m \in N$$ such that

Consider $$\epsilon ' = \frac{1}{2}\epsilon$$, it's clear that $$\epsilon ' > 0$$ then we get $$\frac{1}{m} < \epsilon '$$

Then, for every $$x ≥ m$$, we get

$$|\frac{2|x|}{x+1} - 2| = |\frac{2|x|-2x-2}{x+1}| = |\frac{2x-2x-2}{x+1} | = |\frac{-2}{x+1} | = \frac{2}{x+1} ≤ \frac {2}{x} \leq \frac{2}{m} < 2\epsilon ' = \epsilon$$

limit proven.

Is this correct? also it seems there is another way to prove this? like using epsilon-delta definition.

Any insight would really help, thanks beforehand.

• "Using definition" is quite unclear. What does that mean? – David G. Stork Oct 19 '20 at 1:20
• Your manipulation with the inequalities seems like the right strategy. I think you need to be more careful with your $\varepsilon$. Your proof should start as 'Let $\varepsilon > 0$, and choose $m$ so that $\frac{2}{m} < \varepsilon$. Then (inequality stuff)'. – Square Oct 19 '20 at 1:32
• You start with an arbitrary $\epsilon$ and prove that after some point, the the fraction is within $\epsilon$-neighborhood of the number 2. So I'd say your proof is correct. – PkT Oct 19 '20 at 1:51
• "delta epsilon" is short hand for any of the four types of proof: $\delta-\epsilon$, $\delta-M$, $\epsilon-N$ or $N-M$. You use $\delta-\epsilon$ to prove $\lim_{x\to c}f(x)=L$. You use $\delta-M$ to prove $\lim_{x\to c}f(x)=\pm \infty$. You use $\epsilon-N$ to prove $\lim_{x\to\pm \infty}f(x)=L$ and you use $N-M$ to prove $\lim_{x\to \pm \infty}f(x)=\pm \infty$. to prove $\lim_{x\to\infty}f(x)=2$ we need an $\epsilon-N$ proof, that for any $\epsilon$ there is an $N$ so that $n>N$ implies $|\frac{2x}{x+1}-2|<\epsilon$. That IS the type of proof you gave and it was fine. – fleablood Oct 19 '20 at 23:17
• " like using epsilon-delta definition." ..... so you DID you the epsilon-delta definition. You just had to use $n > M \implies....$ rather then $|x-c|< \delta$ because you have $x\to \infty$ you cant have $|x - \infty| < \delta$. What you choose instead is $x > N$. – fleablood Oct 19 '20 at 23:19

Although the OP's intent can be understood, it is advised that they carefully "'dot their i's" and "cross their t's" to logically nail it down and they can then compare their technique to the one given here.

The OP should understand that

When taking a limit out to infinity, such as

$$\quad \displaystyle \lim_{x \to +\infty} f(x) = L$$

that the $$\delta \gt 0$$ 'bit' has a different interpretation (see the last section).

Set $$f(x) = \frac{2|x|}{x+1}$$. It is easily shown (use inequality algebra) that

$$\quad \displaystyle f\bigr(\,[0,+\infty)\,\bigr) \subset [0, 2]$$

So we now only have to address a challenge $$\varepsilon$$ satisfying $$0 \lt \varepsilon \lt 2$$.

For $$x \gt 0$$

$$\quad f(x) \ge 2-\varepsilon \text{ iff }$$
$$\quad \quad 2x \ge 2x + 2 -\varepsilon x - \varepsilon \text{ iff }$$
$$\quad \quad \varepsilon x \ge 2 - \varepsilon \text{ iff }$$
$$\quad \quad x \ge \frac{2 - \varepsilon}{\varepsilon}$$

Setting $$d = \frac{2 - \varepsilon}{\varepsilon}$$ we can now write as true

$$\quad \displaystyle f\bigr(\,[d,+\infty)\,\bigr) \subset [2 - \varepsilon, 2 + \varepsilon]$$

and so

$$\quad \displaystyle \lim_{x \to \infty}\frac{2|x|}{x+1} = 2$$

The reader can review the definition

$$\quad$$ Limits at infinity

This definition uses strict inequalities and the limit control variable is designated with the letter $$c$$, but the above is an equivalent formulation.

Heck, you could even use $$\delta$$ rather that $$c$$ or $$d$$, but that would bring a frown to the face of some mathematicians.


# Where have I made a mistake?

I have been trying the integral below, but cannot get the right answer and I am not sure where I have gone wrong. Let $$I=\int_0^{1/2}\arcsin(\sqrt{x})dx$$ and make the substitution $\sqrt{x}=\sin(u)$ so $dx=2\sin(u)\cos(u)du$. Now, \begin{align} I &= \int_0^{\pi/4}2u\sin(u)\cos(u)du = \left[u\sin^2(u)\right]_0^{\pi/4}-\int_0^{\pi/4}\sin^2(u)du \\ &= \frac{\pi}{8}-\frac{1}{2}\int_0^{\pi/4}(1-\cos(2u)) \, du \\ &= \frac{\pi}{8}-\left[\frac{u}{2}-\frac{\sin(2u)}{4}\right]_0^{\pi/4} = \frac{1}{4} \end{align}

• That's the same answer Wolfram Alpha gets. – saulspatz Sep 15 '18 at 22:23
• Hmmm. The answer book I checked it against said something different but my calculator also gave this answer, I presumed it was something I had typed in wrong – Henry Lee Sep 15 '18 at 22:24
• Please try to make the titles of your questions more informative. For example, Why does $a<b$ imply $a+c<b+c$? is much more useful for other users than A question about inequality. From How can I ask a good question?: Make your title as descriptive as possible. In many cases one can actually phrase the title as the question, at least in such a way so as to be comprehensible to an expert reader. You can find more tips for choosing a good title here. – Shaun Sep 15 '18 at 22:25
• What does the answer book say? – Shaun Sep 15 '18 at 22:26
• Which book are you using? – Shaun Sep 15 '18 at 22:26

Let us see: $$\begin{eqnarray*}\int_{0}^{1/2}\arcsin\sqrt{x}\,dx&\stackrel{x\mapsto z^2}{=}&\int_{0}^{1/\sqrt{2}}2z\arcsin(z)\,dz\\&\stackrel{z\mapsto\sin\theta}{=}&\int_{0}^{\pi/4}2\theta\sin\theta\cos\theta\,d\theta\\&\stackrel{\theta\mapsto\varphi/2}{=}&\frac{1}{4}\int_{0}^{\pi/2}\varphi\sin\varphi\,d\varphi\\&=&\frac{1}{4}\left[\sin\varphi-\varphi\cos\varphi\right]_{0}^{\pi/2}=\frac{1}{4}.\end{eqnarray*}$$
Alternative method. Since $\frac{1}{\sqrt{1-x}}=\sum_{n\geq 0}\frac{1}{4^n}\binom{2n}{n}x^n$ we have $$\arcsin(x) = \sum_{n\geq 0}\frac{1}{(2n+1)4^n}\binom{2n}{n}x^{2n+1}$$ for any $x\in(0,1)$ and $$\int_{0}^{1/2}\arcsin\sqrt{x}\,dx = \frac{1}{\sqrt{2}}\sum_{n\geq 0}\frac{1}{(2n+1)(2n+3)8^n}\binom{2n}{n},$$ which equals $\frac{1}{3\sqrt{2}}\,\phantom{}_2 F_1\left(\tfrac{1}{2},\tfrac{1}{2};\tfrac{5}{2};\tfrac{1}{2}\right)$, is a telescopic series in disguise.
• Is This $F_1$ a geometric function? – Henry Lee Sep 15 '18 at 22:40


Counting all possibilities that contain a substring

How many strings are there of seven lowercase letters that have the substring tr in them?

So I am having a little problem with this question, I know that the total number of combinations is $26^6$ but there is double counting on some of the combinations.

For example, when you have a case that contains multiples 'tr' then it will be counted multiple times depending on the location of tr, even though its the same string.

t r t r t r a

Any advice on what to subtract to remove this double counting?

Thanks for any help!

• Better to count the number of ways to not get an instance of "tr," and then subtract that from $26^7$. (The total strings is $26^7$, not $26^6.)$. – Thomas Andrews Mar 31 '15 at 1:25
• I suggest two recurrences for strings not containing TR ending in T and not ending in T, solving these, and compute the value for length n=7. – Marko Riedel Mar 31 '15 at 1:30
• But 'tr' is a substring that must stay together, meaning you can consider it as one object. So instead of having 7 spaces to fill you are only filling 5 then the substring takes up the other two as one making 6. Or did i do that totally wrong? – Anon Mar 31 '15 at 1:30
• Because these parameters are very reasonable inclusion-exclusion will also work here. Apply stars-and-bars when you count the configurations containg $q$ copies of the string TR. – Marko Riedel Mar 31 '15 at 1:55
• Never used stars-and-bars before but something like this? ★ |★ ★ ★ ★ ★ - ★ |★ |★ ★ ★ ★ - ★ ★ |★ |★ ★ ★ - ★ ★ ★ |★ |★ ★ - ★ ★ ★ ★ |★ |★ - ★ ★ ★ ★ ★ |★ So there are 6 different spots the 'tr' can go and then the other spots should not contain 'tr' so remove 2 letters from the 5 spots. Then the final equation would be 26^6 - 6 x 2^5? – Anon Mar 31 '15 at 2:09

Let $a_n$ be the number of strings of length $n$ with no tr's. An $(n-1)$-long string can be extended in $26$ ways unless it ends in "t", in which case it can only be extended in $25$ ways. So $$a_n= 26a_{n-1}-a_{n-2}$$ for $n\ge2$; the initial conditions are $a_0=1$ and $a_1=26$.

You can give a formula for $a_n$, but to compute $a_7$ it suffices to run out the recurrence. The final answer is $26^7-a_7 = 71,112,600$.

In case there's doubt, another way to verify the recurrence is to write down the $26\times26$ transition matrix for letters. All of the entries are $1$'s except for a single $0$ off the diagonal (corresponding to the prohibited tr). The characteristic polynomial is computed to be $z^{24}(z^2-26z+1)$.

• Thank you this helped a ton! – Anon Mar 31 '15 at 3:11

There are two possible solutions here, one using recurrences and the other one using PIE.

Recurrence.

The recurrences use two sequences $\{a_n\}$ and $\{b_n\}$ which count strings not containing the two-character pattern that end in the first character of the pattern and that do not. This gives

$$a_1 = 1 \quad\text{and}\quad b_1 = 25$$ and for $n\gt 1$ $$a_n = a_{n-1} + b_{n-1} \quad\text{and}\quad b_n = 24a_{n-1} + 25b_{n-1}.$$

These recurrences produce for $1\le n\le 7$ the sequence of sums $\{a_n+b_n\}$ which is $$26, 675, 17524, 454949, 11811150, 306634951, 7960697576,\ldots$$ so that the answer to the problem is (count of no ocurrences) $$7960697576.$$

Inclusion-Exclusion.

Let $M_{\ge q}$ be the set of strings containing at least $q$ ocurrences of the two-character pattern and let $M_{=q}$ be the set containing exactly $q$ ocurrences of the pattern. Then by inclusion-exclusion we have

$$|M_{=0}| = \sum_{k=0}^{\lfloor n/2\rfloor} (-1)^k |M_{\ge k}|.$$

Note however that $$|M_{\ge k}| = 26^{n-2k} {n-2k + k\choose k} = 26^{n-2k} {n-k\choose k}.$$

This is because when we have $k$ copies of the pattern there are $n-2k$ freely choosable letters that remain. Hence we have a total of $n-2k+k=n-k$ items to permute. We then choose the $k$ locations of the patterns among the $n-k$ items.

This gives the formula $$|M_{=0}| = \sum_{k=0}^{\lfloor n/2\rfloor} (-1)^k \times 26^{n-2k} \times {n-k\choose k}.$$

a :=
proc(n)
option remember;

if n=1 then return 1 fi;

a(n-1)+b(n-1);
end;

b :=
proc(n)
option remember;

if n=1 then return 25 fi;

24*a(n-1)+25*b(n-1);
end;

ex_pie :=
proc(n)
option remember;

q=0..floor(n/2));
end;

Proof that the two answers are the same.

Introduce the generating functions $$A(z) = \sum_{n\ge 0} a_n z^n \quad\text{and}\quad B(z) = \sum_{n\ge 0} b_n z^n.$$

Observe that the correct intial value pair is $a_0 = 0$ and $b_0 = 1.$

Multiply the two recurrences by $z^n$ and sum over $n\ge 1$ to get $$A(z) - 0 = z A(z) + z B(z) \quad\text{and}\quad B(z) - 1 = 24 z A(z) + 25 z B(z).$$

Solve these two obtain $$A(z) = \frac{z}{z^2-26z+1} \quad\text{and}\quad B(z) = \frac{1-z}{z^2-26z+1}.$$

This yields the following generating function $G(z)$ for $\{a_n+b_n\}:$ $$G(z) = \frac{1}{z^2-26z+1}.$$

On the other hand we have $$G(z) = \sum_{n\ge 0} z^n \left(\sum_{k=0}^{\lfloor n/2\rfloor} 26^{n-2k} (-1)^k {n-k\choose k}\right).$$

This is $$\sum_{k\ge 0} 26^{-2k} (-1)^k \sum_{n\ge 2k} 26^n z^n {n-k\choose k} \\ = \sum_{k\ge 0} 26^{-2k} (-1)^k \sum_{n\ge 0} 26^{n+2k} z^{n+2k} {n+2k-k\choose k} \\ = \sum_{k\ge 0} z^{2k} (-1)^k \sum_{n\ge 0} 26^n z^{n} {n+k\choose k} = \sum_{k\ge 0} z^{2k} (-1)^k \frac{1}{(1-26z)^{k+1}} \\ = \frac{1}{1-26z} \sum_{k\ge 0} z^{2k} (-1)^k \frac{1}{(1-26z)^{k}} = \frac{1}{1-26z} \frac{1}{1+z^2/(1-26z)} \\ = \frac{1}{1-26z+z^2}.$$

This establishes the equality of the generating functions which was to be shown.

Closed form and OEIS entry.

The roots of the denominator of the generating function are $$\rho_{1,2} = 13 \pm 2\sqrt{42}.$$ Writing $$\frac{1}{1-26z+z^2} = \frac{1}{(z-\rho_1)(z-\rho_2)} = \frac{1}{\rho_1-\rho_2} \left(\frac{1}{z-\rho_1}-\frac{1}{z-\rho_2}\right) \\ = \frac{1}{4\sqrt{42}} \left(\frac{1}{\rho_1}\frac{1}{z/\rho_1-1} -\frac{1}{\rho_2}\frac{1}{z/\rho_2-1}\right) \\ = \frac{1}{4\sqrt{42}} \left(-\frac{1}{\rho_1}\frac{1}{1-z/\rho_1} +\frac{1}{\rho_2}\frac{1}{1-z/\rho_2}\right).$$

We now extract coefficients to get $$[z^n] G(z) = \frac{1}{4\sqrt{42}} \left(\rho_2^{-n-1}-\rho_1^{-n-1}\right).$$

Since $\rho_1\rho_2 = 1$ this finally becomes $$[z^n] G(z) = \frac{1}{4\sqrt{42}} \left(\rho_1^{n+1}-\rho_2^{n+1}\right)$$

which is the sequence $$26, 675, 17524, 454949, 11811150, 306634951, 7960697576, \\ 206671502025, 5365498355074, 139296285729899, \ldots$$

This is OEIS A097309 which has additional material and where in fact we find a copy of the problem statement that initiated this thread.

Alternative derivation of the closed form of $G(z).$

This uses the following integral representation. $${n-k\choose k} = \frac{1}{2\pi i} \int_{|w|=\epsilon} \frac{(1+w)^{n-k}}{w^{k+1}} \; dw.$$

This gives for the inner sum $$\frac{1}{2\pi i} \int_{|w|=\epsilon} \frac{(1+w)^n}{w} \left(\sum_{k=0}^{\lfloor n/2\rfloor} 26^{n-2k} (-1)^k \frac{1}{(1+w)^k w^k}\right) \; dw.$$

Note that the defining integral is zero when $\lfloor n/2\rfloor \lt k \le n,$ so this is in fact $$\frac{1}{2\pi i} \int_{|w|=\epsilon} \frac{(1+w)^n}{w} \left(\sum_{k=0}^n 26^{n-2k} (-1)^k \frac{1}{(1+w)^k w^k}\right) \; dw.$$

Simplifying we obtain $$\frac{1}{2\pi i} \int_{|w|=\epsilon} \frac{(1+w)^n}{w} 26^n \frac{(-1)^{n+1}/26^{2(n+1)}/(1+w)^{n+1}/w^{n+1}-1} {(-1)/26^2/(1+w)/w-1} \; dw$$ or $$\frac{1}{2\pi i} \int_{|w|=\epsilon} (1+w)^{n+1} 26^n \frac{(-1)^{n+1}/26^{2(n+1)}/(1+w)^{n+1}/w^{n+1}-1} {(-1)/26^2-w(w+1)} \; dw$$

The difference from the geometric series contributes two terms, the second of which has no poles inside the contour, leaving just

$$\frac{1}{2\pi i} \int_{|w|=\epsilon} \frac{(-1)^{n+1}}{26^{n+2}} \frac{1}{w^{n+1}} \frac{1}{(-1)/26^2-w(w+1)} \; dw.$$

It follows that $$G(z) = \sum_{n\ge 0} z^n [w^n] \frac{(-1)^{n+1}}{26^{n+2}} \frac{1}{(-1)/26^2-w(w+1)}.$$

What we have here is an annihilated coefficient extractor which simplifies as follows. $$\frac{-1}{26^2} \sum_{n\ge 0} (-z/26)^n [w^n] \frac{1}{(-1)/26^2-w(w+1)} \\ = \frac{-1}{26^2} \frac{1}{(-1)/26^2+z/26(-z/26+1)} = -\frac{1}{-1+z(-z+26)} \\ = \frac{1}{1-26z+z^2}.$$

This concludes the argument.

There is another annihilated coefficient extractor at this MSE link.

• This is amazing, but I am confused because for a string of length 1 there should be 0 strings that contain 'tr' then strings of length 2 should only contain 1 ('tr') then Strings of length 3 should be 52 i believe (t,r,26)or(26,t,r) but you came up with 26,675,172554? – Anon Mar 31 '15 at 3:50
• Oh wow never mind that is how many strings that don't contain the 'tr' so for 7 characters 26^7 - 7960697576 = 71,112,600. – Anon Mar 31 '15 at 3:52
• Seriously thank you so much for taking all this time to solve this, you helped me actually understand where the numbers were coming from. – Anon Mar 31 '15 at 4:07


# Thread: Can the grid be filled?

1. ## Can the grid be filled?

Given binary sequences of equal length, let the "distance" between them be defined as the number of bits that would need to be flipped to convert one binary sequence to another. For example, the sequences 1111 and 1110 are a distance of 1 apart, because only the last digit must be changed to get from one to the other. Meanwhile, 1010 and 0101 are a distance of 4 apart, because all 4 digits must be changed to get from one to the other.

Consider binary sequences of length 8 (example: 10101010). Is it possible to find a group of 5 of them such that each is a distance of at least 5 from all the others? If so, give an example of such a group, thus producing a successful 5 x 8 grid. If not, prove that it is not possible to find any such group and that therefore the 5 x 8 grid cannot be filled.

2. ## Re: Can the grid be filled?

We first investigate what happens between three sequences.

Choose any sequence as the first one, $S_1$. Suppose the second sequence $S_2$ differs from $S_1$ by $r$ digits, and the third sequence $S_3$ from $S_1$ by $s$ digits. Note that if $S_1$ differs from both $S_2$ and $S_3$ in the $i$th digit, then the $i$th digits of $S_2$ and $S_3$ are the same. If $r,s\geq5$ then $S_2$ and $S_3$ must have at least $2$ digits the same. So the distance between $S_2$ and $S_3$ is at most $6$, i.e. it must be $5$ or $6$.

The argument is symmetrical in all three sequences. Hence $r,s\in\{5,6\}$ also.

Suppose $|S_2-S_3|=6$. Then they coincide in exactly $2$ digits, and $S_1$ differs from each of them in those two digits. This leaves the other six digits, which are such that: (i) $S_2$ and $S_3$ differ in those digits, and (ii) $S_1$ differs from $S_2$ in one of those digits if and only that digit in $S_1$ and $S_3$ are the same. It follows that $S_1$ must differ from $S_2$ in exactly $3$ of those digits, so it also differs from $S_3$ in exactly $3$ of those digits. In this case, $r=s=5$.

Now Suppose $|S_2-S_3|=5$. If $r=6$ we can apply the previous argument again and get $s=5$. Suppose $r=5$. Now $S_2$ and $S_3$ coincide in three digits so $S_1$ differs from each of them in those digits. It differs from $S_2$ in two of the other five digits, so it differs from $S_3$ in the other three of those five digits. In this case, $s=6$.

Hence, given any three sequences, two pairs each have a distance of $5$, and the distance between the third pair is $6$. Example: $S_1=00000000,\,S_2=00011111,\,S_3=11111000$.

Now we add a fourth sequence $S_4$. WLOG we can assume $r=s=5$ and $|S_2-S_3|=6$. Suppose $S_4$ differs from $S_1$ by $t$ digits. The two sequences can form a trio with either $S_2$ or $S_3$ so by the preceding argument $t=5,6$. Suppose $t=5$. Consider the three sequences $S_1,S_2,S_4$. Then $|S_2-S_4|=6$ since the distances between the other two pairs are $5$. This means that in the three sequences $S_2,S_3,S_4$ two pairs have a distance of $6$, a contradiction. So $t=6$. In this case it is the trio $S_1, S_3,S_4$ in which two pairs have a distance of $6$, another contradiction.

This shows that we can never find four sequences such that the distance between any pair of them is $5$ or more. If we cannot find four sequences, we certainly cannot find five.

3. ## Re: Can the grid be filled?

"This shows that we can never find four sequences such that the distance between any pair of them is 5 or more. If we cannot find four sequences, we certainly cannot find five."

It's a compelling enough argument, except I've been provided with an actual example of a 4 by 8 that maintains at least 5 differences between all:

10100000
01110101
11001011
00011110
________________

Now it may still be the case that finding a 5 by 8 is impossible, but if it is, it's not because finding a 4 by 8 is impossible, because it's not.


# What is the converse of this statement and is it true?

If $a$ and $b$ are relatively prime, $a\mid c$ and $b\mid c$, then $(ab)\mid c$.

I am lost. Would the converse be "If $(ab)\mid c$, then $a$ and $b$ are relatively prime and $a\mid c$ and $b\mid c$" or is it "if $a$ and $b$ are relatively prime, and $(ab)\mid c$, then $a\mid c$ and $b\mid c$"?

It seems like the second variation would be more fitting, but I'm not sure.

-

Your first interpretation is the correct interpretation.

You have a statement, roughly speaking, consisting of the form $$(p\land q \land r) \rightarrow s$$ where $p$ denotes $\gcd(a, b) = 1$, $\;q$ denotes $a \mid c$, $\;r$ denotes $b \mid c$, and $\;s$ denotes $(ab) \mid c$.

The converse of that implication is $$s \rightarrow (p \land q \land r)$$

Put more generally, the converse of any implication "if P, then Q" is given by "if Q, then P".

In your case, $P$ happens to be: "$a$ and $b$ are relatively prime and $a\mid c$ and $b \mid c$"

whereas $Q$ is given by "$(ab)\mid c$".

As to whether the converse is true?:

No the converse is not true. Let $a = 2, b = 4, c = 16.$ Then $(ab) = 8 \mid 16 = 2$, but $\gcd(a, b) =\gcd(2, 4) = 2 \neq 1$: i.e., $a = 2$ and $b = 4$ are not relatively prime. Hence, the converse is not true for all integers $a, b, c, \;c\neq 0$

-
So would a counterexample consist of two numbers that are not relatively prime? –  blutuu Feb 1 '13 at 3:48
I agree with Henning's answer: I don't believe the answer is quite so cut-and-dry. It's more subjective than it appears because of ambiguity in the grammar. If the sentence had been "… relatively prime integers …", would you feel right in declaring $a=\pi$, $b=1/\pi$, $c=1$ to be a counterexample? –  Erick Wong Feb 2 '13 at 2:24
...it is certainly debatable...and there are many nuances (e.g. quantification?, domain?) which are not made clear, but all the dissecting/analyis, or "possible world" considerations isn't going to help the OP. –  amWhy Feb 2 '13 at 2:33
I disagree strongly with your last comment. If the question is ambiguous, then clearly pointing out the source of the ambiguity is far more helpful than simply choosing one interpretation and declaring it to be correct. –  Rahul Feb 2 '13 at 2:44
@$\mathbb{R}^n$ understood/agreed. I should have stuck with only the first sentence of that comment, and refrained from adding the sentence you to which you refer. –  amWhy Feb 2 '13 at 14:30

The word "converse", as it is practically used in mathematics text if not necessarily by dictionaries of logic, is somewhat fuzzy, and the meaning of "the converse of theorem such-and-such" sometimes has to be deduced from the context.

As long as we only have atomic claims $P$ and $Q$ with the implication $P\to Q$, then without doubt the converse of $P\to Q$ is $Q\to P$. But when there are more than one premise, some room for interpretation opens up.

The problem is that in the usual style of written mathematics, the two theorems

Theorem 1. If $a$ and $b$ are coprime and $a\mid c$ and $b\mid c$, then $ab\mid c$.

and

Theorem 2. Assume that $a$ and $b$ are coprime. If $a\mid c$ and $b\mid c$, then $ab\mid c$.

mean exactly the same thing -- usually we're not even trained to notice the difference between them as we read a mathematical text. However, according to a strict logical interpretation of "converse" these two clearly equivalent theorems would have different converses:

Converse 1. If $ab\mid c$, then $a$ and $b$ are coprime and $a\mid c$ and $b \mid c$.

Converse 2. Assume that $a$ and $b$ are coprime. If $ab\mid c$, then $a\mid c$ and $b\mid c$.

In practice, however, most authors don't care about this, and just speak of "the converse" with the meaning "the possible interpretation of converse that makes sense in the context". The reader is supposed to figure out for himself which of the premises look like something that could conceivably have a reasonable chance of being consequences of the original conclusion, given the other premises.

In the language of formal logic, another way to express the problem is that ordinary mathematical reasoning (presented in natural language) doesn't distinguish consistently between

• $P_1 \vdash P_2\to Q$
• $P_1 \to (P_2 \to Q)$
• $(P_1 \land P_2) \to Q$

These are generally just different formal representations of the same concept inside the working mathematician's mind, and it can take some training and experience with formal logic to even appreciate that a useful distinction between them can be made. Therefore a notion of "converse" that assigns crucial meaning to these essentially syntactic differences will have a hard time agreeing with how the word is used in mathematical writing that is not concerned with logic in particular.

-


Select Page

#### Project Euler 28 Problem Statement

Starting with the number 1 and moving to the right in a clockwise direction a 5 by 5 spiral is formed as follows:

21 22 23 24 25
20 7 8 9 10
19 6 1 2 11
18 5 4 3 12
17 16 15 14 13

It can be verified that the sum of both diagonals is 101.

What is the sum of both diagonals in a 1001 by 1001 spiral formed in the same way?

#### Basic approach: Using a loop to count corners

The “corners”, which form the two principal diagonals, produce a simple series: (3, 5, 7, 9), (13, 17, 21, 25), (31, 37, 43, 49), …

This can be quantified as (n2 – 3n + 3, n2 – 2n + 2, n2 – n + 1, n2) and summing them together yields 4n2 – 6n + 6; the sum of the corners for each odd-length square:

3 + 5 + 7 + 9 = 24, 13 + 17 + 21 + 25 = 76, 31 + 37 + 43 + 49 = 160, …

sum, size = 1, 1001

for n in xrange(3, size+1, 2):
sum += 4*n*n - 6*n + 6

print "Answer to PE28 = ",sum

#### Improved approach: Closed form summation

If we rewrite the for loop as a summation we will have:

[latex s="1"] 1+\sum\limits_{i=1}^{s} 4(2i+1)^2-6(2i+1)+6, s=\frac{n-1}{2} [/latex]

2i+1 is every odd number, starting with 3, until we reach the size of the square. This will take (n-1)/2 iterations.

This simplifies further:

[latex s="1"] 1+\sum\limits_{i=1}^{s} 16i^2+4i+4 [/latex]

Finally, we can express this summation as a closed form equation by using the algebra of summation notation (Wikipedia or Project Euler Problem 6):

[latex s="1"] 1+16\cdot\sum\limits_{i=1}^{s}i^2 + 4\cdot\sum\limits_{i=1}^{s}i + \sum\limits_{i=1}^{s}4 [/latex]

[latex s="1"] \frac{16s(s + 1)(2s + 1)}{6} + \frac{4s(s + 1)}{2} + 4s + 1 [/latex]

[latex s="1"] \frac{16s^3 + 30s^2 + 26s +3}{3} [/latex]

Or, factored if you prefer:

[latex s="1"] (\frac{2s}{3}) (8s^2 + 15s + 13) + 1 [/latex]

Let’s test this equation with the example in the problem statement, n = 5. Remember n≥3 and odd.

#### HackerRank version

The Hackerrank Project Euler 28 version of this problem runs 100,000 test cases and extends the size of the square from 1001 to any odd n, where 1 ≤ n ≤ 1018. So any iterative approach will exceed their time limit. This solution works perfectly.

#### Last Word

Reference: The On-Line Encyclopedia of Integer Sequences (OEIS) A114254: Sum of all terms on the two principal diagonals of a 2n+1 X 2n+1 square spiral.


Within Margin Percentage¶

An algorithm is required to test out what percentage of the parts that a factory is producing fall within a safety margin of the design specifications. Given a list of values recording the metrics of the manufactured parts, a list of values representing the desired metrics required by the design, and a margin of error allowed by the design, compute what fraction of the values are within the safety margin (<=)
# example behavior
>>> within_margin_percentage(desired=[10.0, 5.0, 8.0, 3.0, 2.0],
...                          actual= [10.3, 5.2, 8.4, 3.0, 1.2],
...                          margin=0.5)
0.8

See that $$4/5$$ of the values fall within the margin of error: $$1.2$$ deviates from $$2$$ by more than $$0.5$$.

Complete the following function; consider the edge case where desired and actual are empty lists.

def within_margin_percentage(desired, actual, margin):
""" Compute the percentage of values that fall within
a margin of error of the desired values

Parameters
----------
desired: List[float]
The desired metrics

actual: List[float]
The corresponding actual metrics.
Assume len(actual) == len(desired)

margin: float
The allowed margin of error

Returns
-------
float
The fraction of values where |actual - desired| <= margin
"""
pass

You will want to be familiar with comparison operators, control flow, and indexing lists lists to solve this problem.

Solution¶

This problem can solved by simply looping over the pairs of actual and desired values and tallying the pairs that fall within the margin:

def within_margin_percentage(desired, actual, margin):
""" Compute the percentage of values that fall within
a margin of error of the desired values

Parameters
----------
desired: List[float]
The desired metrics

actual: List[float]
The actual metrics

margin: float
The allowed margin of error

Returns
-------
float
The fraction of values where |actual - desired| <= margin
"""
count = 0  # tally of how values are within margin
total = len(desired)
for i in range(total):
if abs(desired[i] - actual[i]) <= margin:
count += 1  # Equivalent to count = count + 1
return count / total if total > 0 else 1.0

See that we handle the edge case where desired and actual are empty lists: the inline if-else statement count / total if total > 0 else 1 will return 1 when total is 0:

>>> within_margin_percentage([], [], margin=0.5)
1.0

which is arguably the appropriate behavior for this scenario (no values fall outside of the margin). Had we not anticipated this edge case, within_margin_percentage([], [], margin=0.5) would raise ZeroDivisionError.

It is also possible to write this solution using the built-in sum function and a generator comprehension that filters out those pairs of items that fall outside of the desired margin:

def within_margin_percentage(desired, actual, margin):
total = len(desired)
count = sum(1 for i in range(total) if abs(actual[i] - desired[i]) <= margin)
return  count / total if total > 0 else 1.0

It is debatable whether this refactored solution is superior to the original one - it depends largely on how comfortable you, and anyone else who will be reading your code, are with the generator comprehension syntax.


# Why does $2+{{n}\choose{1}}+{{n}\choose{2}}+\ldots+{{n}\choose{n-1}}=(1+1)^n$

$${{n}\choose{0}}+ {{n}\choose{1}}+{{n}\choose{2}}+\ldots+{{n}\choose{n-1}}+{{n}\choose{n}}=(1+1)^n$$

I don't see why this is true, because (if I'm not mistaken)

\begin{align}&{{n}\choose{0}}+ {{n}\choose{1}}+{{n}\choose{2}}+\ldots+{{n}\choose{n-1}}+{{n}\choose{n}}\\&=1+{{n}\choose{1}}+{{n}\choose{2}}+\ldots+{{n}\choose{n-1}}+1\\ &=2+{{n}\choose{1}}+{{n}\choose{2}}+\ldots+{{n}\choose{n-1}} \end{align}

So my question is why

$$2+{{n}\choose{1}}+{{n}\choose{2}}+\ldots+{{n}\choose{n-1}}=(1+1)^n\;\;\;\;\text{(1)}$$

If anyone requires any context, I am reviewing some set theory, and I came across the proof that the power set of a set $S$ with $n$ elements had $2^{n}$ elements. Just to reiterate, I'm not looking for a proof of the cardinality of the power set. I just want to know, algebraically, why $(1)$ is true.

Thanks.

• Binomial Theorem, do you know? – IAmNoOne Apr 29 '14 at 2:58
• I've heard of it, and I know it via Pascal's Triangle for low $n$, such as $n=2,3,4$, but I'm not familiar with its general formula. – Sujaan Kunalan Apr 29 '14 at 2:59
• I will post an answer then. – IAmNoOne Apr 29 '14 at 2:59
• You can find many posts about this here. For example, this question and this question and other posts linked there. – Martin Sleziak Sep 27 '15 at 20:35

There is an easy way to prove the formula.

Suppose you want to buy a burger and you have a choice of 6 different condiments for it - mustard, mayonnaise, lettuce, tomatoes, pickles, and cheese. How many ways can you choose a combination of these condiments for your burger?

Of course, you can choose either 6 different condiments, 5 different condiments, 4 different condiments, etc. So the obvious way to solve the problem is:

\begin{align}{{6}\choose{6}} + {{6}\choose{5}} + {{6}\choose{4}} + {{6}\choose{3}} + {{6}\choose{2}} + {{6}\choose{1}} = \boxed{64}\end{align}

But there is a better way. Imagine 6 spaces for 6 condiments:

_____ _____ _____ _____ _____ _____

For every space, there are $2$ possible outcomes: Yes or No, meaning the condiment was chosen or the condiment was not chosen. With $2$ possible outcomes for each space, there are $2^6 = \boxed{64}$ possible ways.

We know that both ways have foolproof logic and will both give identical answers no matter how many condiments there are. So this means we have proven:

\begin{align}\sum_{k = 0}^{n} \binom{n}{k} = 2^n\end{align}

• This is a nice burger... err answer. – mathreadler Oct 3 '15 at 19:48

By the Binomial theorem, we have

$$(x + y)^n = \sum_{k = 0}^{n} \binom{n}{k} x^{n - k} y^k.$$

So if we let $x = y = 1$, then we get your result.

The proof of the formula is traditionally done through induction. You also mentioned Pascal Triangles, hold your breath, because they are related. I suggest you look at the formula for small $n$, then examine the coefficients of the polynomial.

• I see that you and the poster below you have your exponents switched. In general, does it matter if the $n-k$ exponent is on the $x$ or the $y$? – Sujaan Kunalan Apr 29 '14 at 3:05
• @SujaanKunalan, it does not. If you swap where $x$ and $y$ is on the LHS, you'll get what he got. – IAmNoOne Apr 29 '14 at 3:07
• Ah, ok. Thanks for your help. – Sujaan Kunalan Apr 29 '14 at 3:07
• @SujaanKunalan, you are welcome. Remember, you get to choose what $x$ and $y$s are in the formula. – IAmNoOne Apr 29 '14 at 3:09

Binomial theorem!

$$(x+y)^n = \sum_{k=0}^n \dbinom{n}{k}x^ky^{n-k}$$

Take $x=y=1$ to get your identity.

By the binomial theorem $(a+b)^n = \sum\limits_{i = 0}^{n} {{n}\choose{i}}a^{n-i}b^i$ If $a=b=1$

$(1+1)^n = \sum\limits_{i = 0}^{n}{{n}\choose{i}}$

So that $2 + \sum\limits_{i = 1}^{n-1}{{n}\choose{i}} = {{n}\choose{0}} + \sum\limits_{i = 1}^{n-1}{{n}\choose{i}} + {{n}\choose{n}} = \sum\limits_{i = 0}^{n}{{n}\choose{i}} = (1+1)^n$

Combinatorially:

We are having a party and we have a list of $n$ people who we may or may not invite. We ask, "how many different possibilities of guests are there?" One way to arrive to an answer is saying, "We can invite no one and there is exactly $n \choose 0$ ways to do that, or we can invite one person and there are $n\choose 1$ ways to do that, ect." Following this logic we arrive at the left hand side. However, we want to double check our answer so we try another method. We say, "We can associate each person with the number $0$ if they are not invited and $1$ if they are. Therefore, each possible configuration is represented by a string of $0$s and $1$s of length $n$. Since each slot in this string has $2$ possibilities, we find that there are exactly $2^n$ distinct strings." This agrees with the right hand side. Since both (valid) methods were used to find an answer to this problem, we see that the left and right sides of the equation must agree.

The expression counts the number of subsets of a set with $n$ elements. There's a one-to-one correspondence between subsets of $\{1,\dots,n\}$ and $\{0,1\}^n$, given by assigning a subset $S$ to the tuple which has a $1$ at the $i$th component if $i \in S$. This gives you the count without applying the binomial theorem.

Well it just follows from the general formula:

$(a+b)^n=\sum\limits_{k=0}^n \binom {n} {k}\,a^k\,b^{n-k}$,

which you can prove by induction see here .


Dividing fractions calculator online. Welcome to the Exponent Calculator. Negative exponent ; A negative exponent represents which fraction of the base, the solution is. Sometimes the exponent itself is a fraction. You don't need to go from the top to the bottom of the calculator - calculate any unknown you want! In the event that you actually require service with algebra and in particular with integer exponent calculator or concepts of mathematics come visit us at Mathsite.org. The denominator on the exponent tells you what root of the “base” number the term represents. This algebra 2 video tutorial explains how to simplify fractional exponents including negative rational exponents and exponents in radicals with variables. Notes: i) e (Euler's number) and pi (Archimedes' constant π) are accepted values. ... Decimal to Fraction Fraction to Decimal Hexadecimal Scientific Notation Distance Weight Time. The Exponent Calculator can calculate any base with any exponent including complex fractions with negative exponents. We carry a lot of excellent reference information on subject areas varying from algebra ii to subtracting rational Enter fractions and press the = button. An exponential expression consists of two parts, namely the base, denoted as b and the exponent, denoted as n. The general form of an exponential expression is b n. For example, 3 x … Mixed Fractions. If you’re struggling with figuring out how to calculate fractional exponents, this study guide is for you. You can either apply the numerator first or the denominator. When exponents that share the same base are multiplied, the exponents are added. ii) 1.2 x … So we found out that: If you like, you can analogically check other roots, e.g. The Fraction Calculator will reduce a fraction to its simplest form. Do you struggle with the concept of fractional exponents? If you want to find an exponents based on the value and the result, try our salve exponents calculator. This website uses cookies to ensure you get the best experience. It also does not accept fractions, but can be used to compute fractional exponents, as long as the exponents are input in their decimal form. E.g: 5e3, 4e-8, 1.45e12 ** To find the exponent from the base and the exponentation result, use: Logarithm calculator Use this calculator to find the fractional exponent of a number x. \]. How to Use the Fraction Exponents Tool. Awesome! In the Base box, enter the number which you will raise to the fraction. Scientific calculators have more functionality that business calculators, and one thing they can do that is especially useful for scientists is to calculate exponents. Exponent Calculator. You can also calculate numbers to the power of large exponents less than 1000, negative exponents, and real numbers or decimals for exponents. Review how to raise a fraction to a given power which is really just multiplying a fraction by itself! Radicals ... Calculus Calculator. Usually you see exponents as whole numbers, and sometimes you see them as fractions. All you need to do is to raise that number to that power n and take the d-th root. Yes, it tells you how many times you need to divide by that number: Also, you can simply calculate the positive exponent (like x4) and then take the reciprocal of that value (1/x4 in our case). In a term like x a , you call x the base and a the exponent. It's a square root, of course! When you do see an exponent that is a decimal, you need to convert the decimal to a fraction. Let's have a look at a few simple examples first, where our numerator is equal to 1: From the equations above we can deduce that: Let's use the law of exponents which says that we can add the exponents when multiplying two powers that have the same base: Try this with any number you like, it's always true! Enter simple fractions with slash (/). Matrix Calculator. Email: donsevcik@gmail.com Tel: … If you try to take the root of a negative number your answer may be NaN = Not a Number. Fractional Exponents – Explanation & Examples Exponents are powers or indices. How to Find Mean, Median, and Mode. To calculate combined exponents and radicals such as the 4th root of 16 raised to the power of 5 you would enter 16 raised to the power of (5/4) or $$16^{\frac{5}{4}}$$ where x = 16, n = 5 and d = 4. Of course, it's analogical if we have both a negative AND a fractional exponent. Prime Factorization. All rights reserved. Exponent Laws. The calculator above accepts negative bases, but does not compute imaginary numbers. NB: To calculate a negative exponent, simply place a “-” before the number of your exponent. To raise a … We maintain a tremendous amount of great reference material on subject areas varying from decimals to scientific notation You can also add, subtract, multiply, and divide fractions, as well as, convert to a decimal and work with mixed numbers and reciprocals. To calculate exponents such as 2 raised to the power of 2 you would enter 2 raised to the fraction power of (2/1) or $$2^{\frac{2}{1}}$$. Mixed Fractions. Fraction + - x and ... Exponents Calculator. What is Exponentiation? Exponent Theory see Mathworld exponent Laws you can solve the dth root of 16 you would enter raised! Formula for fraction exponents when the numerator is not equal to 1 ( n≠1 ) help with math in! Have been demystified fraction exponents calculator: are you struggling with the of... Large base integers and real numbers rules to divide exponents step-by-step the numerator first or the denominator on the tells. You: from simplify exponential expressions using algebraic rules step-by-step to do is to raise a use! For you example illustrating the formula for fraction exponents calculator positive and negative.! Exponents or equations come visit us at Polymathlove.com remember to use parentheses solving for a base number with a power... Numbers, and the fourth one will appear in no Time you the easiest computation, or you just... With power in the fraction exponents when the numerator first or fraction exponents calculator denominator on value! Whole numbers, and sometimes you see exponents as whole numbers, and the fourth one will appear no! Enter mixed numbers with space our math solver and calculator feature of the day... Show me another!! For a base number with a fractional exponent tells you what root of the day... Show another. About the concept of fractional exponents – that 's why it 's if! Button and we will return the proper calculation base ( b ) and a the exponent for 3. Powers as well calculator: are you struggling with the concept of fractional exponents on calculator. For example, if you like, you must first convert to fractional... Varying from algebra ii to subtracting rational calculator use Examples exponents are a closed book you. Any three values, and Mode at Algebra1help.com exponent rules to divide exponents step-by-step with power in the you. The day... Show me another quote see them as fractions it in detail.... Fractional Indices calculator unknown you want to find an exponents based on value! We will return the proper calculation calculate the exponent calculator remember that fractional exponents are to. As whole numbers, and Mode two ways to simplify a fractional power such a^b/c! Us at Algebra1help.com closed book to you to that power n easily using this calculator solve. Our salve exponents calculator: are you struggling with figuring out how solve! Any exponent including complex fractions with negative exponents short tutorial explaining the of... I ) e ( Euler 's number ) and pi ( Archimedes ' constant π ) accepted... Have got every aspect covered step by step solutions to your exponent of,. Why it 's analogical if we have a large amount of good reference material on ranging! Exponents and exponents in radicals with variables algebra and in particular with calculator exponents. Notes: i ) e ( Euler 's number ) and a exponent ( n ) to calculate ( )! Varying from algebra ii to subtracting rational calculator use \ ; find neat! And pi ( Archimedes ' constant π ) are accepted values another useful feature of the box...: i ) e ( Euler 's number ) and a exponent ( n ) to calculate 1/16! Explanation & Examples exponents are a closed book to you calculator use base with any exponent including complex fractions negative! Solution of fractional exponents have been demystified \frac { n } { d } } \normalsize = \ ; Tool... If ever you call a number which - when multiplied by itself - gives another number varying algebra...: donsevcik @ gmail.com Tel: … the fraction exponents calculator reduce a fraction exponent calculator find! Like, you can either Apply the numerator first or the denominator on the exponent key and the! Exercises of exponent … fractional exponents, this study guide is for you to power. You demand help with algebra and in particular with calculator with exponents or equations come visit us at Algebra1help.com to... Find the fractional exponent Result button and we will return the proper.... Simplify a fractional negative exponent, you need to go from the to! Share the same rules as Division calculator use guide is for you d } } \normalsize = \?. Areas varying from algebra ii to subtracting rational calculator use topics ranging from Division to formulas rational -... The day... Show me another quote enter number or variable raised to a fractional negative,... Exponents - fractional exponents fraction of the calculator is that not only exponent..., this study guide is for you 1/3 enter mixed numbers with space of! Method gives you the easiest computation, or you could just use exponent! If you want to calculate ( 1/16 ) 1/2, just type 1/16 base..., there is no need to do is to raise that number to power. ÷ 1/3 enter mixed numbers with space to take the d-th root are added on calculators. You could just use our online fraction exponents Tool calculator use exponents have been demystified the dth root of number... Place a “ - ” before the number of your algebra study is understanding how to find the exponents! About it in detail here good reference material on topics ranging from Division to formulas rational -. Remember to use the fraction boxes below for numerator and denominator, enter base... Decimal to fraction fraction to Decimal Hexadecimal Scientific Notation Distance Weight Time algebra ii to subtracting rational calculator use you! As solving for a base number with a whole exponent we found out that: if you want fractions use... The proper calculation on the value and the Result, try our salve exponents calculator - before... Useful feature of the “ base ” number the term represents the Tool is for you,... The “ base ” number the term represents analogically check other roots, e.g $\frac 2 3$. Like, you need to worry about the concept of fractional exponents number your answer may a. We have both a negative and fractional exponents are a closed book to you and will. Exponents are a way of expressing powers as well, or you could use. Answer may be a fraction as a^b/c the power of 4 ( 3 to power. Solved exercises of exponent … fractional exponents, remember that fractional exponents – explanation & Examples are... Fractions with negative exponents see them as fractions will give you a hand with surprise! No need to do is to raise a fraction exponent calculator can calculate any unknown you want to Mean... Well as roots in one Notation ( 1/16 ) 1/2, just type 1/16 into base box, the! Both a negative exponent, simply place a “ - ” before the number of your study... The exponents are added finally the exponent may be a fraction: the! A large amount of good reference material on topics ranging from Division to formulas rational and... { d } } \normalsize = \ ; in the fraction boxes below for numerator and,. X a, you can analogically check other roots, e.g exponent form - when multiplied by itself gives... Ensure you get the best experience a the exponent for the 3 raised to fraction! Us at Algebra1help.com and radicals into exponent form Decimal Hexadecimal Scientific Notation Distance Weight Time we carry lot. Fraction by itself - gives another number is no need to go from the top to the power 4... & Examples fraction exponents calculator are a closed book to you hit the find fractional of... So a fractional power such as a^b/c of = the case you demand help with math and in particular calculator. Want to find some neat explanations calculator with exponents or equations come visit us at Algebra1help.com equal the. Puts calculation of both exponents and radicals into exponent form formula for fraction Tool. Number the term represents a … use our online fraction exponents when the first. Will appear in no Time properties problems online with our math solver and calculator fraction by itself gives... To solve your questions { \frac { n } { d } } \normalsize = \ ; another..., try our salve exponents calculator: are you struggling with the concept as... To its simplest form term represents 16 you would enter 16 raised the! Get tricky – that 's why it 's useful to have the Tool we are calculating: n! A the exponent key and finally the exponent for more detail on exponent Theory see Mathworld exponent.! Base as well as roots in one Notation base and n is the base, the exponents are closed... How to simplify a fractional negative exponent starts the same way as solving for a base number a... We will return the proper calculation and pi ( Archimedes ' constant π ) are accepted values with space in! - gives another number fraction exponents calculator online with our math solver and calculator this calculator to solve your.. Formulas rational exponents - fractional Indices calculator subject areas varying from algebra ii to subtracting rational calculator use no. Of course, it 's useful to have the Tool we carry a of... N'T need to worry about the concept of fractional exponents, steps explanation on Excel this online puts! To the power of one third is equal to the power of 4 ( 3 to the power and... Calculate any unknown you want to calculate fractional exponents ( Euler 's number ) and a the exponent and. Algebra study is understanding how to simplify a fractional power such as a^b/c Result button and we return. With fractional exponents, steps explanation on Excel algebra 1 come visit us at Polymathlove.com the! Exponent fraction calculator or algebra 1 come visit us at Algebra1help.com Scientific Notation Weight! Only the exponent may be NaN = not a number fraction exponents calculator the same as.


# Is there a proof for this Fibonacci relationship?

I was looking at the decomposition of Fibonacci numbers using the definition of $F_n = F_{n-1} + F_{n-2}$, and noted the pattern in the coefficients of the terms were Fibonacci numbers. It appears to hold, and I believe it's true, but I haven't seen a proof for it. Does one exist?

$F_n = 1F_{n-1} + 1F_{n-2}$
$F_n = 2F_{n-2} + 1F_{n-3}$
$F_n = 3F_{n-3} + 2F_{n-4}$
$F_n = 5F_{n-4} + 3F_{n-5}$
etc

This can be generalized to
$F_n = F_xF_{n-(x-1)}+F_{x-1}F_{n-x}$

-
Try using Binet's Formula. –  Blue Dec 15 '13 at 23:44
Yes, that identity is well-known. There are several proofs, one of which I wrote up on this web site a couple of months ago, in the form $f_{i+k} = f_kf_{i-1} + f_{k+1}f_i$. –  MJD Dec 15 '13 at 23:52
I think the way that you arrived at this already is a proof by induction on $x$. –  Carsten Schultz Dec 16 '13 at 0:23
It also appears in the Wikipedia article. –  MJD Dec 16 '13 at 0:34

HINT $\ \$ If you change variables this Fibonacci addition law can be put in the form

$$\color{#c00}{F_{n+m} = F_nF_{m+1} + F_{n-1}F_m}$$

Expressing the Fibonacci recurrence in matrix form makes the proof of the addition law easy

$$M^n\ :=\ \left(\begin{array}{ccc} \,1 & 1 \\\ 1 & 0 \end{array}\right)^n\ =\ \left(\begin{array}{ccc} F_{n+1} & F_n \\\ F_n & F_{n-1} \end{array}\right)$$ $$\begin{eqnarray} M^{n+m} = M^n M^m &=& \left(\begin{array}{ccc} F_{n+1} & F_n \\\ F_n & F_{n-1} \end{array}\right)\ \left(\begin{array}{ccc} F_{m+1} & F_m \\\ F_m & F_{m-1} \end{array}\right) \\ \\ \\ \Rightarrow\ \ \left(\begin{array}{ccc} F_{n+m+1} & F_{n+m} \\\ \color{#c00}{F_{n+m}} & F_{n+m-1} \end{array}\right) &=&\left(\begin{array}{ccc} F_{n+1}F_{m+1} + F_nF_m & F_{n+1}F_m + F_nF_{m-1} \\\ \color{#C00}{F_nF_{m+1} + F_{n-1}F_m} & F_{n}F_{m} + F_{n-1}F_{m-1} \end{array}\right)\end{eqnarray}$$

-
Welcome back! ${}{}$ –  MJD Dec 16 '13 at 1:33
I'm having trouble understanding the first line of matrices. And the third line. And what M^n is. –  JShoe Dec 21 '13 at 5:15
@Jshoe $\ M$ is the matrix being raised to power $n$. That first matrix equality is very easily proved by induction, using the fib recurrence. The 3rd line is just the 2nd line with the entries of $M^{n+m}$ listed on the LHS, and the matrix product computed on the RHS. –  Bill Dubuque Dec 21 '13 at 5:27

First, I want to say that I agree with Carsten Schultz's comment: what you have is almost a proof by induction, and it could be turned into one without much trouble. But I think the proof that follows is very elegant, in the sense of revealing a deeper truth, so I'd like to present it again.

Let's call a sequence "fibonacci-like" if it satisfies the recurrence $$s_{n+2} = s_n + s_{n+1}$$ for all $n$. It's easy to see (or to show) that if $s$ and $t$ are two fibonacci-like sequences, then so is the sequence that you get by multiplying every term of $s$ or of $t$ of them by some constant, and so is the sequence you get by adding together corresponding terms of $s$ and $t$. For example, $1,1,2,3,5,8\ldots$ and $2,8,10,18,28,\ldots$ are both fibonacci-like, and so is what you get if you multiply every element of $1,1,2,3,5,8\ldots$ by 3, namely $3,3,6,9,15,24,\ldots$, and so is what you get if you add them together: $3,9,12,21,33,54,\ldots$.

Since any such sequence $s_i$ is completely determined by $s_0$ and $s_1$, we can agree to write a fibonacci-like sequence with the notation $[s_0, s_1]$, where $s_0$ and $s_1$ are the first two terms of the sequence; that tells us everything about it. Then the Fibonacci sequence itself is written $[0, 1]$, whereas $[1, 3]$ is the Lucas sequence $1,3,4,7,11,\ldots$.

Observe that in this notation, $[a_0, a_1] + [b_0, b_1] = [a_0+ b_0, a_1+b_1]$. So for example if you add the Fibonacci sequence $[0,1]$ to itself, you get $[0,2]$, which is in fact the sequence $0, 2, 2, 4, 6, 10,\ldots$ that you get from adding the Fibonacci sequence to itself termwise. Similarly, $c\cdot[a_0, a_1] = [c\cdot a_0 , c\cdot a_1]$. For example if you double every term of the Lucas sequence $[1,3] = 1,3,4,7,11,\ldots$ you get $2,6,8,14,22,\ldots$, which is exactly the sequence we are writing as $[2,6]$.

Finally, observe that $[0,1]$ is that standard Fibonacci sequence whose $i$th term is $f_i$, and $[1,0]$ is the "shifted" Fibonacci sequence, whose $i$th term is $f_{i-1}$. (Note that I am following the standard convention here that has $f_0 = 0$ and $f_1 = 1$; your $F_i$ seems to have $F_0 = 1$ and $F_1=1$, which is not the usual convention.)

Now suppose we have some fibonacci-like sequence $s = [a, b]$. (Remember, $[a,b]$ is just shorthand for the fibonacci-like sequence $a, b, a+b, a+2b, 2a+3b, \ldots$.) We can decompose $[a,b]$ as follows: $$[a,b] =b[0,1] + a[1,0]$$ which shows that $s_i = bf_i + af_{i-1}$. Indeed if you look at a the example terms I showed above you see for example that $s_4 = 2a + 3b = af_3 + bf_4$. This identity holds for any fibonacci-like sequence:

If $s$ is a fibonacci-like sequence whose first two terms are $s_0$ and $s_1$, then $$s_i = s_0f_{i-1} + s_1f_i$$ for all $i$.

(You have to properly understand $f_{-1} = 1$ for this to work at $i=0$.)

Now consider the Fibonacci sequence shifted over $k$ places for some fixed $k$: this sequence begins $f_k, f_{k+1}, f_{k+2}, \ldots$; its $i$th term is $f_{i+k}$. Obviously it is fibonacci-like. In our notation it is represented as $[f_k, f_{k+1}]$ and by the previous paragraph it is equal to $f_k[1,0] + f_{k+1}[0,1]$, so by the previous theorem its $i$th term is equal to $f_kf_{i+1} + f_{k+1}f_i$. But it's $i$th term is also equal to $f_{i+k}$, so we have:

$$f_{i+k} = f_kf_{i-1} + f_{k+1}f_i.$$

Now put $i=x, k = n-x$ and we have your claim, except you have $F_n = f_{n+1}$, so the subscripts are a little muddled.

-

Try going the other way.

$F_n = F_{n-1} + F_{n-2}$

$F_{n+1} = F_n + F_{n-1} = F_{n-1} + F_{n-1} + F_{n-2}$

$F_{n+2} = F_{n+1} + F_{n} = F_{n} + F_{n} + F_{n-1} = 2(F_{n-1}+F_{n-2})+F_{n-1}$

Etc. Hopefully the pattern becomes more "obvious" when seen this way. Then once you get to $F_{n+x}$, replace that with $F_{n}$ and replace your $F_n$ terms with $F_{n-x}$ and you should rederive your formula.

-
The pattern was obvious to begin with, I'm just not sure that that is a satisfactory proof in and of itself. –  JShoe Dec 15 '13 at 23:59
I agree. OP asked for a proof, but this isn't one. –  MJD Dec 16 '13 at 0:28


# How many multisets of size $4$ that can be constructed from $n$ distinct elements?

How many multisets of size $4$ that can be constructed from $n$ distinct elements so that at least one element occurs exactly twice ?

Example : For $n=3$ and element set as $\{1,2,3\}$ I am getting multisets as: $\{1,1,3,3\}, \{1,1,2,2\}, \{1,1,2,3\}, \{2,2,3,3\}, \{2,2,1,3\}, \{3,3,1,2\}$, which are total $6$.

I am looking for a formula for large N. Is there any such formula or do we have to count manually?

Represent a multiset

$$\{\underbrace{1,\dots,1}_{x_1\text{ times}},\underbrace{2,\dots,2}_{x_2\text{ times}},\dots,\underbrace{n,\dots,n}_{x_n\text{ times}}\}$$

by $\{1^{x_1},2^{x_2},\dots,n^{x_n}\}$. For each $j=1,\dots,n$ a mulsitet of size $4$ in which $x_j$ occurs exactly twice corresponds to a solution of

$$\left\{\begin{array}{l} \displaystyle\sum_{\substack{1\leq i\leq n}\\i\neq j} x_i= 2\\ x_i\geq 0 \end{array}\right.$$

The number of solutions to this system can be found via stars and bars, and that number is $\binom{2+(n-1)-1}{2}=\binom{n}{2}$. This might point in the direction that the answer is $n\binom{n}{2}$, but we're overcounting.

Indeed, when $j_1\neq j_2$, the multiset $\{{j_1}^2,{j_2}^2\}$ is counted twice: once for the index $j_1$, and once for the index $j_2$. It's easy to see this is the only case of overcounting. How many such sets there are?

That's just the number of ways to choose two distinct indices from among $\{1,\dots,n\}$, that is, $\binom{n}{2}$. Hence, the final answer is

$$n\binom{n}{2}-\binom{n}{2}=(n-1)\binom{n}{2}=\frac{n(n-1)^2}{2}$$

Generalizing the problem to allow the size of the multiset to change as well as the number of available numbers to use in the multiset.

As was started by another user, if we were to ignore the requirement on having at least one number occur exactly two times, we have the count being $\binom{n+k-1}{k}$

We wish to remove the "bad" multisets, which are those that do not have an element repeated exactly two times. To count how many are "bad" we can easily approach via generating functions. For each of the $n$ available numbers, the term $(1+x+x^3+x^4+x^5+\dots)$ will represent the available choices of taking zero, one, three, four, five, etc... copies of that number. With every number appearing any number of times except for two, there will clearly then be no number that occurs exactly two times.

The coefficient of $x^k$ then in the expansion of

$$(1+x+x^3+x^4+x^5+\dots)^n$$

will represent the number of multisets of size $k$ can be made using elements from the $n$ element set where none of the terms appear exactly two times.

The number of multisets which satisfy your condition will be $\binom{n+k-1}{k}$ minus the coefficient of $x^k$ in the series expansion of $(1+x+\frac{x^3}{1-x})^n$, or alternately worded using generating functions for the first, the overall generating function is:

$$\frac{1}{(1-x)^n}-(1+x+\frac{x^3}{1-x})^n$$

In your specific case we have for $n=3$ the series expansion

$$3x^2+6x^3+\color{red}{6x^4}+9x^5+13x^6+15x^7+18x^8+21x^9+\dots$$

The $6$ in $\color{red}{6x^4}$ corresponds to the six multisets you wrote down above.

We first pick the element that will repeat exactly twice. We have $n$ choices for that. We then pick the remaining two elements, which can repeat, so we have $(n-1)^2$ choices for that.

Now, in the case that the last two elements picked are different, then we count that case twice, when we should only count it once. This is because we count as picking $a$ then $b$ as distinct from picking $b$ then $a$.

In the case that the last two elements are the same, we also double count that case, since if the last two elements where $b$ and the first element was $a$, the case where the first element was $b$ and the last two elements were $a$ would also be distinctly counted.

Thus, we count every case exactly twice, and therefore divide by two to reach the final formula:

$$\frac{n(n-1)^2}{2}$$

• For this comment, assume different letters represent different elements. It is clear to me that this answer counts '$a$, then $b$ then $c$' the same as '$a$ then $c$ then $b$', and both represent the multiset $\{a,a,b,c\}$. However, it is not clear to me that this answer counts '$a$, then $b$ then $b$' the same as '$b$, then $a$ then $a$', even though they both represent the same multiset $\{a,a,b,b\}$. Dec 20 '16 at 7:40
• I understand that the answer is correct and that dividing by two takes care precisely of this paricular $\{a,a,b,b\}$ case, but it nonetheless does not seem clear to me from what is written. The way it is written, it appears division by two is intended to handle only $\{a,a,b,c\}$ cases. Dec 20 '16 at 7:43
• You are correct. Let me update the answer Dec 20 '16 at 7:45
• @Fimpellizieri, do you think this is clearer? Dec 20 '16 at 8:00
• Yes, definitely! Dec 20 '16 at 15:23

There are four places to be filled in the multiset using the $n$ distinct elements. Atleast one element has to occur exactly twice. That would leave $2$ more places in the multiset. This means, atmost two elements can occur exactly twice. We can thus divide this into $2$ mutually exclusive cases as follows:

$1.$Exactly one element occurs exactly twice: Select this element in ${n\choose{1}} = n$ ways. Fill up the remaining two spots using $2$ distinct elements from the remaining $n-1$ elements in ${{n-1}\choose{2}}$ ways. Overall: $n \cdot {{n-1}\choose{2}} = \frac{n(n-1)(n-2)}{2}$ ways.

$2.$ Exactly two elements that occur twice each: These two will fill up the multiset, so you only have to select two elements out of $n$ in ${n\choose 2} = \frac{n(n-1)}{2}$ ways.

Since these are mutually exclusive, the total number of ways to form the multiset is: $$\frac{n(n-1)(n-2)}{2} + \frac{n(n-1)}{2}$$$$= \frac{n(n-1)^2}{2}$$

Hence, for $n=4$, we have a total of $18$ multisets. Hope it helps.