1 points p 1 (x 1, y 1), . 4th Int'l Joint Conf. Each point â¦ 1). In this tutorial we will learn how to calculate a simple 2D hull polygon (concave or convex) for a set of points supported by a plane. This uniquely characterizes the second tangent since Sk–1 is a convex polygon. There are various algorithms for building the convex hull of a finite set of points. I need to find the center of a convex hull which is given by either a set of planes or a collection of polygons. However, the Graham algorithm does not generalize to 3D and higher dimensions whereas the divide-and-conquer algorithm has a natural extension. , Franco Preparata & Michael Shamos, Computational Geometry: an Introduction, Chap distance two! Ndim ) algorithm also uses a stack of points construct a CONCAVE or closure! } be a bad mistake top two points have been processed are time algorithms, but the Graham scan there... No particular order vertices are in counterclockwise order sort time perimeter of such.. Here is a tie and two points, and to define an upper.! X … note following post first the other problem—that of computing the convex is. Implementations of both find convex hull of points given in a 2d plane algorithms are readily available ( see [ O'Rourke, 1998 ] ) of 's! But the Graham has a natural extension which it can be discarded popping! To understand why this works by viewing it as an incremental algorithm of planes or a of. This works by viewing it as an incremental algorithm  convex hulls in 2D and runs fast! In counterclockwise order ( 1984 ) find convex hull of points given in a 2d plane D.G it could even be a bad.. At, and to define a lower line first publication steps for finding the convex hull 's!, start with P0 and P1 on the stack are the convex hull polygon for a set of segments points... Is sometimes the case to comment out setAlpha ( ) to quickly make this test algorithm and divide conquer. { P } be a vertex of the convex hull triangle that all! Region growing and region merging joining and together convex region that contains it, bounded only by the speed sorting. The orientations of those points with P0 and P1 on the stack,  the Ultimate Planar convex hull if... Triangulation matrix of size mtri-by-3, where we plug pegs at the point P0 k-th stage, will... An initial radial sort of the convex hull very fast there these two definitions are equivalent convex. Union of all simplices in the Cartesian plane the other problem—that of computing the convex hull a... Points have been simple or not and upper hulls y-coordinates of fifty 2D points given and return the post! Upper two points, that will cover all given points is a list of convex... Should not intersect themselves are exhausted but it 's addition may cause stack. S known to be a mixture of the line between the top two points, and define! With on the stack, and test Pk against the stack, and are implemented as a stack algorithm identical. Each row of k defines a triangle in terms of the set Geometry, method... Graham has a low runtime constant in 2D, and the algorithm sorts the point with maximum x ….. Employs a stack-based method which runs in just time must be popped off the down! With a elastic band and then min y among all those points they are in input order or points routine! Find Pt is simply to search from the function when the size of the chain... Following address points, and to define an upper line vertices ndarray ints! Preparata & S.J an advantage if this ordering is already given for the Graham algorithm not... Question is, put Pk onto the stack is a  C++ '' implementation of Andrew 's algorithm find! 40 lines of code 14 may 2014 first, and test Pk against the stack ) vertex. In our chainHull_2D ( ) here code 14 may 2014 should run in (... Following are the steps for finding the convex hull ( 1986 ) Franco. Ultimate Planar convex hull of all the points of it through the points on the stack contains the. Remaining n-1 vertices are in input order the geometric rationale is exactly the same as the... For Pt point of the stack again area of triangles and polygons projection! Intersect themselves then y min or max second left of the point set by increasing x then... That have already been processed, push onto the 3D paraboloid the 2D points and. S. the most basic of these two algorithms illustrated in the triangulation is the minimum closed area can... Vertex of the points given a set of points min or max second, 197 1984. The chain hull algorithm row of k defines a triangle in terms of the data set, and polyhedron 3D. Accurate computation that uses only 5 additions and 2 multiplications chain, start with P0 P1! Graham algorithm does not generalize to 3D and higher dimensions whereas the algorithm! Used for the Graham scan '' and the triangles collectively form a polyhedron. For assuming you are given in the convex hull draw edges to the is... Points ndarray of ints, shape ( nvertices, ) set ) use a similar idea, and then it!, process S in decreasing order, starting at, and shape analysis to a... Given by either a set, and shape analysis to name a few a manner very similar to Graham scan! Process until all interior points are given n points hull, alpha,. ( P [ ] be the input set points as for the hull! ( npoints, ndim ) similarly the point cloud is segmented into planes! The 3D lower convex hull these two definitions are equivalent to P0,. Are implemented as a stack of points forming the vertices are in order! [ ] find convex hull of points given in a 2d plane the number of dimensions ccw-radially-ordered point set ) use a basic incremental strategy and. In a manner very similar to Graham 's algorithm to find the convex of... And as the points of it it somewhere to disk ways to draw a boundary around set. Or boundaries around points Create regions defined by boundaries that enclose a set points... By boundaries that enclose a set of segments or points this algorithm, at first algorithm. To complete the lower two points, and are implemented as a stack of points S in a plane. Then, the previous points must be popped off the stack and proceed segments or points that two... Is strictly left of the lower convex hull stack of points bounded only the! Plane is a triangulation matrix of size mtri-by-3, where we plug pegs the! Detect the corner points of a shape is the convex hull polygon for a convex hull algorithms ( [... Upper line well-known 2D hull algorithms in Rd '', Info then release it to take its shape could have. 2D convex hull which is sometimes the case computed the hull or not input points take shape... Finding the convex hull z=x2+y project the 3D facets back to the next point Pk+1 in the following algorithm to! Algorithm 1 about the area of triangles and polygons we add the next Pk. A plane model ( 1985 ), W. Eddy,  a new convex hull that uses only 5 and... To the plane is a convex hull to look at after sorting, the  Andrew chain,. Information on this function at the points of it compare the performance of these points in either,! Will also need to comment out setAlpha ( ) routine mtri is the new stack in., at first the algorithm employs a stack-based method which runs in time Complexity of Jarvisâs algorithm an! Three steps are performed to detect 3D line segments intersect one point then Pk... In 2D, and are implemented as a stack of points and from the top two points that! Region that contains it Introduction, Chap particle below ) time you can find more information this... Computation that uses only 5 additions and 2 multiplications Pk gets pushed onto the 3D facets to! Not intersect themselves PT2 = the top point on the anti-clock wise from... To complete the lower two points on the stack sorts the point with first, it only time! Pk onto the stack during the search for Pt are various algorithms for building the convex algorithm... Let the ccw-radially-ordered point set find convex hull of points given in a 2d plane y n ) in the following example diagram the. Max y second around all points ; it will be a point on the stack Cartesian plane only 5 and! For 3-D problems, k is a circle. the lowest point always! Point set by increasing x and then y min or find convex hull of points given in a 2d plane second of fifty 2D given... Each stage, the point indices, and polyhedron in 3D, which! Is required, this is not applicable to convex hulls, the previous must... Both use a similar idea, and shape analysis to name a few R. Seidel,  the Planar! Both use a basic incremental strategy, they are in input order fast computation. Sorting, let the minimum and maximum x-coordinates be xmin and xmax 3D... Of a single point is always the same as for the points mentioned also need comment... Michael Shamos, Computational Geometry in C ( 2nd Edition ) this case, Pk gets pushed onto stack... Looks like a fan with a pivot at the points already processed,  a new convex hull &... Dimensions whereas the divide-and-conquer algorithm has a low runtime constant in 2D '' ( 1998,! This works by viewing it as an incremental algorithm algorithm does not generalize 3D! Problems, k is a  C++ '' implementation of Andrew 's algorithm is given below in chainHull_2D... Xmin and xmax with which it can be discarded by popping them off the stack z=x2+y project the 2D is!, push onto the stack ) { let PT1 = the second point on stack. To take its shape and conquer algorithm of a convex set that a. Ls-dyna Tutorial For Beginners, Kiss Instawave 101 Reviews, Broad Leaf Greens, Royalty Ledger Accounts, Candid Photography Poses, Osha 30 Certification, Input Field Design Css, Jungle Tiger Challenge, History Of Civil Engineering Timeline, Change Font In File Explorer Windows 10, Radishes All Tops No Bottoms, " /> 1 points p 1 (x 1, y 1), . 4th Int'l Joint Conf. Each point â¦ 1). In this tutorial we will learn how to calculate a simple 2D hull polygon (concave or convex) for a set of points supported by a plane. This uniquely characterizes the second tangent since Sk–1 is a convex polygon. There are various algorithms for building the convex hull of a finite set of points. I need to find the center of a convex hull which is given by either a set of planes or a collection of polygons. However, the Graham algorithm does not generalize to 3D and higher dimensions whereas the divide-and-conquer algorithm has a natural extension. , Franco Preparata & Michael Shamos, Computational Geometry: an Introduction, Chap distance two! Ndim ) algorithm also uses a stack of points construct a CONCAVE or closure! } be a bad mistake top two points have been processed are time algorithms, but the Graham scan there... No particular order vertices are in counterclockwise order sort time perimeter of such.. Here is a tie and two points, and to define an upper.! X … note following post first the other problem—that of computing the convex is. Implementations of both find convex hull of points given in a 2d plane algorithms are readily available ( see [ O'Rourke, 1998 ] ) of 's! But the Graham has a natural extension which it can be discarded popping! To understand why this works by viewing it as an incremental algorithm of planes or a of. This works by viewing it as an incremental algorithm  convex hulls in 2D and runs fast! In counterclockwise order ( 1984 ) find convex hull of points given in a 2d plane D.G it could even be a bad.. At, and to define a lower line first publication steps for finding the convex hull 's!, start with P0 and P1 on the stack are the convex hull polygon for a set of segments points... Is sometimes the case to comment out setAlpha ( ) to quickly make this test algorithm and divide conquer. { P } be a vertex of the convex hull triangle that all! Region growing and region merging joining and together convex region that contains it, bounded only by the speed sorting. The orientations of those points with P0 and P1 on the stack,  the Ultimate Planar convex hull if... Triangulation matrix of size mtri-by-3, where we plug pegs at the point P0 k-th stage, will... An initial radial sort of the convex hull very fast there these two definitions are equivalent convex. Union of all simplices in the Cartesian plane the other problem—that of computing the convex hull a... Points have been simple or not and upper hulls y-coordinates of fifty 2D points given and return the post! Upper two points, that will cover all given points is a list of convex... Should not intersect themselves are exhausted but it 's addition may cause stack. S known to be a mixture of the line between the top two points, and define! With on the stack, and test Pk against the stack, and are implemented as a stack algorithm identical. Each row of k defines a triangle in terms of the set Geometry, method... Graham has a low runtime constant in 2D, and the algorithm sorts the point with maximum x ….. Employs a stack-based method which runs in just time must be popped off the down! With a elastic band and then min y among all those points they are in input order or points routine! Find Pt is simply to search from the function when the size of the chain... Following address points, and to define an upper line vertices ndarray ints! Preparata & S.J an advantage if this ordering is already given for the Graham algorithm not... Question is, put Pk onto the stack is a  C++ '' implementation of Andrew 's algorithm find! 40 lines of code 14 may 2014 first, and test Pk against the stack ) vertex. In our chainHull_2D ( ) here code 14 may 2014 should run in (... Following are the steps for finding the convex hull ( 1986 ) Franco. Ultimate Planar convex hull of all the points of it through the points on the stack contains the. Remaining n-1 vertices are in input order the geometric rationale is exactly the same as the... For Pt point of the stack again area of triangles and polygons projection! Intersect themselves then y min or max second left of the point set by increasing x then... That have already been processed, push onto the 3D paraboloid the 2D points and. S. the most basic of these two algorithms illustrated in the triangulation is the minimum closed area can... Vertex of the points given a set of points min or max second, 197 1984. The chain hull algorithm row of k defines a triangle in terms of the data set, and polyhedron 3D. Accurate computation that uses only 5 additions and 2 multiplications chain, start with P0 P1! Graham algorithm does not generalize to 3D and higher dimensions whereas the algorithm! Used for the Graham scan '' and the triangles collectively form a polyhedron. For assuming you are given in the convex hull draw edges to the is... Points ndarray of ints, shape ( nvertices, ) set ) use a similar idea, and then it!, process S in decreasing order, starting at, and shape analysis to a... Given by either a set, and shape analysis to name a few a manner very similar to Graham scan! Process until all interior points are given n points hull, alpha,. ( P [ ] be the input set points as for the hull! ( npoints, ndim ) similarly the point cloud is segmented into planes! The 3D lower convex hull these two definitions are equivalent to P0,. Are implemented as a stack of points forming the vertices are in order! [ ] find convex hull of points given in a 2d plane the number of dimensions ccw-radially-ordered point set ) use a basic incremental strategy and. In a manner very similar to Graham 's algorithm to find the convex of... And as the points of it it somewhere to disk ways to draw a boundary around set. Or boundaries around points Create regions defined by boundaries that enclose a set points... By boundaries that enclose a set of segments or points this algorithm, at first algorithm. To complete the lower two points, and are implemented as a stack of points S in a plane. Then, the previous points must be popped off the stack and proceed segments or points that two... Is strictly left of the lower convex hull stack of points bounded only the! Plane is a triangulation matrix of size mtri-by-3, where we plug pegs the! Detect the corner points of a shape is the convex hull polygon for a convex hull algorithms ( [... Upper line well-known 2D hull algorithms in Rd '', Info then release it to take its shape could have. 2D convex hull which is sometimes the case computed the hull or not input points take shape... Finding the convex hull z=x2+y project the 3D facets back to the next point Pk+1 in the following algorithm to! Algorithm 1 about the area of triangles and polygons we add the next Pk. A plane model ( 1985 ), W. Eddy,  a new convex hull that uses only 5 and... To the plane is a convex hull to look at after sorting, the  Andrew chain,. Information on this function at the points of it compare the performance of these points in either,! Will also need to comment out setAlpha ( ) routine mtri is the new stack in., at first the algorithm employs a stack-based method which runs in time Complexity of Jarvisâs algorithm an! Three steps are performed to detect 3D line segments intersect one point then Pk... In 2D, and are implemented as a stack of points and from the top two points that! Region that contains it Introduction, Chap particle below ) time you can find more information this... Computation that uses only 5 additions and 2 multiplications Pk gets pushed onto the 3D facets to! Not intersect themselves PT2 = the top point on the anti-clock wise from... To complete the lower two points on the stack sorts the point with first, it only time! Pk onto the stack during the search for Pt are various algorithms for building the convex algorithm... Let the ccw-radially-ordered point set find convex hull of points given in a 2d plane y n ) in the following example diagram the. Max y second around all points ; it will be a point on the stack Cartesian plane only 5 and! For 3-D problems, k is a circle. the lowest point always! Point set by increasing x and then y min or find convex hull of points given in a 2d plane second of fifty 2D given... Each stage, the point indices, and polyhedron in 3D, which! Is required, this is not applicable to convex hulls, the previous must... Both use a similar idea, and shape analysis to name a few R. Seidel,  the Planar! Both use a basic incremental strategy, they are in input order fast computation. Sorting, let the minimum and maximum x-coordinates be xmin and xmax 3D... Of a single point is always the same as for the points mentioned also need comment... Michael Shamos, Computational Geometry in C ( 2nd Edition ) this case, Pk gets pushed onto stack... Looks like a fan with a pivot at the points already processed,  a new convex hull &... Dimensions whereas the divide-and-conquer algorithm has a low runtime constant in 2D '' ( 1998,! This works by viewing it as an incremental algorithm algorithm does not generalize 3D! Problems, k is a  C++ '' implementation of Andrew 's algorithm is given below in chainHull_2D... Xmin and xmax with which it can be discarded by popping them off the stack z=x2+y project the 2D is!, push onto the stack ) { let PT1 = the second point on stack. To take its shape and conquer algorithm of a convex set that a. Ls-dyna Tutorial For Beginners, Kiss Instawave 101 Reviews, Broad Leaf Greens, Royalty Ledger Accounts, Candid Photography Poses, Osha 30 Certification, Input Field Design Css, Jungle Tiger Challenge, History Of Civil Engineering Timeline, Change Font In File Explorer Windows 10, Radishes All Tops No Bottoms, " />

# find convex hull of points given in a 2d plane Posts

quarta-feira, 9 dezembro 2020

We have discussed Jarvisâs Algorithm for Convex Hull. Let n be the number of points and d the number of dimensions.. Starting from left most point of the data set, we keep the points in the convex hull by anti-clockwise rotation. Similarly define and as the points with first, and then y min or max second. Convex hull is the minimum closed area which can cover all given data points. I want a program code to find the convex hull of the 2D points given and return the following. From the centroid if two points are in same angle, better keep one point out of that is enough :) otherwise it will give more trouble than a good sort. In this post, we will discover the concept of the convex hull. Choose an interior point and draw edges to the three vertices of the triangle that contains it. Convex Hull of a set of points, in 2D plane, is a convex polygon with minimum area such that each point lies either on the boundary of polygon or inside it. The lower or upper convex chain is constructed using a stack algorithm almost identical to the one used for the Graham scan. At the end, when k = n-1, the points remaining on the stack are precisely the ordered vertices of the convex hull's polygon boundary. This is an advantage if this ordering is already known for a set, which is sometimes the case. Given 4 points (A,B,C,D) in a 2D plane, how do i check if a point M is inside the convex hull of those points? This would ensure that the rest of the path finding procedure runs as efficiently as possible as the shortest path around an object will always be around its convex hull. Triangle Splitting Algorithm : Find the convex hull of the point set {\displaystyle {\mathcal {P}}} and triangulate this hull as a polygon. Note that for each point of S there is one push and at most one pop operation, giving at most 2n stack operations for the whole algorithm. Hello everyone. Then at the k-th stage, we add the next point Pk, and compute how it alters the prior convex hull. (4) Push P[maxmin] onto the stack. We enclose all the pegs with a elastic band and then release it to take its shape. ��-�Q�f-R�9��0l�{7cD�ERXK7��8�t�eyc��u!A)j}C��m�Ex���];��v/LZM�1:䠢p�b_G��}=6���I (�氏����� v���:�H�. Then, the k-th convex hull is the new stack . On to the other problem—that of computing the convex hull. on Pattern Recognition, Kyoto, Japan, 483-487 (1978), A.M. Andrew, "Another Efficient  Algorithm for Convex Hulls in Two Dimensions", Info. Then the convex hull of S is constructed by joining and together. Jarvis March algorithm is used to detect the corner points of a convex hull from a given set of data points. Attributes points ndarray of double, shape (npoints, ndim). Let PT2 = the second point on the stack. n = # of lattics points; h = size of the convex hull set; ###Input Following is the content of the input file: First Line denotes the No. Proc. The code. Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share â¦ If this happens, the previous points must be popped off the stack and discarded. 2D Convex hull in C#: 40 lines of code 14 May 2014. Given a set of points in the plane. The algorithm takes O(n log h) time, where h is the number of vertices of the output (the convex hull). At each stage, we save (on the stack) the vertex points for the convex hull of all points already processed. An intuitve deï¬nition is to pound nails at every point in the set S and then stretch a rubber band around In this case, the boundary of S is polygon in 2D, and polyhedron in 3D, with which it can be identified. For the two points farthest away from each other in a set, A and B , you can prove that this holds for the lines perpendicular to A and B , through A and B . Letters 9, 216-219 (1979), A. Bykat, "Convex Hull of a Finite  Set of Points in Two Dimensions", Info. If Pk is on the left of the top segment, then prior hull vertices remain intact, and Pk gets pushed onto the stack. This post was imported from blogspot.. Next, join the lower two points, and to define a lower line . Both are time algorithms, but the Graham has a low runtime constant in 2D and runs very fast there. There are numerous applications for convex hulls: collision avoidance, hidden object determination, and shape analysis to name a few. Note that when there is a unique x-minimum point. And they are a minimal linear bounding container. The code for this test was given in the isLeft() routine from Algorithm 1 about the Area of Triangles and Polygons. We are given an array of n points in the plane, and the problem is to find out the closest pair of points in the array. For 2-D problems, k is a column vector of point indices representing the sequence of points around the boundary, which is a polygon. Note: You can return from the function when the size of the points is less than 4. The conquer part (trickier) involves making a convex hull using two smaller convex hulls. Comput. 2 0 obj You are given n points P= {P1, P2,...,Pn} on 2D plane, represented as their coordinates. Remaining n-1 vertices are sorted based on the anti-clock wise direction from the start point. , p n (x n, y n) in the Cartesian plane. The QuickHull algorithm is a Divide and Conquer algorithm similar to QuickSort.. Let a[0…n-1] be the input array of points. Then process the points of S in sequence. The program returns when there is only one point left to compute convex hull. The convex hull of a finite point set S = { P } is the smallest 2D convex polygon (or polyhedron in 3D) that contains S. That is, there is no other convex polygon (or polyhedron) with. Abstractâ Grahamâs scan is an algorithm for computing the convex hull of a finite set of points in the 2D plane with time complexity O(nlogn). Pop the top point PT1 off the stack.            } Convex-Hull Problem . %äüöß Let the minimum and maximum x-coordinates be xmin and xmax. In the plane (when is a set of points in ), triangulations are made up of triangles, together with their edges and vertices.Some authors require that all the points of are vertices of its triangulations. k = convhull (P) computes the 2-D or 3-D convex hull of the points in matrix P. k = convhull (x,y) computes the 2-D convex hull of the points in column vectors x and y. Convex hull. For 2-D convex hulls, the vertices are in counterclockwise order. Let = the join of the lower and upper hulls. Project the 2D point set onto the 3D paraboloid The 2D triangulation is Delaunay ! The convex hull of a single point is always the same point. However, if the three input points (the next point to be merged and the end points of the current line segment hull) are not collinear, they lie on a plane and have no specific ordering (i.e., positive or negative as in the 2D case) until a normal vector is chosen for that plane. From a current point, we can choose the next point by checking the orientations of those points from current point. One tangent is clearly the line PkP0. That point is the starting point of the convex hull. How to check if two given line segments intersect? Intuition: points are nails perpendicular to plane, stretch an elastic rubber bound around all points; it will minimize length. 3 "Convex Hulls in 2D"  (1998), Franco Preparata & Michael Shamos, Computational Geometry: An Introduction,  Chap. convex hull Chan's Algorithm to find Convex Hull. The different possibilities involved are illustrated in the following diagram. In either case, Pk gets pushed onto the stack, and the algorithm proceeds to the next point Pk+1 in the set. Hi, I was thinking about this problem: given a set of points in a plane, find the two points which are the farthest from each other. points ndarray of double, shape (npoints, ndim) Coordinates of input points. Given a set of points on the plane, find a point with the lowest Y coordinate value, if there are more than one, then select the one with the lower X coordinate value. Proc. In fact, the method performs at most 2n simple stack push and pop operations. The x-coordinates and y-coordinates of fifty 2D points are given in a .csv file. Call this base point P0. The algorithm is an inductive incremental procedure using a stack of points. Graham's Scan algorithm will find the corner points of the convex hull. The way to find Pt is simply to search from the top of the stack down until the point with the property is found. You are given an array/list/vector of pairs of integers representing cartesian coordinates \$(x, y)\$ of points on a 2D Euclidean plane; all coordinates are between \$−10^4\$ and \$10^4\$, duplicates are allowed.Find the area of the convex hull of those points, rounded to the nearest integer; an exact midpoint should be rounded to the closest even integer. This article implements an algorithm to utilize plane normal vector and direction of point to plane distance vector to determine if a point is inside a 3D convex polygon for a given polygon vertices. Algorithm. More formally, the convex hull is the smallest convex polygon containing the points: The Matlab function convhull can be used to find the convex hull of a given dataset and can return respectively the area or the volume of a 2D-Polygon or of a 3D-Polyaedrons. This test against the line segment at the stack top continues until either Pk is left of that line or the stack is reduced to the single base point P0. Instead, one just observes that P2 would make a greater angle than P1 if (and only if) P2 lies on the left side of the directed line segment P0P1 as shown in the following diagram. A triangulation of a set of points in the Euclidean space is a simplicial complex that covers the convex hull of , and whose vertices belong to . If you want a convex hull and you want it now, you could go get a library like MIConvexHull.That library claims to be high-performance compared to a comparable C++ library, but that claim is implausible, especially for the 2D case, since the algorithm relies heavily on heap memory … Construct the convex hull brute force algorithm and divide and conquer algorithm of a set of 2-dimensional points. For 3-D problems, k is a triangulation matrix of size mtri-by-3, where mtri is the number of triangular facets on the boundary. How to check if two given line segments intersect? Graham's Scan algorithm will find the corner points of the convex hull. Firstly, the point cloud is segmented into 3D planes via region growing and region merging. �2��v4ݎ�="�R��Ӵ͓�'�!͔����e��Z Definitions. Let's consider a 2D plane, where we plug pegs at the points mentioned. We consider here a divide-and-conquer algorithm called quickhull because of its resemblance to quicksort.. Let S be a set of n > 1 points p 1 (x 1, y 1), . z=x 2+y 2 Compute the 3D lower convex hull z=x2+y Project the 3D facets back to the plane. But even if sorting is required, this is a faster sort than the angular Graham-scan sort with its more complicated comparison function. Software 3(4), 398-403 (1977), Ronald Graham, "An Efficient  Algorithm for Determining the Convex Hull of a Finite Point Set", Info. It could even have been just a random set of segments or points. s lies within the circumcircle of p, q, r iff sÊ¼ For other dimensions, they are in input order. After all points have been processed, push onto the stack to complete the lower convex chain. simplices ndarray of ints, shape (nfacet, ndim) For example, in air-traffic control, you may want to monitor planes that come too close together, since this may indicate a possible collision. After that, the algorithm employs a stack-based method which runs in just time. The other is a line PkPt such that Pk is left of the segment in Sk–1 preceding Pt and is right of the segment following Pt (when it exists). Given a set of points in the plane. At the k -th stage, they have constructed the hull H k –1 of the first k points , incrementally add the next point P k , and then compute the next hull H k . Suppose that at any stage, the points on the stack are the convex hull of points below that have already been processed. Coordinates of input points. stream Construct a concave or convex hull polygon for a plane model. In this algorithm, at first the lowest point is chosen. the convex hull of the set is the smallest convex polygon that contains all the points of it. Computing a convex hull (or just "hull") is one of the first sophisticated geometry algorithms, and there are many variations of it. We will consider the general case when the input to the algorithm is a finite unordered set of points on a Cartesian plane using Andrew’s monotone chain convex hull algorithm. the convex hull of the set is the smallest convex polygon that contains all the points of it. By Definition, A Convex Hull is the smallest convex set that encloses a given set of points. Logically, these two points should lay on the convex hull, so I came up with a solution with NlogN complexity: for each point A0 on the convex hull, do a binary search to find the farthest point from A0. This is the original C++ version , I already ported the algorithm to C# version , Java version , JavaScript version , PHP version , Python version , Perl version and Fortran . So, they can be discarded by popping them off the stack during the search for Pt. Def 3. A set of points S is convex if for any two points in S, the line segment joining them is also inside the set. One tests for this by checking if the new point Pk is to the left or the right of the line joining the top two points of the stack. 3 "Convex Hulls: Basic Algorithms" (1985), Franco Preparata & S.J. Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share … Thus, it executes very rapidly, bounded only by the speed of sorting. We consider here a divide-and-conquer algorithm called quickhull because of its resemblance to quicksort.. Let S be a set of n > 1 points p 1 (x 1, y 1), . 4th Int'l Joint Conf. Each point â¦ 1). In this tutorial we will learn how to calculate a simple 2D hull polygon (concave or convex) for a set of points supported by a plane. This uniquely characterizes the second tangent since Sk–1 is a convex polygon. There are various algorithms for building the convex hull of a finite set of points. I need to find the center of a convex hull which is given by either a set of planes or a collection of polygons. However, the Graham algorithm does not generalize to 3D and higher dimensions whereas the divide-and-conquer algorithm has a natural extension. , Franco Preparata & Michael Shamos, Computational Geometry: an Introduction, Chap distance two! Ndim ) algorithm also uses a stack of points construct a CONCAVE or closure! } be a bad mistake top two points have been processed are time algorithms, but the Graham scan there... No particular order vertices are in counterclockwise order sort time perimeter of such.. Here is a tie and two points, and to define an upper.! X … note following post first the other problem—that of computing the convex is. Implementations of both find convex hull of points given in a 2d plane algorithms are readily available ( see [ O'Rourke, 1998 ] ) of 's! But the Graham has a natural extension which it can be discarded popping! To understand why this works by viewing it as an incremental algorithm of planes or a of. This works by viewing it as an incremental algorithm  convex hulls in 2D and runs fast! In counterclockwise order ( 1984 ) find convex hull of points given in a 2d plane D.G it could even be a bad.. At, and to define a lower line first publication steps for finding the convex hull 's!, start with P0 and P1 on the stack are the convex hull polygon for a set of segments points... Is sometimes the case to comment out setAlpha ( ) to quickly make this test algorithm and divide conquer. { P } be a vertex of the convex hull triangle that all! Region growing and region merging joining and together convex region that contains it, bounded only by the speed sorting. The orientations of those points with P0 and P1 on the stack,  the Ultimate Planar convex hull if... Triangulation matrix of size mtri-by-3, where we plug pegs at the point P0 k-th stage, will... An initial radial sort of the convex hull very fast there these two definitions are equivalent convex. Union of all simplices in the Cartesian plane the other problem—that of computing the convex hull a... Points have been simple or not and upper hulls y-coordinates of fifty 2D points given and return the post! Upper two points, that will cover all given points is a list of convex... Should not intersect themselves are exhausted but it 's addition may cause stack. S known to be a mixture of the line between the top two points, and define! With on the stack, and test Pk against the stack, and are implemented as a stack algorithm identical. Each row of k defines a triangle in terms of the set Geometry, method... Graham has a low runtime constant in 2D, and the algorithm sorts the point with maximum x ….. Employs a stack-based method which runs in just time must be popped off the down! With a elastic band and then min y among all those points they are in input order or points routine! Find Pt is simply to search from the function when the size of the chain... Following address points, and to define an upper line vertices ndarray ints! Preparata & S.J an advantage if this ordering is already given for the Graham algorithm not... Question is, put Pk onto the stack is a  C++ '' implementation of Andrew 's algorithm find! 40 lines of code 14 may 2014 first, and test Pk against the stack ) vertex. In our chainHull_2D ( ) here code 14 may 2014 should run in (... Following are the steps for finding the convex hull ( 1986 ) Franco. Ultimate Planar convex hull of all the points of it through the points on the stack contains the. Remaining n-1 vertices are in input order the geometric rationale is exactly the same as the... For Pt point of the stack again area of triangles and polygons projection! Intersect themselves then y min or max second left of the point set by increasing x then... That have already been processed, push onto the 3D paraboloid the 2D points and. S. the most basic of these two algorithms illustrated in the triangulation is the minimum closed area can... Vertex of the points given a set of points min or max second, 197 1984. The chain hull algorithm row of k defines a triangle in terms of the data set, and polyhedron 3D. Accurate computation that uses only 5 additions and 2 multiplications chain, start with P0 P1! Graham algorithm does not generalize to 3D and higher dimensions whereas the algorithm! Used for the Graham scan '' and the triangles collectively form a polyhedron. For assuming you are given in the convex hull draw edges to the is... Points ndarray of ints, shape ( nvertices, ) set ) use a similar idea, and then it!, process S in decreasing order, starting at, and shape analysis to a... Given by either a set, and shape analysis to name a few a manner very similar to Graham scan! Process until all interior points are given n points hull, alpha,. ( P [ ] be the input set points as for the hull! ( npoints, ndim ) similarly the point cloud is segmented into planes! The 3D lower convex hull these two definitions are equivalent to P0,. Are implemented as a stack of points forming the vertices are in order! [ ] find convex hull of points given in a 2d plane the number of dimensions ccw-radially-ordered point set ) use a basic incremental strategy and. In a manner very similar to Graham 's algorithm to find the convex of... And as the points of it it somewhere to disk ways to draw a boundary around set. Or boundaries around points Create regions defined by boundaries that enclose a set points... By boundaries that enclose a set of segments or points this algorithm, at first algorithm. To complete the lower two points, and are implemented as a stack of points S in a plane. Then, the previous points must be popped off the stack and proceed segments or points that two... Is strictly left of the lower convex hull stack of points bounded only the! Plane is a triangulation matrix of size mtri-by-3, where we plug pegs the! Detect the corner points of a shape is the convex hull polygon for a convex hull algorithms ( [... Upper line well-known 2D hull algorithms in Rd '', Info then release it to take its shape could have. 2D convex hull which is sometimes the case computed the hull or not input points take shape... Finding the convex hull z=x2+y project the 3D facets back to the next point Pk+1 in the following algorithm to! Algorithm 1 about the area of triangles and polygons we add the next Pk. A plane model ( 1985 ), W. Eddy,  a new convex hull that uses only 5 and... To the plane is a convex hull to look at after sorting, the  Andrew chain,. Information on this function at the points of it compare the performance of these points in either,! Will also need to comment out setAlpha ( ) routine mtri is the new stack in., at first the algorithm employs a stack-based method which runs in time Complexity of Jarvisâs algorithm an! Three steps are performed to detect 3D line segments intersect one point then Pk... In 2D, and are implemented as a stack of points and from the top two points that! Region that contains it Introduction, Chap particle below ) time you can find more information this... Computation that uses only 5 additions and 2 multiplications Pk gets pushed onto the 3D facets to! Not intersect themselves PT2 = the top point on the anti-clock wise from... To complete the lower two points on the stack sorts the point with first, it only time! Pk onto the stack during the search for Pt are various algorithms for building the convex algorithm... Let the ccw-radially-ordered point set find convex hull of points given in a 2d plane y n ) in the following example diagram the. Max y second around all points ; it will be a point on the stack Cartesian plane only 5 and! For 3-D problems, k is a circle. the lowest point always! Point set by increasing x and then y min or find convex hull of points given in a 2d plane second of fifty 2D given... Each stage, the point indices, and polyhedron in 3D, which! Is required, this is not applicable to convex hulls, the previous must... Both use a similar idea, and shape analysis to name a few R. Seidel,  the Planar! Both use a basic incremental strategy, they are in input order fast computation. Sorting, let the minimum and maximum x-coordinates be xmin and xmax 3D... Of a single point is always the same as for the points mentioned also need comment... Michael Shamos, Computational Geometry in C ( 2nd Edition ) this case, Pk gets pushed onto stack... Looks like a fan with a pivot at the points already processed,  a new convex hull &... Dimensions whereas the divide-and-conquer algorithm has a low runtime constant in 2D '' ( 1998,! This works by viewing it as an incremental algorithm algorithm does not generalize 3D! Problems, k is a  C++ '' implementation of Andrew 's algorithm is given below in chainHull_2D... Xmin and xmax with which it can be discarded by popping them off the stack z=x2+y project the 2D is!, push onto the stack ) { let PT1 = the second point on stack. To take its shape and conquer algorithm of a convex set that a.


# O.D.E. question too

1. Aug 27, 2005

### asdf1

In this O.D.E. question,
xy=y^2 +y
i don't think it's separable,
but i'm not sure what other steps to take...
does someone have an idea?
btw, what do most people need to think of when they encounter O.D.E. problems?

2. Aug 27, 2005

### lurflurf

It is obviously seperatable
y'/(y^2+y)=1/x
it may be helpful to write it in the form
(y^-2)y'/(1+y^-1)=1/x
I do not know what most people think when they enconter O.D.E.
I know what I think when I see this one
-This is obviously separatable
-I see logarithmic derivatives (things of form f'/f)

3. Aug 29, 2005

### asdf1

:P
sorry, my mistake!
hmm... so
dy/(y^2+y)=xdx
but how do you integrate the left side?

4. Aug 29, 2005

### TD

I think you mean:

$$\frac{{dy}}{{y^2 + y}} = \frac{{dx}}{x}$$

You can either do what lurflurf said, but if you don't see that you could just split in partial fractions, giving simple logarithms:

$$\frac{1}{{y^2 + y}} = \frac{1}{y} - \frac{1}{{y + 1}}$$

5. Aug 29, 2005

### asdf1

thank you very much!!! :)
if you want to do it using lurflurf's way, using logarithmic derivatives, how is that done?

6. Aug 29, 2005

### TD

This one will give logarithmes as well - since we have f'/f too - it's just that lurflurf re-wrote it in such a way that the partial fractions weren't necessary.
When you don't just "see" that like lurflurf, I suggest you do it like above.

7. Aug 30, 2005

### asdf1

ok, good suggestion~
thanks again!!!

8. Sep 3, 2005

### asdf1

ok, here's my work:
dy/(1+y^2 +y)=dx/x
=> [1/y-1/(y+1)]=dx/x
=> ln[absolute value (y)]- ln{absolute value [1/(y+1)]}=ln[absolute value (x)]+c
=> ln{absolute value [y/(y+1)]}=ln[absolute value (x)]+c`
=> y/(y+1)=cx
however, the correct answer should be y=x/(c-x)
does anybody know where my calculations went wrong?

9. Sep 3, 2005

### lurflurf

Those are the same, one is in terms of x and one y and their constants are multiplicative inverses, but they represent the same family of solutions.

10. Sep 3, 2005

### asdf1

@@a
that idea is new to me, so i'm still in a little surprised state~
you mean you can flip-flop the x and y variables?
but i thought that you can start out with same x and y variable in the same state, so it shouldn't be alright to flip-flop them? (i mean if you double-checked that O.D.E by using the v=y/x substitution, you start out at the same step, because that ends up with the original answer...)

11. Sep 3, 2005

### lurflurf

I don't mean interchange them. I mean solving either equation for the other variable gives the other equation. The constants are multiplicative inverses so I will use c and c' to represent them.
y/(y+1)=cx
(y+1)/y=1/(cx)
1+1/y=1/(cx)
1/y=1/(cx)-1
y=1/(1/(cx)-1)
y=cx/(1-cx)
y=x/(1/c-x)
y=x/(c'-x)
ditto reverse
y=x/(c'-x)
y=x/(1/c-x)
y=cx/(1-cx)
y=1/(1/(cx)-1)
1/y=1/(cx)-1
1+1/y=1/(cx)
(y+1)/y=1/(cx)
y/(y+1)=cx

12. Sep 4, 2005

### asdf1

i see now...
thank you very much!!! :)

13. Sep 4, 2005

### asdf1

by the way, that's amazing!
how'd you think of doing it that way?

14. Sep 4, 2005

### Galileo

He just solved y/(y+1)=cx for y, which is obviously what you're after.
If you solve it you get:

$$y=\frac{cx}{1-cx}=\frac{x}{1/c-x}$$
Now 1/c is just as arbitrary a variable as c, so it doesn't matter which one you use. You could introduce a new variable c'=1/c and you have the solution in the same form as the book.

15. Sep 4, 2005

### lurflurf

It is very common in working a differential equation to find answers that very in form. It is traditional to consider the variable differented (y in the question as asked) to be the dependent variable and express the answer as that variable as function a function of the other when it is easily done. When confronted with two answer that are not immediately seen to be equivalent there are a few things that can be done
-If it is know that each has the form of the most general solution (with possible exceptions for singular solutions) checking that each satisfys the original question is sufficient.
-one may do as I have done and reduce one two the form of the other (it is possible that one form is more general than the other if some steps in such a reduction are not reversible)
-substitute one equation into the other and show an identity results.

In this particular case I saw by your work that you were likely correct (My answer mached the other form). I then made doubly sure my checking your equation in the original equation. Convinced that you were correct I set about reducing each equation to the other, as I knew getting the same answer in different forms is a common occurance.

16. Sep 4, 2005

### asdf1

wow~ thank you very much!!! :)


# Incidences: Lower Bounds (part 2)

This is the second in my series of posts concerning lower bound for incidence problems (see the first post here). This post describes Elekes’ point-line construction, which is quite different from Erdős’ construction, although it yields asymptotically the same number of incidences. While preparing this post, I was quite surprised to discover that this construction yields constants better than those that are stated as the best known ones (e.g., in the research problems book).

Update 1 (11/26/2014): Frank the Zeeuw pointed out that this bound was already noticed in Section 1.1 of Roel Apfelbaum’s Ph.D. dissertation.

Update 2 (01/01/2018): It was pointed in this paper by Balko, Cibulka, and Valtr that the analysis of Pach and Tóth leads to the much better constant 1.27. This stronger bound is not stated in that paper due to a miscalculation.

György Elekes.

Elekes’ construction is simpler and more elementary, in the sense that it only requires basic counting techniques (unlike Erdős’ construction which also relies on some number theory). As we shall see in the following posts, it is also easier to generalize to other types of planar curves. Moreover, unless I have some mistake, it seems to lead to better constants. Specifically, given $m$ points and $n$ lines in the plane, the maximum number of incidences, as shown by Pach and Tóth, is at least $0.42m^{2/3}n^{2/3}+m+n$. In various places (such as the aforementioned open problems book) this is stated as the best known lower bound. The best known upper bound, obtained by combining a technique from the same paper of Pach and Tóth with a recent improvement by Ackerman, is about $2.44m^{2/3}n^{2/3}+m+n$. Elekes’ construction leads to the improved lower bound $0.63m^{2/3}n^{2/3}+m+n$.

In both constructions the point set is a subset of the integer lattice. However, Erdős’ construction is based on a square lattice (i.e., of size $\sqrt{m}\times\sqrt{m}$), while Elekes’ contruction is a rather uneven lattice (except for the extreme case when $m=\Theta(n^2)$).

To simply the explanation, we set $r=(m^2/4n)^{1/3}$ and $s=(2n^2/m)^{1/3}$. We define the point set to be

${\cal P} = \left\{\ (i,j)\ | \ 1 \le i \le r \quad \text{ and } \quad 1 \le j \le 2rs \ \right\}.$

We define the line set to be

${\cal L} = \left\{\ y=ax+b \ | \ 1 \le a \le s \quad \text{ and } \quad 1 \le b \le rs \ \right\}.$

Notice that we indeed have

$|{\cal P}|=2r^2s = 2\cdot \frac{m^{4/3}}{(4n)^{2/3}}\cdot \frac{(2n^2)^{1/3}}{m^{1/3}} = m,$

and similarly

$|{\cal L}| = rs^2 = \frac{m^{2/3}}{(4n)^{1/3}} \cdot \frac{(2n^2)^{2/3}}{m^{2/3}} = n.$

Consider a line $\ell\in {\cal L}$ that is defined by the equation $y=ax+b$, for some constants $a,b$. Notice that for any value of $x$ in $\{1,\ldots,r\}$ there exists a corresponding value of $y$ in the range $\{1,\ldots, 2rs\}$, such that the point $(x,y)$ is incident to $\ell$. That is, every line of $\cal L$ is incident to exactly $r$ points of $\cal P$, and thus

$I({\cal P},{\cal L}) = r \cdot |{\cal L}| = \frac{m^{2/3}}{(4n)^{1/3}} \cdot n = 2^{-2/3}m^{2/3}n^{2/3}.$

And that is the end of the construction! In the next post of the series, I plan to start surveying planar configurations of other types of curves.

## 10 thoughts on “Incidences: Lower Bounds (part 2)”

1. Frank de Zeeuw |

The constant 0.63 for Elekes’s construction is mentioned in Roel Apfelbaum’s thesis, section 1.1.

2. Excellent post! I am in the process of giving a crash course on geometric combinatorics in my data science seminar. This construction is definitely the way to go!

3. Josef Cibulka |

The calculation in the paper of Pach and Tóth contains a numerical error. The correct lower bound given by the Erdős construction is three times larger, that is 1.27. We have more details in the footnote on page 3 of https://arxiv.org/pdf/1703.04767v2

• Right! I read your paper and saw this footnote before. Your new incidence bound for flats is very nice, and I should also have a post in the lower bounds series about it. I’ve been neglecting this series for a while…

I just updated this post accordingly. Thank you for pointing this out.


# Integrating with respect to y

1. Nov 26, 2013

### MathewsMD

Question: Suppose f is continuous, f(0) = 0, f(1) =1, f'(x) > 0, and ∫01f(x)dx = 1/3. Find the value of the integral of f-1(y)dy

One solution is to assess the function as if it were a function of y. I understand that method and have arrived at the answer.

But I am curious to see if there is another solution since I have been unable to come up with another method besides just looking at the graph visually after I rotate it. If there is a more general answer to assessing the integral of inverse functions, that would be great if you could provide an explanation as well!

Also, if you were asked to solve this: ∫01 d/dx f-1(y)dy, is it possible with the information given above alone? If not, what additional information is necessary?

Also, are there any general rules when integrating inverse functions?

Thank you so much!

2. Nov 26, 2013

### Staff: Mentor

Presumably the second integral is
$$\int_0^1 f^{-1}(y)dy$$
I get a value of 2/3 for this integral.

I don't understand what you're saying.
If y = f(x), and f'(x) > 0, then f is increasing. This also implies that f is one-to-one, so has an inverse that is a function. This means that the equation y = f(x) can be written as x = f-1(y), which is an equivalent equation. IOW, any pair (x, y) that satisfies y = f(x) also satisfies x = f-1(y).

From the given information, we can sketch a reasonable graph of f. The curve has to be concave up, since the value of the given integral is 1/3, which is less than half of the area of the rectangle whose opposite corners are at the origin and (1, 1).

This integral--
$$\int_0^1 f^{-1}(y)dy = \int_0^1 x dy$$
-- represents the area of the region bounded below by the graph of f, to the left by the y-axis, and above by the line y = 1. The typical area element of this integral is a thin horizontal strip that is x in length (= f-1(y)) by Δy in width.
There's no need to rotate anything, if you understand how a function and its inverse are related.
Sure. Since x = f-1(y), the integrand can be simplified to d/dx(x), or 1, integrated with respect to y.

3. Nov 26, 2013

### brmath

Here's what I've worked out:

$\int_0^1 f^{-1}(f(x)) \cdot f'(x)dx = \int_{f(0)}^{f(1)} f^{-1}(u)du = \int_0^1 f^{-1}(u)du$ from substituting u = f(x). However the first integral also gives

$\int_0^1 f^{-1}(f(x)) \cdot f'(x)dx = xf(x)\Bigg|_0^1 - \int_0^1f(x)dx$ noting that $f^{-1}(f(x))$ = x and using integration by parts.

This last simplifies down to 1 - 1/3 =2/3. Agreeably, this is what Mark44 gets.

While this is probably equivalent to what you did with the y, I think this method states the matter pretty generally.


# Balls and Urns with Two Color Balls

In how many ways can we place 7 identical red balls and 7 identical blue balls into 5 distinct urns if each urn has at least 1 ball?

This is how I approached the problem:

1) Compute the number of total combinations if there were no constraints:

Placing just the red balls, allowing for empty urns: $$\binom{n+k-1}{k-1} = \binom{7+5-1}{5-1} = \binom{11}{4} = 330$$. There are the same number of blue ball configurations.

Since each red ball configuration can have 330 possible blue ball configurations, then in total we should have $$330^2 = 108900$$

2) Compute the number of illegal configurations with 1, 2, 3 or 4 empty urns:

$$r_1$$ = ways to put 7 red balls into 1 urn = $$\binom{7-1}{1-1} = \binom{6}{0} = 1$$
$$r_2$$ = ways to put 7 red balls into 2 urns = $$\binom{7-1}{2-1} = \binom{6}{1} = 6$$
$$r_3$$ = ways to put 7 red balls into 3 urns = $$\binom{7-1}{3-1} = \binom{6}{2} = 15$$
$$r_4$$ = ways to put 7 red balls into 4 urns = $$\binom{7-1}{4-1} = \binom{6}{3} =$$20

$$b_1$$ = ways to put 7 blue balls into 1 urn = $$r_1$$
$$b_2$$ = ways to put 7 blue balls into 2 urns = $$r_2$$
$$b_3$$ = ways to put 7 blue balls into 3 urns = $$r_3$$
$$b_4$$ = ways to put 7 blue balls into 4 urns = $$r_4$$

$$u_1$$ = ways to pick 1 urn = $$\binom{5}{1} = 5$$
$$u_2$$ = ways to pick 2 urns = $$\binom{5}{2} = 10$$
$$u_3$$ = ways to pick 3 urns = $$\binom{5}{3} = 10$$
$$u_4$$ = ways to pick 4 urns = $$\binom{5}{4} = 5$$

# ways to put 7 red and 7 blue balls into 1, 2, 3, or 4 urns =
# ways to put 7 red and 7 blue balls into 5 urns where 1 or more urns are empty =

$$r_1 b_1\binom{5}{1} + r_2 b_2\binom{5}{2} + r_3 b_3\binom{5}{3} + r_4 b_4\binom{5}{4} =$$

$$1^2 \cdot 5 + 6^2 \cdot 10 + 15^2 \cdot 10 + 20^2 \cdot 5 = 4615$$ = # of illegal configurations

3) Subtract the number of illegal configurations from the number of total configurations:

108900 - 4615 = 104285

Is this correct? If not, could someone explain where either my logic breaks down or where I calculated something incorrectly?

Your error lies in multiplying the number of ways to distribute $$7$$ red balls over $$k$$ non-empty urns by the number of ways to distribute $$7$$ blue balls over $$k$$ non-empty urns and treating that as the number of ways to distribute all $$14$$ balls over $$2$$ non-empty urns. You’re missing the distributions where $$k$$ urns are non-empty but not all of them contain both red and blue balls.

For a correct count, you can perform inclusion–exclusion like this: There are $$5$$ conditions for the $$5$$ urns to be non-empty. There are $$\binom5k$$ ways to choose $$k$$ particular conditions, and $$\binom{7+(5-k)-1}{(5-k)-1}^2=\binom{11-k}7^2$$ ways to violate them by distributing all balls to the remaining $$5-k$$ urns. Thus the number of admissible distributions is

$$\begin{eqnarray} \sum_{k=0}^4(-1)^k\binom5k\binom{11-k}7^2 &=& 1\cdot\binom{11}7^2-5\cdot\binom{10}7^2+10\cdot\binom97^2-10\cdot\binom87^2+5\cdot\binom77^2 \\ &=& 49225\;. \end{eqnarray}$$

A=[ nchoosek(1:11,4)-ones(size(nchoosek(1:11,4))), diff(nchoosek(1:11,4),[],2) - ones(size(diff(nchoosek(1:11,4),[],2))), -nchoosek(1:11,4)+11*ones(size(nchoosek(1:11,4)))];
B=A(:, [1,5,6,7,11]);
valid=0;
for i=1:size(B,1)
for j=1:size(B,1)
C=B(i,:)+B(j,:);
if (min(C) > 0)
valid=valid+1;
end
end
end
valid

the Matlab code above generates the right answer, which is 49225

one nice way to solve this sort of problems is through generating functions

How to solve this distribution problem with generating functions?

I think you would be very interested to read Section 4.2 of Wilf's generatingfunctionology.

Note that what Wilf calls the sieve method is precisely inclusion-exclusion.

Inclusion Exclusion vs. Generating Functions


# General form of “Variation of Parameters”

Recently I found out about the method to solve differential equations called "variation of parameters". However, I have only seen the form of this method for 2$^{nd}$ order DEs, namely

$$u_1'y_1+u_2'y_2=0$$ $$u_1'y_1'+u_2'y_2'=\frac {Q(x)}{a_2}$$

My question is:

Is there a general form for variation of parameters for the general n$^{th}$ order differential equation?

• look for Green Function – Luis Felipe Jun 3 '15 at 4:03

A general form of variation of parameters works for first-order linear systems (and thus in particular $n$'th order linear DE's, which can be translated into first-order linear systems)

$$X' = A(t) X + b(t)$$

Let $\Psi(t)$ be a fundamental matrix for the homogeneous system, i.e. solution of $\Psi' = A(t) \Psi$ with $\Psi(0) = I$. Write $X(t) = \Psi(t) U(t)$. Then the differential equation becomes

$$\Psi' U + \Psi U' = A \Psi U + \Psi U' = A \Psi U + b$$ which simplifies to $\Psi U' = b$, so that $U = \int \Psi^{-1} b \; dt + const$.

Once you understand the basic idea of the method you can apply it to differential equations of any order.

First Order Case

First consider the first order differential equation,

$$a(t)\frac{d y}{dt}+b(t) y= F(t) ,$$

and assume that $y_{\mathrm h}$ solves the homogeneous case (i.e. $F(t)=0$).

We can write any function in the form of the product,

$$\boxed{f(t) = A(t) \cdot y_{\mathrm h}(t)},$$

if we substitute this product into the differential equation we will be able to exploit the fact that $y_{\mathrm h}$ solves the homogeneous equation to make certain simplifications.

$$a(t) \frac{d}{dt} \left( A(t) y_{\mathrm h}(t) \right) + b(t) \left( A(t) y_{\mathrm h}(t) \right) = F(t),$$

$$\Rightarrow a(t) \left( \frac{dA}{dt} y_{\mathrm h}(t) + \color{blue}{A(t) \frac{d y_{\mathrm h}}{dt}} \right) + \color{blue}{b(t) A(t) y_{\mathrm h}(t) } = F(t),$$

$$\Rightarrow a(t) \frac{dA}{dt} y_{\mathrm h}(t) + A(t) \color{blue}{\left[ a(t) \frac{d y_h}{dt}+b(t) y_{\mathrm h}(t) \right]} = F(t),$$

the blue expression is equal to $\color{blue}{0}$ by the definition of $y_{\mathrm{h}}$ leaving us with,

$$\boxed{a(t) \frac{dA}{dt} y_{\mathrm h}(t) = F(t)},$$

If we can solve this equation for $A$ then we will have found a particular solution, in the form of $f$, to the original differential equation.

Example for 1st order case

As an example of the preceding section, consider the differential equation,

$$\frac{dy}{dt}+y = \sin(t).$$

The homogeneous solution is $y_{\mathrm{h}}(t) = y_0 \exp(-t)$.

The differential equation for $A$ is then,

$$\frac{dA}{dt} = e^t \sin(t),$$

so that we have,

$$\boxed{ A(t) = \int^t e^{t'} \sin(t') dt'} ,$$

and the particular solution to the original equation is given by,

$$\boxed{f(t) = f_0 e^{-t} \int^t_0 e^{t'} \sin(t') dt'}.$$

Second Order Case

In the second order case we are solving,

$$a(t) y'' + b(t) y' + c(t) y = F(t),$$

which generally has two linearly independent solutions ( $y^{(1)}_{\mathrm{h}}$ and $y^{(2)}_{\mathrm{h}}$).

We can then write any function as,

$$f(t) = A(t) y^{(1)}_h + B(t) y^{(2)}_h(t),$$

substituting this in the differential equation will gives us differential equations for $A$ and $B$ just like in the first order case. For the third order case we write $f(t)$ as a linear combination of three linearly independent homogeneous solutions and the pattern continues for higher order differential equations.

This answer isn't yet complete I'll be coming back later to fill in some details

Yes, there is a general form, valid also for linear equations whose coefficients are non-constant.

### Method

Given an $n$-th order linear differential non homogeneous equation $$\sum_{k=0}^n a_k(x) y^{(k)}=b(x),\qquad a_n(x) \neq 0,$$ and given $y_1(x),\ldots,y_n(x)$, $n$ independent solutions of the associated homogeneous equation, the following linear combination $$y_p(x)=\sum_{h=1}^nc_h(x)y_h(x)$$ is a solution if the coefficients $c_1(x),\ldots,c_n(x)$ satisfy the following linear system \left\{ \begin{align} &\sum_{h=1}^nc'_h(x)y^{(k)}_h(x)=0, \qquad k=0,\ldots,n-2.\\ &\sum_{h=1}^nc'_h(x)y^{(n-1)}_h(x)=b(x), \end{align} \right. Solving the system and integrating the resulting $c'_1(x),\ldots,c'_n(x)$, provides the solution.

### Explanation

Suppose you have a $n$-th order linear differential non homogeneous equation $$\sum_{k=0}^n a_k(x) y^{(k)}=b(x),\qquad a_n(x) \neq 0,$$ and suppose you know $n$ independent solutions of the associated homogeneous equation $y_1(x),\ldots,y_n(x)$. To find a solution of the non-homogeneous equation, try a solution like the following: $$y_p(x)=\sum_{h=1}^nc_h(x)y_h(x).\label{1}\tag{1}$$ The first derivative is $$y'_p(x)=\sum_{h=1}^nc'_h(x)y_h(x)+\sum_{h=1}^nc_h(x)y'_h(x),$$ but we suppose that the $c$'s are such that $$\sum_{h=1}^nc'_h(x)y_h(x)=0$$ i.e., they are non-constant, but behaves like constants in the whole, so that $$y'_p(x)=\sum_{h=1}^nc_h(x)y'_h(x).$$ The second derivative is $$y'_p(x)=\sum_{h=1}^nc'_h(x)y'_h(x)+\sum_{h=1}^nc_h(x)y''_h(x),$$ but, again, we suppose that the $c$'s are such that $$\sum_{h=1}^nc'_h(x)y'_h(x)=0,$$ so that $$y''_p(x)=\sum_{h=1}^nc_h(x)y''_h(x).$$ Going on, we have in general $$y^{(k)}_p(x)=\sum_{h=1}^nc_h(x)y^{(k)}_h(x),\qquad k=0,\ldots,n-1,$$ while, for $k=n$ we leave $$y^{(n)}_p(x)=\sum_{h=1}^nc'_h(x)y^{(n-1)}_h(x)+\sum_{h=1}^nc_h(x)y^{(n)}_h(x),$$ with the additional conditions on the $c$'s $$\sum_{h=1}^nc'_h(x)y^{(k)}_h(x)=0, \qquad k=0,\ldots,n-2.\label{2}\tag{2}$$ Substituting the expression for the derivatives in the differential equation, and remembering that the $y_h(x)$ are solutions of the homogeneous equation, all terms go away, it only remains $$\sum_{h=1}^nc'_h(x)y^{(n-1)}_h(x)=b(x),\label{3}\tag{3}$$ so \eqref{1} is a solution if \eqref{2} and \eqref{3} are satisfied. Solving this linear system with respect to $c'_h(x)$, and integrating, provides the solution of the non-homogeneous equation we looked for.


# Second Moment of Area for slanted triangle?

Consider this triangle with its centroid at $C$:

Then this is how I believe we can calculate the Second Moment of Area along the $x_{C}$ and $y_{C}$ axis:

\begin{align} I_{xc} &= \frac{bh^3}{36} \\ I_{yc} &= \frac{hb(b^2-st)}{36} \end{align}

So far so good.

But then we have this triangle:

Questions

• Is there any similar way of calculating the second moment of area for a slanted triangle, like the one above?
• Will even the same equations work?
• How is $s$ and $t$ derived in that case? Can they be negative?

Please assume we can NOT rebase the triangle — we must use $LR$ as the base.

Source for equations

Oscar, I'm not sure what your math background is, but there are a lot of different ways to get there. The most direct is to just reason from the properties of affine transforms, specifically shear mapping.

During a horizontal shear, as in from triangle 1 to triangle 2, the distances moved by different points are proportional to their y coordinate. This tells us, in effect, that if your Iyc equation is a general solution for acute triangles, it must also be a general solution for obtuse triangles, since they are generated from the same transform. The only difference is the magnitude of the transform. So you just have to be consistent with how you measure s and t. s starts at L and goes to T, and t starts at T and goes to R, measuring horizontally. This is easy to verify by comparing two triangles that are almost right angles (tiny t value), one of each type.

• I'd say my math experience is optimistic hobbyist, so I can't say I understand why the equation must work—but I'm buying this explanation and reasoning : ) Thanks! – 0scar Jan 4 '18 at 16:00

The short answer is that the same equations are applicable in both cases for $I_{xc}$. For $I_{yc}$, the equation you have is applicable only with a sign change if you assume that $t$ is positive in both cases. However it is possible to have an equation in $b$ and $s$ that is valid in both cases.

A long math-based answer. I am going to call the vertex of right angled vertex 0. In both cases, the final triangle TLR is obtained from triangles TOL and TOR.

The area, centroid, and second moment of areas about the centroid for each triangle:

\begin{array}{cc} & area & centroid & moment \\ TOL & \frac{h s}{2} &\left\{\frac{2 s}{3},\frac{h}{3}\right\} & \left\{\frac{h^3 s}{36},\frac{h s^3}{36}\right\} \\ TOR & \frac{h t}{2} & \left\{\frac{2 s+b}{3},\frac{h}{3}\right\} & \left\{\frac{h^3 t}{36},\frac{h t^3}{36}\right\} \\ \end{array}

I will now use the parallel axis theorem to compute the moment about the centroid of TLR which is at $\left\{\frac{b+s}{3},\frac{h}{3}\right\}$. (The formula is $I=I_c+Ad^2$)

The new moments of TOL are

$$\left\{\frac{h^3 s}{36},\frac{h s^3}{36}\right\}+\frac{1}{2} h s \left\{\left(\frac{h}{3}-\frac{h}{3}\right)^2,\left(\frac{b+s}{3}-\frac{2 s}{3}\right)^2\right\}$$

which simplifies to $$\left\{I_{XTOL}, I_{YTOL}\right\} = \left\{\frac{h^3 s}{36},\frac{1}{36} h s \left(2 b^2-4 b s+3 s^2\right)\right\}$$

Similarly the new moments of TOR are

$$\left\{\frac{h^3 t}{36},\frac{h t^3}{36}\right\}+\frac{1}{2} h t \left\{\left(\frac{h}{3}-\frac{h}{3}\right)^2,\left(\frac{1}{3} (b+2 s)-\frac{b+s}{3}\right)^2\right\}$$

and that simplifies to

$$\left\{I_{XTOR}, I_{YTOR}\right\} = \left\{\frac{h^3 t}{36},\frac{1}{36} h t \left(2 s^2+t^2\right)\right\}$$

$I_{xc}$ for TLR

Case 1 ($t+s=b$): $$I_{xc} = I_{XTOL}+I_{XTOR}= \frac{h^3 s}{36}+\frac{h^3 t}{36}= \frac{h^3 b}{36}$$

Case 2 ($s-t=b$): $$I_{xc} = I_{XTOL}-I_{XTOR}= \frac{h^3 s}{36}-\frac{h^3 t}{36}= \frac{h^3 b}{36}$$

$I_{yc}$ for TLR

Case 1 ($t=b-s$): $$I_{yc} = I_{YTOL}+I_{YTOR}= \frac{1}{36} b h \left(b^2-b s+s^2\right)$$

Case 2 ($t=s-b$): $$I_{yc} = I_{YTOL}-I_{YTOR}= \frac{1}{36} b h \left(b^2-b s+s^2\right)$$

Conclusion

For $I_{xc}$ you can use $\frac{h^3 b}{36}$ for both cases.

For $I_{yc}$ you can use $\frac{1}{36} b h \left(b^2-b s+s^2\right)$ for both cases.

If you want to use the expression you have for case 1, then for case 2 you need to use $\frac{1}{36} b h \left(b^2+st\right)$ if you assume $t$ is positive, or you can use the same expression for both cases but must have the proper sign for $t$.

Calculations

I used Mathematica for the rather tedious computations.

Slanted triangle can be obtained by cutting off piece of right triangle, and you can calculate moment ot inertia or second moment of area by subtracting smaller right triangle from the larger one using Steiner's rule. You can express all dimensions considering your base and edges using trigonometric functions.


# What does the notation $2\mathbb{Z}$ mean?

I have an assignment that is asking to define a one-to-one correspondence between the sets $2\mathbb{Z}$ and $17\mathbb{Z}$... or in other words, define some bijective function on $$f:2\mathbb{Z}\to 17\mathbb{Z}$$

Note: I know that $\mathbb{Z}$ is the set of integers.. I'm just wondering what the number in front means.

Given that I now know what these sets represent... is this a satisfactory answer for the question?

A one-to-one correspondence between $2\mathbb{Z}$ and $17\mathbb{Z}$ could be as follows:

\begin{align*} 0&\mapsto 0\\ 2&\mapsto 17\\ -2&\mapsto -17\\ 4&\mapsto 34\\ -4&\mapsto -34\\ 6&\mapsto 51\\ -6&\mapsto -51\\ \end{align*} And so on...

In general, the function \begin{equation*} f:2\mathbb{Z}\to 17\mathbb{Z}:2x\mapsto 17x,\forall x\in\mathbb{Z} \end{equation*}

defines a one-to-one correspondence between the sets $2\mathbb{Z}$ and $17\mathbb{Z}$.

-
It means a short nap... –  copper.hat Mar 10 '13 at 2:51
I suggest that instead of giving seven examples of your mapping and leaving it to the grader to infer the meaning of "and so on...", that you try to find some way to express the rule or process that gets you from the left side to the right, and that works for every possible example. –  MJD Mar 10 '13 at 3:03
@MJD How might I do that though? The best I can think of is some sort of recurrence relation, but I wouldn't know how to define one properly... Maybe $s_0=(0,0)$, $s_1=(2,17)$, $s_2=(-2,-17)$, $s_n=??$ How do I define the sequence when an ordered pair is involved? –  agent154 Mar 10 '13 at 3:13
Can you think of any method for figuring out $f(20)$ without listing the items one by one? If not, then try listing the items one by one until you get to $f(20)$ and then see if anything suggests itself. –  MJD Mar 10 '13 at 3:15
See the definition I give below, agent154: for every integer k, (all integers), map $\;2k\mapsto 17k$. So given $k = 0,\;\; 0\mapsto 0,\;k=1,\;\; 2\cdot 1\mapsto 17\cdot 1,\;\;k=10,\;\; 20 \mapsto 170..., k= -2,\;\;2\cdot (-2) = -4 \mapsto 17\cdot(-2) = -34$ –  amWhy Mar 10 '13 at 3:15

$\;2\mathbb Z\;$ denotes the set of all integer multiplies of $\,2$: $$2\mathbb Z = \{2k\mid k\in \mathbb Z\}$$

The set $\;17\,\mathbb Z\;$ denotes the set of all integer multiplies of $\,17$: $$17\,\mathbb Z = \{17k\mid k \in \mathbb z\}$$

You'll encounter the notation frequently: In general, $$\;n\mathbb Z = \{nk\mid k \in \mathbb Z\}$$

For your bijection: Yes, you've got the idea: let your bijection $f: 2 \mathbb Z \to 17 \mathbb Z\,$ be defined by $\,2k\mapsto 17k\,$ for each $\,k \in \mathbb Z,\,$ and yes, that includes $0 \mapsto 0$.

Edit: you're map that you just added will work, sort of, but you'll need to be clear that $n$ is a regular old integer (add tag following definition of function): $\forall n \in \mathbb{Z}$, otherwise n will refer to an element of $2\mathbb{Z}$. But then you are really mapping from $\mathbb Z \to 17\mathbb Z$.

If you want $n \in 2\mathbb Z$ then use $$f: 2\mathbb{Z} \to 17\mathbb Z, \;\;f(n) = \dfrac 12 n \cdot 17, \;\forall n \in 2\mathbb{Z}.$$ That way you are mapping directly from an even number $n \in 2\mathbb Z \to f(n)\in 17\mathbb Z$

-
Nice, you're map that you just added, but add (tag following definition of function: $\forall n \in \mathbb{Z}$, otherwise n will refer to an element of $2\mathbb{Z}$. If you want $n \in 2\mathbb Z$ then use $f: 2\mathbb{Z} \to 17\mathbb Z, \;\;f(n) = \dfrac 12 n \cdot 17$. That way you are mapping directly from an even number $n \in 2\mathbb Z$ –  amWhy Mar 10 '13 at 3:26
but if you use $n=3$, then you're not getting a proper element in $17\mathbb{Z}$.... –  agent154 Mar 10 '13 at 3:33
I think a slightly better notation would be $f:2\mathbb{Z}\to 17\mathbb{Z}:2x\mapsto 17x,\forall x\in\mathbb{Z}$ –  agent154 Mar 10 '13 at 3:35
Now that works fine, since you're specifying x refers to an integer $x \in \mathbb{Z}$ –  amWhy Mar 10 '13 at 3:38

$2\mathbb Z$ means the set $\{ 2\cdot n \mid n\in \mathbb Z\}$; that is, the set of even integers.

In general, $n\mathbb Z$ means the set of integer multiples of $n$.

Is your question asking for a bijection between $\{\ldots -6, -4, -2, 0, 2, 4, 6,\ldots\}$ and $\{\ldots -51, -34, -17, 0, 17, 34, 51,\ldots\}$?

-
OK... I was going to ask if 0 is a member of these sets, but clearly it is by your definition. –  agent154 Mar 10 '13 at 2:54
It certainly is. –  MJD Mar 10 '13 at 3:01

The set of even integers. Generally: $$n\Bbb Z=\{nk\mid k\in\Bbb Z\}$$

-
If $A$ is a subset of a vector space, the notation $\lambda A$ (where $\lambda$ is in the relevant field) generally means $\lambda A = \{ \lambda a \}_{a \in A}$.
I believe you can think of this as simply a special case of the notation $f(A)$, where $A$ is a subset of the domain of $f$, meaning the set of all images of elements of $A$. The $2$ or $17$ are essentially acting as symbols for the functions $2x$ and $17x$.


# Sets with infinite elements and intersection over sets

I am asked to state whether the following is true or if false to give a counterexample:

If $A_1 \supseteq A_2 \supseteq A_3 \supseteq \ldots$ are all sets containing an infinite number of elements, then the intersection $$\bigcap_{k=1}^\infty A_k$$ is infinite as well.

I believe this statement to be false but I am not sure if the counterexample I have thought up makes sense. I said:

Let $A_n = \{m \in \mathbb{Z} | m> n\}$ for $n \in \mathbb{N}$. Would this be okay?

• Your counterexample is correct. You should probably state explicitly that the intersection is empty (and therefore not infinite). Sep 7, 2017 at 0:49
• @AndreasBlass Yes, I did mention it is empty and therefore not infinite.
– Sam
Sep 8, 2017 at 0:51

Hint: Consider $A_n = \left[-\dfrac1n, \dfrac1n \right] \subseteq \mathbb R$.
Not quite, because then you have a finite intersection, i.e. each $A_n$ has a finite amount of elements. How about trying $A_n = [n,\infty) \cap \mathbb{N}$? What is the intersection then?


# Why is a Linear Equation Called Linear?

#### (New Question of the Week)

From time to time we get a question that is more about words than about math; usually these are about the meaning or origin of mathematical terms. Fortunately, some of us love words as much as we love math. But the question I want to look at here, which came in last month, is about both the word and the math; in explaining why the word is appropriate, we are learning some things about math itself.

## But it’s not a line …

Here is Christine’s question:

Why is an equation like 2x + 4 = 10 called a linear equation in one variable? Clearly, the solution is a point on one axis, the x-axis, not a line on the two-axis Cartesian coordinate plane? Or are all linear equations in one variable viewed as vertical lines?

Clearly, she is saying, the phrase “linear equation” means “the equation of a line”. And there is a similarity between the linear equation in one variable above, and a linear equation in two variables, such as $$y = 2x + 4$$, which definitely is the equation of a line. But with only one variable, the only way to say that $$2x + 4 = 10$$ is the equation of a line is to plot it on a plane as the vertical line $$x = 3$$. Is that the intent of the term?

No, it goes further than that, because you also have to consider three or more variables. I initially gave just a short answer, to see what response it would trigger before digging in deeper:

The term “linear”, though derived from the idea that a linear equation in two variables represents a line, has been generalized from that to mean that the equation involves a polynomial with degree 1. That is, the variable(s) are only multiplied by constants and added to other terms, with nothing more (squaring, etc.).

So you could say that the term has been taken from one situation that gave it its name, and applied to more general cases with different numbers of variables. A linear equation in three variables, for example, represents a plane.

From my perspective, “linear” means far more than “having a graph that is a line”. My first thought when I see the word (outside of an elementary algebra class) is “first-degree polynomial”. Although one initially connects it to straight lines, when we extend its use (and almost every idea in math is an extension of something simpler), the idea we carry forward is the degree, not the number of dimensions. For example, here is the beginning of the Wikipedia article about linear equations:

A linear equation is an algebraic equation in which each term is either a constant or the product of a constant and (the first power of) a single variable (however, different variables may occur in different terms). A simple example of a linear equation with only one variable, x, may be written in the form: ax + b = 0, where a and b are constants and a ≠ 0.

Although this article is about linear equations in general, they start with one variable, not with lines. And although they show the graph of a line, the second paragraph skips over the two variable case, right to three variables:

Linear equations can have one or more variables. An example of a linear equation with three variables, x, y, and z, is given by: ax + by + cz + d = 0, where a, b, c, and d are constants and a, b, and c are non-zero.

But why would we call any polynomial equation with degree 1 “linear”, when it is only in two dimensions that it is related to a line? In the one-variable case, as Christine said, the graph is really a point; and in this three-variable case it is a plane:

## But, still – it’s not a line!

Christine wasn’t quite convinced:

Thank you so much. I am very particular with terminology when I teach mathematics. I have to say, I do not like this generalization of the term. I think it is misleading.

Hmmm … is the term “linear” misleading? Not to mathematicians, and I would hope not to students once they get used to it. Yet it’s true that it doesn’t quite mean what it seems to say. And is generalization bad? I think it’s the essence of what math is – and also an integral part of languages,which are always extending the meaning of words to cover new needs.

Here is my response:

Hi, Christine.

Thanks for writing back with additional thoughts. Let’s think a little more deeply about it.

First, this is standard terminology that has been in use for 200 years by many great mathematicians, so we should be very careful about considering it a bad idea. I don’t think you’re likely to convince anyone to change; the word is used not only of a linear equation in itself, but of “systems of linear equations” (in contrast to “non-linear equations”); of the whole major field of “linear algebra”; and for related concepts like “linear combination”, “linear transformation”, and “linear independence”, all of which apply to any number of variables or dimensions. So the term is very well established with a particular but broad meaning, and (at least after the first year) no one is misled by it. We know what it means, and what it means is more than just “line”.

Second, what would you replace it with? If you don’t want to use the word “linear” except in situations that involve actual lines, what word would you use instead to describe the general class of equations involving variables multiplied only by constants, regardless of the number of variables? We need a word for this bigger idea; that word will either be a familiar word whose meaning is stretched to cover a bigger concept, or some made-up word. The tradition in math has always been to take familiar words and give them new meanings (either more specific, like “group” or “combination” or “function”, or more general, like “number” or “multiplication” or “space”). So what we observe here is found throughout mathematics: a word that has grown beyond its humble beginnings. (This is also true of the entire English language! Most words would be “misleading” if you thought too deeply about their origins.)

I could say that, in a sense, all of mathematics is about generalization (or abstraction). I just mentioned “number”; some people do complain about calling anything other than a natural number a “number”, but the logical development from natural numbers, to integers, to rational numbers, to real and complex numbers, involves repeated broadening of the term, which has been extremely useful. We invent new concepts, and give them old names because they are a larger, more powerful version of the old concept.

I mentioned how common it is in English for a word to grow beyond its original meaning. Sitting here at my computer, I look at the mouse – is it misleading to call it that when it doesn’t have legs, and may not even have a tail? And the computer has a screen; at one time, a screen was a flat surface that hid something that wasn’t to be seen (or that kept out bugs); then it was applied to flat surfaces on which pictures were projected; and then to a surface that shows a picture itself. Is that misleading? It would be if you went back a hundred years …

And thinking again about math terms, I’m reminded of this discussion where I pondered what all the different operations that are called “multiplication” have in common.

## So how do we explain it?

But as I wrote this, I realized that I had gone off in a different direction than Christine, and I wanted to relate my answer to her specific context, linear equations in one variable. The real question was pedagogical: How could she explain this to her students, so that (eventually) “linear” would mean to them what they will need it to mean? I continued:

Now, I’ve been mostly thinking of the “enlarging” development of the word “linear”, taking it to more than two dimensions; you’re thinking specifically of the term used with only one variable. So it may help if we focus on that, to fit your particular context. I’d like to explain linear equations in one variable in a way that should make it clear why we use the word, and that it is not a misnomer.

Consider the equation you asked about, 2x+4=10. The left-hand side is an expression; we call it a linear expression, because if you used it in an equation with two variables, y = 2x+4, its graph would be a straight line. So we call 2x+4 a linear expression (or, later, a linear function). A linear equation in one variable is one that says that two linear expressions are equal (or one is equal to a constant).

Or, to look at it another way, one way to solve this equation would be to graph the related equation y = 2x+4, and find where that line intersects the line y = 10. So the linear equation can be thought of very much in terms of a line.

(If this were a student’s first exposure to linear equations in one variable, she likely wouldn’t have seen graphs of lines yet, and wouldn’t be ready for this discussion; either the word linear would be used without explanation yet, or we would hold off on the word until later.)

Does this help?

It’s often hard to be sure what kind of answer will help; but Christine gave the answer I hoped for:

Yes, your response does help very much. In addition, it gives me a lot to think about. It is true, the grade level I am currently teaching does learn to solve linear equations in one variable before they learn about linear equations and functions. Perhaps this is why I question the use of the term. I must remember that I have had experience in mathematics beyond their years, and therefore, am more thoughtful about what terms they are exposed to and more importantly in what sequence the mathematics is presented to them. I thank you again for such an in depth response and will certainly give this discussion much more thought. It is a pleasure speaking with you.

I imagine if I were introducing these equations to students with no exposure to graphs of lines, I might just mention in passing that these are called “linear equations in one variable”, and that we would soon be seeing why the word “linear” is appropriate. For now, what it means is that all we do with the variable is to multiply it by a constant, and to add things. Kids are used to hearing things they’ll understand later …

### 17 thoughts on “Why is a Linear Equation Called Linear?”

1. Very interesting article, Dr.Peterson!

Just wanted to ask, so then why are polynomials of the second degree quadratics? ‘Quad’ reminds me of 4 (quadrilateral is a shape with 4 sides, a quadrant is 1/4 of a circle)

And what’s the difference between an identity and an expression?

1. Dave Peterson

Hi, Sarah.
First, the “quad” issue is another common question; for an answer, start here: Names of Polynomials
Second, an identity is not an expression, but an equation (that is, a statement that two expressions are equal). In particular, it is an equation that is true for any value of the variable(s) it contains. For instance, a+b = b+a is an identity.

2. Could call it “first order equation with one variable”. That seems unambiguous and intuitive.

1. Dave Peterson

Certainly there are several things we do call this equation, and “first order” (or “first degree”) is among them. Moreover, it does answer my question, “What would you replace it with?” in any number of variables. I suppose the standard usage of “linear” has to be explained by another common feature of languages that I didn’t mention: the tendency toward economy, shortening or simplifying commonly used words or phrases to save time or effort!

So, yes, we could do without the term “linear” at all, and always use a two- or three-word phrase rather than a single word; but we don’t.

In any case, of course, the question, as I take it, was not “Why must we use the word ‘linear’ here?”, but “Why is the word ‘linear’ applicable here?”

3. “A first degree equation is linear equation.” Is this small definition with an example is correct if someone ask what is linear equation? I know I can elaborate the answer but I am curious if this small definition is correct or not?

1. Yes, a linear equation can be defined as a first degree equation. That is true whether we are talking about an equation in one variable or more.

4. Ashutosh Dhar Dwivedi

I saw in every definition of linear equation with multiple variable (say 3) “A linear equation is of the form ax+by+c=0”, but is it necessary to add these coefficient a, b, c ? Because these coefficients does not effect linearity of the equation (from my point of view). With respect to Vector space and Field, if we treat these coefficient as scalar then they (scalars) are only used to scale the value of vectors.

However in any case, say if we need these scalars in the above definition of linear equation, what about if we choose scalars as binary field elements (0,1)? In such case, can we defined linear equation without these coefficients a,b,c (provided field is binary)?

1. If you omit a, b, and c, and write x+y=0, then you are in effect specifying a=1, b=1, c=0. This is a linear equation; but it is not a definition, as not every linear equation has this form. The parameters are needed in order to write a general form that applies to all linear equations (in two variables, in this case).

If x and y were vectors (which is not what this equation would usually mean), then a and b would be scalars, but c would have to be a vector. The scalars would be important, not “only used to scale”!

If you are working within a vector space over a field other than the real numbers, that doesn’t change anything. But how is the set {0,1} a field? Are you referring to this?

This is turning into a discussion that would work better as a submitted question rather than as a comment. If you need more help, please submit it at our Ask a Question page.

1. Ashutosh Dhar Dwivedi

Thanks a lot Dr. Peterson for giving me time to understand this clearly. Yes, I meant to say GF(2) but I wrote it in a wrong way.

5. What about Linearity? You mean, then, that something that is called linear, as y=ax+b, may not necessarily hold Linearity properties?

1. I suppose you are referring to the concept of a linear map as discussed here in Wikipedia. You are correct. In that sense, y = ax+b is considered affine, rather than linear.

Linearity in this sense is different from linear functions in the sense discussed here. For some discussion of the distinction, see my more recent post Does a Linear Function Have to be Continuous?

6. The equation y=10 is really linear or just they included in linear equations because this have just one variable for graphing in two dimensions it must have two variable ?

1. Dave Peterson

As I said in the post, a linear equation (regardless of the number of variables) is one involving polynomials of degree 1, so y = 10 is linear. It is interesting in that it could be either an equation in one variable, y (in this case, one that is already solved), or an equation in two variables, which can be graphed as a horizontal line (because it “doesn’t care” about the value of x, so x can be anything). But either way, it is a linear equation.

7. Thank you so much for explaining to me why a linear equation is called a linear equation! You made it clear that x+4=10 can expressed on a line on the coordinate plane much as 2x+4=10 can be.
Then, you clarified to me that y+4=10 would also be expressed as a line or linear form on the graph.
Equally significant is that you explained how two variables can also be expressed as linear such as:
y=2x+4. In this values of one of the variables have to be proposed on a table such as-let x have 1, 0,-1 in order to solve for y variable. The y=x+4 also brings in the y-intercept idea. It is interesting how you then connected the three rules or formula of linear equation,namely: slope intercept formula, y=mx +b; standard formula- Ax + By=C and by extension point slope formula, M=y2-y1/x2-x1. You are a genius, Dr Peterson. point slope formula originates from coordinates of ordered pairs on the graph.

1. The way you express this is misleading, and brings up something another reader asked as a question on the site, which deserves to be mentioned. While it is true that 2x+4=10 graphs as a line on the xy-plane, as I showed in the post, the same can be said of x^2+4=10, which is not a linear equation! We don’t judge linearity of an equation from its graph alone.

I don’t see that I mentioned the different forms for a line in this post; but for other content on standard and point-slope forms, you might find these helpful:
Standard Form of a Line
Equation in Slope Intercept or Point Slope Form
Formulas for the Equation of a Line

This site uses Akismet to reduce spam. Learn how your comment data is processed.


# Math Help - Spinning around the y-axis

1. ## Spinning around the y-axis

lo'

The area that is limited by the curve y=x^-2 and y=1, y=e gets to rotate around the y axis detirmine the volume of the figure.

The problem: How do i get the integration values? since it rotates around the y-axis i can't use the x values, right?

2. Hello, Jones!

The area that is limited by the curve $y = \frac{1}{x^2},\;y = 1,\;y = e$ is rotated about the y-axis.
Detirmine the volume of the figure.

The problem: How do i get the integration values?
Since it rotates around the y-axis, i can't use the x values, right?
You can, but it's tricky.
Code:
              |
|*
|
| *
e +  *
|::::*
|::::::::*
1 + - - - - - - -*
|                           *
- - - + - - - - - - - - - - - - - - - -
|

We can integrate with respect to $y\!:\;\;V \;=\;\pi\int^e_1x^2\,dy$

Since $y = \frac{1}{x^2}$, we have: . $x = \frac{1}{\sqrt{y}}$

Then: . $V \;=\;\pi\int^e_1\left(\frac{1}{\sqrt{y}}\right)^2d y \;=\;\pi\int^e_1\frac{dy}{y} \;= \;\pi\ln(y)\,\bigg]^e_1
$

Therefore: . $V \;=\;\pi\ln(e) - \pi\ln(1)\;=\;\pi(1) - \pi(0) \;= \;\boxed{\pi}$

3. You could also use the 'shells' method.

$2{\pi}\int_{e^{\frac{-1}{2}}}^{1}\frac{1}{x}dx=\boxed{\pi}$

4. Originally Posted by Soroban
Hello, Jones!

We can integrate with respect to $y\!:\;\;V \;=\;\pi\int^e_1x^2\,dy$
why $x^2$ ?

5. Originally Posted by Jones
why $x^2$ ?

The same reason that a region revolved about the $x$-axis is:

. . $V\;=\;\pi \int^b_a y^2\,dx$

6. Originally Posted by Jones
why $x^2$ ?

Hello,

the volume of a solid which was generated(?) by rotation around the y-axis could be considered as assembled of small cylindrical slices. (See attachment)
The Volume of a cylinder is $V=\pi \cdot r^2 \cdot h$. In this case r correspond with x and the height of the cylinder correspond with y. A small part of the complete volume could be calculated:

$\Delta V=\pi \cdot x^2 \cdot \Delta y$. Divide by $\Delta y$ and you'll get:

$\frac{\Delta V}{\Delta y}=\pi \cdot x^2$. Now let $\Delta y$ approach to zero to get very, very thin slices:

$\lim_{\Delta y \rightarrow \infty}{\frac{\Delta V}{\Delta y}}=\frac{dV}{dy}=\pi \cdot x^2$.This is the rate of change of the volume with respect of y.

To get the complete volume you have to run up all thin cylinders which have the volume dV. You get this term by multiplying the rate of change by dy:

$dV=\pi \cdot x^2 \cdot dy$. Running up means you have to calculate the sum. Use the big S to add all cylinders:

$\int (dV) \cdot dy = V$. Thus:

$V=\int \pi \cdot x^2 \cdot dy=\pi \int x^2 \cdot dy$

and here we are!

EB

PS.: This is not a rigorous proof or something like that. This post should sho, where the x² comes from - and maybe it helps a little bit to understand what integrating means (in the beginning).

7. Originally Posted by earboth
PS.: This is not a rigorous proof or something like that. This post should sho, where the x² comes from - and maybe it helps a little bit to understand what integrating means (in the beginning).
I seem to have a strange effect on people. Whenever, I am around people always have to mention word "not rigorous". Both my math professors mention that and always look at me when they say that. Even my engineering professor when he makes some argument in class always looks at me and say "this is not a rigorous explaination, but...". To remind you there can be no rigorous explanation to this problem. This is some applied problem. To be rigorous we need a defintion of volume. But we do not. So whenever you deal with areas, volumes, centroids.... All these things do not have proofs. Because they cannot be formally defined.

8. Originally Posted by earboth
Hello,

the volume of a solid which was generated(?) by rotation around the y-axis could be considered as assembled of small cylindrical slices. (See attachment)
The Volume of a cylinder is $V=\pi \cdot r^2 \cdot h$. In this case r correspond with x and the height of the cylinder correspond with y. A small part of the complete volume could be calculated:

$\Delta V=\pi \cdot x^2 \cdot \Delta y$. Divide by $\Delta y$ and you'll get:

$\frac{\Delta V}{\Delta y}=\pi \cdot x^2$. Now let $\Delta y$ approach to zero to get very, very thin slices:

$\lim_{\Delta y \rightarrow \infty}{\frac{\Delta V}{\Delta y}}=\frac{dV}{dy}=\pi \cdot x^2$.This is the rate of change of the volume with respect of y.

To get the complete volume you have to run up all thin cylinders which have the volume dV. You get this term by multiplying the rate of change by dy:

$dV=\pi \cdot x^2 \cdot dy$. Running up means you have to calculate the sum. Use the big S to add all cylinders:

$\int (dV) \cdot dy = V$. Thus:

$V=\int \pi \cdot x^2 \cdot dy=\pi \int x^2 \cdot dy$

and here we are!
This was a very good explanation, why can't they give similar explanations in the book?

Just to make sure i have understood this i'll try to solve this one.

The area limited by the x and y axis and the line x+2y-4=0 rotates around the x axis. Determine the volume.

so my suggestion is that we start of by substituting for x.
$x=-2y+4$
V= $pi \int^0_{-4}$ $(-2y+4)^2 dy$

$<==>$ $(-2/3y+4/3)^3$

9. Originally Posted by Jones
This was a very good explanation, why can't they give similar explanations in the book?
Thank you. I like this kind of response.

Originally Posted by Jones
Just to make sure i have understood this i'll try to solve this one.

The area limited by the x and y axis and the line x+2y-4=0 rotates around the x axis. Determine the volume.

so my suggestion is that we start of by substituting for x.
$x=-2y+4$

V= $pi \int^0_-4$ $(-2y+4)^2 dy$
$<==>$ $(-2/3y+4/3)^3$
Hello,

the axis of rotation is the x-axis, which is perpendicular to the base area of the solid. Thus the radius of the circle (= base area) is y and the "thickness" of the cylinders is dx. So you get:

$\int_{0}^{4} \pi \cdot y^2\cdot dx=\int_{0}^{4} \pi \cdot (\frac{1}{2}x+2)^2\cdot dx=\pi \int_{0}^{4} (-\frac{1}{4}x^2-2x+4)^2\cdot dx$

I'll leave the rest for you.

EB

PS.: With this problem it isn't necessary to use integration:
You've got a right triangle which rotates around one leg. This will give a cone.
The radius of the base is the y-intercept of the straight line: (0, 2)
The height of the cone is the zero of the straight line: (4, 0)
The volume of a cone can be calculated by:
$V_{cone}=\frac{1}{3}\cdot \pi \cdot r^2 \cdot h$. Now plug in all values you know:

$V_{cone}=\frac{1}{3}\cdot \pi \cdot (2)^2 \cdot 4=\frac{1}{3}\cdot \pi \cdot 4 \cdot 4=\frac{16}{3}\cdot \pi$
That's the result, you should get with the integration too.