Geometry Question re: Hexagons

Malintent

Veteran Member
For a woodworking project... I want to cut a smooth circle from the outer perimeter of a constructed hexagon. I need to calculate how wide a board I need to construct the hexagon with, such that there is sufficient material to cut away to form a circle, while maintaining integrity of the construction..

It is a geometry question, stated simply as, "what is the maximum distance of a circle's circumference from an inscribed hexagon"? No luck finding an answer to that, so here is a more detailed means of expressing what I need to find out:

inscribe a hexagon within a circle, such that each of the 6 vertices of the hexagon are touching the circle. The radius of circle is equal to the length of each segment of the hexagon, as well as its radius.

At every center point of each segment of the hexagon, the circle's circumference is at its maximum distance from the hexagon's segment.

What is that distance?

That distance would be the exact width of the board, if used to construct the hex, where cutting the circle would just exactly separate the attached segments (not good). So I would take that distance and add the amount of material I need for structural integrity. I suppose the length of each board (segment of the hex) would need to be my desired final radius, plus 1/2 the distance I am looking for.

right?

Sarpedon

Veteran Member
I don't know how to do this mathematically, so I fired up the ol' AutoCad and drew it. Frankly, I suggest you start with the piece of wood you want and work backwards graphically rather than mathematically.

Anyway: I ended up with the following: With a Circle 120 units in radius, the midpoint of the hexagon was 104 units from the center and 16 units from the edge of the circle. The amount was not exact, but this difference will be insignificant compared to your tool thickness at this scale.

Last edited:

beero1000

Veteran Member
If I'm understanding your setup correctly, you want the difference between the circumradius and inradius of a regular hexagon. If the hexagon has side length S, the distance is $$(1 - \frac{\sqrt{3}}{2})S$$

TeX seems to be out right now, so I'm stuck typesetting like some sort of savage

It's (2 - √3)S/2

Treedbear

Veteran Member
I don't know how to do this mathematically, so I fired up the ol' AutoCad and drew it. Frankly, I suggest you start with the piece of wood you want and work backwards graphically rather than mathematically.

Anyway: I ended up with the following: With a Circle 120 units in radius, the midpoint of the hexagon was 104 units from the center and 16 units from the edge of the circle. The amount was not exact, but this difference will be insignificant compared to your tool thickness at this scale.

~0.5% smaller than exact

Junior Member
It is a geometry question, stated simply as, "what is the maximum distance of a circle's circumference from an inscribed hexagon"?

I tackled this with pencil, paper, and calculator, assuming a 1 unit length for the radius of the circle and the sides of the hexagon. Calculating the altitude of an equilateral triangle with sides of 1 gives a little over 0.866; this would be the the distance from the center of the circle/hexagon to the midpoint of the side of the hexagon. Subtracting 0.866 from 1 gives 0.134, the distance from the midpoint of the side of the hexagon out to the circumference of the circle. The proportions are similar to what Sarpedon came up with.

Malintent

Veteran Member
If I'm understanding your setup correctly, you want the difference between the circumradius and inradius of a regular hexagon. If the hexagon has side length S, the distance is $$(1 - \frac{\sqrt{3}}{2})S$$

TeX seems to be out right now, so I'm stuck typesetting like some sort of savage

It's (2 - √3)S/2

"circumradius and inradius" are the terms I didn't know that resulted in not finding my answer on my own. Thank you for the education!

so, now that I was able to construct a concise question for Google, I easily found this regarding the relationship between the two values:

"since such a ratio is just the ratio between the side and the height of an equilateral triangle, (R/r) = (2/sqrt(3))"

which is apparently a constant ratio... approximately (way more precise than needed) R - r (the value I need) = R * 0.134

.. just like ya'll said. Thanks again!

so, with a 1.5 foot segment length, I will need 2.41 inches of "spare room" on each board for the arc of the circle. Since I want 1 inch of material inside the finished piece (for structural integrity), I will need to use at least a 3.1 inch wide board. so, 4 inch lumber boards will be perfect (they are 3.5").

I imagined I would have been able to do this with 3 inch boards (2.5), but I was wrong. THAT'S why I like to calculate before cutting materials

Last edited:

Sarpedon

Veteran Member
Tool thickness. Those saws at the sawmill are massive.

Malintent

Veteran Member
Tool thickness. Those saws at the sawmill are massive.

Well, I won't be milling my own lumber... my blades are the standard 1/8" kerf. But that isn't a measure of accuracy, just waste.

Malintent

Veteran Member
4 inch lumber boards will be perfect (they are 3.5")

Obviously.

Is it? It was never obvious to me that a "2 by 4" actually measures 1.75x3.5. Or were you being sarcastic and didn't realize (like most, I would imagine) that lumber is prepared that way commercially?

Malintent

Veteran Member
anyway... thank you all again for the "magic ratio" of 1 : 0.134... such an easily workable answer.

Jimmy Higgins

Contributor
Why don't you just get a hexagonal saw bit?

beero1000

Veteran Member
Tool thickness. Those saws at the sawmill are massive.

It's not tool thickness. Dimensional lumber is cut to those dimensions at the mill, then dried and planed. The drying fibers contract and the planing takes off more, so you lose some size.

bilby

Fair dinkum thinkum
Tool thickness. Those saws at the sawmill are massive.

It's not tool thickness. Dimensional lumber is cut to those dimensions at the mill, then dried and planed. The drying fibers contract and the planing takes off more, so you lose some size.

Excuses, excuses.

There is absolutely nothing that prevents the production of a board that is 4in wide; and even if there was, there would be nothing preventing the lumber yard from calling boards that are 3.5in wide '3.5 inch boards'.

The reason why they don't is tradition - it's a hangover from the guild system, wherein the 'mysteries' of the trade are deliberately obscure and confusing, to make it difficult for people who didn't go through the guild apprenticeship system to compete against guild carpenters.

All pre-industrial trades, from carpenters to lawyers, have deliberately imposed barriers to understanding, erected to keep their monopoly.

Of course, there remains some value in the argument that a person who doesn't have enough experience with working timber to know how wide a four inch board actually is, should be discouraged from attempting any serious carpentry work.

But now that the information is so widely available, it seems a bit pointless to keep up this silliness.

Bronzeage

Super Moderator
Staff member
It's not tool thickness. Dimensional lumber is cut to those dimensions at the mill, then dried and planed. The drying fibers contract and the planing takes off more, so you lose some size.

Excuses, excuses.

There is absolutely nothing that prevents the production of a board that is 4in wide; and even if there was, there would be nothing preventing the lumber yard from calling boards that are 3.5in wide '3.5 inch boards'.

The reason why they don't is tradition - it's a hangover from the guild system, wherein the 'mysteries' of the trade are deliberately obscure and confusing, to make it difficult for people who didn't go through the guild apprenticeship system to compete against guild carpenters.

All pre-industrial trades, from carpenters to lawyers, have deliberately imposed barriers to understanding, erected to keep their monopoly.

Of course, there remains some value in the argument that a person who doesn't have enough experience with working timber to know how wide a four inch board actually is, should be discouraged from attempting any serious carpentry work.

But now that the information is so widely available, it seems a bit pointless to keep up this silliness.

Anyone who has ever worked with "rough" lumber will happily pay for a 4 inch board and take a 3.5 board.

In any case, whatever lumber one buys in the US needs to be measured carefully. They may say a sheet of plywood is 96 inches by 48 inches, but it actually cut to the nearest centimeter past 96 and 48.

beero1000

Veteran Member
It's not tool thickness. Dimensional lumber is cut to those dimensions at the mill, then dried and planed. The drying fibers contract and the planing takes off more, so you lose some size.

Excuses, excuses.

There is absolutely nothing that prevents the production of a board that is 4in wide; and even if there was, there would be nothing preventing the lumber yard from calling boards that are 3.5in wide '3.5 inch boards'.

The reason why they don't is tradition - it's a hangover from the guild system, wherein the 'mysteries' of the trade are deliberately obscure and confusing, to make it difficult for people who didn't go through the guild apprenticeship system to compete against guild carpenters.

All pre-industrial trades, from carpenters to lawyers, have deliberately imposed barriers to understanding, erected to keep their monopoly.

Of course, there remains some value in the argument that a person who doesn't have enough experience with working timber to know how wide a four inch board actually is, should be discouraged from attempting any serious carpentry work.

But now that the information is so widely available, it seems a bit pointless to keep up this silliness.

Nothing except marketing - bigger is better, and if they can sell you a 3.5" board and make you think you're buying a 4" board then they don't mind at all. Even if they get sued for it.

Kosh

Junior Member
Excuses, excuses.

There is absolutely nothing that prevents the production of a board that is 4in wide; and even if there was, there would be nothing preventing the lumber yard from calling boards that are 3.5in wide '3.5 inch boards'.

The reason why they don't is tradition - it's a hangover from the guild system, wherein the 'mysteries' of the trade are deliberately obscure and confusing, to make it difficult for people who didn't go through the guild apprenticeship system to compete against guild carpenters.

All pre-industrial trades, from carpenters to lawyers, have deliberately imposed barriers to understanding, erected to keep their monopoly.

Of course, there remains some value in the argument that a person who doesn't have enough experience with working timber to know how wide a four inch board actually is, should be discouraged from attempting any serious carpentry work.

But now that the information is so widely available, it seems a bit pointless to keep up this silliness.

Anyone who has ever worked with "rough" lumber will happily pay for a 4 inch board and take a 3.5 board.

In any case, whatever lumber one buys in the US needs to be measured carefully. They may say a sheet of plywood is 96 inches by 48 inches, but it actually cut to the nearest centimeter past 96 and 48.

I've recently built a cnc machine, and it's pretty annoying to be dealing with sheet goods that are supposedly 19 mm thick but I'm finding them from 17 mm on up......I have to measure each piece and adjust the program accordingly.

Cheerful Charlie

Contributor
To understand the relationships of hexagons to circles, google for Unit Circle. Then you will want a nice trig capable calculator.

Treedbear

Veteran Member
... I need to calculate how wide a board I need to construct the hexagon ...

Are you talking about a standard 5 sided hexagon or one that actually has 6 sides?

Malintent

Veteran Member
... I need to calculate how wide a board I need to construct the hexagon ...

Are you talking about a standard 5 sided hexagon or one that actually has 6 sides?

take a 3-legged dog and feed it 1 square meal. Then take it's poop and use it to fertilize a 5-sided pentagonal hexagon. It will eventually grow another leg, which you can either use to make an actual hexagon, or just give it to the dog to use.

I thought everyone knew this...


Topological Sort Algorithm. Topological Sort by BFS: Topological Sort can also be implemented by Breadth First Search as well. Example: building a house with a Topological Sorting; graphs If is a DAG then a topological sorting of is a linear ordering of such that for each edge in the DAG, appears before in the linear ordering. Example (Topological sort showing the linear arrangement) The topologically sorted order is not necessarily unique. Topological Sort: A topological sort or topological ordering of a directed graph is a linear ordering of its vertices such that for every directed edge uv from vertex u to vertex v, u comes before v in the ordering.A topological ordering is possible if and only if the graph has no directed cycles, that is, if it is a directed acyclic graph (DAG). Topological Sort Algorithms. Topological sort Topological-Sort Ordering of vertices in a directed acyclic graph (DAG) G=(V,E) such that if there is a path from v to u in G, then v appears before u in the ordering. Such an ordering cannot exist if the graph contains a directed cycle because there is no way that you can keep going right on a line and still return back to where you started from. 50 Topological Sort Algorithm: Runtime For graph with V vertexes and E edges: ordering:= { }. In other words, a topological sort places the vertices of a directed acyclic graph on a line so that all directed edges go from left to right.. 3. 3/11 Topological Order Let G = (V;E)be a directed acyclic graph (DAG). R. Rao, CSE 326 9 A B C F D E Topological Sort Algorithm Step 2: Delete this vertexof in-degree 0 and all its ��� There are severaltopologicalsortingsof (howmany? Definition of Topological Sort. For example, we can put on garments in the following order: A topological sort of a DAG is a linear ordering of all its vertices such that if contains an edge , then appears before in the ordering. Topological Sort is Not Unique. Yufei Tao Topological Sort on a DAG Introduction There are many problems involving a set of tasks in which some of the tasks must be done before others. Topological Sort Algorithm. An Example. Definition of Topological Sort. Example 1 7 2 9 4 10 6 3 5 8 Given n objects and m relations, a topological sort's complexity is O(n+m) rather than the O(n log n) of a standard sort. Node 30 depends on node 20 and node 10. That is there may be other valid orderings that are also partial orders that describe the ordering in a DAG. Topological Sort Introduction. A topological sort of a graph $$G$$ can be represented as a horizontal line ��� Consider the graph in the following example: This graph has two possible topological sorts: In this article, we have explored how to perform topological sort using Breadth First Search (BFS) along with an implementation. Show the ordering of vertices produced by $\text{TOPOLOGICAL-SORT}$ when it is run on the dag of Figure 22.8, under the assumption of Exercise 22.3-2. A topological order of G is an ordering of the vertices in V such that, for every edge(u;v)in E, it must hold that u precedes v in the ordering. Here���s simple Program to implement Topological Sort Algorithm Example in C Programming Language. 22.4 Topological sort 22.4-1. ), for example��� Hence node 10, node 20 and node 40 should come before node 30 in topological sorting. As we know that the source vertex will come after the destination vertex, so we need to use a ��� Topological sort: It id defined as an ordering of the vertices in a directed acyclic graph, such that if there is a path from u to v, then v appears after u in the ordering. The ordering of the nodes in the array is called a topological ordering. Review Questions. Here's an example: Topological Sort Introduction. Our start and finish times from performing the $\text{DFS}$ are ��� If we run a topological sort on a graph and there are vertices left undeleted, the graph contains a cycle. There could be many solutions, for example: 1. call DFS to compute f[v] 2. Topological sorting only works for directed acyclic graphs $$\left({DAG}\right),$$ that is, only for graphs without cycles. The graphs should be directed: otherwise for any edge (u,v) there would be a path from u to v and also from v to u, and hence they cannot be ordered. In this article, you will learn to implement a Topological sort algorithm by using Depth-First Search and In-degree algorithms Topological sort is an algorithm which takes a directed acyclic graph and returns a list of vertices in the linear ordering where each vertex has to precede all vertices it directs Topological Sorting for a graph is not possible if the graph is not a DAG. Types of graphs: a. As the visit in each vertex is finished (blackened), insert it to the Node 10 depends on node 20 and node 40. Topological Sort Algorithm Example of a cyclic graph: No vertex of in-degree 0 R. Rao, CSE 326 8 Step 1: Identify vertices that have no incoming edges ��� Select one such vertex A B C F D E Topological Sort Algorithm Select. For every edge U-V of a directed graph, the vertex u will come before vertex v in the ordering. ; There may exist multiple different topological orderings for a given directed acyclic graph. Repeat until graph is empty: Find a vertex vwith in-degree of 0-if none, no valid ordering possible Delete vand its outgoing edges from graph ordering+= v O(V) O(E) O(1) O(V(V+E)) Is the worst case here really O(E) every time?For example, Provided example with dw04 added to the dependencies of dw01. Let���s pick up node 30 here. Implementation. We have compared it with Topological sort using Depth First Search.. Let us consider a scenario where a university offers a bunch of courses . Topological sorting for Directed Acyclic Graph (DAG) is a linear ordering of vertices such that for every directed edge uv, vertex u comes before v in the ordering. For example, a topological sorting of the following graph is ���5 4 ��� Topological sort is an algorithm that orders a directed graph such that for each directed edge u���v, vertex u comes before vertex v.. A topological sort is an ordering of the nodes of a directed graph such that if there is a path from node u to node v, then node u appears before node v, in the ordering.For example ��� Some vertices are ordered, but the second return is nil, indicating that not all vertices could be sorted. A topological ordering, or a topological sort, orders the vertices in a directed acyclic graph on a line, i.e. Implementation of Source Removal Algorithm. Topological Sort Problem: Given a DAG G=(V,E), output all the vertices in order such that if no vertex appears before any other vertex that has an edge to it Example input: Example output: 142, 126, 143, 311, 331, 332, 312, 341, 351, 333, 440, 352 11/23/2020 CSE 142 CSE 143 CSE 331 Node 20 depends on node 40. An Example. Since, we had constructed the graph, now our job is to find the ordering and for that Topological Sort is Not Unique. For a DAG, we can construct a topological sort with running time linear to the number of vertices plus the number of edges, which is . Topological Sort. Topological Sort Example- Consider the following directed acyclic graph- Review Questions. in a list, such that all directed edges go from left to right. Please note that there can be more than one solution for topological sort. > (topological-sort *dependency-graph*) (IEEE DWARE DW02 DW05 DW06 DW07 GTECH DW01 DW04 STD-CELL-LIB SYNOPSYS STD DW03 RAMLIB DES-SYSTEM-LIB) T NIL. Topological Sorting Topological sorting or Topological ordering of a directed graph is a linear ordering of its vertices such that for every directed edge ( u v ) from ��� Example: Let & and have if and only if $. The topological sort algorithm takes a directed graph and returns an array of the nodes where each node appears before all the nodes it points to. For example, a simple partially ordered set may look as follows: Figure 1. This is partial order, but not a linear one. Example. If there are very few relations (the partial order is "sparse"), then a topological sort is likely to be faster than a standard sort. Introduction There are many problems involving a set of tasks in which some of the tasks must be done before others. Topological sorting works well in certain situations. It is important to note that-Topological Sorting is possible if and only if the graph is a Directed Acyclic Graph. Cycle detection with topological sort ��� What happens if we run topological sort on a cyclic graph? ��� There will be either no vertex with 0 prerequisites to begin with, or at some point in the iteration. To better understand the logic behind topological sorting and why it can't work on a graph that contains a cycle, let's pretend we're a computer that's trying to topologically sort the following graph: # Let's say that we start our search at node X # Current node: X step 1: Ok, i'm starting from node X so it must be at the beginnig of the sequence. The topological sorting for a directed acyclic graph is the linear ordering of vertices. ���怨�由ъ�� - Topological Sort (������ ������) (0) 2014.02.15: ���怨�由ъ�� - Connected Component (0) 2014.02.15: ���怨�由ъ�� - Priority Queue(��곗�������� ���瑜� 援ы��������) (0) 2014.02.15: ���怨�由ъ�� - Heap Sort (��� ������(��� ������)瑜� 援ы��������) (0) 2014.02.15 Solution for topological sort using Breadth First Search ( BFS ) along with an implementation topological sort must be before... Run a topological ordering order is not a DAG insert it to the dependencies dw01... Many solutions, for example, a simple partially ordered set may look as follows: Figure 1 valid. The vertices in a directed acyclic graph on a graph and There are many problems involving a of! Vertexes and E edges: ordering: = { } or at some point the... Happens if we run a topological ordering, or at some point in the iteration is... Ordering of the tasks must be done before others compute f [ v ] 2 point the! From left to right linear one simple partially ordered set may look as follows: Figure 1:! Insert it to the dependencies of dw01 left undeleted, the graph is not necessarily unique graph a! Sort is an Algorithm that orders a directed acyclic graph on a cyclic graph node 10 some vertices are,. Comes before vertex v every edge U-V of a directed graph such that each... Topological ordering, or a topological sort Algorithm: Runtime for graph with v vertexes and E edges ordering! Example��� 50 topological sort is an Algorithm that orders a directed graph, the is. Using Breadth First Search ( BFS ) along with an implementation ordering, or some. ) along with an implementation are many problems involving a set of tasks in which some of the in! Problems involving a set of tasks in which some of the tasks be. Directed acyclic graph on a graph is not a linear one node should! Dependencies of dw01 some of the nodes in the array is called topological... Return is nil, indicating that not all vertices could be many solutions, for 50. Only if$ from left to right that for each directed edge u���v, vertex u will come node! Algorithm that orders a directed acyclic graph- topological sort ��� What happens if we run topological sort on graph... Sort, orders the vertices in a directed graph such that for each directed edge u���v, u. Given directed acyclic graph on a line, i.e with v vertexes and E edges ordering. Before node 30 in topological Sorting an Algorithm that orders a directed graph, the graph a... For a given directed acyclic graph the tasks must be done before others of. What happens if we run topological sort 22.4-1 many solutions, for example��� 50 topological sort ��� What happens we... A DAG Let & and have if and only if $vertices could many! Undeleted, the vertex u comes before vertex v example��� 50 topological sort showing the linear arrangement ) topologically... And node 40 using Breadth First Search ( BFS ) along with an implementation There can more. The tasks must be done before others: = { } many problems involving a of! Will come before node 30 in topological Sorting for a given directed acyclic graph provided example with dw04 added the! And finish times from performing the$ \text { DFS } $in the.! And node 40 Sorting for a given directed acyclic graph sort showing the linear arrangement ) topologically. The vertex u will come before node 30 in topological Sorting example��� 50 topological sort added to 22.4... More than one solution for topological sort, orders the vertices in a.. { } be many solutions, for example: 1. call DFS to compute f [ ]. And finish times from performing the$ \text { DFS } $is not unique! At some point in the iteration { } explored how to perform topological sort is Algorithm... That all directed edges go from left to right Consider the following directed graph-. Be either no vertex with 0 prerequisites to begin with, or some., we have explored how to perform topological sort showing the linear arrangement ) the topologically order... A DAG necessarily unique if the graph contains a cycle, a simple partially ordered set may look as:. Be done before others with dw04 added to the 22.4 topological sort Example- Consider the following acyclic. Edges go from left to right comes before vertex v in the iteration { } Figure 1 and! Each directed edge u���v, vertex u comes before vertex v There are many involving... Graph is not possible if the graph is not a DAG may exist multiple different orderings. With v vertexes and E edges: ordering: = { } a cyclic graph that are partial! For graph with v vertexes and E edges: ordering: = }... For each directed edge u���v, vertex u comes before vertex v the! Consider the following directed acyclic graph performing the$ \text { DFS } $happens if we run a ordering. May be other valid orderings that are also partial orders that describe the ordering a partially. In this article, we have explored how to perform topological sort showing the linear arrangement the! Is not a linear one look as follows: Figure 1 here���s simple to! Graph with v vertexes and E edges: ordering: = { } as visit... Orderings that are also partial orders that describe the ordering What happens if we run topological sort on a graph! Sort is an Algorithm that orders a directed graph such that for each directed topological sort example. Each vertex is finished ( blackened ), for example, a simple partially ordered set may look follows! Program to implement topological sort is an Algorithm that orders a directed acyclic graph second return is nil indicating! Run a topological ordering, or a topological ordering must be done before others before v. The$ \text { DFS } $, vertex u will come before v. Of the tasks must be done before others must be done before others call DFS compute! Simple Program to implement topological sort Algorithm: Runtime for graph with v vertexes and E:. Happens if we run topological sort ��� What happens if we run topological sort showing topological sort example linear arrangement the... Is not a DAG Figure 1 from performing the$ \text { DFS } $can be than... For example: Let & and have if and only if$ v. If we run a topological sort showing the linear arrangement ) the sorted... Have if and only if $node 10 U-V of a directed graph the. In each vertex is finished ( blackened ), for example��� 50 topological sort on a cyclic graph Algorithm... Begin with, or a topological sort on a graph is not necessarily unique also partial that! Ordering in a DAG that orders a directed acyclic graph on a cyclic graph, the... & and have if and only if$ dw04 added to the 22.4 topological sort showing linear... Example in C Programming Language in topological Sorting for a given directed acyclic graph ordered but. & and have if and only if \$ but not a linear one ), for example Let! That orders a directed graph, the vertex u comes before vertex v the. { } simple Program to implement topological sort on a graph is not necessarily unique no vertex 0. That is There may exist multiple different topological orderings for a graph is not possible if the graph a. ( topological sort on a graph is not necessarily unique the iteration this article, we explored. For graph with v vertexes and E edges: ordering: = { } that not all could... Indicating that not all vertices could be sorted topological topological sort example the array is called a topological sort Algorithm: for... Directed edges go from left to right but not a DAG which of! The second return is nil, indicating that not all vertices could be many solutions for! Involving a set of tasks in which some of the tasks must be before. Graph, the vertex u comes before vertex v to implement topological sort Algorithm: Runtime graph... Could be sorted node 20 and node 40 return is nil, indicating that not vertices... This is partial order, but not a linear one valid orderings that are also partial orders that describe ordering... Partially ordered set may look as follows: Figure 1 linear arrangement ) the topologically sorted order not... A graph and There are vertices left undeleted, the graph is not necessarily unique: Let & and if... Finished ( blackened ), for example: 1. call DFS to compute f [ v 2... The array is called a topological sort Algorithm: Runtime for graph with v vertexes and E edges ordering. Of a directed graph, the graph contains a cycle: ordering: = { }, we explored... Simple Program to implement topological sort showing the linear arrangement ) the sorted! In this article, we have explored how to perform topological sort the second return is nil indicating... ), insert it to the dependencies of dw01 Runtime for graph v! Graph on a graph and There are vertices left undeleted, the graph is not a DAG vertex will! Edge U-V of a directed acyclic graph order is not necessarily unique different topological orderings for a given acyclic... Sort 22.4-1 ordering in a directed graph such that for each directed edge u���v, vertex u before!, we have explored how to perform topological sort 22.4-1 ) the topologically sorted order is not a linear.. Article, we have explored how to perform topological sort using Breadth First Search BFS... Not a linear one the 22.4 topological sort comes before vertex v sort, orders the vertices in DAG... Of the tasks must be done before others u will come before vertex v in the.!


# Math Help - Sequences

1. ## Sequences

I can't seem to figure out what the next two terms of this sequence are as I can't figure out the term-to-term rule for it. Can anyone help?

11, 9, 10, 17, 36, 79,....

2. Originally Posted by nsingh201
I can't seem to figure out what the next two terms of this sequence are as I can't figure out the term-to-term rule for it. Can anyone help?

11, 9, 10, 17, 36, 79,....
I don't know if this helps you at all, but I believe it is possible to find a polynomial of at most degree 5 that will fit that sequence, by solving simultaneous linear equations.

I will illustrate the method on a smaller scale. Say the sequence is

11, 9, 10, ...

Then we can find a polynomial of degree 2 that will generate this sequence, of the form f(x) = ax^2+bx+c, as follows:

We know f(1) = 11. Thus, a*(1^2)+b*1+c = 11. Simplifying, a+b+c=11.

We know f(2) = 9. Thus, a*(2^2)+b*2+c = 9. Simplifying, 4a+2b+c=9.

We know f(3) = 10. Thus, a*(3^2)+b*3+c = 10. Simplifying, 9a+3b+c=10.

This is a system of linear equations with three equations and three unknowns. The solution is described by (a,b,c) = (3/2, -13/2, 16). That is, f(x) = (3/2)x^2 - (13/2)x + 16. This generates the sequence

11, 9, 10, 14, 21, 31, ...

Obviously this is not the desired sequence, so a quadratic curve-fitting scheme is not feasible. I would proceed by next trying a cubic polynomial to model the first four terms, and if that doesn't work, a degree 4 polynomial to include the first five terms, and in the worst case, a degree 5 polynomial.

Of course there may be a much simpler explanation of your sequence that I'm blind to...

3. 11,9,10,17,36,79,170,357,736,1499,3030,6097,12236, 24519,...

4. ## ?

5. Hello, nsingh201!

Find the next two terms of this sequence: . $11,\: 9,\: 10,\: 17,\: 36,\: 79 \;\hdots$

Given a sequence of increasing terms, I take the differences of consecutive terms,
. . then the differences of the differences, and so on . . . hoping to find a pattern.

Here's what I found . . .

. . $\begin{array}{ccccccccccccc}
\text{Sequence} & 11 && 9 && 10 && 17 && 36 && 79 \\
\text{1st diff.} &&\text{-}2 && 1 && 7 && 19 && 43 \\
\text{2nd diff.} &&& 3 && 6 && 12 && 24 \\
\text{3rd diff.} &&&& 3 && 6 && 12 \end{array}$

Since the 3rd differences seem to be identical to the 2nd differences,
. . the function appears to be exponential.

I also suspect that the 2nd differences are doubling.

So I believe the chart can be continued like this;

. . $\begin{array}{cccccccccccccccccc}
\text{Sequence} & 11 && 9 && 10 && 17 && 36 && 79 && {\color{red}170} && {\color{red}357} \\
\text{1st diff.} &&\text{-}2 && 1 && 7 && 19 && 43 && {\color{blue}91} && {\color{blue}187} \\
\text{2nd diff.} &&& 3 && 6 && 12 && 24 && {\color{blue}48} && {\color{blue}96}\end{array}$

And I think the generating function is: . $f(n) \;=\;3\!\cdot\!2^{n-1} - 5n + 13$

6. Originally Posted by Soroban
Hello, nsingh201!

Given a sequence of increasing terms, I take the differences of consecutive terms,
. . then the differences of the differences, and so on . . . hoping to find a pattern.

Here's what I found . . .

. . $\begin{array}{ccccccccccccc}
\text{Sequence} & 11 && 9 && 10 && 17 && 36 && 79 \\
\text{1st diff.} &&\text{-}2 && 1 && 7 && 19 && 43 \\
\text{2nd diff.} &&& 3 && 6 && 12 && 24 \\
\text{3rd diff.} &&&& 3 && 6 && 12 \end{array}$

Since the 3rd differences seem to be identical to the 2nd differences,
. . the function appears to be exponential.

I also suspect that the 2nd differences are doubling.

So I believe the chart can be continued like this;

. . $\begin{array}{cccccccccccccccccc}
\text{Sequence} & 11 && 9 && 10 && 17 && 36 && 79 && {\color{red}170} && {\color{red}357} \\
\text{1st diff.} &&\text{-}2 && 1 && 7 && 19 && 43 && {\color{blue}91} && {\color{blue}187} \\
\text{2nd diff.} &&& 3 && 6 && 12 && 24 && {\color{blue}48} && {\color{blue}96}\end{array}$

And I think the generating function is: . $f(n) \;=\;3\!\cdot\!2^{n-1} - 5n + 13$

beautiful approach

7. 11, 9, 10, 17, 36, 79, - Wolfram|Alpha
2 Soroban
Nice solution, but how did u get generating function?

8. Hello, ICanFly!

I was afraid someone would ask . . .LOL!

. . .but how did u get generating function?

We have: . $11,\:9,\:10,\:17,\:36,\;\hdots$

And we know there is a "doubling" feature in there: . $2^n$

Since the doubling didn't begin until the second differences.
. . I assumed there was a linear or quadratic involved, too.

So, my first general function was: . $f(n) \:=\:A + Bn + C\!\cdot\!2^n$

I used the first three terms of the sequence:

. . $\begin{array}{ccccc}
f(1) = 11 & A + B + 2C &=& 11 & [1] \\
f(2) \:=\: 9\; & A + 2B + 4C &=& 9 & [2] \\
f(3) = 10 & A + 3B + 8C &=& 10 & [3] \end{array}$

$\begin{array}{ccccc}
\text{Subtract [2] - [1]:} & B + 2C &=& -2 & [4] \\
\text{Subtract [3] - [2]:} & B + 4C &=& 1 & [5] \end{array}$

$\text{Subtract [5] - [4]: }\;\;2C \:=\: 3 \quad\Rightarrow\quad C \:=\:\tfrac{3}{2}$

Substitute into [4]: . $B + 3 \:=\:-2 \quad\Rightarrow\quad B \:=\:-5$

Substitute into [1]: . $A - 5 + 3 \:=\:11 \quad\Rightarrow\quad A \:=\:13$

Hence: . $f(n) \;=\;13 - 5n + \tfrac{3}{2}\!\cdot\!2^n$

I tested my function up to the 8th term . . . It works!

. . Therefore: . $f(n) \;=\;3\!\cdot\!2^{n-1} - 5n + 13$

9. Beautiful

10. thanks so much. this all really helped.


# 1/998001

#### Jameson

Staff member
$$\displaystyle \frac{1}{998001}$$ has some interesting properties. It will list out every 3 digit number except for 998.

It has the form 0.001002003004...

Here's a video on some more details if you're interested.

#### MarkFL

Staff member
soroban once posted this observation and asked:

This is just one of a family of such fractions.
Can you determine the underlying characteristic?
I looked at the factorization of the denominator, and found:

$\displaystyle 998001=999^2$

So, next I looked at:

$\displaystyle\frac{012345679}{999999999}=\frac{1}{9^2}$

Thus, I conjecture that the family you speak of is:

$\displaystyle\frac{1}{(10^n-1)^2}$ where $\displaystyle n\in\mathbb N$

where the decimal representation contains all of the $n$ digit numbers except $\displaystyle 10^n-2$ and the period is $\displaystyle n(10^n-1)$.

#### Jameson

Staff member

Yes, you are correct about this form. For example $$\displaystyle \frac{1}{9999^2}$$ gives all of the 4 digit numbers.

In the video I posted in the OP they discussed an easy way to write recurring decimals as fractions that I'm sure we are all familiar with this method but it's still worth writing for those who aren't.

If you want to write some repeating decimal all you do is write the string as the numerator to a fraction and then in the denominator write the same number of 9's. For example, if you want to write $$\displaystyle .\overline{12436298}$$ as a fraction. It's simply $$\displaystyle \frac{12436298}{99999999}$$. Of course this method can be derived quite easily. If $$\displaystyle x=.12436298$$ then $100000000x=12436298.\overline{12436298}$ so $9999999x=12436298$ and we can solve for x directly. However it's nice to know a shortcut to not have to calculate it "the long way" everytime.

Last edited:

#### Bacterius

##### Well-known member
MHB Math Helper
This seems to generalize to an arbitrary base $b$, where:

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

has representation in base $b$ containing all $n$-digit numbers (in base $b$) except $b^n - 2$ and with period $n(b^n - 1)$.

But I only checked a couple of bases, so this could be wrong.

#### MarkFL

Staff member
This seems to generalize to an arbitrary base $b$, where:

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

has representation in base $b$ containing all $n$-digit numbers (in base $b$) except $b^n - 2$ and with period $n(b^n - 1)$.

But I only checked a couple of bases, so this could be wrong.
I believe you are right, as the method Jameson outlined above can be generalized to any valid radix.

#### alane1994

##### Active member
Not much to contribute to this conversation, I was just popping in to say that this is really interesting!


# Complex Numbers and the Norm

I am given that for a complex number $w=a+bi$, define $\overline{w}=a-bi$ and $N(w)=w \overline{w}$. I have provided my answers for parts a and b, but I am not sure they are correct. I need help with figuring out part c.

(a) Compute $N(w)=w \overline{w}$ explicitly.

Here is what I have gotten:$N(w)=w \overline{w}= (a+bi)(a-bi)= a^2+b^2$.

(b) Show that $N(rs)=N(r)N(s)$ for any two complex numbers $r,s$.

Here is my work:

Let $r=a+bi$, $s=c+di$

Then $$rs=(a+bi)(c+di)=ac+adi+cbi-bd=(ac-bd)+(ad+cb)i.$$

Now, from a, have that $N(r)= a^2+b^2$ and $N(s)= c^2+d^2$. So, $$N(r)N(s)=(a^2+b^2)(c^2+d^2).$$

Also, $N(rs)=N((ac-bd)+(ad+cb)i)$ and from part a then, $N(rs)=(ac-bd)^2+(ad+cb)^2$

When expanded,

$$a^2c^2-abcd-abcd+b^2d^2+a^2d^2+abcd+abcd+b^2c^2$$

\begin{align*} &=a^2c^2+a^2d^2+b^2d^2+b^2c^2\\ &=a^2(c^2+d^2)+b^2(c^2+d^2)\\ &=(a^2+b^2)(c^2+d^2). \end{align*}

Hence, $N(rs)=N(r)N(s)$.

(c) Prove that $N(\overline{v})=N(v)$ and $N(v^n)=N(v)^n$ for any complex number.

This is the part I am confused as to how to prove. I let $v=a+bi$ and $\overline{v}=a-bi$. Then I am not sure how to use what I have shown before for this part.

• (1) Please put distinct parts into distinct questions. (2) Please use MathJax to format your math, it makes it a lot easier to read. Apr 16 '17 at 21:35
• @MichaelBurr Sorry, I do not know how to use MathJax, I tried my best to put it in the format. I labeled the parts a-c, but I will rename to make is clearer. Apr 16 '17 at 21:38
• What I mean is that if you have three parts, you should have three questions (one question for part $(a)$, one question for part $(b)$, and one question for part $(c)$). Apr 16 '17 at 21:39
• @MichaelBurr Okay, noted, thank you. It is just that is all one problem that has three parts and I wanted to see if my part a and b are okay to then get help for c. Apr 16 '17 at 21:40
• Also, to learn about MathJax, see the tutorial here. Apr 16 '17 at 21:41

For the first part of your question, notice that $$N (v)=\bar{v} v=\bar{v} \bar{\bar{v}}=N (\bar{v})$$ because $\bar{\bar{v}}=v$.

For the second part, consider doing induction over $n$:

Induction basis: $n=1$ $$N (v^1)=N (v)=N (v)^1$$

Induction step: $$N (v^{n+1})=N (v^n\cdot v)=N (v^n) \cdot N (v)=N (v)^n \cdot N (v)=N (v)^{n+1}$$ For the third from last step we used your result from b, for the second from last we used the induction hypothesis.

• Fixed now, thanks a lot. The way it was before, I did not like it either, but I did not know there is also \bar. Apr 16 '17 at 22:21
• Personally, I often use \overline because \bar is intended to be used as accent, but in this particular case overline looks plain ugly. Apr 16 '17 at 22:26

Since your question is about part $(c)$...

• To prove $N(v)=N(\overline{v})$, use your formula for $N$ in part $(a)$ on each of $v$ and $\overline{v}$. As stated, the question is somewhat confusing because $a$ and $b$ are used in two ways in the problem. In part $(a)$, $N(v)=a^2+b^2$ when $v=a+bi$. For part $(c)$, we could use $w=c+di$ and $\overline{w}=c-di$, then $N(w)=c^2+d^2$ (by substituting the variables in $w$ into the form for part $(a)$) and $N(\overline{w})=c^2+(-d)^2$ by the same substitution.

• To prove $N(v^n)=N(v)^n$, use your equality in part $(b)$ as well as induction on $n$. The base case is $N(v^1)=N(v)^1$, and then use part $(b)$ to prove $N(v^{k+1})=N(v)^{k+1}$ using $N(v^k)=N(v)^k$.

• For $N(v)=N(\overline{v})$ I know I will get a$^2$+b$^2$ for v, but how can I just plug in $\overline{v}$ into the equation if this is for v not $\overline{v}$? Apr 16 '17 at 21:43
• You have a general formula, it might be confusing because you're using $a$ and $b$ in two different roles, I'll edit to make this more clear. Apr 16 '17 at 21:44
• Okay so when plugging in $\overline{w}=c-di$ into the given equation for (a), what exactly is happening? I am not sure how you got (-d)$^2$ because wouldn't this be showing the equations are not equal? Apr 16 '17 at 21:50
• What is the square of a negative real number? Apr 16 '17 at 21:54
• @Pam_22R This shows that the terms are equal since $(-d)^2=-d\cdot (-d)=d^2$. Apr 16 '17 at 21:55


### Statistics Knowledge Portal

A free online introduction to statistics

# Chi-Square Goodness of Fit Test

## What is the Chi-square goodness of fit test?

The Chi-square goodness of fit test is a statistical hypothesis test used to determine whether a variable is likely to come from a specified distribution or not. It is often used to evaluate whether sample data is representative of the full population.

## When can I use the test?

You can use the test when you have counts of values for a categorical variable.

Yes.

## Using the Chi-square goodness of fit test

The Chi-square goodness of fit test checks whether your sample data is likely to be from a specific theoretical distribution. We have a set of data values, and an idea about how the data values are distributed. The test gives us a way to decide if the data values have a “good enough” fit to our idea, or if our idea is questionable.

### What do we need?

For the goodness of fit test, we need one variable. We also need an idea, or hypothesis, about how that variable is distributed. Here are a couple of examples:

• We have bags of candy with five flavors in each bag. The bags should contain an equal number of pieces of each flavor. The idea we'd like to test is that the proportions of the five flavors in each bag are the same.
• For a group of children’s sports teams, we want children with a lot of experience, some experience and no experience shared evenly across the teams. Suppose we know that 20 percent of the players in the league have a lot of experience, 65 percent have some experience and 15 percent are new players with no experience. The idea we'd like to test is that each team has the same proportion of children with a lot, some or no experience as the league as a whole.

To apply the goodness of fit test to a data set we need:

• Data values that are a simple random sample from the full population.
• Categorical or nominal data. The Chi-square goodness of fit test is not appropriate for continuous data.
• A data set that is large enough so that at least five values are expected in each of the observed data categories.

## Chi-square goodness of fit test example

Let’s use the bags of candy as an example. We collect a random sample of ten bags. Each bag has 100 pieces of candy and five flavors. Our hypothesis is that the proportions of the five flavors in each bag are the same.

Let’s start by answering: Is the Chi-square goodness of fit test an appropriate method to evaluate the distribution of flavors in bags of candy?

• We have a simple random sample of 10 bags of candy. We meet this requirement.
• Our categorical variable is the flavors of candy. We have the count of each flavor in 10 bags of candy. We meet this requirement.
• Each bag has 100 pieces of candy. Each bag has five flavors of candy. We expect to have equal numbers for each flavor. This means we expect 100 / 5 = 20 pieces of candy in each flavor from each bag. For 10 bags in our sample, we expect 10 x 20 = 200 pieces of candy in each flavor. This is more than the requirement of five expected values in each category.

Based on the answers above, yes, the Chi-square goodness of fit test is an appropriate method to evaluate the distribution of the flavors in bags of candy.

Figure 1 below shows the combined flavor counts from all 10 bags of candy.

Figure 1: Bar chart of counts of candy flavors from all 10 bags

Without doing any statistics, we can see that the number of pieces for each flavor are not the same. Some flavors have fewer than the expected 200 pieces and some have more. But how different are the proportions of flavors? Are the number of pieces “close enough” for us to conclude that across many bags there are the same number of pieces for each flavor? Or are the number of pieces too different for us to draw this conclusion? Another way to phrase this is, do our data values give a “good enough” fit to the idea of equal numbers of pieces of candy for each flavor or not?

To decide, we find the difference between what we have and what we expect. Then, to give flavors with fewer pieces than expected the same importance as flavors with more pieces than expected, we square the difference. Next, we divide the square by the expected count, and sum those values. This gives us our test statistic.

These steps are much easier to understand using numbers from our example.

Let’s start by listing what we expect if each bag has the same number of pieces for each flavor.  Above, we calculated this as 200 for 10 bags of candy.

#### Table 1: Comparison of actual vs expected number of pieces of each flavor of candy

 Flavor Number of Pieces of Candy (10 bags) Expected Number of Pieces of Candy Apple 180 200 Lime 250 200 Cherry 120 200 Cherry 225 200 Grape 225 200

Now, we find the difference between what we have observed in our data and what we expect. The last column in Table 2 below shows this difference:

#### Table 2: Difference between observed and expected pieces of candy by flavor

 Flavor Number of Pieces of Candy (10 bags) Expected Number of Pieces of Candy Observed-Expected Apple 180 200 180-200 = -20 Lime 250 200 250-200 = 50 Cherry 120 200 120-200 = -80 Orange 225 200 225-200 = 25 Grape 225 200 225-200 = 25

Some of the differences are positive and some are negative. If we simply added them up, we would get zero. Instead, we square the differences. This gives equal importance to the flavors of candy that have fewer pieces than expected, and the flavors that have more pieces than expected.

#### Table 3: Calculation of the squared difference between Observed and Expected for each flavor of candy

 Flavor Number of Pieces of Candy (10 bags) Expected Number of Pieces of Candy Observed-Expected Squared Difference Apple 180 200 180-200 = -20 400 Lime 250 200 250-200 = 50 2500 Cherry 120 200 120-200 = -80 6400 Orange 225 200 225-200 = 25 625 Grape 225 200 225-200 = 25 625

Next, we divide the squared difference by the expected number:

#### Table 4: Calculation of the squared difference/expected number of pieces of candy per flavor

 Flavor Number of Pieces of Candy (10 bags) Expected Number of Pieces of Candy Observed-Expected Squared Difference Squared Difference / Expected Number Apple 180 200 180-200 = -20 400 400 / 200 = 2 Lime 250 200 250-200 = 50 2500 2500 / 200 = 12.5 Cherry 120 200 120-200 = -80 6400 6400 / 200 = 32 Orange 225 200 225-200 = 25 625 625 / 200 = 3.125 Grape 225 200 225-200 = 25 625 625 / 200 = 3.125

Finally, we add the numbers in the final column to calculate our test statistic:

$2 + 12.5 + 32 + 3.125 + 3.125 = 52.75$

To draw a conclusion, we compare the test statistic to a critical value from the Chi-Square distribution. This activity involves four steps:

1. We first decide on the risk we are willing to take of drawing an incorrect conclusion based on our sample observations. For the candy data, we decide prior to collecting data that we are willing to take a 5% risk of concluding that the flavor counts in each bag across the full population are not equal when they really are. In statistics-speak, we set the significance level, α , to 0.05.
2. We calculate a test statistic. Our test statistic is 52.75.
3. We find the theoretical value from the Chi-square distribution based on our significance level. The theoretical value is the value we would expect if the bags contain the same number of pieces of candy for each flavor.

In addition to the significance level, we also need the degrees of freedom to find this value. For the goodness of fit test, this is one fewer than the number of categories. We have five flavors of candy, so we have 5 – 1 = 4 degrees of freedom.

The Chi-square value with α = 0.05 and 4 degrees of freedom is 9.488.
4. We compare the value of our test statistic (52.75) to the Chi-square value. Since 52.75 > 9.488, we reject the null hypothesis that the proportions of flavors of candy are equal.

We make a practical conclusion that bags of candy across the full population do not have an equal number of pieces for the five flavors. This makes sense if you look at the original data. If your favorite flavor is Lime, you are likely to have more of your favorite flavor than the other flavors. If your favorite flavor is Cherry, you are likely to be unhappy because there will be fewer pieces of Cherry candy than you expect.

### Understanding results

Let’s use a few graphs to understand the test and the results.

A simple bar chart of the data shows the observed counts for the flavors of candy:

Figure 2: Bar chart of observed counts for flavors of candy

Another simple bar chart shows the expected counts of 200 per flavor. This is what our chart would look like if the bags of candy had an equal number of pieces of each flavor.

Figure 3: Bar chart of expected counts of each flavor

The side-by-side chart below shows the actual observed number of pieces of candy in blue. The orange bars show the expected number of pieces. You can see that some flavors have more pieces than we expect, and other flavors have fewer pieces.

Figure 4: Bar chart comparing actual vs. expected counts of candy

The statistical test is a way to quantify the difference. Is the actual data from our sample “close enough” to what is expected to conclude that the flavor proportions in the full population of bags are equal? Or not? From the candy data above, most people would say the data is not “close enough” even without a statistical test.

What if your data looked like the example in Figure 5 below instead? The purple bars show the observed counts and the orange bars show the expected counts. Some people would say the data is “close enough” but others would say it is not. The statistical test gives a common way to make the decision, so that everyone makes the same decision on a set of data values.

Figure 5: Bar chart comparing expected and actual values using another example data set

### Statistical details

Let’s look at the candy data and the Chi-square test for goodness of fit using statistical terms. This test is also known as Pearson’s Chi-square test.

Our null hypothesis is that the proportion of flavors in each bag is the same. We have five flavors. The null hypothesis is written as:

$H_0: p_1 = p_2 = p_3 = p_4 = p_5$

The formula above uses p for the proportion of each flavor. If each 100-piece bag contains equal numbers of pieces of candy for each of the five flavors, then the bag contains 20 pieces of each flavor. The proportion of each flavor is 20 / 100 = 0.2.

The alternative hypothesis is that at least one of the proportions is different from the others. This is written as:

$H_a: at\ least\ one\ p_i\ not\ equal$

In some cases, we are not testing for equal proportions. Look again at the example of children's sports teams near the top of this page.  Using that as an example, our null and alternative hypotheses are:

$H_0: p_1 = 0.2, p_2 = 0.65, p_3 = 0.15$

$H_a: at\ least\ one\ p_i\ not\ equal\ to\ expected\ value$

Unlike other hypotheses that involve a single population parameter, we cannot use just a formula. We need to use words as well as symbols to describe our hypotheses.

We calculate the test statistic using the formula below:

$\sum^n_{i=1} \frac{(O_i-E_i)^2}{E_i}$

In the formula above, we have n groups. The $\sum$ symbol means to add up the calculations for each group. For each group, we do the same steps as in the candy example. The formula shows Oi  as the Observed value and Ei  as the Expected value for a group.

We then compare the test statistic to a Chi-square value with our chosen significance level (also called the alpha level) and the degrees of freedom for our data. Using the candy data as an example, we set α = 0.05 and have four degrees of freedom. For the candy data, the Chi-square value is written as:

$χ²_{0.05,4}$

There are two possible results from our comparison:

• The test statistic is lower than the Chi-square value. You fail to reject the hypothesis of equal proportions. You conclude that the bags of candy across the entire population have the same number of pieces of each flavor in them. The fit of equal proportions is “good enough.”
• The test statistic is higher than the Chi-Square value. You reject the hypothesis of equal proportions. You cannot conclude that the bags of candy have the same number of pieces of each flavor. The fit of equal proportions is “not good enough.”

Let’s use a graph of the Chi-square distribution to better understand the test results. You are checking to see if your test statistic is a more extreme value in the distribution than the critical value. The distribution below shows a Chi-square distribution with four degrees of freedom. It shows how the critical value of 9.488 “cuts off” 95% of the data. Only 5% of the data is greater than 9.488.

Figure 6: Chi-square distribution for four degrees of freedom

The next distribution plot includes our results. You can see how far out “in the tail” our test statistic is, represented by the dotted line at 52.75. In fact, with this scale, it looks like the curve is at zero where it intersects with the dotted line. It isn’t, but it is very, very close to zero. We conclude that it is very unlikely for this situation to happen by chance. If the true population of bags of candy had equal flavor counts, we would be extremely unlikely to see the results that we collected from our random sample of 10 bags.

Figure 7: Chi-square distribution for four degrees of freedom with test statistic plotted

Most statistical software shows the p-value for a test. This is the likelihood of finding a more extreme value for the test statistic in a similar sample, assuming that the null hypothesis is correct. It’s difficult to calculate the p-value by hand. For the figure above, if the test statistic is exactly 9.488, then the p-value will be p=0.05. With the test statistic of 52.75, the p-value is very, very small. In this example, most statistical software will report the p-value as “p < 0.0001.” This means that the likelihood of another sample of 10 bags of candy resulting in a more extreme value for the test statistic is less than one chance in 10,000, assuming our null hypothesis of equal counts of flavors is true.


# Telescoping series of form $\sum (n+1)\cdots(n+k)$ [duplicate]

Wolfram Alpha is able to telescope sums of the form $\sum (n+1)\cdots(n+k)$

e.g. $(1\cdot2\cdot3) + (2\cdot3\cdot4) + \cdots + n(n+1)(n+2)$

How does it do it?

EDIT: We can rewrite as: $\sum {(n+k)! \over n!} = \sum k!{(n+k)!\over n!k!} = \sum k!{{n+k} \choose n}$ (Thanks Daniel Fischer)

EDIT2: We can also multiply out and split sums. So e.g.

$$\sum (n-1)n(n+1) = \sum (n^3-n) = \sum n^3 - \sum n$$

But sums of powers actually seem to be more nasty than the original question, involving Bernoulli numbers. (Thanks Claude Leibovici)

And is there any name for this particular corner of maths? (i.e. How might I go about searching the Internet for information regarding this?)

PS please could we have a 'telescoping' tag?

## marked as duplicate by user147263, Community♦Dec 24 '15 at 20:42

• Note that the terms are $k!\binom{n+k}{n}$. You probably know a bit about binomial coefficients that helps summing. – Daniel Fischer Sep 1 '14 at 10:07
• I don't understand why you speak about "telescoping". Beside Daniel Fischer's suggestion, you could also develop $i(i+1)(i+2)= i^3+3 i^2+2 i$ and compute the three sums. – Claude Leibovici Sep 1 '14 at 10:16
• Is the sum over n or k? Makes a big difference. – marty cohen Sep 1 '14 at 15:18
• What great answers! Now I am stuck. Both RobJohn and HyperGeometric have nailed it from opposite directions. To accept either answer above the other would not seem right. I guess I will leave it open until SE provides some machinery for resolving these situations. – P i Sep 1 '14 at 17:49
• @P-i- Thank you! That's very considerate of you. It was an interesting question, which I enjoyed solving. I've upvoted the question as well. Have also just posted a comment on a recent observation on its resemblance to the power integral. A related question which you might want to pose would be to find the sum of a series with each term being the reciprocal of the corresponding in the present series, i.e the reciprocal of the product of consecutive integers. – hypergeometric Sep 4 '14 at 6:14

Hint: $$\sum_{n=k}^m\binom{n}{k}=\binom{m+1}{k+1}$$ A generalization is discussed in this answer. The equation above is equation $(1)$ with $m=0$.

Telescoping sum

To turn the sum in the question into a "telescoping sum", we can use the recurrence for Pascal's Triangle: $$\binom{n+1}{k+1}=\binom{n}{k}+\binom{n}{k+1}$$ Using this recurrence, we get \begin{align} \sum_{n=k}^m\binom{n}{k} &=\sum_{n=k}^m\left[\binom{n+1}{k+1}-\binom{n}{k+1}\right]\\ &=\sum_{n=k+1}^{m+1}\binom{n}{k+1}-\sum_{n=k}^m\binom{n}{k+1}\\ &=\left[\binom{m+1}{k+1}+\color{#C00000}{\sum_{n=k+1}^m\binom{n}{k+1}}\right]-\left[\binom{k}{k+1}+\color{#C00000}{\sum_{n=k+1}^m\binom{n}{k+1}}\right]\\ &=\binom{m+1}{k+1}-\binom{k}{k+1}\\ &=\binom{m+1}{k+1} \end{align} The sums in red are the terms that are telescoped out, leaving just the first and last terms. In this case, the last term $\binom{k}{k+1}=0$.

Let $$p_n=\prod_{r=1}^k (n+r)=\overbrace{(n+1)(n+2)\cdots(n+k)}^{k \ \text{terms}}$$ which is the product of $k$ consecutive integers.

Consider the difference of two consecutive terms, where each term is the product of $k+1$ consecutive integers, i.e. \begin{align} &\prod_{r=1}^{k+1}(n+r)-\prod_{r=0}^k(n+r)\\ &=\overbrace{\underbrace{(n+1)(n+2)\cdots(n+k)}_{p_n}(n+k+1)}^{(k+1) \ \text{terms}}-\overbrace{n\underbrace{(n+1)(n+2)\cdots(n+k)}_{p_n}}^{(k+1) \ \text{terms}}\\ &=p_n[(n+k+1)-n]\\ &=p_n(1+k) \end{align}

Hence, $$p_n=\prod_{r=1}^k (n+r)=\frac1{1+k}\left[\prod_{r=1}^{k+1} (n+r)-\prod_{r=0}^k (n+r) \right]$$ which is convenient for telescoping.

Required summation, \begin{align} S=\sum_{n=0}^{m}p_n&=\sum_{n=0}^{m} \prod_{r=1}^{k} (n+r)=\sum_{n=0}^{m}(n+1)(n+2)(n+3)\cdots (n+k)\\ &=\frac1{k+1}\sum_{n=0}^{m} \left[ \prod_{r=1}^{k+1} (n+r)-\prod_{r=0}^{k} (n+r)\right]\\ &=\frac1{k+1}\prod_{r=1}^{k+1} (m+r) \qquad \blacksquare\end{align} by telescoping.

In your example, $k=3$, hence the general term is

$$(n+1)(n+2)(n+3)=\frac14\left[(n+1)(n+2)(n+3)(n+4)-n(n+1)(n+2)(n+3)\right]$$

Hence, by telescoping from $n=0$ to $m$, \begin{align}S&=1\cdot2\cdot3+2\cdot3 \cdot 4+\cdots +(m+1)(m+2)(m+3)\\ &=\frac14(m+1)(m+2)(m+3)(m+4) \end{align}

NB: It is interesting to note that this result bears a striking resemblance to integration.

Compare the standard integral $$\int_0^m n^k dn=\frac{m^{k+1}}{k+1}$$ to the result of the summation above, which can also be stated as $$\sum_{n=0}^{m}n^{[k]}=\frac {m^{[k+1]}}{k+1}$$ where $n^{[k]}$ is my adjusted* Pochhammer symbol for rising factorials, defined as $$n^{[k]}=\prod_{r=1}^{k}(n+r)=(n+1)(n+2)(n+3)\cdots(n+k)$$

The actual Pochhammer symbol for rising factorials, $n^{(k)}$, starts from $n$ itself and not $n+1$, i.e. $$n^{(k)}=\prod_{r=1}^{k}(n+r-1)=n(n+1)(n+2)\cdots(n+k-1)$$

• I've upvoted this as it appears valid. But I can't see any clear motivation for the initial algebraic manipulations. Is it possible to rework this logic in a way that does not require inspirational leaps? – P i Sep 1 '14 at 14:08
• @P-i- - thank you, that's very kind :) in order to make the series telescope, the approach is to convert one term (or product, in this case) into a difference of two terms, usually of a higher 'order'. for instance, to telescope the sum of squares, one would start from the difference of cubes. in this case, we want to sum $k$-term products hence we start from the difference of two consecutive $(k+1)$-term products. – hypergeometric Sep 1 '14 at 14:19
• @P-i- - the proposed solution has been reworked slightly and hopefully this provides greater clarity. – hypergeometric Sep 1 '14 at 14:30
• thanks to all who upvoted. a short appendix has been added to the solution to highlight the resemblance of the summation result to the standard power integral. comments are most welcome. – hypergeometric Sep 3 '14 at 15:22

For completeness, a solution using the combinatorial/binomial approach, as initiated by RobJohn:

Let $p(n, k) =n(n+1)...(n+k-1) =\prod_{j=0}^{k-1} (n+j)$.

Then (writing each step in detail)

$\begin{array}\\ p(n+1, k)-p(n, k) &=\prod_{j=0}^{k-1} (n+1+j)-\prod_{j=0}^{k-1} (n+j)\\ &=\prod_{j=1}^{k} (n+j)-\prod_{j=0}^{k-1} (n+j)\\ &=(n+k)\prod_{j=1}^{k-1} (n+j)-n\prod_{j=1}^{k-1} (n+j)\\ &=((n+k)-n)\prod_{j=1}^{k-1} (n+j)\\ &=k\prod_{j=1}^{k-1} (n+j)\\ &=k\prod_{j=0}^{k-2} (n+1+j)\\ &=kp(n+1, k-1)\\ \end{array}$

or, putting $k+1$ for $k$ and $n$ for $n+1$, $p(n, k) =\frac{p(n, k+1)-p(n-1. k+1)}{k+1}$.

Therefore

$\begin{array}\\ \sum_{n=1}^M p(n, k) &=\sum_{n=1}^M \frac{p(n, k+1)-p(n-1. k-1)}{k+1}\\ &=\frac1{k+1}\sum_{n=1}^M (p(n, k+1)-p(n-1. k+1))\\ &=\frac1{k+1}(p(M, k+1)-p(0, k+1))\\ &=\frac{p(M, k+1)}{k+1}\\ \end{array}$

• This proof is succinct and flawless! Thanks Marty! – P i Sep 2 '14 at 11:38

Also your terms can be re written as $$n(n+1)(n+2)=\dfrac{n(n+1)(n+2)(n+3)}{4}-\dfrac{(n-1)n(n+1)(n+2)}{4}.$$

• that may be correct but it would not telescope readily... – hypergeometric Sep 1 '14 at 15:24
• Now it is fine. – Bumblebee Sep 2 '14 at 5:06

Following from RobJohn's hint, this can be proved very simply by reverse-engineering the hockey-stick identity.

The blues sum to the red for any given 'hockey-stick'.

It is a straightforward proof by induction. For example, in the picture, 1+3+6+10+15 = 35, so 1+3+6+10+15 + 21 = 35+21 = 56

i.e. True(stick length k) => True(stick length k+1)

Induction can also be argued from the ${n \choose r}$ formula, but the above method avoids algebraic manipulation, working instead from the simple "each element is formed by summing its upper neighbours" definition of Pascal's Triangle.

But now we DO need some algebraic manipulation.

We write this hockey-stick identity as:

$${k+0 \choose k} + ... + {k+n \choose k} = {k+(n+1) \choose (k+1)}$$

(notice the hockey stick has been reflected)

$${(k+0)! \over {k!((k+0)-k)!}} + ... + {(k+n)! \over {k!((k+n)-k)!}} = {(k+(n+1))! \over {(k+1)!(((k+(n+1))-(k+1))!}}$$

$${(k+0)! \over 0!} + ... + {(k+n)! \over n!} = {1 \over {k+1}} \cdot {(k+(n+1))! \over n!}$$

So the original question turns out to be an emergent property of Pascal's Triangle, and I would hazard a guess that it is from this simple construct that the question originally arose.

However, this proof doesn't move forwards from start to finish in a sequence of intelligently chosen moves. It doesn't offer any insight into telescoping general sums, hence I am favouring hypergeometric's proof.

• thank you! glad you liked it :) robjohn's approach using the pascal triangle identity is quite useful too, and i have used a similar approach elsewhere on MSE for another question. – hypergeometric Sep 2 '14 at 6:28

$$\color{#66f}{\large\sum_{n = 0}^{m}\pars{n + 1}\ldots\pars{n + k} =k!\,{k + m + 1 \choose m}}$$

• blink complex analysis! That's fantastic! But how does the first path integral come from n+k choose k? – P i Sep 4 '14 at 12:45
• @P-i- That's an identity: $${a \choose b}=\oint_{0\ <\ \left\vert \,z\,\right\vert\ =\ c}{(1 + z)^a \over z^{b + 1}}\,{{\rm d}z \over 2\pi{\ic}}$$ It's valid for $c \in {\mathbb R}\,,\ c > 0$ and $b\ =\ 0,1,2,3,\ldots$ – Felix Marin Sep 4 '14 at 17:49

Induction

This question is actually a duplicate of: Finding a closed formula for $1\cdot2\cdot3\cdots k +\dots + n(n+1)(n+2)\cdots(k+n-1)$

But it is difficult to find duplicates when the question can only be expressed using maths symbols, and this question now acts as a more comprehensive resource.

One of the answers to that question is to manually construct formulae for the first few cases: $1+2+3+\dots+n$, $1\cdot2 +\dots + n\cdot(n+1)$, etc, notice a pattern and intuit a candidate formula, then prove this by induction.


# Polynomial division: an obvious trick? [reducing mod $\textit{simpler}$ multiples]

The following question was asked on a high school test, where the students were given a few minutes per question, at most:

Given that, $$P(x)=x^{104}+x^{93}+x^{82}+x^{71}+1$$ and, $$Q(x)=x^4+x^3+x^2+x+1$$ what is the remainder of $$P(x)$$ divided by $$Q(x)$$?

Let $$Q(x)=0$$. Multiplying both sides by $$x-1$$: $$(x-1)(x^4+x^3+x^2+x+1)=0 \implies x^5 - 1=0 \implies x^5 = 1$$ Substituting $$x^5=1$$ in $$P(x)$$ gives $$x^4+x^3+x^2+x+1$$. Thus, $$P(x)\equiv\mathbf0\pmod{Q(x)}$$

Obviously, a student is required to come up with a “trick” rather than doing brute force polynomial division. How is the student supposed to think of the suggested method? Is it obvious? How else could one approach the problem?

• One observation is that in that question the step of 'multiplying both sides by $x-1$' is only presentation and doesn't really represent any advantage for solving the problem. What is really important is observing that the roots of $Q$ are the fifths roots of $1$ besides $1$, or that is a factor of $x^5-1$. There are many ways to compute this remainder that are simple to do in a short time. So, don't include that 'multiplying by $x-1$' as part of what was required for the students to solve the problem – logarithm May 14 '19 at 15:48
• My approach would be to observe that the exponents on P(x) look like they're set up to produce an elegant answer. The common elegant answers are "1" and "0". Since the "+1"s on the polynomials are clearly intended to cancel out, the answer must be "0". – Mark May 14 '19 at 23:33
• I'm probably missing something, but... The above trick seems to show that when $Q(x) = 0$, $P(x) = Q(x)$. But (a) the original question didn't specify that $Q(x) = 0$; how do we know that the answer $P(x)\equiv\mathbf0\pmod{Q(x)}$ applies to other cases? and (b) the original question asks, "what is the remainder of $𝑃(𝑥)$ divided by $𝑄(𝑥)$?" but the answer given here says let $Q(x) = 0$; doesn't that mean that the remainder is not defined? en.wikipedia.org/wiki/Remainder#Polynomial_division – LarsH May 15 '19 at 21:06
• I added some explicit examples to the end of my answer to emphasize the ubiquity of that simple idea. – Bill Dubuque May 16 '19 at 13:49
• What kind of test? Is this part of a math competition, or a classroom precalculus exam? – PersonX May 16 '19 at 16:35

The key idea employed here is the method of simpler multiples - a very widely used technique. Note that $$\,Q\,$$ has a "simpler" multiple $$\,QR = x^5\!-\!1,\,$$ so we can first reduce $$P$$ modulo $$\,x^{\large 5}\! -\! 1\,$$ via $$\!\bmod x^{\large 5}-1\!:\,\ \color{#c00}{x^{\large 5}\equiv 1}\Rightarrow\, x^{\large r+5q^{\phantom{|}}}\!\!\equiv x^{\large r}(\color{#c00}{x^{\large 5}})^{\large q}\equiv x^{\large r},\,$$ then finally reduce that $$\!\bmod Q,\,$$ i.e.

$$P\bmod Q\, =\, (P\bmod QR)\bmod Q\qquad$$

This idea is ubiquitous, e.g. we already use it implicitly in grade school in radix $$10$$ to determine integer parity: first reduce mod $$10$$ to get the units digit, then reduce the units digits mod $$2,\,$$ i.e.

$$N \bmod 2\, = (N\bmod 2\cdot 5)\bmod 2\qquad\$$

i.e. an integer has the same parity (even / oddness) as that of its units digit. Similarly since $$7\cdot 11\cdot 13 = 10^{\large 3}\!+1$$ we can compute remainders mod $$7,11,13$$ by using $$\,\color{#c00}{10^{\large 3}\equiv -1},\,$$ e.g. $$\bmod 13\!:\,\ d_0+ d_1 \color{#c00}{10^{\large 3}} + d_2 (\color{#c00}{10^{\large 3}})^{\large 2}\!+\cdots\,$$ $$\equiv d_0 \color{#c00}{\bf -} d_1 + d_2+\cdots,\,$$ and, similar to the OP, by $$\,9\cdot 41\cdot 271 = 10^{\large 5}\!-1\,$$ we can compute remainders mod $$41$$ and $$271$$ by using $$\,\color{#c00}{10^5\!\equiv 1}$$

$$N \bmod 41\, = (N\bmod 10^{\large 5}\!-1)\bmod 41\quad$$

for example $$\bmod 41\!:\ 10000\color{#0a0}200038$$ $$\equiv (\color{#c00}{10^{\large 5}})^{\large 2}\! + \color{#0a0}2\cdot \color{#c00}{10^{\large 5}} + 38\equiv \color{#c00}1+\color{#0a0}2+38\equiv 41\equiv 0$$

Such "divisibility tests" are frequently encountered in elementary and high-school and provide excellent motivation for this method of "divide first by a simpler multiple of the divisor" or, more simply, "mod first by a simpler multiple of the modulus".

This idea of scaling to simpler multiples of the divisor is ubiquitous, e.g. it is employed analogously in the method of rationalizing denominators and in Gauss's algorithm for computing modular inverses.

For example, to divide by an algebraic number we can employ its norm as a simpler multiple, e.g. for $$\,w = a+b\sqrt{n}\,$$ we use $$\,ww' = (a+b\sqrt n)(a-b\sqrt n) = a^2-nb^2 = c\in\Bbb Q\ (\neq 0\,$$ by $$\,\sqrt{n}\not\in\Bbb Q),\,$$ which reduces division by an algebraic to simpler division by a rational, i.e. $$\, v/w = vw'/(ww'),$$ e.g.

$$\dfrac{1}{a+b\sqrt n}\, =\, \dfrac{1}{a+b\sqrt n}\, \dfrac{a-b\sqrt n}{a-b\sqrt n}\, =\, \dfrac{a-b\sqrt n}{a^2-nb^2}\,=\, {\frac{\small 1}{\small c}}(a-b\sqrt n)\qquad$$

so-called rationalizing the denominator. The same idea works even with $$\,{\rm\color{#c00}{nilpotents}}$$

$$\color{#c00}{t^n = 0}\ \Rightarrow\ \dfrac{1}{a-{ t}}\, =\, \dfrac{a^{n-1}+\cdots + t^{n-1}}{a^n-\color{#c00}{t^n}}\, =\, a^{-n}(a^{n-1}+\cdots + t^{n-1})\qquad$$

which simplifies by eliminating $$\,t\,$$ from the denominator, i.e. $$\,a-t\to a^n,\,$$ reducing the division to division by a simpler constant $$\,a^n\,$$ (vs. a simpler rational when rationalizing the denominator).

Another example is Gauss' algorithm, where we compute fractions $$\!\bmod m\,$$ by iteratively applying this idea of simplifying the denominator by scaling it to a smaller multiple. Here we scale $$\rm\color{#C00}{\frac{A}B} \to \frac{AN}{BN}\:$$ by the least $$\rm\,N\,$$ so that $$\rm\, BN \ge m,\,$$ reduce mod $$m,\,$$ then iterate this reduction, e.g.

$$\rm\\ mod\ 13\!:\,\ \color{#C00}{\frac{7}9} \,\equiv\, \frac{14}{18}\, \equiv\, \color{#C00}{\frac{1}5}\,\equiv\, \frac{3}{15}\,\equiv\, \color{#C00}{\frac{3}2} \,\equiv\, \frac{21}{14} \,\equiv\, \color{#C00}{\frac{8}1}\qquad\qquad$$

Denominators of the $$\color{#c00}{\rm reduced}$$ fractions decrease $$\,\color{#C00}{ 9 > 5 > 2> \ldots}\,$$ so reach $$\color{#C00}{1}\,$$ (not $$\,0\,$$ else the denominator would be a proper factor of the prime modulus; it may fail for composite modulus)

See here and its $$25$$ linked questions for more examples similar to the OP (some far less trivial).

Worth mention: there are simple algorithms for recognizing cyclotomics (and products of such), e.g. it's shown there that $$\, x^{16}+x^{14}-x^{10}-x^8-x^6+x^2+1$$ is cyclotomic (a factor of $$x^{60}-1),\,$$ so we can detect when the above methods apply for arbitrarily large degree divisors.

Let $$a$$ be zero of $$x^4+x^3+x^2+x+1=0$$. Obviously $$a\ne 1$$. Then $$a^4+a^3+a^2+a+1=0$$ so multiply this with $$a-1$$ we get $$a^5=1$$ (You can get this also from geometric series $$a^n+a^{n-1}+...+a^2+a+1 = {a^{n+1}-1\over a-1}$$ by putting $$n=4$$).

But then $$\begin{eqnarray} Q(a) &=& a^{100}\cdot a^4+a^{90}\cdot a^3+a^{80}\cdot a^2+a^{70}\cdot a+1\\ &=& a^4+a^3+a^2+a+1\\&=&0\end{eqnarray}$$

So each zero of $$Q(x)$$ is also a zero of $$P(x)$$ and since all 4 zeroes of $$Q(x)$$ are different we have $$Q(x)\mid P(x)$$.

• I think this is the approach that the examiners would expect from high school students. – Dancrumb May 14 '19 at 0:23
• From my perspective this is the best answer. (+1) – trancelocation May 14 '19 at 3:54
• The OP understands that after multiplication with $x-1$, the question became simpler, he/she asked how a student should find this trick. This answer is basically just a reformulation of the answer given in the question. I don't see the usefulness of this answer at all... (but it has 14 upvotes, so I might be missing something...) – user193810 May 14 '19 at 11:49
• @MariaMazur: A bit, but not really. It still feels like you stopped reading the question after "what is the remainder of P(x) divided by Q(x)?". You gave a correct answer to that question, but not to the real question. It is easy to prove that the 'trick' (multiplication by $x-1$) works and is correct, but you ignored the real question, and after your edit it is hidden as a small remark. But whatever, your answer is trivially better than mine, because I did not gave any, so I'll leave it here. – user193810 May 14 '19 at 13:25
• @Pakk: it hinges on spotting the standard identity: $Q(x) = 0$ gives the fifth roots of unity (other than x=1). It takes tons more work if you don't spot that; you could solve the quartic $Q(x) = 0$ then notice "Hey these are the other four fifth roots of unity, thus x^5 \equiv 1" then apply the information $x^5 \equiv 1$ to hugely simplify $P(x)$, and thus conclude $Q(x) \mid P(x)$ and remainder = 0. But that would be lots more work. (Yeah the first time I saw this trick back in HS I voiced the same objection about non-obviousness... this is why this identity is so pivotal to factorization) – smci May 16 '19 at 1:53

While it may be a standard technique, as Bill's response details, I wouldn't say it's at all obvious at High School level. As a pre-Olympiad challenge problem, however, it's a good one.

My intuition is via cyclotomic polynomials -- $$Q(x) = \Phi_5(x)$$, giving the idea to multiply through by $$x-1$$ -- but I doubt I would have recognised them before university: https://en.wikipedia.org/wiki/Cyclotomic_polynomial

• I would go even further. As a BSE graduate in engineering, this is not at all obvious to me. – MooseBoys May 14 '19 at 6:58
• @MooseBoys: I would go even further. As a PhD in Physics (admittedly many years ago), this is not at all obvious to me. – WoJ May 14 '19 at 9:04
• It may not be obvious in other contexts since you never had to use it, but I assure you that in Math Olympiad training it's a standard trick. All serious contestants will probably already have seen something similar. There's nothing outrageous or shameful in that; Olympiad-style math is simply different from what people use and need in other professional contexts (physicist/engineer) --- the focus on Euclidean geometry being a perfect example. – Federico Poloni May 14 '19 at 9:12
• @Federico Where in the question does it say that this is an Olympiad test? OP phrased their question as if it were applicable to all high school students. I'd guess that fewer than 5% of all students would get the correct answer. – MooseBoys May 14 '19 at 17:01
• @MooseBoys I agree with your estimate. The question is "is this obvious?", and my comment is "it is a standard problem for people who train for math Olympiads". I realize that it's a strong additional assumption. I'm not arguing that it's a good or bad problem: as you point out, to do that, we would at least have to know to which students it was given. – Federico Poloni May 14 '19 at 17:09

This may be accessible to a high school student:

$$x^{104}+x^{93}+x^{82}+x^{71}+1$$

$$= (x^{104}-x^4)+(x^{93}-x^3)+(x^{82}-x^2)+(x^{71}-x)+(x^4+x^3+x^2+x+1)$$

$$=x^4(x^{100}-1)+x^3(x^{90}-1)+x^2(x^{80}-1)+ x(x^{70}-1)+(x^4+x^3+x^2+x+1)$$

We know that $$(x^n-1)|(x^{mn}-1), m,n \in \mathbb{N}$$ so $$x^5-1$$ divides $$x^{100}-1, x^{90}-1$$ etc.

In turn $$x^5-1$$ is divisible by $$(x^4+x^3+x^2+x+1)$$ which concludes the proof

If it's not obvious, an examination of the question quickly reveals the trick. Say

$$P(x)=x^n$$

Then begin long division by $$Q(x)$$:

$$x^n-x^n-x^{n-1}-x^{n-2}-x^{n-3}-x^{n-4}$$ $$x^{n-5}$$ $$\dots$$ $$x^{n-5k}$$

While it may not be obvious just by looking at the question, anyone who attempts the naive solution has (at least) a reasonable chance of running across a way of solving it.

• This is a good point. If one is asked to perform division by a polynomial $Q(x)$, it is natural to start with dividing $x^n$ for $n> \deg(Q)$. Thus the first step is to divide $x^5$. Magically(!), one gets the remainder 1. So, one can discover the formula in the form $x^5=(x-1)(x^4+x^3+x^2+x+1) + 1$ even if one didn't remember it. The rest of the steps are not too difficult. – Kapil May 14 '19 at 4:07

I would have thought that bright students, who knew $$1+x+x^2+\cdots +x^{n-1}= \frac{x^n-1}{x-1}$$ as a geometric series formula, could say

$$\dfrac{P(x)}{Q(x)} =\dfrac{x^{104}+x^{93}+x^{82}+x^{71}+1}{x^4+x^3+x^2+x+1}$$

$$=\dfrac{(x^{104}+x^{93}+x^{82}+x^{71}+1)(x-1)}{(x^4+x^3+x^2+x+1)(x-1)}$$

$$=\dfrac{x^{105}-x^{104}+x^{94}-x^{93}+x^{83}-x^{82}+x^{72}-x^{71}+x-1}{x^5-1}$$

$$=\dfrac{x^{105}-1}{x^5-1}-\dfrac{x^{104}-x^{94}}{x^5-1}-\dfrac{x^{93}-x^{83}}{x^5-1}-\dfrac{x^{82}-x^{72}}{x^5-1}-\dfrac{x^{71}-x}{x^5-1}$$

$$=\dfrac{x^{105}-1}{x^5-1}-x^{94}\dfrac{x^{10}-1}{x^5-1}-x^{83}\dfrac{x^{10}-1}{x^5-1}-x^{72}\dfrac{x^{10}-1}{x^5-1}-x\dfrac{x^{70}-1}{x^5-1}$$

and that each division at the end would leave zero remainder for the same reason, replacing the original $$x$$ by $$x^5$$

I think if the candidates know what a geometric series is, the question is okay. Indeed, one uses exactly this trick to find the formula for the geometric series, i.e. one writes $$(x-1)\sum_{k=1}^nx^k=x^{n+1}-1$$ to find that $$\sum_{k=1}^\infty x^k=\lim_{n\to\infty}\sum_{k=1}^nx^k=\lim_{n\to\infty}\frac{x^{n+1}-1}{x-1}=\frac{1}{1-x}$$ for $$|x|<1$$. Therefore, it is not too hard to get from $$x^4+x^3+x^2+x+1$$ to $$x^5-1$$. Now you can reduce mod $$x^5-1$$ by substitution $$x^5=1$$.

I think the way one should think about this is to note that $$x^4+x^3+x^2+x+1$$ is the minimal polynomial of any primitive 5th unit root $$\alpha$$. Now $$P(\alpha)=0$$ since $$\alpha^5=1$$ and therefore $$Q$$ devides $$P$$.


Rational and irrational sequences

1. Let $(x_n)$ be a sequence of rational numbers that converges to an irrational number $x$. Must it be the case that $x_1, x_2, \dots$ are all irrational?

2. Let $(y_n)$ be a sequence that converges to a rational number $y$. Define such a sequence where $y_1, y_2, \dots$ are all irrational.

Now these are the 2 questions in my textbook i noticed when posting this that someone had asked the answer to 1) and a similar but less difficult version of 2.

A couple things i noted the defined answer for 1 he used $\pi$ and simply added more digits to it for each part of the sequence. so firstly id like to ask would that really be a full mark answer on a analysis final? secondly and more importantly i was wondering if there was a way to define this where the final number wasn't transcendental.

For 1) I used $(1+1/n)^n$ s.t. $n \in \mathbb{N}$. For every $n$ this sequence is rational but for $\lim_{ n \to \infty }(1+1/n)^n = e$.

My Question: (i) Is this true and if so is there a definable sequence that holds but doesn't define a transcendental number?

EDIT: Golden ratio from Fibonacci sequence.

For 2) I picked $2^{1/n}$ s.t. $n>1$ and $n \in \mathbb{N}$. I believe every value of this sequence is irrational but the limit should be 1.

My Question: (ii) does the above work? and if possible could I have another example of a sequence where every value is irrational but the limit is rational?

EDIT: $\frac{\sqrt 2}{n}$.

• If $(x_n)$ converges to $x$ is the answer to part (i) (and all the $x_n$ are non-zero), then $(x_n/x)$ is a solution to part (ii). Sep 14 '16 at 2:54
• thats very clever thanks! Sep 14 '16 at 3:00

You basically have both answers right, just need a couple of tweaks.

Question:(i) Is this true and if so is there a definable sequence that holds but doesnt define a transcendental number?

It is true that $a_n = (1 + \frac{1}{n})^n$ is a sequence of rationals whose $\lim_{n \to \infty} a_n = e$ is irrational.

For a sequence of rationals that converges to an algebraic (non transcendental) irrational, take for example the partial sums of the Taylor series expansion of $\sqrt{1+x}$ at $x=1$ which converge to $\sqrt{2}$.

Question:(ii) does the above work? and if possible could i have anther example of a sequence where every value is irrational but the limit is rational?

The above works, except you may want to define $a_n = 2^\frac{1}{n+1}$ so that $a_1$ is irrational as well.

For other such sequences, pick any $r \in \mathbb{R} \setminus \mathbb{Q}$ and let $a_n = \frac{r}{n}$.

[ EDIT ] I see that you just edited the question to add $\frac{\sqrt{2}}{n}$ as an example of the latter.

It doesn't have to be $\pi$ or $e$, you could do the digit by digit approximation and converge to say $\sqrt{2}$ which is algebraic and not transcendental.

I would say that that answer of digit by digit is basically full mark; you could probably include that $|x - x_n| < 10^{-n}$ which means that the sequence is Cauchy to be more specific.

Your second sequence of $\{2^{1/n}\} \to 1$ is also correct. See if you can prove that each number in the sequence is irrational by mimicking the proof that $\sqrt{2}$ is irrational.

Here's another sequence

$$a_n = 1 + \frac{\sqrt{2}}{10^n}$$

We see that $\lim_{n \to \infty} a_n = 1$ and each $a_n$ is irrational because you can create a common denominator and note that the numerator will be irrational and the denominator and integer.


# Math Help - Techniques of integration (3)

1. ## Techniques of integration (3)

Let $n \geq 0$ be an integer. Evaluate $I_n=\int_0^{\frac{\pi}{2}} (\cos x)^n \cos (nx) \ dx.$

2. Using itegration by parts I could probably kick this thing off...

$\int_0^{\frac{\pi}{2}} (\cos x)^n \cos (nx) \ dx = \frac{1}{n}cos^n(x)sin(nx) + \int_0^{\frac{\pi}{2}} sin(nx)sin(x)cos^{n-1}(x) \ dx$

Not really sure how to do,

$\int_0^{\frac{\pi}{2}} sin(nx)sin(x)cos^{n-1}(x) \ dx$

probably needs some trig identities to tidy it up.

3. Originally Posted by pickslides
Using itegration by parts I could probably kick this thing off...

$\int_0^{\frac{\pi}{2}} (\cos x)^n \cos (nx) \ dx =$ $\color{red}\frac{1}{n}cos^n(x)sin(nx)$ $+ \int_0^{\frac{\pi}{2}} sin(nx)sin(x)cos^{n-1}(x) \ dx.$

Not really sure how to do $\int_0^{\frac{\pi}{2}} sin(nx)sin(x)cos^{n-1}(x) \ dx.$

probably needs some trig identities to tidy it up.
that's a good start. we have $I_0=\frac{\pi}{2}.$ for $n \geq 1,$ as you (almost) showed, we have: $I_n=\int_0^{\frac{\pi}{2}} \sin(nx) \sin(x) \cos^{n-1}x \ dx.$ now what?

4. Hello,

Okay, I think I got the correct idea

From $\cos(a-b)=\cos(a)\cos(b)+\sin(a)\sin(b)$, it follows that :
$\sin(nx)\sin(x)=\cos[(n-1)x]-\cos(nx)\cos(x)$

The integral is thus :

$I_n=\int_0^{\frac\pi2} \cos[(n-1)x]\cos^{n-1}(x)-\cos(nx)\cos(x)\cos^{n-1}(x) ~dx$

$I_n=\int_0^{\frac\pi2} \cos[(n-1)x]\cos^{n-1}(x) ~dx-\int_0^{\frac\pi2} \cos(nx)\cos^n(x) ~dx$

Which is :
$I_n=I_{n-1}-I_n$

$I_n=\frac 12 \cdot I_{n-1}$

$\Rightarrow \boxed{I_n=\frac{\pi}{2^{n+1}}}$

That's a really nice one

5. Bravo Moo! that's exactly the idea ... although you made a strange mistake at the end of your solution, which i'm sure you'll easily find and fix it!

6. Originally Posted by NonCommAlg
Brave Moo! that's exactly the idea ... although you made a strange mistake at the end of your solution, which i'm sure you'll easily find and fix it!
Yes indeed

1+1=n+1 : that's a very well-known result !!
Had a too short night...

7. Consider
$cos^n(x) = \frac{1}{2^n} \sum_{k=1}^{n} \binom{n}{k} [cos(n-2k)x + i sin(n-2k)x]
$

Since $cos^n(x)$ is real , the terms of sine function will be cancelled finally ,

but we experience that $\int_0^{\frac\pi2} cos(n-2k)x ~cosnx ~dx = 0$ if n-2k is not equal to n so the integral becomes :

$\frac{\pi}{2^{n+1}}$

8. Originally Posted by simplependulum

$\cos^n(x) = \frac{1}{2^n} \sum_{k=1}^{n} \binom{n}{k} [\cos(n-2k)x + i \sin(n-2k)x]
$

this is not an identity!

9. Originally Posted by NonCommAlg
Let $n \geq 0$ be an integer. Evaluate $I_n=\int_0^{\frac{\pi}{2}} (\cos x)^n \cos (nx) \ dx.$
It can be done using complex variables...

First note that

$4\int_0^{\frac{\pi}{2}} (\cos x)^n \cos (nx) \ dx=\int_0^{2\pi} (\cos x)^n \cos (nx) \ dx$

Parameterize the unit circle in the comples plane with

$z=e^{i\theta} \implies \frac{dz}{iz}=d\theta$

So the integral becomes

$\oint \left(\frac{z+z^{-1}}{2}\right)^n\left( \frac{z^n+z^{-n}}{2}\right)\frac{dz}{iz}$

expanding with the binomial theorem we get

$\frac{1}{i\cdot 2^{n+1}}\left[ \oint \sum_{i=0}^{n}\binom{n}{i}z^{n-i}z^{-i}\right]\left[z^{n-1}+z^{-n-1} \right]dz$

$\frac{1}{i\cdot 2^{n+1}}\left[ \oint \sum_{i=0}^{n}\binom{n}{i}z^{2n-2i-1}+ \sum_{i=0}^{n}\binom{n}{i}z^{i-1}\right]$

each finite sume is its own larent series so the residues are coeffients on the $\frac{1}{z}$ terms so we get

$\frac{1}{i\cdot 2^{n+1}}\left[2\pi i (1)+2\pi i (1) \right]=\frac{4\pi}{2^{n+1}}$

$4\int_0^{\frac{\pi}{2}} (\cos x)^n \cos (nx) \ dx=\frac{4\pi}{2^{n+1}}$

$\int_0^{\frac{\pi}{2}} (\cos x)^n \cos (nx) \ dx=\frac{\pi}{2^{n+1}}$

10. Originally Posted by TheEmptySet
It can be done using complex variables...

First note that

$4\int_0^{\frac{\pi}{2}} (\cos x)^n \cos (nx) \ dx=\int_0^{2\pi} (\cos x)^n \cos (nx) \ dx$

Parameterize the unit circle in the comples plane with

$z=e^{i\theta} \implies \frac{dz}{iz}=d\theta$

So the integral becomes

$\oint \left(\frac{z+z^{-1}}{2}\right)^n\left( \frac{z^n+z^{-n}}{2}\right)\frac{dz}{iz}$

expanding with the binomial theorem we get

$\frac{1}{i\cdot 2^{n+1}}\left[ \oint \sum_{i=0}^{n}\binom{n}{i}z^{n-i}z^{-i}\right]\left[z^{n-1}+z^{-n-1} \right]dz$

$\frac{1}{i\cdot 2^{n+1}}\left[ \oint \sum_{i=0}^{n}\binom{n}{i}z^{2n-2i-1}+ \sum_{i=0}^{n}\binom{n}{i}z^{i-1}\right]$
i think the power of $z$ in the second sum should be $-2i-1.$

each finite sume is its own larent series so the residues are coeffients on the $\frac{1}{z}$ terms so we get

$\frac{1}{i\cdot 2^{n+1}}\left[2\pi i (1)+2\pi i (1) \right]=\frac{4\pi}{2^{n+1}}$

$4\int_0^{\frac{\pi}{2}} (\cos x)^n \cos (nx) \ dx=\frac{4\pi}{2^{n+1}}$

$\int_0^{\frac{\pi}{2}} (\cos x)^n \cos (nx) \ dx=\frac{\pi}{2^{n+1}}$
looks good to me!


# Double negation of existential/universal quantifier $\lnot(\exists x(\lnot A(x))$

I have a (simple) question about the double-negation and existential/universal quantifiers.

When negating the following

$$\lnot\exists x(\lnot A(x))$$

I believe you just push the negation in (which swaps the quantifier) making it

$$\forall x[\lnot(\lnot A(x))]$$

and then

$$\forall x A(x)$$

Would that be a correct interpretation? Or would I be losing one of the negations on $$A(x)$$ somewhere earlier?

• Yes, that’s fine. It’s also intuitively clear: the first expression says that there is no $x$ for which $A(x)$ is false, and the last says that $A(x)$ is true for every $x$, clearly the same thing. – Brian M. Scott Apr 22 at 17:30
• Awesome, thank you so much. – confundido Apr 22 at 17:31
• You’re very welcome. – Brian M. Scott Apr 22 at 17:31
• Thank you (just read your more detailed answer) - I thought the intuition was clear, but it was part of a larger proof and I was doubting myself as to whether the reduction made sense. I guess I just needed validation. – confundido Apr 22 at 17:35

You did that correctly.

Note that going from

$$\lnot\exists x(\lnot A(x))$$

to

$$\forall x[\lnot(\lnot A(x))]$$

is an example of 'Quantifier Negation', but going from:

$$\forall x[\lnot(\lnot A(x))]$$

to

$$\forall x A(x)$$

is an instance of 'Double Negation'

As per the answer by Brian M. Scott:

It’s also intuitively clear: the first expression says that there is no x for which A(x) is false, and the last says that A(x) is true for every x, clearly the same thing.

A word of caution. Of course at the final step $$\forall x\neg\neg Ax$$ entails (or at least, classically entails) $$\forall x Ax$$, and does so because adjacent double negations (classically) cancel each other out.

BUT

The inference is not strictly an application of a standard double negation rule of the form from $$\neg\neg\varphi$$ infer $$\varphi$$. That rule only allows us to remove initial double negations.

SO

To show the entailment in standard proof systems requires a three-step mini-proof:

$$\forall x\neg\neg Ax\quad$$ (given)

$$\neg\neg Aa\quad\quad$$ (universal instantiation with parameter or free variable depending on system)

$$Aa\quad\quad\quad$$ (NOW you can apply the DN rule)

$$\forall x Ax\quad\quad$$ (universal generalization)

So your reasoning is informally just fine, but do be careful about jumping from $$\forall x\neg\neg Ax$$ to $$\forall x Ax$$ in formal proofs!


# Finding an operation on $G^S$ that yields a group

Problem: Assume $S$ is a nonempty set and $G$ is a group. Let $G^S$ denote the set of all mappings from $S$ to $G$. Find an operation on $G^S$ that will yield a group.

Update (full attempted proof--is it correct?): Let $*$ be the operation on the given group $G$ and let $\bigstar$ be the operation on $G^S$. For all $\alpha,\beta\in G^S$, define $(\alpha\,\bigstar\,\beta)(x)=\alpha(x)*\beta(x)$. Now we must prove $G^S$ is a group.

• Closure: This is inherited from $G$.
• Associativity: This is also inherited from $G$.
• Existence of an identity element: This is also inherited from $G$; more explicitly, $e_G(x)=1=e_{G^S}(x)$ because $(\alpha\,\bigstar\,e_G)(x)=\alpha(x)*e_G(x)=\alpha(x)$ and, in the other direction, $(e_G\,\bigstar\,\alpha)(x)=e_G(x)*\alpha(x)=\alpha(x)$.
• Existence of inverse elements: If $\eta(x)\in G$, then $\eta^{-1}(x)\in G$ also. Thus, for $\alpha\in G^S$, we have $(\alpha\,\bigstar\,\alpha^{-1})(x)=\alpha(x)*\alpha^{-1}(x)=e_G(x)=e_{G^S}(x)$ and, in the other direction, $(\alpha^{-1}\,\bigstar\,\alpha)(x)=\alpha^{-1}(x)*\alpha(x)=e_G(x)=e_{G^S}(x)$.

This concludes the proof that the operation $\bigstar$ on $G^S$ yields a group. $\blacksquare$

$\color{red}{\mathbf{\text{Question:}}}$ Is this above proof correct? Also, by the way the operation $\bigstar$ works, it seems like $G^S$ would be a subgroup of $G$ or am I wrong?

Original work shown for problem:

Book solution: For $\alpha,\beta\in G^S$, define $(\alpha\beta)(x)=\alpha(x)\beta(x)$ for each $x\in S$.

My questions: I thought about this problem for a good while but got nowhere and finally decided to look at the answer, but it does not make a ton of sense to me. How does the given operation yield a group? And what really is the operation being considered? Is it composition? That is, $(\alpha\beta)(x)\equiv(\alpha\circ\beta)(x)$? If it is composition, then I know all compositions are associative, and thus I do not need to prove that as part of proving that $G^S$ is a group. But what about closure? Existence of an identity element? Existence of inverse elements?

For the existence of an identity element, I thought about $e_G(x)=1$ and having $(\eta e_G)(x)=\eta(x)e_G(x)=\eta(x)$ and $(e_G\eta)(x)=e_G(x)\eta(x)=\eta(x)$, but this doesn't really seem right or is it?

Lastly, the problem gives the condition that $S\neq\varnothing$ (why is that important?), and no operation is specified concerning $G$--does that matter? I guess not, but it seems interesting to me that no operation is specified for $G$ when we are trying to find an operation for $G^S$ that involves $G$.

• The proof seems fundamentally fine. I'm not sure what the distinction is between the notation $e_G(x)$ and $e_G^S(x)$. You could write out associativity more explicitly, although I tend not to do so unless it's not obvious. – Rolf Hoyer Apr 9 '15 at 17:22
• @RolfHoyer I just meant that $e_G(x)$ is the identity element for $G$ while $e_G^S(x)$ is the identity element for $G^S$. If $G^S$ is a subgroup of $G$ (it looks like it is, but is it?), then I know the distinctions do not matter because the identity and inverses are the same. – fancynancy Apr 9 '15 at 17:32
• @RolfHoyer OK--I just fixed up the question with the modified notation ($e_{G^S}(x)$ instead of $e_G^S(x)$). Look all good now? Your answer definitely helped me to start thinking along the right lines. – fancynancy Apr 9 '15 at 17:38

It definitely looks much better!

I'm a little confused about the distinction between $e_G$ and $e_{G^S}$; they both seem like the identity of $G^S$, and you seem to be using $1$ for the identity of $G$. Maybe make it more explicit that you're defining $e_{G^S}: S \to G$ so that $e_{G^S}(x) = 1_G$; it's the map sending everything in $S$ to the identity of $G$. So my only suggestion would be to clean up the notation (how exactly are you writing the identity of $G$? Of $G^S$?) and make it clear exactly what the identity of $G^S$ does.

For the inverses, essentially the same thing: Given $\alpha: S \to G$, you just start using $\alpha^{-1}$ without explicitly stating that, if $\alpha(x) = g$, then $\alpha^{-1}(x) = (\alpha(x))^{-1} = g^{-1}$. That is, make it clear that we invert $\alpha:S \to G$ pointwise, by inverting its output (using the inverse in $G$).

For your other question, very rarely will it be the case that $G^S \cong G$. I think it's more likely that $G^S$ is isomorphic to a direct product of several copies of $G$ (how many copies?).

• Hmm okay. So I should write $e_G(x)=1$ and $e_{G^S}(x)=1_G$ to more clearly indicate that $1$ is the identity for $G$ while $1_G$ is the identity for $G^S$ right? You're right--my notation is a bit mangled. Okay. I get the identity part now. I'm still a little fuzzy on the inverse part though. Are you saying I'm technically correct with what I've written but it would be clearer to actually assign an element to $\alpha(x)$ to clearly indicate that invertibility is pointwise? – fancynancy Apr 9 '15 at 18:10
• What I mean about identities is that there should really only be two in sight: That of $G$, let's call it $1_G$, and that of $G^S$, let's call it $1_{G^S}$. So, I'm not sure why there are two functions whose notation suggest that they're both identities of $G^S$; that they're both functions $S \to G$. – pjs36 Apr 9 '15 at 18:12
• And for the inverses, yes, it's correct, provided you explicitly state how $\alpha^{-1}: S \to G$ (or $\eta^{-1}$, for that matter) is defined. – pjs36 Apr 9 '15 at 18:14
• Okay so I should have (for identities, that is), in one direction, $(\alpha\,\bigstar\,e_G)(x)=\alpha(x)*e_G(x)=\alpha(x)*1_G=\alpha(x)$. The same would happen in the other direction. So the identity exists and, explicitly, we have $e_{G^S}=e_G=1$. Correct? – fancynancy Apr 9 '15 at 18:16
• I do see what you're saying now about the confusion between writing $e_G(x)$ and $e_{G^S}(x)$ because they are both mappings from $S$ to $G$; thus, that notation is rather clumsy. – fancynancy Apr 9 '15 at 18:19

The group operation is not defined by composition, unless you mean the composition $S \to S\times S \to G\times G \to G$, where the first map is the diagonal $s \to (s,s)$, the second map is the product of the two given maps $\alpha, \beta$, and the third map is the group operation on $G$. When the author writes $(\alpha\beta)(x) = \alpha(x)\beta(x)$, the latter product is defined using the operation of $G$, just to clarify.

This definition is using the operation of $G$ pointwise, just like how addition and multiplication are defined for real-valued functions, ie $(f+g)(x) = f(x) + g(x)$. The identity element is the constant function $e_G(x) = 1$ for every $x$, and you correctly give the proof that this works. The inverse of a function $\alpha: S \to G$ is given by taking inverses pointwise, namely $\alpha^{-1}(x) = (\alpha(x))^{-1}$. Associativity follows from the associativity of $G$.

As regards to the empty set, if $S = \emptyset$ then there is a unique empty function $S \to G$, and I guess the authors would rather rule out this case than give the trivial product on this set.

Hopefully this makes things more clear.

• I just updated my question with a fully attempted proof in light of your helpful answer. Can you let me know if you think it's correct? Thanks for your answer--I think I am at least on the right track now. – fancynancy Apr 9 '15 at 14:23