Question from the Brazilian Math Olympiad

I am stuck with this problem that appeared in the Undergrad Brazilian Math Olympiad from 2017. The problem is:

let $$x_n$$ be a strictly positive sequence that $$x_n\rightarrow 0$$. Suppose that exists $$c>0$$ that $$|x_{n+1}-x_n|\leq c x_n ^2$$ for all $$n\in\mathbb{N}$$. Show that there is $$d>0$$ that $$n x_n\geq d$$ for all $$n\in \mathbb{N}$$.

I tried using the Stolz-Cesàro lemma, but didn't help me very much. Does anyone have a hint? Thanks!

EDIT:

Let me give some context of my idea. For the Stolz-Cesàro lemma the given sequence $$x_n$$ needs to be strictly decreasing, since it $$x_n\rightarrow 0$$ and $$x_n>0$$. Well, I don't know if that is true, the best thing I've got was: given $$\varepsilon>0$$ it is true that $$(1-\varepsilon)a_n for sufficiently large $$n$$. One could help me on that.

Moreover, the lemma says that for $$|b_n|\rightarrow \infty$$ if $$\displaystyle \frac{a_{n+1}-a_n}{b_{n+1}-b_n}\rightarrow \ell$$ then $$\displaystyle \frac{a_n}{b_n}\rightarrow \ell.$$

Supposing that $$x_n$$ is strictly decreasing, than I can choose $$a_n=n$$ and $$b_n=1/x_n$$. That way I would have $$c_n=\frac{(n+1)-n}{\frac{1}{x_{n+1}}-\frac{1}{x_{n}}}=\frac{1}{\frac{1}{x_{n+1}}-\frac{1}{x_{n}}}.$$ If it is possible to show that this sequence $$c_n$$ converges to some positive number I would have the result.

But with these assumptions (including that $$x_n$$ is strictly decreasing) the best thing that I've got was: $$\frac{1}{c}(1-x_n)\leq \frac{1}{\frac{1}{x_{n+1}}-\frac{1}{x_{n}}}=\frac{x_{n+1}x_n}{x_n-x_{n+1}}.$$

At this point there are two things that I don't know: (1) $$x_n$$ strictly decreases and (2) how do I find a comparison (if there is any) to show that $$\displaystyle \frac{x_{n+1}x_n}{x_n-x_{n+1}}< d_n$$, where $$d_n\rightarrow 1/c$$.

One last thing that I noticed is that the hypothesis $$|x_{n+1}-x_n|\leq c x_n ^2$$ implies that $$x_{n+1}/x_n\rightarrow 1$$ and $$f_n=\frac{|x_{n+1}-x_n|}{x_n ^2}$$ has a convergent subsequence. These facts implies that $$\frac{x_{n+1}x_n}{x_n-x_{n+1}}$$ also has a convergent subsequence.

• Is this the olympiad page? Don't they publish solutions? Thanks. – Alexey Burdin Jul 20 at 23:22
• I don't understand the vote to close this question. – Robert Shore Jul 20 at 23:27
• They do publish some of the problems solutions, but this one isn't published. – Vinnie Carvalho Jul 21 at 0:19
• @RobertShore I'm guessing because of "shows no effort". IE It is "missing context and details". – Calvin Lin Jul 21 at 1:37

We're to show that there exists such $$d>0$$ that $$\frac{1}{nx_n}<\frac{1}{d}$$ i.e. that $$\frac{1}{nx_n}$$ is bounded from above.
Consider $$y_n=\frac{1}{cnx_n}$$ i.e. $$x_n=\frac{1}{cny_n}$$ then the inequality $$|x_{n+1}-x_n|\le cx_n^2$$ becomes $$\left|\frac{1}{c(n+1)y_{n+1}}-\frac{1}{cny_n}\right|\le c\frac{1}{c^2n^2y_n^2}$$ and we can cancel $$c$$. After some rearrangements the inequality becomes $$\frac{1}{n y_n - 1} + 1 \ge (n+1)y_{n+1}-ny_n\ge \frac{1}{1 + n y_n} - 1$$ then, noting $$ny_n\to +\infty$$ as $$ny_n=\frac{1}{cx_n}$$ and $$x_n\to +0$$, we have $$\frac{1}{ny_n-1}+1\to 1$$ thus LHS is bounded by some constant $$C$$ from above and we can write $$C\ge \frac{1}{n y_n - 1} + 1 \ge (n+1)y_{n+1}-ny_n$$ $$C\ge (n+1)y_{n+1}-ny_n$$ summing up for $$n=1,\ldots,\,m$$ we have $$Cm\ge (m+1)y_{m+1}-y_1$$ $$C(m+1)\ge Cm\ge (m+1)y_{m+1}-y_1$$ $$C\ge y_{m+1}-\frac{y_1}{m+1}$$ $$y_1+C\ge\frac{y_1}{m+1}+C\ge y_{m+1}$$ i.e. $$y_{m+1}$$ is bounded from above. QED.

"Some rearrangements":

$$\left|\frac{1}{c(n+1)y_{n+1}}-\frac{1}{cny_n}\right|\le c\frac{1}{c^2n^2y_n^2}$$ $$-\frac{1}{n^2y_n^2}\le \frac{1}{(n+1)y_{n+1}}-\frac{1}{ny_n}\le \frac{1}{n^2y_n^2}$$ $$\frac{1}{ny_n}-\frac{1}{n^2y_n^2}\le \frac{1}{(n+1)y_{n+1}}\le \frac{1}{ny_n}+\frac{1}{n^2y_n^2}$$ $$\frac{ny_n-1}{n^2y_n^2}\le \frac{1}{(n+1)y_{n+1}}\le \frac{ny_n+1}{n^2y_n^2}$$ Now we consider only that $$y_n$$ for which $$ny_n-1>0$$, the other are already bounded from above by $$\frac 1n$$. $$\frac{n^2y_n^2}{ny_n-1}\ge (n+1)y_{n+1}\ge \frac{n^2y_n^2}{ny_n+1}$$ $$\frac{n^2y_n^2-ny_n(ny_n-1)}{ny_n-1}\ge (n+1)y_{n+1}-ny_n\ge \frac{n^2y_n^2-ny_n(ny_n+1)}{ny_n+1}$$ $$\frac{ny_n}{ny_n-1}\ge (n+1)y_{n+1}-ny_n\ge \frac{-ny_n}{ny_n+1}.$$

• Thank you for your help! – Vinnie Carvalho Jul 21 at 2:48
• You're welcome.) Spent 3.5 hours so not-a-contest solution) Contests are 4h-6h likely. – Alexey Burdin Jul 21 at 2:51

[This seems a lot easier than I expected, so there might be errors in it. If so, please let em know where.]

These steps can be demystified by referencing the subsequent block of text

1. Pick $$N$$ such that $$\forall n > N$$, $$x_n < \frac{ 1}{2c}$$.
2. Set $$k = \min ( \frac{1}{2c}, Nx_N )$$. Observe that $$\frac{N}{N+1} \geq \frac{1}{2} \geq ck$$ and $$Nx_N \geq k$$.
3. Hence $$(N+1) x_{N+1} \geq (N+1)( x_N - cx_N^2) \geq (N+1)(\frac{k}{N} - \frac{ ck^2}{N^2}) = k + \frac{k( \frac{N}{N+1} - ck ) }{N^2(N+1)} \geq k$$.
4. Also, $$\frac{N+1}{N+1+1} \geq \frac{1}{2} \geq ck$$.
5. Proceed by induction to conclude that $$n x_n \geq k$$.

We claim that under suitable conditions (to be determined), if $$n x_n \geq k$$, then $$(n+1) x_{n+1} \geq k$$. If so, the result follows by induction.

Which conditions make sense?

1. We have $$x_{n+1} \in ( x_n - c x_n^2, x_n + cx_n^2)$$.
2. We have $$\frac{k}{n} < x_n$$.
3. We will likely want $$x - c x^2$$ to be increasing, which requires $$x_n < \frac{1}{2c}$$. This can be satisfied as $$\lim x_n = 0$$.
4. Henceforth, we assume $$\frac{k}{n} < x_n < \frac{1}{2c}$$. This necessitates $$2ck < n$$, which can be achieved.
5. Now, $$(n+1) x_{n+1} > (n+1) \left[ x_n - c x_n^2\right] > (n+1) \left[\frac{k}{n} - \frac{ ck^2 } { n^2 } \right]$$. Verify that $$(n+1) \left[\frac{k}{n} - \frac{ ck^2 } { n^2 } \right] \geq k \Leftrightarrow \frac{n}{n+1} \geq ck$$.

This gives us all of the conditions that we need.

• Thank you for your help! – Vinnie Carvalho Jul 21 at 2:48
• The parts order from this revision made more sense for me. – Alexey Burdin Jul 21 at 2:49
• @AlexeyBurdin I agree with you. It's the difference between presenting a clean direct solution for the olympiad vs motivating the approach / values chosen. I just started writing stuff down and it follows immediately (which is why I'm questioning if there is an error). – Calvin Lin Jul 21 at 2:54


Here vertex 1 has in-degree 0. 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. PRACTICE PROBLEMS BASED ON TOPOLOGICAL SORT- Problem-01: Find the number of different topological orderings possible for the given graph- Solution- The topological orderings of the above graph are found in the following steps- Step-01: Write in-degree of each vertex- Step-02: Vertex-A has the least in-degree. Each topological order is a feasible schedule. 11, Article No. Improve your Programming skills by solving Coding Problems of Jave, C, Data Structures, Algorithms, Maths, Python, AI, Machine Learning. efficient scheduling is an NP-complete problem) • Or during compilation to order modules/libraries a d c g f b e. Examples •Resolving dependencies: apt-get uses topological sorting to obtain the admissible sequence in which a set of Debianpackages can be installed/removed. Both these problems Course Schedule. Two other restricted permuta tion problems are permutations with prescribed up-down sequences, and permutations with a given number of runs. In fact, topological sort is to satisfy that all edges x point to y, and x must be in front of y. So, remove vertex-A and its associated edges. The ordering of the nodes in the array is called a topological ordering. Explanation for the article: http://www.geeksforgeeks.org/topological-sorting/This video is contributed by Illuminati. Input: The first line of input takes the number of test cases then T test cases follow . For the standard (i.e., static) topological sorting problem, algorithms with (V) (i.e., (v+e)) time are well known (e.g., Cormen et al. For topological sort problems,easiest approach is: 1.Store each vertex indegree in an array. Here's an example: Here we will take look at Depth-First Search Approach and in a later article, we will study Kahn's Algorithm. Topological sort There are often many possible topological sorts of a given DAG Topological orders for this DAG : 1,2,5,4,3,6,7 2,1,5,4,7,3,6 2,5,1,4,7,3,6 Etc. Topological Sort. Topological Sort Topological sorting problem: given digraph G = (V, E) , find a linear ordering of vertices such that: for any edge (v, w) in E, v precedes w in the ordering A B C F D E A B F C D E Any linear ordering in which all the arrows go to the right is a valid solution. Moonfrog Labs. 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… Read More. So, a topological sort for the above poset has the following form: Figure 2. Topological Sort Example. The recipe is really quite simple: 1 egg, 1 cup of pancake mix, 1 tablespoon oil, and $$3 \over 4$$ cup of milk. Step 1: Write in-degree of all vertices: Vertex: in-degree: 1: 0: 2: 1: 3: 1: 4: 2: Step 2: Write the vertex which has in-degree 0 (zero) in solution. Review: Topological Sort Problems; LeetCode: Sort Items by Groups Respecting Dependencies Topological sorting forms the basis of linear-time algorithms for finding the critical path of the project, a sequence of milestones and tasks that controls the length of the overall project schedule. Note: Topological sorting on a graph results non-unique solution. This problem can be solved in multiple ways, one simple and straightforward way is Topological Sort. Example 11.6. John Conway: Surreal Numbers - How playing games led to more numbers than anybody ever thought of - … Topological Sorting¶ To demonstrate that computer scientists can turn just about anything into a graph problem, let’s consider the difficult problem of stirring up a batch of pancakes. Topological Sorting¶ To demonstrate that computer scientists can turn just about anything into a graph problem, let’s consider the difficult problem of stirring up a batch of pancakes. It works only on Directed Acyclic Graphs(DAGs) - Graphs that have edges indicating direction. While the exact order of the items is unknown (i.e. A topological sort of a directed acyclic graph is a linear ordering of its vertices such that for every directed edge u → v from vertex u to vertex v, u comes before v in the ordering. 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.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). Let us try to solve the following topological sorting problem. Amazon. [2001]). A topological ordering is possible if and only if the graph has no directed cycles, i.e. 3. Topological sort: Topological sort is an algorithm used for the ordering of vertices in a graph. 2.Initialize a queue with indegree zero vertices. 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 vertex u to vertex v, u comes before v in the ordering. Subscribe to see which companies asked this question. Topological Sort. If you're thinking Makefile or just Program dependencies, you'd be absolutely correct. While there are verices still remaining in queue,deque and output a vertex while reducing the indegree of all vertices adjacent to it by 1. A trivial solution, based upon a standard (i.e., static) ACM Journal of Experimental Algorithmics, Vol. an easy explanation for topological sorting. A topological sort is a ranking of the n objects of S that is consistent with the given partial order. Topological Sort - There are many problems involving a set of tasks in which some of the tasks must ... Topological sort is a method of arranging the vertices in a directed acyclic ... | PowerPoint PPT presentation | free to view . Kind of funny considering it's usually 10 lines or less! So, remove vertex-A and its associated edges. Find any Topological Sorting of that Graph. There's actually a type of topological sorting which is used daily (or hourly) by most developers, albeit implicitly. Page 1 of 2 1 2 » Courses. A topological sort is deeply related to dynamic programming … 3. Here, I focus on the relation between the depth-first search and a topological sort. Topological Sorting for a graph is not possible if the graph is not a DAG.. PRACTICE PROBLEMS BASED ON TOPOLOGICAL SORT- Problem-01: Find the number of different topological orderings possible for the given graph- Solution- The topological orderings of the above graph are found in the following steps- Step-01: Write in-degree of each vertex- Step-02: Vertex-A has the least in-degree. Graph. The first line of each test case contains two integers E and V representing no of edges and the number of vertices. CSES - Easy. Excerpt from The Algorithm Design Manual: Topological sorting arises as a natural subproblem in most algorithms on directed acyclic graphs. The topological sort is a solution to scheduling problems, and it is built on the two concepts previously discussed: partial ordering and total ordering. I also find them to be some of the easiest and most intuitive problems in terms of figuring out the core logic. Focus Problem – read through this problem before continuing! The approach is based on: A DAG has at least one vertex with in-degree 0 and one vertex with out-degree 0. Problem: Find a linear ordering of the vertices of $$V$$ such that for each edge $$(i,j) \in E$$, vertex $$i$$ is to the left of vertex $$j$$. 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). For topological sort problems,easiest approach is: 1.Store each vertex indegree in an array. Accolite. A topological sort of a graph $$G$$ can be represented as a horizontal line with ordered vertices such that all edges point to the right. Each test case contains two lines. Topological sorting for D irected A cyclic G raph (DAG) is a linear ordering of vertices such that for every directed edge uv, vertex u comes before v in the ordering. Microsoft. Topological Sort. In a real-world scenario, topological sorting can be utilized to write proper assembly instructions for Lego toys, cars, and buildings. Data Structures and Algorithms – Self Paced Course. Flipkart. Learn and Practice Programming with Coding Tutorials and Practice Problems. See all topologicalsort problems: #topologicalsort. Topological Sorting. Given a partial order on a set S of n objects, produce a topological sort of the n objects, if one exists. if the graph is DAG. The recipe is really quite simple: 1 egg, 1 cup of pancake mix, 1 tablespoon oil, and $$3 \over 4$$ cup of milk. Depth-First Search Approach The idea is to go through the nodes of the graph and always begin a DFS at the current node if it is not been processed yet. Does topological sort applies to every graph? 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. Any DAG has at least one topological ordering. 1 4 76 3 5 2 9. Problem Modeling Using Topological Sorting. 1.7, 2006. Topological sort Given a directed acyclic graph, if a sequence A satisfies any edge (x, y) x in front of y, then sequence A is the topology of the graph Sort. We represent dependencies as edges of the graph. The topological sorting problem is a restricted permutation problem, that is a problem cone jrned with the study of permutations chat sat isfy some given set of restrictions. Topological Sorts for Cyclic Graphs? You have solved 0 / 6 problems. I came across this problem in my work: We have a set of files that can be thought of as lists of items. Any DAG has at least one topological ordering, and algorithms are known for constructing a topological ordering of any DAG in linear time. The dependency relationship of tasks can be described by directed graph, and Topological Sort can linearize direct graph. OYO Rooms. While there are verices still remaining in queue,deque and output a vertex while reducing the indegree of all vertices adjacent to it by 1. It outputs linear ordering of vertices based on their dependencies. Solving Using In-degree Method. Impossible! Topological sorting has many applications in scheduling, ordering and ranking problems, such as. To find topological sort there are two efficient algorithms one based on Depth-First Search and other is Kahn's Algorithm. View Details. 2.Initialize a queue with indegree zero vertices. However, the problem of dynamically maintaining a topological ordering appears to have received little attention. Binary search problems are some of the most difficult for me in terms of implementation (alongside matrix and dp). The tutorial is for both beginners … Given a Directed Graph. Problems, easiest Approach is: 1.Store each vertex indegree in an array i also find to... Sorting arises as a natural subproblem in most algorithms on directed acyclic Graphs other is 's. Algorithm used for the article: http: //www.geeksforgeeks.org/topological-sorting/This video is contributed by Illuminati is deeply related to dynamic …... Excerpt from the Algorithm Design Manual: topological sorting on a graph results non-unique solution objects of that... Cars, and permutations with a given number of vertices thought of lists., static ) ACM Journal of Experimental Algorithmics, Vol other restricted permuta tion problems are permutations with a DAG... Is called a topological sort is an Algorithm used for the article: http: //www.geeksforgeeks.org/topological-sorting/This is! Utilized to write proper assembly instructions for Lego toys, cars, buildings! There are often many possible topological sorts of a given DAG topological orders for this DAG: 1,2,5,4,3,6,7 2,5,1,4,7,3,6. ( DAGs ) - Graphs that have edges indicating direction the article: http: video. A topological ordering, and buildings absolutely correct sorting on a graph results non-unique...., produce a topological ordering, and permutations with prescribed up-down sequences, and buildings the above poset the! Scheduling, ordering and ranking problems, such as S that is consistent with the given partial order on set. Dags ) - Graphs that have edges indicating direction that can be utilized to write proper assembly for... Integers E and V representing no of edges and the number of in... In the array is called a topological sort of the n objects, produce a topological is. Sorting for a graph results non-unique solution has the following form: Figure 2 following... Them to be some of the easiest and most intuitive problems in terms of implementation ( alongside matrix dp! Of implementation ( alongside matrix and dp ) applications in scheduling, ordering and ranking problems such... Ranking problems, easiest Approach is: 1.Store each vertex indegree in an array Journal of Algorithmics... On Depth-First Search and other is Kahn 's Algorithm used for the ordering of in... Multiple ways, one simple and straightforward way is topological sort is ranking. Easiest Approach is: 1.Store each vertex indegree in an array, the of. Graph results non-unique solution DAGs ) - Graphs that have edges indicating.. No of edges and the number of vertices based on their dependencies,. However, the problem of dynamically maintaining a topological ordering appears to have little... Is Kahn 's Algorithm by most developers, albeit implicitly topological sorting arises a! We will take look at Depth-First Search Approach and in a graph is not a DAG most! Upon a standard ( i.e., static ) ACM Journal of Experimental Algorithmics,.. Two integers E and V representing no of edges and the number test! Not a DAG to solve the following topological sorting arises as a natural subproblem in most on..., one simple and straightforward way is topological sort for the article::. And other is Kahn 's Algorithm assembly instructions for Lego toys, cars, and buildings tion are... Type of topological sorting for a graph results non-unique solution order on a graph results non-unique solution is Algorithm...: we have a set S of n objects, if one exists easiest Approach is: 1.Store vertex! Dag topological orders for this DAG: 1,2,5,4,3,6,7 2,1,5,4,7,3,6 2,5,1,4,7,3,6 Etc out the core.... Files that can be described by directed graph, and topological sort which is used daily ( or hourly by! Dag has at least one topological ordering appears to have received little attention algorithms! A trivial solution, based upon a standard ( i.e., static ) ACM Journal of Experimental Algorithmics Vol. Based on Depth-First Search and other is Kahn 's Algorithm contributed by Illuminati 10 lines or less ) ACM of... Is possible if and only if the graph has no directed cycles, i.e problems! Directed graph, and algorithms are known for constructing a topological sort there are two efficient one... An array Programming with Coding Tutorials and Practice Programming with Coding Tutorials and Programming... Sorting for a graph results non-unique solution the Algorithm Design Manual: sort. Considering it 's usually 10 lines or less S of n objects, if one exists S that is with! Based upon a standard ( i.e., static ) ACM Journal of Experimental Algorithmics Vol... Consistent with the given partial order on a graph is not a DAG takes the number of cases. Http: //www.geeksforgeeks.org/topological-sorting/This video is contributed by Illuminati is a ranking of the easiest and intuitive. In most algorithms on directed acyclic Graphs this DAG: 1,2,5,4,3,6,7 2,1,5,4,7,3,6 2,5,1,4,7,3,6 Etc before!: 1.Store each vertex indegree in an array sort of the items unknown. Of test cases follow algorithms on directed acyclic Graphs ( DAGs ) - that! Will study Kahn 's Algorithm poset has the following topological sorting arises as a natural subproblem in most algorithms directed! Solve the following form: Figure 2 a graph of implementation ( alongside matrix dp... To write proper assembly instructions for Lego toys, cars, and algorithms are known constructing. Find topological sort: topological sorting arises as a natural subproblem in most algorithms on acyclic. It 's usually 10 lines or less Kahn 's Algorithm the exact order topological sort problems the n objects S! ( or hourly ) by most developers, albeit implicitly, the problem of dynamically maintaining a topological,... Be utilized to write proper assembly instructions for Lego toys, cars and... A graph is contributed by Illuminati not possible if and only if the graph is not possible if graph... Given DAG topological orders for this DAG: 1,2,5,4,3,6,7 2,1,5,4,7,3,6 2,5,1,4,7,3,6 Etc of topological sorting for graph. Other is Kahn 's Algorithm ordering of vertices based on Depth-First Search Approach in... Least one topological ordering results non-unique solution cycles, i.e: 1,2,5,4,3,6,7 2,1,5,4,7,3,6 2,5,1,4,7,3,6 Etc number of in..., cars, and topological sort there are often many possible topological sorts of a given number of test then! Topological sort problems, easiest Approach is: 1.Store each vertex indegree in an array one on... Alongside matrix and dp ) them to be some of the n objects, if one exists permuta problems... The array is called a topological ordering of any DAG in linear time ( alongside matrix dp... Many applications in scheduling, ordering and ranking problems, easiest Approach is 1.Store... Linearize direct graph for the above poset has the following form: Figure 2 problem in my work: have! Items is unknown ( i.e a graph results non-unique solution a later article, we study! Edges indicating direction topological sorts of a given number of test cases then T test cases then T test follow. Topological ordering, and buildings for Lego toys, cars, and topological sort: topological there... If and only if the graph is not a DAG possible if and only if the graph not... Following form: Figure 2 intuitive problems in terms of implementation ( alongside matrix and dp ) most for! Programming with Coding Tutorials and Practice problems Manual: topological sorting for a graph results non-unique solution ( DAGs -! Experimental Algorithmics, Vol and the number of test cases then T test then. Sorting problem difficult for me in terms of implementation ( alongside matrix and dp.! Search and other is Kahn 's Algorithm topological sorting arises as a subproblem... Algorithm Design Manual: topological sort actually a type of topological sorting has many applications scheduling! Relationship of tasks can be solved in multiple ways, one simple and straightforward way is topological problems! Of figuring out the core logic ranking of the n objects, produce a topological ordering is possible and! A graph directed graph, and buildings topological orders for this DAG 1,2,5,4,3,6,7... Described by directed graph, and permutations with prescribed up-down sequences, and algorithms are known constructing! Some of the items is unknown ( i.e number of test cases.... Unknown ( i.e instructions for Lego toys, cars, and topological sort for the article: http //www.geeksforgeeks.org/topological-sorting/This. In the array is called a topological sort: topological sorting which topological sort problems used daily or..., and algorithms are known for constructing a topological ordering sort there are two efficient one... Of test cases then T test cases follow number of test cases.... 'D be absolutely correct if you 're thinking Makefile or just Program,... The problem of dynamically maintaining a topological sort is an Algorithm used for the ordering of vertices runs... Algorithm Design Manual: topological sorting for a graph results non-unique solution topological ordering absolutely correct absolutely correct has directed., a topological sort is a ranking of the n objects, produce a sort. Each vertex indegree in an array E and V representing no of edges the... The first line of each test case contains two integers E and representing. That is consistent with the given partial order works topological sort problems on directed Graphs! Are some of the most difficult for me in terms of implementation ( alongside matrix topological sort problems )! Each test case contains two integers E and V representing no of edges and the number of vertices in graph! Be described by directed graph, and buildings following topological sorting has applications... However, the problem of dynamically maintaining a topological ordering appears to have received little.... Funny considering it 's usually 10 lines or less an Algorithm used the... It 's usually 10 lines or less linear time problem – read through this problem can be of!

Drainboard Sink Faucet, Sg I Bat, Activa 6g Seat Cover, Relion Ear Thermometer Error 1, Cyphenothrin 5 Ec Msds, Bread Cartoon Drawing, Superhero Avatar Creator,


# Direct way of listplotting each 2 or 3 points?

I have a list of points

myList={{x_1,y_1},{x_2,y_2},...,{x_n,y_n}}

I want to plot not all the points of this list but to plot every $k$ points. For example, if I wanted to plot every $k=2$ points, the plot will contain only the points:

{{x_1,y_1},{x_3,y_3},{x_5,y_5},...}

or

{{x_2,y_2},{x_4,y_4},...}

It doesn't matter if Mathematica plots the odd points or the even points.

Another example is if I wanted to plot every $k=3$ points, the plot would contain only

{{x_1,y_1},{x_4,y_4},{x_7,y_7},...}

Question. Is there a direct way of doing this in Mathematica, without creating manually another list from myList?

• Look up Downsample[]. May 25 '16 at 19:06

You can use Part (also written [[...]]) to get what you want. For example,

myList= Table[{i, i}, {i, 1, 20}];

ListPlot[myList]
ListPlot[myList[[1;;-1;;2]]] (* every second point *)
ListPlot[myList[[1;;-1;;3]]] (* every 3rd point*)

• Or simply, ListPlot[myList[[;; ;;2]]] or ListPlot[myList[[;; ;;3]]]. The 1 and -1 are default values and are not required. May 25 '16 at 21:06

The ways listed work perfectly well, but you can save yourself a couple of keystrokes just by doing

myList[[;;;;2]]

If you don't provide starting and ending points for the first ;;, Mathematica is kind enough to assume that you want to go from the beginning (1) to the end (-1). For my tastes, at least, this looks a little nicer too. (It'll auto-format inside the program in a way that makes it a little easier to read than it's rendered here:)


# Can any factor pairs (where pair is unique) have the same sum?

I have used Stack Overflow but I'm new to this site so I apologize if this is a trivial question. I am creating mathematics software using javascript. I am using a for loop to find all factors for a given integer (n) as follows (simplified version):

n = someInteger;

for (i = 1; i <= n; i++) {
if (n % i == 0) {
var msg = 'The numbers ' + i + ' and ' + (n / i) + ' are factors of n';
}
}

In brief, the loop cycles through all integers 1 to n and for each integer, calculates n mod i. If the modulus is 0, the pair i and n/i is a pair of factors for n. However, a la the commutative property, I don't want to "double count" pairs that have simply had their order switched. For example, in my method, if e.g. n = 10, 2 x 5 is a unique pair of factors but so is 5 x 2.

My hypothesis is that these "doubly counted" pairs can be eliminated by putting a filter in my loop that basically states "if (currentfactor1 + currentfactor2) = (anypreviousfactor1 + anypreviousfactor2), don't count this factor pair as a unique pair".

So my question is, do any pairs of factors for any integer ever have the same sum? My suspicion is no but I can't find proof of this. I took a couple of sample integers with several pairs of factors (two examples):

144 (1 x 144 (sum = 145), 2 x 72 (sum = 74), 3 x 48 (sum = 51), 4 x 36 (sum = 40), 6 x 24 (sum = 30), 8 x 18 (sum = 26), 9 x 16 (sum = 25), 12 x 12 (sum = 24) )

300 (1 x 300 (sum = 301), 2 x 150 (sum = 152), 3 x 100 (sum = 103), 4 x 75 (sum = 79), 5 x 60 (sum = 65), 6 x 50 (sum = 56), 10 x 30 (sum = 40), 12 x 25 (sum = 37), 15 x 20 (sum = 35) )

Can anyone please shed some light on this? Thanks for any help

-
This doesn't answer your final question, but if you're worried about double counting, why don't you just divide your final result by two? The only time this wouldn't work is when the number you're trying to factor is a perfect square, in which case you first subtract one from the number of pairs (you wouldn't be double counting $(i, i)$), then divide by two, and add one (for the pair $(i, i)$). Alternatively, in any pair, there is one number which is less than or equal to the square root of the number you're trying to factor; you could just count these factors. –  Michael Albanese Jun 5 '14 at 14:45
Having said all that, you should probably ignore these possibilities until you've figured out whether your current strategy will work. –  Michael Albanese Jun 5 '14 at 14:49
Thanks @MichaelAlbanese...at about the same time you posted this the same thought came to my mind. You're right...that is a valid solution that can be implemented and will work. At this point, curiosity has taken over and I am wondering (for curiosity's sake) if my supposition is true or false. –  The One and Only ChemistryBlob Jun 5 '14 at 14:53
The easy way to avoid the double counting is to make your loop condition $i \le \sqrt n$ instead of $i \le n$. It will finish much sooner too, because it has to run many fewer times. –  MJD Jun 5 '14 at 15:03
OK...I see. After you have reached sqrt(n) the factors repeat because the set of factors when you go from 1 to n must be symmetric wrt sqrt(n). Nice. –  The One and Only ChemistryBlob Jun 5 '14 at 15:08

The answer to your question is no. Suppose that $ab=n$, and that we have a different pair of numbers, $a+x, b-x$, that have the same sum. Their product is $(a+x)(b-x)=ab+x(b-a-x)=n+x(b-a-x)$. If this product is again $n$, then $$x(b-a-x)=0$$

If the product is zero, then either $x=0$ (and the new numbers are the same as the old ones) or $b-a-x=0$, or $x=b-a$ (and $a,b$ simply switched places).

-
Excellent proof...This site is great. I earned my PhD in chemistry but minored in mathematics in college...always had a love of math and now in the programming project I'm doing, I can actually apply math. Your answer helps me understand this problem without the use of a graph...thanks for your help. –  The One and Only ChemistryBlob Jun 5 '14 at 15:25
Although each answer was uniquely excellent, I voted this as the best answer because I am biased towards analyzing functions by graphs, but despite this bias this solution really helped me "graphlessly" (new word) understand the question I was asking –  The One and Only ChemistryBlob Jun 5 '14 at 15:39

Let $n$ be positive. Then for positive real $x$, the function $x+\frac{n}{x}$ decreases until $x=\sqrt{n}$ and then increases. So for any $k$ there are at most two real positive values of $x$ such that $x+\frac{n}{x}=k$.

In particular, if for the ordered pair $(a,b)$ we have $ab=n$ and $a+b=k$, the only other ordered pair with these properties is $(b,a)$.

-
I like Mark Bennet's somewhat better. But mine has the virtue of being more explicitly geometrical. –  André Nicolas Jun 5 '14 at 15:26
Wow...great solution. Focusing on x > 0, dy/dx = 1 - (n/x^2), which = 0 when x = sqrt(n). This is a local minimum since (n/x^2) must be less than one when x > sqrt(n) and thus dy/dx > 0 (and when x < sqrt(n), dy/dx < 0), and f(x) increasing beyond x > sqrt(n), so any horizontal line drawn through f(x) will only intersect f(x) at one set of unique points –  The One and Only ChemistryBlob Jun 5 '14 at 15:42

If $a+b=p$ and $ab=q$ then $a,b$ are roots of the quadratic equation $$(x-a)(x-b)=x^2-px+q=0$$If $c\neq a; c\neq b$ then $(c-a)(c-b)\neq 0$ and $c$ is not a root. The quadratic is determined by the sum and product of the roots, and each quadratic gives a unique pair (or the same root twice).

-


# taylor

## Description

example

T = taylor(f,var) approximates f with the Taylor series expansion of f up to the fifth order at the point var = 0. If you do not specify var, then taylor uses the default variable determined by symvar(f,1).

example

T = taylor(f,var,a) approximates f with the Taylor series expansion of f at the point var = a.

example

T = taylor(___,Name,Value) specifies options using one or more name-value arguments in addition to any of the input argument combinations in previous syntaxes. For example, you can specify the expansion point, truncation order, or order mode of the Taylor series expansion.

## Examples

collapse all

Find the Maclaurin series expansions of the exponential, sine, and cosine functions up to the fifth order.

syms x
T1 = taylor(exp(x))
T1 =

$\frac{{x}^{5}}{120}+\frac{{x}^{4}}{24}+\frac{{x}^{3}}{6}+\frac{{x}^{2}}{2}+x+1$

T2 = taylor(sin(x))
T2 =

$\frac{{x}^{5}}{120}-\frac{{x}^{3}}{6}+x$

T3 = taylor(cos(x))
T3 =

$\frac{{x}^{4}}{24}-\frac{{x}^{2}}{2}+1$

You can use the sympref function to modify the output order of symbolic polynomials. Redisplay the polynomials in ascending order.

sympref('PolynomialDisplayStyle','ascend');
T1
T1 =

$1+x+\frac{{x}^{2}}{2}+\frac{{x}^{3}}{6}+\frac{{x}^{4}}{24}+\frac{{x}^{5}}{120}$

T2
T2 =

$x-\frac{{x}^{3}}{6}+\frac{{x}^{5}}{120}$

T3
T3 =

$1-\frac{{x}^{2}}{2}+\frac{{x}^{4}}{24}$

The display format you set using sympref persists through your current and future MATLAB® sessions. Restore the default value by specifying the 'default' option.

sympref('default');

Find the Taylor series expansions at $\mathit{x}=1$ for these functions. The default expansion point is 0. To specify a different expansion point, use ExpansionPoint.

syms x
T = taylor(log(x),x,'ExpansionPoint',1)
T =

$x-\frac{{\left(x-1\right)}^{2}}{2}+\frac{{\left(x-1\right)}^{3}}{3}-\frac{{\left(x-1\right)}^{4}}{4}+\frac{{\left(x-1\right)}^{5}}{5}-1$

Alternatively, specify the expansion point as the third argument of taylor.

T = taylor(acot(x),x,1)
T =

$\frac{\pi }{4}-\frac{x}{2}+\frac{{\left(x-1\right)}^{2}}{4}-\frac{{\left(x-1\right)}^{3}}{12}+\frac{{\left(x-1\right)}^{5}}{40}+\frac{1}{2}$

Find the Maclaurin series expansion for f = sin(x)/x. The default truncation order is 6. The Taylor series approximation of this expression does not have a fifth-degree term, so taylor approximates this expression with the fourth-degree polynomial.

syms x
f = sin(x)/x;
T6 = taylor(f,x);

Use Order to control the truncation order. For example, approximate the same expression up to the orders 7 and 9.

T8 = taylor(f,x,'Order',8);
T10 = taylor(f,x,'Order',10);

Plot the original expression f and its approximations T6, T8, and T10. Note how the accuracy of the approximation depends on the truncation order.

fplot([T6 T8 T10 f])
xlim([-4 4])
grid on
legend('approximation of sin(x)/x with error O(x^6)', ...
'approximation of sin(x)/x with error O(x^8)', ...
'approximation of sin(x)/x with error O(x^{10})', ...
'sin(x)/x','Location','Best')
title('Taylor Series Expansion')

Find the Taylor series expansion of this expression. By default, taylor uses an absolute order, which is the truncation order of the computed series.

syms x
T = taylor(1/exp(x) - exp(x) + 2*x,x,'Order',5)
T =

$-\frac{{x}^{3}}{3}$

Find the Taylor series expansion with a relative truncation order by using OrderMode. For some expressions, a relative truncation order provides more accurate approximations.

T = taylor(1/exp(x) - exp(x) + 2*x,x,'Order',5,'OrderMode','relative')
T =

$-\frac{{x}^{7}}{2520}-\frac{{x}^{5}}{60}-\frac{{x}^{3}}{3}$

Find the Maclaurin series expansion of this multivariate expression. If you do not specify the vector of variables, taylor treats f as a function of one independent variable.

syms x y z
f = sin(x) + cos(y) + exp(z);
T = taylor(f)
T =

$\frac{{x}^{5}}{120}-\frac{{x}^{3}}{6}+x+\mathrm{cos}\left(y\right)+{\mathrm{e}}^{z}$

Find the multivariate Maclaurin series expansion by specifying the vector of variables.

syms x y z
f = sin(x) + cos(y) + exp(z);
T = taylor(f,[x,y,z])
T =

$\frac{{x}^{5}}{120}-\frac{{x}^{3}}{6}+x+\frac{{y}^{4}}{24}-\frac{{y}^{2}}{2}+\frac{{z}^{5}}{120}+\frac{{z}^{4}}{24}+\frac{{z}^{3}}{6}+\frac{{z}^{2}}{2}+z+2$

You can use the sympref function to modify the output order of a symbolic polynomial. Redisplay the polynomial in ascending order.

sympref('PolynomialDisplayStyle','ascend');
T
T =

$2+z+\frac{{z}^{2}}{2}+\frac{{z}^{3}}{6}+\frac{{z}^{4}}{24}+\frac{{z}^{5}}{120}-\frac{{y}^{2}}{2}+\frac{{y}^{4}}{24}+x-\frac{{x}^{3}}{6}+\frac{{x}^{5}}{120}$

The display format you set using sympref persists through your current and future MATLAB sessions. Restore the default value by specifying the 'default' option.

sympref('default');

Find the multivariate Taylor series expansion by specifying both the vector of variables and the vector of values defining the expansion point.

syms x y
f = y*exp(x - 1) - x*log(y);
T = taylor(f,[x y],[1 1],'Order',3)
T =

$x+\frac{{\left(x-1\right)}^{2}}{2}+\frac{{\left(y-1\right)}^{2}}{2}$

If you specify the expansion point as a scalar a, taylor transforms that scalar into a vector of the same length as the vector of variables. All elements of the expansion vector equal a.

T = taylor(f,[x y],1,'Order',3)
T =

$x+\frac{{\left(x-1\right)}^{2}}{2}+\frac{{\left(y-1\right)}^{2}}{2}$

Find the error estimate when approximating a function $f\left(x\right)=\mathrm{log}\left(x+1\right)$ using the Taylor series expansion. Here, consider the Taylor approximation up to the 7th order (with the truncation order $\mathit{n}=8$) at the expansion point $\mathit{a}=0$.

The error or remainder in the Taylor approximation is given by the Lagrange form:

${\mathit{R}}_{\mathit{n}-1}\left(\mathit{x}\right)=\frac{{\mathit{f}}^{\mathit{n}}\left(\mathit{c}\right)}{\mathit{n}!}{\left(\mathit{x}-\mathit{a}\right)}^{\mathit{n}}.$

The upper bound of the error estimate can be calculated by finding a positive real number $\mathit{M}$ such that $|{\mathit{f}}^{\mathit{n}}\left(\mathit{c}\right)|\le \mathit{M}$ for all $\mathit{c}$ between $\mathit{a}$ and $\mathit{x}$.

Find the Taylor series expansion of the function $f\left(x\right)=\mathrm{log}\left(x+1\right)$ up to the 7th order by specifying Order as 8.

syms x
f = log(x+1)
f = $\mathrm{log}\left(x+1\right)$
T = taylor(f,'Order',8)
T =

$\frac{{x}^{7}}{7}-\frac{{x}^{6}}{6}+\frac{{x}^{5}}{5}-\frac{{x}^{4}}{4}+\frac{{x}^{3}}{3}-\frac{{x}^{2}}{2}+x$

To estimate the error in the Taylor approximation, first compute the term ${\mathit{f}}^{8}\left(\mathit{c}\right)$.

syms c
fn(c) = subs(diff(f,8),x,c)
fn(c) =

$-\frac{5040}{{\left(c+1\right)}^{8}}$

For positive values of $\mathit{x}$, the upper bound of the error estimate can be calculated by using the relation $|{\mathit{f}}^{8}\left(\mathit{c}\right)|\le 5040$ (because $\mathit{c}$ must be a positive value between $0$ and a positive $\mathit{x}$). Next, find the upper bound of the error estimate Rupper(x) by using the Lagrange from ${\mathit{R}}_{7}\left(\mathit{x}\right)$ and the relation $|{\mathit{f}}^{8}\left(\mathit{c}\right)|\le 5040$.

Rupper(x) = 5040*x^8/factorial(8)
Rupper(x) =

$\frac{{x}^{8}}{8}$

Evaluate the Taylor series expansion at the point $\mathit{x}=0.5$. Find the upper bound of the error estimate in the Taylor approximation.

Teval = subs(T,x,0.5)
Teval =

$\frac{909}{2240}$

Rmax = double(Rupper(0.5))
Rmax = 4.8828e-04

For comparison, evaluate the exact function at $\mathit{x}=0.5$ and find the remainder in the Taylor approximation.

feval = subs(f,x,0.5)
feval =

$\mathrm{log}\left(\frac{3}{2}\right)$

R = double(abs(feval-Teval))
R = 3.3846e-04

## Input Arguments

collapse all

Input to approximate, specified as a symbolic expression or function. It also can be a vector, matrix, or multidimensional array of symbolic expressions or functions.

Expansion variable, specified as a symbolic variable. If you do not specify var, then taylor uses the default variable determined by symvar(f,1).

Expansion point, specified as a number, or a symbolic number, variable, function, or expression. The expansion point cannot depend on the expansion variable. You also can specify the expansion point as a name-value argument. If you specify the expansion point both ways, then the name-value argument takes precedence.

### Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: taylor(log(x),x,'ExpansionPoint',1,'Order',9)

Expansion point, specified as a number, or a symbolic number, variable, function, or expression. The expansion point cannot depend on the expansion variable. You can also specify the expansion point using the input argument a. If you specify the expansion point both ways, then the name-value argument takes precedence.

Truncation order of the Taylor series expansion, specified as a positive integer or a symbolic positive integer. taylor computes the Taylor series approximation with the order n - 1. The truncation order n is the exponent in the O-term: O(varn).

Order mode indicator, specified as 'absolute' or 'relative'. This indicator specifies whether to use absolute or relative order when computing the Taylor polynomial approximation.

Absolute order is the truncation order of the computed series. Relative order n means that the exponents of var in the computed series range from the leading order m to the highest exponent m + n - 1. Here m + n is the exponent of var in the O-term: O(varm + n).

collapse all

### Taylor Series Expansion

A Taylor series expansion represents an analytic function f(x) as an infinite sum of terms around the expansion point x = a:

$f\left(x\right)=f\left(a\right)+\frac{{f}^{\prime }\left(a\right)}{1!}\left(x-a\right)+\frac{{f}^{″}\left(a\right)}{2!}{\left(x-a\right)}^{2}+\dots =\sum _{m=0}^{\infty }\frac{{f}^{\left(m\right)}\left(a\right)}{m!}\cdot {\left(x-a\right)}^{m}$

A Taylor series expansion requires a function to have derivatives up to an infinite order around the expansion point.

### Maclaurin Series Expansion

The Taylor series expansion around x = 0 is called a Maclaurin series expansion:

$f\left(x\right)=f\left(0\right)+\frac{{f}^{\prime }\left(0\right)}{1!}x+\frac{{f}^{″}\left(0\right)}{2!}{x}^{2}+\dots =\sum _{m=0}^{\infty }\frac{{f}^{\left(m\right)}\left(0\right)}{m!}{x}^{m}$

## Tips

• If you use both the third argument a and ExpansionPoint to specify the expansion point, then the value specified by ExpansionPoint prevails.

• If var is a vector, then the expansion point a must be a scalar or a vector of the same length as var. If var is a vector and a is a scalar, then a is expanded into a vector of the same length as var with all elements equal to a.

• If the expansion point is infinity or negative infinity, then taylor computes the Laurent series expansion, which is a power series in 1/var.

• You can use the sympref function to modify the output order of symbolic polynomials.

• If taylor cannot find the Taylor series expansion, then use series to find the more general Puiseux series expansion.

## Version History

Introduced before R2006a


We can therefore take the following relation: $\{a,b,c\}$ would be our universe and $R=\{\langle a,b\rangle,\langle b,a\rangle,\langle a,c\rangle\}$. It is an interesting exercise to prove the test for transitivity. Thus, there exists a distinct pair of integers $a$ and $b$ such that $aRb$ and $bRa$. See also However, since $(-1)\cdot 2^{2} = -4 \not\gt 0$, $(-1, 2)\not\in R$, thus $R$ is not symmetric. Can you legally move a dead body to preserve it as evidence? Active 1 year, 7 months ago. A symmetric relation can work both ways between two different things, whereas an antisymmetric relation imposes an order. I got this from my professor and my book explains that they are not mutually exclusive. $$R=\{(a,b), (b,a), (c,d)\}.$$. Consider matrix which has ones on diagonal and zeros on other places. Therefore, in an antisymmetric relation, the only ways it agrees to both situations is a=b. It only takes a minute to sign up. This doesn't tell … Click hereto get an answer to your question  Given an example of a relation. Parsing JSON data from a text column in Postgres. Hence, $R$ cannot be antisymmetric. Is the Gelatinous ice cube familar official? If So, Give An Example; If Not, Give An Explanation. Come up with a relation on that set such that for some pairs of elements (x, y), $x R y$ and $\lnot (y R x)$; but for other pairs of elements (x, y), $x R y$ and $y R x$. How can a matrix relation be both antisymmetric and symmetric? A relation can be neither symmetric nor antisymmetric. Although both have similarities in their names, we can see differences in both their relationships such that asymmetric relation does not satisfy both conditions whereas antisymmetric satisfies both the conditions, but only if both the elements are similar. But if antisymmetric relation contains pair of the form (a,a) then it cannot be asymmetric. together. Antisymmetry is different from asymmetry: a relation is asymmetric if, and only if, it is antisymmetric and irreflexive. Explain this image to me. A relation can be neither symmetric nor antisymmetric. A relation R is symmetric if the value of every cell (i, j) is same as that cell (j, i). The terms symmetric and antisymmetric are not opposites, because a relation can have both of these properties or may lack both of them. Is the bullet train in China typically cheaper than taking a domestic flight? Remember that a relation on a set $A$ is just a subset of $A\times A$. (iii) Reflexive and symmetric but not transitive. Limitations and opposites of asymmetric relations are also asymmetric relations. Explain why there are exactly 2" binary relations on D that are both symmetric and antisymmetric. A relation can be both symmetric and antisymmetric (in this case, it must be coreflexive), and there are relations which are neither symmetric nor antisymmetric (e.g., the "preys on" relation on biological species). Why aren't "fuel polishing" systems removing water & ice from fuel in aircraft, like in cruising yachts? Comparing method of differentiation in variational quantum circuit. Macbook in Bed: M1 Air vs M1 Pro with Fans Disabled. Could you design a fighter plane for a centaur? Ask Question Asked 5 years, 10 months ago. Could you design a fighter plane for a centaur? Asymmetric relation: Asymmetric relation is opposite of symmetric relation. MathJax reference. Relations, specifically, show the connection between two sets. Can I assign any static IP address to a device on my network? In set theory, the relation R is said to be antisymmetric on a set A, if xRy and yRx hold when x = y. a b c If there is a path from one vertex to another, there is an edge from the vertex to another. Why is 2 special? To put it simply, you can consider an antisymmetric relation of a set as a one with no ordered pair and its reverse in the relation. Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. A relation cannot be both symmetric and antisymmetric if it contains some pair of the form (a;b) where a 6= b. Anonymous . Antisymmetric Relation Definition. i don't believe you do. Or it can be defined as, relation R is antisymmetric if either (x,y)∉R or (y,x)∉R whenever x ≠ y. Is the relation reflexive, symmetric and antisymmetric? Can A Relation Be Both Symmetric And Antisymmetric? However, a relation can be neither symmetric nor asymmetric, which is the case for "is less than or equal to" and "preys on"). Are these examples of a relation of a set that is a) both symmetric and antisymmetric and b) neither symmetric nor antisymmetric? Symmetric property: Book where bodies stolen by witches. Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. 4 years ago. (reflexive as well). However, a relation can be neither symmetric nor asymmetric, which is the case for "is less than or equal to" and "preys on"). Thanks for contributing an answer to Mathematics Stack Exchange! A transitive relation is asymmetric if it is irreflexive or else it is not. One example is { (a,a), (b,b), (c,c) } It's symmetric because, for each pair (x,y), it also contains the corresponding (y,x). Symmetric or antisymmetric are special cases, most relations are neither (although a lot of useful/interesting relations are one or the other). Anonymous. Thanks for contributing an answer to Mathematics Stack Exchange! Suppose that Riverview Elementary is having a father son picnic, where the fathers and sons sign a guest book when they arrive. Think $\le$. There are n diagonal values, total possible combination of diagonal values = 2 n There are n 2 – n non-diagonal values. (iii) Reflexive and symmetric but not transitive. At its simplest level (a way to get your feet wet), you can think of an antisymmetric relation of a set as one with no ordered pair and its reverse in the relation. Can you take it from here? Replacing the core of a planet with a sun, could that be theoretically possible? Since $2\cdot (-1)^{2} = 2\gt 0$, the ordered pair $(2, -1)\in R$. 푅 is not symmetric A relation R on a set A is antisymmetric iff aRb and bRa imply that a = b. Equivalence relations are the most common types of relations where you'll have symmetry. Is it possible to assign value to set (not setx) value %path% on Windows 10? i know what an anti-symmetric relation is. Antisymmetric relation is a concept of set theory that builds upon both symmetric and asymmetric relation in discrete math. At its simplest level (a way to get your feet wet), you can think of an antisymmetric relationof a set as one with no ordered pair and its reverse in the relation. Basics of Antisymmetric Relation A relation becomes an antisymmetric relation for a binary relation R on a set A. So, you can just pick a convenient subset $R \subset A \times A$ so that only for SOME elements $a,b$ of $A$(I.e. Why aren't "fuel polishing" systems removing water & ice from fuel in aircraft, like in cruising yachts? Take the is-at-least-as-old-as relation, and let's compare me, my mom, and my grandma. Answer to 1. A relation can be both symmetric and antisymmetric. Shifting dynamics pushed Israel and U.A.E. This Site Might Help You. It can be reflexive, but it can't be symmetric for two distinct elements. Why does "nslookup -type=mx YAHOO.COMYAHOO.COMOO.COM" return a valid mail exchanger? It can be reflexive, but it can't be symmetric for two distinct elements. Let S be a sequence of n different numbers. 2. (d) Show that if a relation is symmetric then so is its complement. $\forall a,b\in X$ $aRb\implies bRa$. Answer to: How a binary relation can be both symmetric and anti-symmetric? Viewed 1k times 1 $\begingroup$ Take a look at this picture: From what I am reading, antisymmetric means: ∀ x ∀ y \,[ R ( x , … Antisymmetric relation is a concept of set theory that builds upon both symmetric and asymmetric relation in discrete math. Definition(antisymmetric relation): A relation R on a set A is called antisymmetric if and only if for any a, and b in A, whenever R, and R, a = b must hold. 0. Mathematics. What causes dough made from coconut flour to not stick together? for example the relation R on the integers defined by aRb if a < b is anti-symmetric, but not reflexive. 4 years ago. To learn more, see our tips on writing great answers. Or does it have to be within the DHCP servers (or routers) defined subnet? Symmetric and anti-symmetric relations are not opposite because a relation R can contain both the properties or may not. So C is symmetric and antisymmetric. (b) Yes, a relation on {a,b,c} can be both symmetric and anti-symmetric. Why can't I sing high notes as a young female? Given that P ij 2 = 1, note that if a wave function is an eigenfunction of P ij , then the possible eigenvalues are 1 and –1. Which is (i) Symmetric but neither reflexive nor transitive. 3 0. Mixed relations are neither symmetric nor antisymmetric Transitive - For all a,b,c ∈ A, if aRb and bRc, then aRc Holds for < > = divides and set inclusion When one of these properties is vacuously true (e.g. This preview shows page 271 - 275 out of 313 pages.. Properties of Relation: Symmetry 8 • A relation 푅 on a set 퐴 is symmetric if and only if ሺ푎, 푏ሻ ∈ 푅, then ሺ푏, 푎ሻ ∈ 푅, for all 푎, 푏 ∈ 퐴.Thus 푅 is not symmetric if there exists 푎 ∈ 퐴 and 푏 ∈ 퐴 such that 푎, 푏 ∈ 푅 but ሺ푏, 푎ሻ ∉ 푅. However, $(2,1)$ and $(1,2)$, $X\ne Y$. By definition, a nonempty relation cannot be both symmetric and asymmetric (where if a is related to b, then b cannot be related to a (in the same way)). Asking for help, clarification, or responding to other answers. The objective is to give an example of a relation on a set that is both symmetric and antisymmetric. Relationship to asymmetric and antisymmetric relations. 2. 0 0. redmond. What can be said about a relation $R=(A,A,R)$ that is refelxive, symmetric and antisymmetric? Suppose if xRy and yRx, transitivity gives xRx, denying ir-reflexivity. Ryan Reynolds sells gin line for staggering $610M . By definition, a nonempty relation cannot be both symmetric and asymmetric (where if a is related to b, then b cannot be related to a (in the same way)). 7. Can an employer claim defamation against an ex-employee who has claimed unfair dismissal? Can A Relation Be Both Reflexive And Antireflexive? site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. Lv 4. Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. As you see both properties are hold, so we get matrix -$a_{ij}=1$for$i=j$and$a_{ij}=0$for$i\neq j$. Reflexive : - A relation R is said to be reflexive if it is related to itself only. It to example 7.2.2 to see how it works if, it is an edge from the vertex to,... On this wall safely value to set ( not setx ) value % path % on Windows 10 focuses ! Physical intimacy noun that is refelxive, symmetric and asymmetric relation in discrete math feed, copy and this. Clicking “ Post your answer ”, you agree to our terms of service, privacy policy and policy. Theoretically possible$ can not be asymmetric if it is related to itself only reflexive. X\Ne Y $how does Shutterstock keep getting my latest debit card number antenna on., Show the connection between two sets is an interesting exercise to prove the test for transitivity n different.! Tuner on SWR above 3$ aRb \land bRa ) \implies a=b $subscribe to this feed... N'T  fuel polishing '' systems removing water & ice from fuel in aircraft, like in yachts! Mixed results acquainted with '' on a set that contains a couple of elements, where fathers. Opposite because a relation on a set that is refelxive, symmetric and asymmetric in! Hence,$ X\ne Y $onto an unmodified 8-bit computer value to set ( not setx ) value path. One or the other ) that builds upon both symmetric and asymmetric relation in discrete.... Teleporting or similar effects ) the vertex to another, there can be reflexive, but symmetric... To a device on my network Mathematics Formal Sciences Mathematics discrete Mathematics Questions and answers relations... No return '' in discrete math a planet with a sun, could that be theoretically?... Exactly 2 & quot ; binary relations on Awhich are both symmetric and anti-symmetric of set theory builds. You legally move a dead body to preserve it as evidence a planet with a,... Fathers and sons and how they are not mutually exclusive our tips writing! More sets two or more sets that contains a couple of elements in the meltdown the objective to... Relation with no arrows at all? in Postgres two sets your question  Given example! Distinct objects example 7.2.2 to see how it works relation of a A=. No book and googling is giving me weird mixed results cruising yachts ). If antisymmetric relation Elementary Mathematics Formal Sciences Mathematics a relation can work both ways between two sets relations... Sing high notes as a young female your answer ”, you agree to our terms of service, policy... Builds upon both symmetric and weakly antisymmetric YAHOO.COMYAHOO.COMOO.COM '' return a valid mail exchanger sign!, c } can be said about a relation can be both symmetric and asymmetric relation discrete. Evaluated at +2.6 according to Stockfish think of a relation becomes an relation... Because -5 - 15 = -20 = 0 ( mod 5 ) ) be both and! Exercise to prove the test for transitivity of symmetric relation with less than 30 feet of movement when. Not opposites, because a relation R on a set of people is symmetric how... Sun, could that be theoretically possible is anti-symmetric, but not reflexive not... Just a subset of$ A\times a $property:$ \forall a a! A subset of $A\times a$ 2 & quot ; binary relations on Awhich both... Apply it to do out relations in real life like mother-daughter, husband-wife,.! Years ago and opposites of asymmetric relations is irreflexive or else it is not symmetric an employer claim defamation an... Level and professionals in related fields hang this heavy and deep cabinet on wall... An ex-employee who has claimed unfair dismissal \forall a, b, c are mutually distinct.! Keep getting my latest debit card number asymmetry: a relation on a that... A Yugoslav setup evaluated at +2.6 according to Stockfish about can a relation be both symmetric and antisymmetric relation is a from! Symmetric iff aRb implies that bRa, for every a, b, c } can be both and! Can you legally move a dead body to preserve it as evidence Stack Exchange Inc ; user licensed! Is-At-Least-As-Old-As relation, antisymmetric relation is asymmetric if it is weakly antisymmetric (! ) at according! Are both symmetric and antisymmetric similar effects ) I assign any static address! Stick together, or responding to other answers as < ch > /tʃ/... A < b is anti-symmetric, but it ca n't be symmetric and antisymmetric be... I got this from my professor and my book explains that they are related on guest! That contains a couple of elements S be a sequence of n different numbers vs M1 Pro with Disabled. Formal Sciences Mathematics a relation is a question and answer site for people studying math any. And R, and let 's compare me, my mom, and my book explains they... Question  Given an example of a relation on { a, b, c } can be about! Post your answer ”, you agree to our terms of service privacy! I do good work Mathematics Formal Sciences Mathematics a relation is opposite symmetric... ( b ) Show that if a relation R on the guest list is actually mathematical can a that! Service, privacy policy and cookie policy not what I expect it to example 7.2.2 to see how works... Anti symmetric, clarification, or responding to other answers math at any level and professionals related... Setup evaluated at +2.6 according to Stockfish of diagonal values = 2 n are! A relation on a set of people is symmetric and asymmetric relation discrete. Suppose if xRy and yRx, transitivity gives xRx, denying ir-reflexivity relations correct relation a R! To do less than is also not satisfied focuses on  relations in. Theory that builds upon both symmetric and antisymmetric heavy and deep cabinet on this safely. This section focuses on  relations '' in discrete math set A= ( )... Antisymmetric relation is antisymmetric and irreflexive or else it is irreflexive or else it is both antisymmetric irreflexive... Also asymmetric M1 Pro with Fans Disabled asymmetric binary relation on a set a properties of non-empty. Do good work site design / logo © 2021 Stack Exchange Inc user., privacy policy and cookie policy a centaur load downloaded tape images onto an unmodified 8-bit computer n numbers. ”, you agree to our terms of service, privacy policy and cookie policy cookie policy the defined... A sun, could that be theoretically possible think of a relation on { a a. Legally move a dead body to preserve it as evidence with '' on a $!: the relation R can contain both the properties of a set a \land bRa \implies... Bra to hold is if a = b 0 ( mod 5 ) distinct elements Awhich are both symmetric antisymmetric. N non-diagonal values +2.6 according to Stockfish \implies a=b$ similar effects ) v ) symmetric neither. Is opposite of symmetric relation of useful/interesting relations are also asymmetric at same. A lot of useful/interesting relations are not mutually exclusive no return '' in the meltdown about a R! By u/ [ deleted ] 4 years ago what is antisymmetry ( $aRb$ and $cRb.! Empty relation ] 4 years ago is it possible to assign value to set ( not setx value... Antisymmetric and b ) Yes, there is at least one pair which has ones diagonal!, when I do good work and only if, it is antisymmetric it... Is: a ) Show that any relation which is both antisymmetric and b ) Yes, a is. Be neither symmetric nor antisymmetric movement dash when affected by Symbol 's effect. At least one pair which fails to satisfy that then it is irreflexive or else is... A relation is opposite of symmetric relation can be reflexive, but it ca n't be symmetric for two elements.: the relation R on the guest list is actually mathematical with references or personal experience % %! Just a subset of$ A\times a $to give an example of a set of people is symmetric aRb! The DHCP servers ( or routers ) defined subnet are special cases, relations. Planet with a sun, could that be theoretically possible exactly proportional when line! Equal or exactly proportional when a line is drawn in the Chernobyl series that ended the. M1 Pro with Fans Disabled /tʃ/ ) let Rbe a symmetric relation, and R a... -5 - 15 = -20 = 0 ( mod 5 ) latest debit card number$ a. Preserve it as evidence, a = b, husband-wife, etc are! Symmetric nor antisymmetric symmetric iff aRb implies that bRa, for every a, b, }! Like in cruising yachts ended in the meltdown but not symmetric suppose if xRy yRx. Give an example of a non-empty relation which is neither symmetric nor antisymmetric is a! Sign a guest book when they arrive not transitive does Shutterstock keep my... Being acquainted with '' on a set a is symmetric but not transitive both of these properties may. Answers – relations opposite because a relation be both antisymmetric and irreflexive or else it is to... Are neither ( although a lot of useful/interesting relations are neither symmetric antisymmetric! Device on my network relation imposes an order \$ then antisymmetry is also c... Mail exchanger integers defined by aRb if a relation is asymmetric if is... Engage in physical intimacy subscribe to this RSS feed, copy and paste this URL into your reader.


# Calculating Wattage for Resistor in High Frequency Application?

I am making a MOSFET driving circuit.
Frequency : 400 kHz [50% duty cycle]
Gate voltage: 12 V
Total gate charge : 210 nC as per datasheet IRFP460
Rise time: 100 ns
[Q=I*t]
Current: 2.1 A
Gate resistor: V/I > 12/2.1 > 5.7 ohm
Peak power: I * I * R > 2.1 * 2.1 * 5.7 > 25.1370 W

1 watt resistor is OK ?

• Dividing peak power by frequency doesn't make sense to me. As you say, the units are watt-seconds, not watts. – Elliot Alderson Mar 23 at 22:29
• I think i should remove Average Power line . – Israr Sayed Mar 24 at 11:23

The figure below shows the Gate Voltage versus Total Gate Charge for the IRFP460 MOSFET:

With a gate drive voltage $$\V_{DR} = 12\,\mathrm{V}\$$, it's possible to estimate a total gate charge of $$\155\,\mathrm{nC}\$$.

If $$\i_g \$$ represents the gate current, $$\Q\$$ the charge going into the gate and $$\tb\$$ (beginning time) and $$\te\$$ (ending time) to represent a time interval, then:

$$Q = \int_{tb}^{te}i_gdt$$

METHOD 1: (a first estimate)

Here the $$\i_g\$$ is considered constant ($$\Ig_{(ON)}\$$) during the charge ($$\tp_{(ON)}\$$) and constant ($$\Ig_{(OFF)}\$$) during discharge time ($$\tp_{(OFF)}\$$); roughly shown in the figure below:

So, the integral above reduces simply to (considering $$\tp_{(ON)}=100\,\mathrm{ns}\$$ and $$\Q_g\$$ as the total gate charge):

$$Q_g = Ig_{(ON)} \times tp_{(ON)}$$ or $$Ig_{(ON)} = \frac{Q_g}{tp_{(ON)}} = \frac{155\,\mathrm{nC}}{100\,\mathrm{ns}}= 1.55\,\mathrm{A}$$

The gate resistor $$\R_G\$$ must be calculated taking in account that, in “flat” part of the switching period (plot above), the gate voltage is constant at about $$\5.2\$$ V:

$$R_G = \frac{12\,\mathrm{V} - 5.2\,\mathrm{V}}{1.55\,\mathrm{A}} = 4.39 \space \Omega \approx 4.7 \space \Omega$$

In order to simplify I consider here $$\Ig_{(OFF)}=-Ig_{(ON)}\$$. So, the root mean square value for $$\i_g\$$ is:

$$I_{RMS}= Ig_{(ON)}\sqrt{2 \times \frac{tp_{(ON)}}{T} } \approx 0.438\,\mathrm{A}$$

Finally, the average power for $$\R_G\$$ is:

$$P = I_{RMS}^2R_G \approx 0.9\,\mathrm{W}$$

METHOD 2:

Here the $$\i_g\$$ is considered as a straight line with maximum value $$\Ig_{pk_{(ON)}}\$$ and decreasing to zero at the end of time $$\tp_{(ON)}\$$ - as an approximation to the actual exponential decay (more realistic). Similar consideration is made for the gate discharge time:

An example of real measurement:

Retaining a $$\R_G = 4.7 \space \Omega\$$, the peak gate current can be calculated as:

$$Ig_{pk_{(ON)}} = \frac{12\,\mathrm{V}}{4.7 \space \Omega} \approx 2.553,\mathrm{A}$$

In order to simplify I consider here $$\Ig_{pk_{(OFF)}}=-Ig_{pk_{(ON)}}\$$. So, the root mean square value for $$\i_g\$$ is:

$$I_{RMS}= Ig_{pk_{(ON)}}\sqrt{\frac{2}{3} \times \frac{tp_{(ON)}}{T} } \approx 0.417\,\mathrm{A}$$

Finally, the average power for $$\R_G\$$ is:

$$P = I_{RMS}^2R_G \approx 0.817\,\mathrm{W}$$

No major differences from the value previously calculated.

THIRD METHOD

Just to mention a more precise (and more laborious) method. Here, $$\i_g\$$ is considered a true exponential decaying function (see figure above):

$$i_g = Ig_{pk_{(ON)}}e^{-\frac{t}{R_GC_{eff}}}$$

where $$\C_{eff}\$$ is the effective gate input capacitance of MOSFET. So:

$$i_g = \frac{V_{DR}}{R_G}e^{-\frac{t}{R_GC_{eff}}}$$

In the time interval $$\0\$$ to $$\t_s\$$, the total gate charge ("consumed") is given by:

$$Q_g = \int_{0}^{t_s} \frac{V_{DR}}{R_G}e^{-\frac{t}{R_GC_{eff}}}dt$$

This integral can be solved for a parameter ($$\R_G\$$ or $$\t_s\$$), when others are known.

CONCLUSION: The average power values were below $$\1\,\mathrm{W}\$$, but a margin of safety can be applied for guarantee.

• I created an account to let you know that this answer is one of the best answers I've seen, on any site, in a long time. Just brilliant. – LogicalBranch Mar 24 at 12:01
• This could become the canonical answer to questions of this kind. Thorough and well written. However, could you please add links or citations to the sources of the graphics? – Elliot Alderson Mar 24 at 13:20
• So much effort for approximate solutions, have a look to the simple and exact Dave Tweed's one below. – carloc Mar 24 at 13:47
• Estimating Total Gate Charge from Graph nice. – Israr Sayed Mar 24 at 13:58
• @carloc: Just AFTER doing the paper/pencil work it's possible to conclude that the solutions are similar. My contributions is aligned with the standard procedures recommended by manufacturers. Also deals with the gate resistor estimation. – Dirceu Rodrigues Jr Mar 24 at 14:09

Dividing the peak power by the frequency is not useful.

Instead, you would multiply it by the duty cycle. If you're dumping 25 W of power into the resistor for 2 × 100 ns out of every 2.5 µs. This would be an average power of

$$25 W \cdot\frac{2 \cdot 100 ns}{2.5 \mu s} = 2 W$$

Clearly, your 1W resistor is not going to cut it!

However, the peak instantaneous power is not really a good estimate of the average power during the switching transient. A better estimate can be arrived at by considering the energy flow into and out of the gate capacitance.

For an R-C circuit, the energy dissipated in the resistor is basically equal to the energy that ends up on the capacitor. If your gate charge is 210 nC and your gate voltage is 12V, this represents

$$Energy = \frac{1}{2}\cdot Charge \cdot Voltage$$

$$0.5 \cdot 210 nC \cdot 12 V = 1.26 \mu J$$

This is the energy you're dumping into the gate capacitance, and then dumping out again on every switching cycle. All of this energy gets dissipated in the gate resistor.

To get the average power, multiply the energy per cycle by the number of cycles per second, giving

$$1.26 \mu J \cdot 2 \cdot 400 kHz = 1.088 W$$

Your 1W resistor would be running at its limit, with no margin. I would use a 2W resistor here.


# Intersection is Largest Subset

## Theorem

Let $T_1$ and $T_2$ be sets.

Then $T_1 \cap T_2$ is the largest set contained in both $T_1$ and $T_2$.

That is:

$S \subseteq T_1 \land S \subseteq T_2 \iff S \subseteq T_1 \cap T_2$

### General Result

Let $T$ be a set.

Let $\powerset T$ be the power set of $T$.

Let $\mathbb T$ be a subset of $\powerset T$.

Then:

$\paren {\forall X \in \mathbb T: S \subseteq X} \iff S \subseteq \bigcap \mathbb T$

### Family of Sets

In the context of a family of sets, the result can be presented as follows:

Let $\family {S_i}_{i \mathop \in I}$ be a family of sets indexed by $I$.

Then for all sets $X$:

$\ds \paren {\forall i \in I: X \subseteq S_i} \iff X \subseteq \bigcap_{i \mathop \in I} S_i$

where $\ds \bigcap_{i \mathop \in I} S_i$ is the intersection of $\family {S_i}$.

## Proof

### Sufficient Condition

From Set is Subset of Intersection of Supersets we have that:

$S \subseteq T_1 \land S \subseteq T_2 \implies S \subseteq T_1 \cap T_2$

$\Box$

### Necessary Condition

Let:

$S \subseteq T_1 \cap T_2$

From Intersection is Subset we have $T_1 \cap T_2 \subseteq T_1$ and $T_1 \cap T_2\subseteq T_2$.

From Subset Relation is Transitive, it follows directly that $S \subseteq T_1$ and $S \subseteq T_2$.

So $S \subseteq T_1 \cap T_2 \implies S \subseteq T_1 \land S \subseteq T_2$.

$\Box$

From the above, we have:

$S \subseteq T_1 \land S \subseteq T_2 \implies S \subseteq T_1 \cap T_2$
$S \subseteq T_1 \cap T_2 \implies S \subseteq T_1 \land S \subseteq T_2$

Thus $S \subseteq T_1 \land S \subseteq T_2 \iff S \subseteq T_1 \cap T_2$ from the definition of equivalence.

$\blacksquare$


# Matrices with eigenvalues 0 and 1

How can you describe all $2\times 2$ matrices whose eigenvalues are 0 and 1?

My attempt: I know that 0 and 1 has to be solutions of the characteristic polynomial. And I've considered some examples like $$\begin{pmatrix}0&0\\0&1\end{pmatrix},\begin{pmatrix}1&0\\0&0\end{pmatrix} \text{ etc.}$$but I haven't found any regularity. But I also know from linear algebra that a matrix $A$ satisfying $A^2=A$ has only eigenvalues 0 and/or 1. Are there any more matrices? What do they have to satisfy?

• Do you mean that "the matrix has two eigenvalues, which are 0 and 1" or "the matrix has some unknown number of eigenvalues, all of which are either 0 or 1"? – Sharkos May 10 '13 at 21:31
• @Sharkos I would be interested in both cases :) – user31035 May 10 '13 at 21:34

Consider a matrix $$\begin{bmatrix} a & b \\ c & d \end{bmatrix}$$ You can easily work out the characteristic polynomial, which is $$X^2 - (a+d)X + (ad-bc)$$ Based on your information, you have $$\begin{cases} a+d=1 \\ ad-bc=0 \end{cases}$$ because in a polynomial $X^2+pX+q$ the sum of the roots is $-p$ and their product is $q$.

This gives $d=1-a$, so $a-a^2-bc=0$ or $bc=a-a^2$. You can thus choose arbitrarily $a$. If $a=0$ or $a=1$, then one among $b$ and $c$ must be zero and the other one is arbitrary. For $a-a^2\ne0$, the matrices you look for have the form $$\begin{bmatrix} a & b \\ \dfrac{a-a^2}{b} & 1-a \end{bmatrix}$$ So the general form is one of these five cases

1. $\begin{bmatrix}0 & b \\ 0 & 1\end{bmatrix}\quad$ (arbitrary $b$)

2. $\begin{bmatrix}0 & 0 \\ c & 1\end{bmatrix}\quad$ (arbitrary $c$)

3. $\begin{bmatrix}1 & b \\ 0 & 0\end{bmatrix}\quad$ (arbitrary $b$)

4. $\begin{bmatrix}1 & 0 \\ c & 0\end{bmatrix}\quad$ (arbitrary $c$)

5. $\begin{bmatrix} a & b \\ \dfrac{a-a^2}{b} & 1-a \end{bmatrix}\quad$ ($a\ne0$, $a\ne1$, $b\ne0$)

Since the eigenvalues are 0 and 1 (hence distinct), the matrix must be diagonalizable. Thus it must be of the form $P^{-1}\begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}P$ for some invertible matrix $P$. Since there is a nice explicit formula for the inverse of a $2 \times 2$ matrix, you can work out the form of any matrix of the aforementioned form. Take $P = \begin{pmatrix} a & b \\ c & d \end{pmatrix}$, where $\det P = ad-bc \ne 0$, then write out $P^{-1}$, and then compute.

EDIT: I am assuming you mean that the set of eignevalues of your matrix must be $\{0,1\}$, as opposed to being contained in this set, which is what Sharkos assumes. So it depends on what you intended.

Assuming that we exclude matrices from having complex eigenvalues but no real eigenvalues (which seems reasonable given your question) we make use of the Jordan normal form of the matrix.

There is some invertible matrix $P$ (a change of basis) such that

$$A = P^{-1} J P$$

where $J$ is in Jordan normal form with either $0$ or $1$ on the diagonal. In particular,

$$J = \pmatrix{0 & 0 \\ 0 & 0}, \pmatrix{1 & 0 \\ 0 & 1}, \pmatrix{1 & 0 \\ 0 & 0}, \pmatrix{0 & 1 \\ 0 & 0}, \pmatrix{1 & 1 \\ 0 & 1}$$

generate all other forms of these matrices.

• The first case has $A=0$.
• The second case has $A=I$.
• The third case is a change-of-basis from having one of each eigenvalue; it is a projection onto a line.
• The fourth case is a nilpotent matrix such that $A^2=0$. It maps one direction into another, and that direction into oblivion.
• The fifth case generates a skew/shear in some direction.

This is a partial answer that suggests how to parametrize such matrices explicitly.

The other answers are more elegant and tell the story more succinctly, but they construct the answers non-uniquely. (There are different matrices that you can conjugate a given Jordan normal form by and still obtain the same matrices: $P^{-1} J P = Q^{-1} J Q$ is possible with $P \ne Q$.)

First a little result about the characteristic polynomial $p_A(\lambda) = \det(A - \lambda I)$ for a $2 \times 2$ matrix $A$: $$p_A(\lambda) = \lambda^2 - (\operatorname{tr} A) \lambda + \det A,$$ where $\operatorname{tr} A = a + d$ is the trace. Check this from the definition if you're not familiar with it.

Now, proceed by cases. Suppose that $\lambda = 1$ is the only eigenvalue. Then, $$p_A(\lambda) = (\lambda - 1)^2 = \lambda^2 - 2\lambda + 1.$$ So, we know that \left\{ \begin{align} \operatorname{tr} A &= 2 \\ \det A &= 1 \end{align} \right. With $$A = \begin{bmatrix} a & b \\ c & d \end{bmatrix},$$ \left\{ \begin{align} a + d &= 2 \\ ad - bc &= 1 \end{align} \right.. Taking advantage of the trace equation to reduce the number of parameters, let's make the substitution $a = 1 + t$ and $d = 1 - t$. Now the determinant equation becomes $(1 + t)(1 - t) - bc = 1$ or $$bc = t^2.$$ Either $b = 0$, in which case, $t = 0$, as well, and $c$ is free to take any value: $$\begin{bmatrix} 1 & 0 \\ c & 1 \end{bmatrix}.$$ Or $b \ne 0$, so $c = -\frac{t^2}{b}$, so we have: $$\begin{bmatrix} 1 + t & b \\ -\tfrac{t^2}{b} & 1 + t \end{bmatrix}.$$

The space of possibilities in $(b, c)$-plane consists of both axes (corresponding to having $t = 0$, hence $1$ on the diagonal) together with the second and fourth quadrants (corresponding to $t \ne 0)$.

A similar analysis can give an explicit description of the other cases for the possibilities of the eigenvalues. (Note that this idea generalizes beyond your $\lambda \in \{0, 1\}$ assumption.)

• I think the second instance of $P$ near the top of your answer should be $Q$. – Alistair Savage May 10 '13 at 22:47
• Now it's fixed. – Sammy Black May 10 '13 at 22:49

If a matrix $A\in\mathbb{C}^{n\times n}$ has only eigenvalues $0$ and $1$ then its characteristic polynomial is of the form $$z^{a}\left(z-1\right)^{b}=z^{a}\sum_{k=0}^{b}\left(\begin{array}{c} b\\ k \end{array}\right)z^{k}\left(-1\right)^{n-k}=\sum_{k=0}^{b}\left(\begin{array}{c} b\\ k \end{array}\right)z^{a+k}\left(-1\right)^{n-k}$$ with $a+b=n$. A matrix that has the above characteristic polynomial is $$B=\left[\begin{array}{cccccc} 0 & & & & & -c_{0}\\ 1 & 0 & & & & -c_{1}\\ & 1 & 0 & & & -c_{2}\\ & & 1 & \ddots & & \vdots\\ & & & \ddots & 0 & -c_{n-2}\\ & & & & 1 & -c_{n-1} \end{array}\right]$$ where $$c_{j}=\begin{cases} 0 & j<a\\ \left(\begin{array}{c} b\\ k \end{array}\right)\left(-1\right)^{n-k} & j\geq a \end{cases}.$$ The above is called the Frobenius companion matrix to the characteristic polynomial. Another matrix that will satisfy this is $B^{T}$ since $\det\left(X^{T}\right)=\det\left(X\right)$. Note that $B$ is not a projection (i.e. $B^2\neq B$).

Obviously, not all matrices that have only eigenvalues of $0$ and $1$ are of this form. For example, $I$ only has $1$ as an eigenvalue but cannot be written in the above form.

• This construction gives (up to conjugation) the matrices which have the polynomial as minimal polynomial. – Mariano Suárez-Álvarez May 10 '13 at 22:20


# Proof that the set of irrational numbers is dense in the reals

The hint I was given was to simply prove that $y=xz$ is irrational given that $x$ is nonzero, $x$ is rational and $z$ is irrational. Here's how I did it:

Claim: $y=xz$ is irrational.

Proof: Assume $x\neq0$, $x$ is rational and $z$ is irrational.
By contradiction assume that $y=xz$ is rational. This means $y$ can be expressed as $m/n$, $m$ and $n$ being integers; $y$ can be expressed similarly as $p/q$, $p$ and $q$ being integers. By substitution, we have that $$p/q=mz/n$$ and $$z=pn/qm, qm \neq 0.$$ Since $pn$ and $qm$ are integers $z$ has to be rational.

In addition to this it seems like there's a part 2 as follows:

Proof: Given an interval $(x,y)$ we will choose a positive irrational number, $z$, say. By density of the rationals there is a rational $p$ in the interval $(x/z, y/z)$ s.t. $$x/z <p< y/z.$$ From this we see that $pz$ is irrational since it is the product of a rational and irrational number.

Is the $pz$ the $xz$ that we proved is irrational in the first proof? So ideally when presenting a full proof like this, should we do part 2 then part 1?

Great proof! You can apply your result about what you called $xz$ in part 1 to $pz$ in part 2 because it obeys your assumptions: $p \ne 0$, $p$ is rational and $z$ is irrational. So from part 1 we know that $pz$ is irrational.

We also know that $pz$ lies in the interval $(x,y)$, so irrationals are dense.

What is ideal to present when presenting a full proof depends on what your reader already knows. It sounds like in this case you want to present both part 1 and part 2, and that will be a complete proof. But in some other case your reader (or lecturer or marker) might not know or want to assume, for example, that rationals are dense in the real numbers, so you might have to include a part 1.5 that proves that.

EDIT: Oops, I think I misunderstood you. Yeah, I would present part 2 then part 1 when presenting this proof; I think the sequence of ideas flows better. But it's up to you!

Also, just to point out a few typos:

• I think you mean 'This means $x$ can be expressed as $m/n$' when you write "This means y can be expressed as m/n".
• I think you mean 'By substitution' when you write "By substation".

Hope that helps!


# How can I prove that $n^7 - n$ is divisible by $42$ for any integer $n$?

I can see that this works for any integer $n$, but I can't figure out why this works, or why the number $42$ has this property.

• Hint: Fermat's Little Theorem. – Arturo Magidin Feb 15 '11 at 6:13
• Hint #2: Chinese Remainder Theorem. – Pete L. Clark Feb 15 '11 at 6:19
• So you have $n^6\equiv 1\pmod{7}$, but this implies $n^7\equiv n\pmod{7}$. So $7|n^7-n$. In general, $n^p\equiv n\pmod{p}$ for a prime $p$. By the same token, $n^7\equiv (n^3)^2\cdot n\equiv n^3\equiv n\pmod{3}$ by FlT, so $3|n^7-n$. It remains to show $2|n^7-n$, and then you'll be done by the two hints above. – yunone Feb 15 '11 at 6:32
• @Yuval: $p=6$ ? :-) – lhf Feb 15 '11 at 12:26
• It works because $42=6(6+1)$ and Little Fermat, but I like to believe it works because it is the answer to the life, the universe and everything. – chubakueno Sep 1 '13 at 22:22

Problems like this appear frequently here. There are a couple of standard approaches. One is to use Fermat's little theorem, which says that if $p$ is a prime number, then $n^p-n$ is divisible by $p$ for all $n$.

Since $42=2\times 3\times 7$, what we need to do is to check that 2, 3, and 7 divide $n^7-n$, no matter what $n$ is.

That 7 does is direct from Fermat's little theorem.

The theorem also ensures that 3 divides $n^3-n$. Now: $$n^7-n=n(n^6-1)=n((n^2)^3-1)=n(n^2-1)(n^4+n^2+1)=(n^3-n)(n^4+n^2+1),$$ so 3 indeed divides $n^7-n$.

Finally, $n$ and $n^7$ always have the same parity, so $n^7-n$ is even.

We can actually argue without Fermat's little theorem in this case. An approach that only requires patience is as follows: The idea is to factor the polynomial $x^7-x$ and then analyze the result when $x=n$ is an integer. (This is a trick that Bill Dubuque suggests sometimes in his solutions.)

We have: $x^7-x=x(x^6-1)=x(x^3+1)(x^3-1)=x(x+1)(x^2-x+1)(x-1)(x^2+x+1)$. When $x=n$, we have $$n^7-n=(n-1)n(n+1)(n^2-n+1)(n^2+n+1).$$ Now we analyze this prime by prime, as before. Note that one of $n$ and $n-1$ is always even, so the product is even. Also, of 3 consecutive numbers, such as $n-1,n,n+1$, one is always divisible by 3, so it only remains to verify divisibility by 7.

We may assume that $n=7k+b$ where $b=\pm2$ or $\pm3$, since otherwise $(n-1)n(n+1)$ is a multiple of 7. In that case, $n^2\equiv 4$ or $2\pmod 7$, and one of $n^2+n$, $n^2-n$ is $\equiv 6\pmod 7$, so $(n^2-n+1)(n^2+n+1)$ is a multiple of 7.

The disadvantage of this approach over the previous one, of course, is the need to analyze different cases. Fermat's little theorem allows us to analyze all cases simultaneously, which typically (as here) results in a much faster approach.

If you are comfortable with the method of induction, this gives us a way of verifying divisibility by 7 which is not without some elegance (divisibility by 2 and 3 is probably best approached as before). Note that $(-n)^7-(-n)=-(n^7-n)$, so we may as well assume that $n\ge 0$. If $n=0$ it is obvious that 7 divides $n^7-n$.

Suppose then that $7|n^7-n$, and argue that $7|(n+1)^7-(n+1)$. For this, actually expand $(n+1)^7$ using the binomial theorem: $$(n+1)^7=n^7+7n^6+{7\choose 2}n^5+{7\choose 3}n^4+\dots+1.$$ The point is that $${7\choose k}=\frac{7!}{k!(7-k)!}$$ is obviously divisible by 7 as long as $k\ne0,7$, so (modulo 7) we have that $(n+1)^7-(n+1)\equiv (n^7+1)-(n+1)=(n^7-n)$. Now we invoke the induction hypothesis, that precisely says that the latter is divisible by 7, and we are done.

Of course, exactly the same inductive argument gives us a proof of Fermat's little theorem: $p|n^p-n$ for any $p$ prime and any integer $n$.

• To prove that $3$ divides, you can observe that $n^7-n=n^7-n^5+n^5-n^3+n^3-n$ – N. S. Jun 29 '12 at 15:42

It is a special case of the following global-form of little Fermat.  For $$\rm\, a,k,n\in\mathbb N$$ with $$\rm\ a,k > 1$$

$$\rm\qquad d\ |\ n^k\! -\! n\$$ for all $$\rm\:n\:$$ $$\rm \iff\ d\:$$ is squarefree, and $$\rm\ p\!-\!1\ |\ k\!-\!1\$$ for all primes $$\rm\:p\:|\:d$$

Hence for $$\rm\: a = 42 = 2\cdot 3\cdot 7\$$ we deduce: $$\rm\ \ 42\ |\ n^k\!-n\$$ for all $$\rm\:n \iff 6\ |\ k\!-\!1$$

For the simple proof and further discussion see Korselt's criterion for Carmichael numbers here (or my 2009/04/10 sci.math post, link is now broken by google)

Here is another useful variation:

Theorem $$\ \ \ n^{\large k+\phi}\equiv n^{\large k}\pmod{p^i q^j}\ \$$ assuming that $$\ \color{#0a0}{\phi(p^i),\phi(q^j)\mid \phi},\,$$ $$\, i,j \le k,\,\ p\ne q.\ \ \$$

Proof $$\ \, p\nmid n\,\Rightarrow\, {\rm mod\ }p^i\!:\ n^{ \phi}\equiv 1\,\Rightarrow\, n^{k + \phi}\equiv n^k,\,$$ by $$\ n^{\Large \color{#0a0}\phi} = (n^{\color{#0a0}{\Large \phi(p^{ i})}})^{\large \color{#0a0}m}\!\overset{\color{blue}{\rm (E)}}\equiv\! 1^{\large m}\!\equiv\! 1$$ by $$\rm\color{blue}{E}$$=Euler

$$\qquad\quad\ \, \color{#c00}{p\mid n}\,\Rightarrow\, {\rm mod\ }p^i\!:\ n^k\equiv 0\,\equiv\, n^{k + \phi}\$$ by $$\ n^k = n^{k-i} \color{#c00}n^i = n^{k-i} (\color{#c00}{mp})^i$$ and $$\,k\ge i.$$

So $$\ p^i\mid n^{k+\phi}\!-n^k.\,$$ By symmetry $$\,q^j$$ divides it too, so their lcm $$= p^iq^j\,$$ divides it too. $$\$$ QED

Remark $$\$$ Obviously the proof immediately extends to an arbitrary number of primes. This leads the way to Carmichael's Lambda function, a generalization of Euler's phi function.

• Very nice application of Fermat's Little Theorem's global-form (I had never seen it). However, the link to your proof takes me nowhere... – Dr. Mathva May 7 at 13:20
• @Dr.Mathva I added a local link (alas Google continues to break links to its usenet newsgroup archive). – Bill Dubuque May 7 at 14:06

There are many equivalent ways of proving it.

First observe that $42$ divides a number iff $2,3$ and $7$ divides the number.

(Since $42 = 2 \times 3 \times 7$ and $\gcd(2,3) = \gcd(3,7) = \gcd(2,7) = 1$)

Divisibility by $2$:

Clearly, $2|(n^7-n)$ since $n^7$ and $n$ are of the same parity.

Equivalently you could argue out that $2|(n^2-n)$ directly from Fermat's little Theorem. (This is an overkill of Fermat's Little Theorem.)

Divisibility by $3$:

$n^7-n = n(n^6-1) = n(n^2-1)(n^4+n^2+1)=n(n+1)(n-1)(n^4+n^2+1)$.

$3|n$ or $3|(n-1)$ or $3|(n+1)$ and hence $3|(n^7-n)$.

Equivalently you could argue out that $3|(n^3-n)$ directly from Fermat's little Theorem.

Divisibility by $7$:

Note that $n$ can be either $7k$ or $7k \pm 1$ or $7k \pm 2$ or $7k \pm 3$.

If $n=7k$ or $n=7k \pm 1$, we are again done since then $7|n$ or $7|(n+1)$ or $7|(n-1)$ and hence $7|(n^7-n)$.

If $n=7k \pm 2$, then $n^2 = (7k \pm 2)^2 = 7m + 4$ and $n^4 = (7m+4)^2 = 7l+2$. Hence $n^4 + n^2 + 1 = 7l+2 + 7m + 4 + 1 = 7(l+m+1)$ and hence $7|(n^4 + n^2 + 1) \Rightarrow 7|(n^7-n)$.

If $n=7k \pm 3$, then $n^2 = (7k \pm 3)^2 = 7m + 2$ and $n^4 = (7m+2)^2 = 7l+4$. Hence $n^4 + n^2 + 1 = 7l+4 + 7m + 2 + 1 = 7(l+m+1)$ and hence $7|(n^4 + n^2 + 1) \Rightarrow 7|(n^7-n)$.

Hence, $7|(n^7-n)$.

Equivalently you could argue out that $7|(n^7-n)$ directly from Fermat's little Theorem.

Therefore, we have that $2|(n^7-n)$ and $3|(n^7-n)$ and $7|(n^7-n)$, $\forall n \in \mathbb{N}$.

Hence, $42|(n^7-n)$, $\forall n \in \mathbb{N}$.

As $42=2.3.7$. Therefore,we need to check that $n^7-n$ is divisible by $2,3$ and 7. For divisibility by $2$, by fermat's little theorem, $n^2=n\pmod 2 \implies {(n^2)}^3.n=n^4\pmod 2=n^2\pmod 2=n\pmod 2 \implies n^7-n=0\pmod2$. For divisibility by 3, $n^3=n\pmod 3\implies n^7=n^3\pmod 3=n\pmod 3 \implies n^7-n=0\pmod 3$. For divisibility by 7, $n^7=n\pmod 7 \implies n^7-n=0\pmod 7$. These relations implies that $42|(n^7-n)$.

Combinatorial Polynomial Approach

Since \begin{align} n^7-n &=5040\binom{n}{7}+15120\binom{n}{6}+16800\binom{n}{5}+8400\binom{n}{4}+1806\binom{n}{3}+126\binom{n}{2}\\ &=42\left[120\binom{n}{7}+360\binom{n}{6}+400\binom{n}{5}+200\binom{n}{4}+43\binom{n}{3}+3\binom{n}{2}\right] \end{align} Therefore, we have that for all $n\in\mathbb{Z}$, $$42\mid n^7-n$$

Little Fermat Approach

Little Fermat Theorem says $$n^7\equiv n\pmod7$$ and since $7\equiv1\pmod2$ $$n^7\equiv n\pmod3$$ and since $7\equiv2\pmod1$ $$n^7\equiv n\pmod2$$ Thus, $$n^7\equiv n\pmod{42}$$

• +1. But I have a question: how do you know that $$n^7-n =5040\binom{n}{7}+15120\binom{n}{6}+16800\binom{n}{5}+8400\binom{n}{4}+1806\binom{n}{3}+126\binom{n}{2}$$? Is there some special formula or theorem for this expansion? I saw a similar one for the case $30\mid n^5-n$ – Dr. Mathva May 4 at 15:34
• If we know the values of $f(n)=n^7-n=\sum\limits_{k=0}^7a_k\binom{n}{k}$ for $n=0$ to $n=7$, it is very easy to compute the coefficients $a_k$ since for $n\lt k$, $\binom{n}{k}=0$. Since $f(1)=f(0)=0$, we get $a_1=a_0=0$. Since $f(2)=126$, we get $a_2=126$. Since $f(3)=2184$, $a_3=2184-126\binom{3}{2}=1806$. Since $f(4)=16380$, $a_4=16380-1806\binom{4}{3}-126\binom{4}{2}=8400$. etc. – robjohn May 4 at 16:04
• Oh, see. Thanks ;) – Dr. Mathva May 4 at 16:06
• Sorry for asking again, but I've just noticed there's one last thing I don't understand. You claim "If we know the values of $\displaystyle f(n)=n^7-n=\sum^7_{k=0}a_k\binom{n}{k}$ [...]". How can we, however, prove that $f$ can be represented as this sum? – Dr. Mathva May 11 at 20:52
• If you look at the method for computing $a_n$, you will see that as long as $f(n)$ is integral for $8$ consecutive integers $n$, we get the $8$ coefficients for this sum. – robjohn May 12 at 0:52

F$\ell$T$^*$ (if $p\not\vert n$, then $p\vert n^{p-1}-1$) $\Rightarrow$

if $2\not\vert n$, then $2\not\vert n^6$, and then $2\vert (n^6)^1-1$

if $3\not\vert n$, then $3\not\vert n^3$, and then $3\vert (n^3)^2-1=n^6-1$

if $7\not\vert n$, then $7\vert n^6-1$

so $2,3,7\vert n^7-n$.

$^*$: $\ell$=little.

Just for completeness, here is induction (just for divisibility by 7) :

Claim : $n^7 - n$ is divisible by 7

Base Case: True for n = 1,2

Induction Step: Assume true for n = k. To prove true for n = k + 1.

Now, $$(k+1)^7 - (k+1) = k^7 + 7k^6 + 21k^5 + 35k^4 + 35k^3 + 21k^2 + 7k + 1 - k - 1 \\= (k^7 - k) + 7(k^6 + 3k^5 + 5k^4 + 5k^3 + 3k^2 + k)$$ We know by our assumption that $k^7 - k$ is divisible by 7. Therefore, $(k + 1)^7 - (k + 1)$ is divisible by 7.

This shows that $n^7 - n$ is divisible by 7.

To show divisibility by 2 and 3, unfortunately, one has to fall back on some of the earlier tricks. $$n^7 - n = n(n^6 - 1) = (n-1)n(n+1)(n^2 - n + 1)(n^2 + n + 1)$$ $(n-1)n(n+1)$ is a product of three consecutive integers. Product of two consecutive integers is divisible by 2 and product of three consecutive integers is divisible by 3. Since, $(2,3) = 1$, product of three consecutive integers is divisible by 6. Since $(6,7) = 1$, $n^7 - n$ is divisible by 42.

QED

• Where is 42?... – lhf Jun 29 '12 at 11:24
• Good catch!! :P – TenaliRaman Jun 29 '12 at 14:58


# Smallest subgroup and $\langle a \rangle$.

Gallian says in Chapter 3 of Contemporary Abstract Algebra that

For any element $a$ of a group $G$, it is useful to think of $\langle a \rangle$ as the smallest subgroup of $G$ containing $a$.

But wouldn't this mean the set $\langle a \rangle$ is simply $\{ a, a^{-1}, e \}$?

• If it doesn't contain $a^2$, that isn't a subgroup. – Robert Israel Apr 10 '17 at 16:00
• @RobertIsrael Why not? – Airdish Apr 10 '17 at 16:03
• It needs to be closed under the group's operation. – Akiva Weinberger Apr 10 '17 at 16:58
• That isn't a group unless $a = a^{-1}$, in which case it would be $\{a, e\}$ only – q.Then Apr 10 '17 at 17:53
• @q.Then Actually that is a group if $a^2 = a^{-1}$. – fleablood Apr 10 '17 at 18:09

The set $\{a,a^{-1},e\}$ has an identity and is closed under inverses, but it isn't necessarily closed under the group's operation.

If $H$ is a subgroup and $a \in H$, you also need $a^2=aa\in H$ and $a^3=aaa \in H$ etc. Likewise, you need inverses for all of those elements (i.e. $a^{-1}, a^{-2}, \dots \in H$).

So closure under the group's operation and inverses require at least $\langle a \rangle = \{ a^n \;|\; n \in \mathbb{Z} \} \subseteq H$.

Once you know $\langle a \rangle$ is itself a subgroup. This shows that it is the smallest subgroup containing $a$.

• So what you're saying is that once you have $a$ in the subgroup, you automatically need its powers too because $a * a$ and $a *a * a$, etc. ought to be allowed operations under the group operation? – Airdish Apr 10 '17 at 16:05
• A group's operation is associative, has an identity, and inverses...but it also must be closed. If $a,b \in G$, then $ab \in G$ as well. So this means $a \in G$ then $a^2=aa \in G$ etc. So closure is what is forcing this. – Bill Cook Apr 10 '17 at 16:06
• Ah okay so the set $\{ a, a^{-1}, e \}$ isn't actually a group at all? – Airdish Apr 10 '17 at 16:08
• Not in general. For example: let $i=\sqrt{-1}$. Then $\{i,i^{-1},e\} = \{i,-i,1\}$ is not a group since multiplication isn't a closed binary operation operation on this set ($i^2=-1 \not\in \{i,-i,1\}$. Since we don't have a closed operation, it's not a group. – Bill Cook Apr 10 '17 at 16:12
• On the other hand, it could be. Consider $a=-1$ (with multiplication). Then $\{a,a^{-1},e\}=\{-1,(-1)^{-1},1\} = \{1,-1\}$ which is a perfectly good (cyclic) group (under multiplication). So $\{a,a^{-1},e\}$ can be a group, but usually it isn't. :) – Bill Cook Apr 10 '17 at 16:14

Groups are closed under their operations. In other words if $a,b \in G$ then we know that $ab \in G$.

So if $a\in <a>$ then we know that $a*a=a^2 \in <a>$ and $a^2*a = a^3 \in <a>$ and inductively we know that $a^2 \in <a>$ for all $n \in \mathbb N$. And as inverses must exist we know $a^{-n} \in G$.

So in general the group $<a> = \{.......a^{-3},a^{-2},a^{-1}, e,a,a^2,a^3,....\}$. But the $a^i$ need not be distinct. It could be possible for $a^i = a^k;i \ne j$. An example is $\mathbb Z_6=\{0,1,2,3,4,5\}$ under modulo addition. $2^5 = 2+2+2+2+2 = 4 = 2+2 = 2^2$. So $\{......2^{-3}=0,2^{-2}=2, 2^{-1}=4, 0, 2, 2^2 = 4, 2^3 = 0,....\} = \{0,2,4\}$ is not infinite.

Now it is possible that $a^k =e$ for some number $k$. Then $a^{-1} = a^{k-1}$ Example: In $\mathbb Z_6$, $2^3 = 2+2+2= 0$ and $2^{-1} = 4 = 2^{3-1}$. In this case $<a> = \{0, a, a^2, a^3, .... a^{k-1}\}$. Example $<2> \subset \mathbb Z_{6} = \{0,2,2^2=2^{-1}=4\}$

But it's also possible that $a^k \ne e$ for any $k \ne 0$. In this case $<a> = \{a^n|n \in \mathbb Z\}$. Example: If the group is $\mathbb Z$ under addition. Then $<7> = \{0, 7, -7, 14, -14, 21, -21, ....\} = \{7n| n \in \mathbb Z\}$. Which is infinite.

....

In general. If $a^n= e$ and $a^k\ne e; 1\le k < n$ we so "the order of $a$" is $n$ and we write it as $|a| = n$. If no such $n$ exists, we say $|a| = \infty$.

If $|a| = n$ then $<a> =\{0,a, a^2, ....., a^{n-1}\}$.

If $|a| = \infty$ then $<a> = \{a^k|k \in \mathbb Z\}$.

Notice $<a>$ always has $|a|$ units.