Numerical Integration Matlab Code

Symbolic Integration and Differentiation using MATLAB. Numericaldiﬁerentiationand integration Numerical diﬁerentiation with Richardson Extrapolation Assume Matlab Code: Trapezoid Rule Integration. We can do this in (at least) three diﬀerent ways. MATLAB®’s quad Function. Math 301 – Numerical Analysis 2, Winter 2009. To derive an expression for the indefinite integral of a function, we write − int(f); For example, from our previous example − syms x int(2*x) MATLAB executes the above statement and returns the following result − ans = x^2 Example 1. Note: The five first software elements in this table are all available on the Web through the netlib library: just click on the Code name to get Netlib's keyword search and then submit the Library information in this table to find the code and then download the code. 1) is an approximation of the form IQ(f,a,b) = (b− a) Xm k=1 wkf(xk). Numerical Integration of Empirical Data: using Matlab's built-in trapezoidal integration functions (trapz and cumtrapz) to integrate discrete data when the relationship between the independent and dependent variables is not known as a function. One could also make each integration function generic, instead of making the whole package generic. There are 3 programs that needed be done. Hairer and M. m, fourcoeffs. "Stabilization of Constrained Mechanical Systems with DAEs and Invariant Manifolds. The following MATLAB code gives a generalized illustration of numerical integration using Trapezoidal rule. 6 Trapezoidal Method and Simpson Method / 226 by example MATLAB code with a friendly interface so that students can easily. Area integral over a triangle in MATLAB -- is numerical integration possible? a triangle in MATLAB -- is numerical integration possible? the rest of the code. Springer Series in Comput. If Y is a matrix, then trapz(Y) integrates over each column and returns a row vector of integration values. Its key features are: High-level language for numerical computation, visualization, and application development; Interactive environment for iterative exploration, design, and problem solving. The code is on GitHub. It is executed at the command line prompt by typing: >> trapezoidal( a,b,nintervals) where a and b are the lower and upper limits of integration. If you read the original paper, you will notice at the end all option valuation problems are to solve an integral equation, therefore a good & proper numerical integration method becomes especially crucial. [Jaan Kiusalaas] -- "Numerical Methods in Engineering with MATLAB is a text for engineering students and a reference for practicing engineers. This GUI can be used by entering 'nu' at the MATLAB command prompt. Description. I think that quad uses Simpson, quadl a Gauss-Lobato formula and quadgk the Gauss-Kronrod formula G7K15, and all of them use some kind of adaptative scheme. I need help developing a C-code that numerically integrates using N = 20 and N = 40, where N is the number of steps or interval. will be introduced in the context of learning several methods of numerical integration. m, fintegrand. MATLAB Programming Assignment Help, Numerical integration methods, The fundamental theorem of calculus states that the de?nite integral of a function may be found from the antiderivative of the function. , Part Five, Chapters 17 and 18 PGE 310: Formulation and Solution in Geosystems Engineering Dr. Description: This is an introductory numerical analysis course. time) and one or more derivatives with respect to that independent variable. To plot one set of values versus another (i. Area integral over a triangle in MATLAB -- is numerical integration possible? a triangle in MATLAB -- is numerical integration possible? the rest of the code. Symbolic objects such as π or etc. [Note: Want… Read more about Numerical Integration of Tabular. Numerical Integration with Trapezoidal and Learn more about numerical integration, trapezoidal rule, simpson's rule. The logic is the same as 2-variable integration. quadl Numerical integration with adaptive Lobatto quadrature. MATLAB code for Trapezoidal Rule. Numerical Differentiation. Curve fitting -- 9. But then it finds the area between the second pair of points. View Details. x/dx we ﬁrst divide the interval Ta;bUinto n subintervals, each of length. Research Experience for Undergraduates. Learn more about numerical integration. If you like this article, please share it with your friends and like or facebook page for future updates. Numerical Methods in Engineering with MATLAB R Second Edition Numerical Methods in Engineering with MATLAB R is a text for engi-neering students and a reference for practicing engineers. Learn more about numerical integration, random number generator, trapz, integration, cumtrapz, digital image processing. Its name is from the ancient methods for computing areas of curved figures, the most famous of which is the problem of 'squaring the circles' which means finding a square having the same area as a given circle. Try quadgk. 1 Basic Concepts In this chapter we are going to explore various ways for approximating the integral of a function over a given domain. In general, numerical quadrature involves breaking an interval into subintervals, estimating or modelling the function on each subinterval and integrating it there, then adding up the partial integrals. Numerical Analysis/Matlab Sample Code. Why my vim doesn't support hex color code?. Numerical Integration of Linear and Nonlinear Wave Equations We begin our study with an analysis of various numerical methods and boundary MATLAB Code for. Subscribe to our newsletter to get notifications about our updates via email. I think that quad uses Simpson, quadl a Gauss-Lobato formula and quadgk the Gauss-Kronrod formula G7K15, and all of them use some kind of adaptative scheme. If Y is a matrix, then trapz(Y) integrates over each column and returns a row vector of integration values. Apply MATLAB to solve linear systems of equations. When writing codes for this lab, it is surely best to use M-ﬁles for each approximate integration scheme. It is useful for when you want to see how some integral of the experimental data progresses over time. This code return 0. MATLAB Programming Assignment Help, Numerical integration methods, The fundamental theorem of calculus states that the de?nite integral of a function may be found from the antiderivative of the function. Yes, it's inefficient for single integrals, but it's a great thing for students to look at because a) it's simple to understand (no need of calculus) and b) it's easy to code. more examples. A Friendly Introduction to Numerical Analysis, by Brian Bradie. Our objective is to employ numerical methods in examples emphasizingthe appeal of MATLAB as a programming tool. Chebfun is a collection of algorithms and an open-source software system in object-oriented MATLAB which extends familiar powerful methods of numerical computation involving numbers to continuous or piecewise-continuous functions. I think this is where my code fails. Nodes for all other n are generated on the fly with 1e-10 precision by fast root-finding algorithm. z1 = trap2(0, 2, 10, 'fun_for_integration') z2 = trap2(0, 2, 100, 'fun_for_integration') z3 = trap2(0, 2, 1000, 'fun_for_integration') and we get the Matlab results z1 = 4. GNU Octave is also freely redistributable software. Modified Euler Method with. The author was told that, in the old days. Compound Trapezoidal Method for Numerical Integration by admin in Math, Statistics, and Optimization , MATLAB Family , Numerical Integration $4. function that implements the. Asked by me with the code for the Richardson extrapolation. function that implements the. (See numerical integration for more on quadrature rules. Can anyone help me with the syntax call for numerical integration?. Petzold, and S. Impedance Cardiography (ICG) Is A Noninvasive Technology Measuring Total Electrical Conductivity Of The Thorax And Its Changes In Time To Process Continuously A Number Of Cardio Dynamic Parameters, Such As Stroke Volume, SV, Heart Rate, HR, Cardiac Output, CO, Ventricular Ejection Time, VET, Pre-ejection Period And. is there a matlab code for gaussion Learn more about simulation, integration. Numerical Analysis Project 2: Fall 2016 [Numerical Integration] Find i 6 0 f (x) dx with the function f (x) = 2 x/ (1 + x 2) using the following methods. Solution Preview. In general, numerical quadrature involves breaking an interval into subintervals, estimating or modelling the function on each subinterval and integrating it there, then adding up the partial integrals. Matlab's Numerical Integration Commands The relevant commands we consider are quad and dblquad, triplequad. The numerical value returned by MATLAB is somewhat less than half the area of a square 2 units on a side. Midpoint rule. For higher-dimensional integrals, Monte Carlo is often the tool of choice. This code return 0. I'm trying to integrate x using matlab, and that task is simple by using the following commands: syms x a=int(x) The problem is I'm not sure how to implement numerical integration. Does Matlab provide any alternatives to speed up the operation. Geometric numerical integration is synonymous with structure-preserving integration of ordinary differential equations. Chapra, Applied Numerical Methods with Matlab for Engineers and Scientists, third edition. Suppose that the interval [a,b] is split up in n subintervals, with n an even number. · Midpoint Rule (Rectangular Rule) · Euler-Maclaurin Formula · Richardson Extrapolation · Trapezoidal Rule · Simpson's Rule There are a number of numerical methods that can be used to approximate an integral. It is based on the Fast Fourier Transform (FFT) technique and yields a numerical solution for t=a ("a" is a real number) for a Laplace function F(s) = L(f(t)), where "L" represents the Laplace transformation. function that implements the. NET Numerics under the MathNet. The MATLAB functions for the numerical evaluation of integrals has evolved from quad, through quadl and quadgk, to today's integral. This section under major construction. This code is located in a file called trapezoidal. We study numerical methods to solve linear and nonlinear equations, to interpolate and approximate data, and methods for numerical integration and diﬀerentiation. Roots of algebraic and transcendental equations -- 5. Numerical integration in a loop. 0 Unported License. The MATLAB functions for the numerical evaluation of integrals has evolved from quad, through quadl and quadgk, to today's integral. 0 Simple and intuitive numerical integration based on trapezoidal rule. the numerical integration; no transformation of the EOM (1) is carried out. How to download & Pay on REDS So Love symbol using MATLAB; A Small Tribute To Netaji On 23rd January using MA Runge-Kutta method (Order 4) for solving ODE using Euler's method for solving ODE using MATLAB. txt) or read online for free. a guest Sep 19th, 2017 53 Never Not a member of Pastebin yet? % the little t steps for numerical integration %obtain numerical ODE45 solution to use. Numerical Integration. Numerical integration with Monte Carlo method (on FPGA chip). In contrast to the existing Matlab built-in functions for numerical integration, this program can be used with arrays for the upper and lower integration limits. Introduces intermediate variables for small compact code and reduced operations count. Stanford Libraries' official online search tool for books, media, journals, databases, government documents and more. We begin by clicking on file on the Matlab Command Window and new. Trapezoidal rule to approximate the integral of x^2 style of the same code. function value=rsum1(f,a,b,n) %RSUM1: Computes a Riemann Sum for the function f on %the interval [a,b] with a regular partition of n points. Part B: Numerical integration (08 to 15 November 2010) Source code used in slides. I came across the book, ‘Computational Physics’, in the library here in the Dublin Institute of Technology in early 2012. More accurate methods of numerical integration are based on Gauss quadrature methods for orthogonal polynomials such as Legendre, Chebyshev, Laguerre and Hermite polynomials (optional reading - chapter 7. Caregiver Issues Bathing and Hygiene; Caregiver hiring; Caregiver training; Caregivers – professional; Family Carergivers; Caregiving Around the World. x/dx we ﬁrst divide the interval Ta;bUinto n subintervals, each of length. Type the following into the text editor:. Section 4 is devoted to a presentation and explanation of Matlab codes for implicit Runge-Kutta, composition, and multistep. It is based on the Fast Fourier Transform (FFT) technique and yields a numerical solution for t=a ("a" is a real number) for a Laplace function F(s) = L(f(t)), where "L" represents the Laplace transformation. How to download & Pay on REDS So Love symbol using MATLAB; A Small Tribute To Netaji On 23rd January using MA Runge-Kutta method (Order 4) for solving ODE using Euler's method for solving ODE using MATLAB.$\begingroup$Thank you, but how do you incorporate the code for Simpson's rule into the code for Bisection method? So that at each midpoint, Simpson's rule calculates a new value for the function. There is a complication in using dblquad; it does not accept variable limits. Is publishing runnable code instead of. MATLAB's programming interface gives development tools for improving code quality maintainability and maximizing performance. What we are trying to do here, is to use the Euler method to solve the equation and plot it along side with the exact result, to be able to judge the accuracy of the numerical method. Runge's Function. How to apply numerical integration on a symbolic Learn more about integration. Department of Electrical and Computer Engineering University of Waterloo 200 University Avenue West Waterloo, Ontario, Canada N2L 3G1 +1 519 888 4567. · Midpoint Rule (Rectangular Rule) · Euler-Maclaurin Formula · Richardson Extrapolation · Trapezoidal Rule · Simpson’s Rule There are a number of numerical methods that can be used to approximate an integral. Numerical Integration-1. docx 1 DOING PHYSICS WITH MATLAB COMPUTATIONAL OPTICS NUMERICAL INTEGRATION RAYLEIGH-SOMMERFELD DIFFRACTION INTEGRAL OF THE FIRST KIND Ian Cooper School of Physics, University of Sydney ian. Apply MATLAB to carry out numerical differentiation and integration. Asked by me with the code for the Richardson extrapolation. Simplify your answer as possible. Have a nice day!. m, fourcoeffs. commands to prepare a new workspace each time we run the code. Thus, the answer is same as the one obtained using the program for Trapezoidal method in MATLAB. NUMERICAL SOLUTIONS TO TWO-DIMENSIONAL INTEGRATION PROBLEMS by Alexander D. This book provides a fundamental introduction to numerical analysis for undergraduate students in the areas of mathematics, computer science, physical sciences, and engineering. m is a to compute numerical approximations to definite. Numerical Integration and Intro to Pseudospectral Methods for BVPs. C++ from Python and MATLAB, because C++ is faster. Chapra (2006, Hardcover, Revised) at the best online prices at eBay!. Input/Output: Also see, Simpson 1/3 Rule in Matlab Numerical Methods Tutorial Compilation. If Y is a vector, trapz(Y) is the integral of Y. NUMERICAL INTEGRATION. Subscribe to our newsletter to get notifications about our updates via email. The source code and files included in this project are listed in the project files section, please make sure whether the listed source code meet your needs there. MATLAB Python function In = trapezcomp (f, a, b,. This work. 6 Trapezoidal Method and Simpson Method / 226 by example MATLAB code with a friendly interface so that students can easily. Symbolic and Numerical Integration in MATLAB 1 Symbolic Integration in MATLAB Certain functions can be symbolically integrated in MATLAB with the int command. Scripts de Integração númerica Newton-Cotes. Hairer and M. We begin by clicking on file on the Matlab Command Window and new. Book Description. time) and one or more derivatives with respect to that independent variable. This course will focus on the root finding and numerical integration techniques most frequently covered at the undergraduate level. Summary of first day w/ MATLAB in class. Midpoint rule. , Simpson's. MATLAB is widely used in undergraduate engineering programs as well as in industry. In Matlab code I used 'ArrayValued' to enable the integrand to receive a vector. This method is. Engineering & Matlab and Mathematica Projects for €8 - €30. Consider Example M3. In case you don’t have MATLAB already installed in your system, there are lectures on the various ways you can acquire MATLAB and the procedures involved in its installation. We can do this in (at least) three diﬀerent ways. Learn more about histc, pdf, integrate, trapz, nan, inf, divide by zero MATLAB Answers. Some useful functions. Summary: There are problems in integrating Hamiltonian systems with normal numerical integrators, and your special initial conditions aggravate this to the point where the numerical solution has no resemblance with the correct one. This method is. pdf), Text File (. MATLAB is a high-level language and interactive environment for numerical computation, visualization, and programming. Numerical Methods or Numerical Analysis is a subject included in all types of engineering curriculum around the world. How to download & Pay on REDS So Love symbol using MATLAB; A Small Tribute To Netaji On 23rd January using MA Runge-Kutta method (Order 4) for solving ODE using Euler's method for solving ODE using MATLAB. If Y is a vector, trapz(Y) is the integral of Y. Numerical Integration - Free download as PDF File (. Numerical Methods in Engineering with MATLAB R Second Edition Numerical Methods in Engineering with MATLAB R is a text for engi-neering students and a reference for practicing engineers. Z = trapz(X,Y) computes the integral of Y with respect to X using trapezoidal integration. Unless stated otherwise, the examples below evaluate the integral \(\int_0^{10} x^2 \, dx = \frac{1000}{3} \approx 333. If Y is a multidimensional array, then trapz(Y) integrates over the first dimension whose size does not equal 1. trapz Numerical integration with the trapezoidal rule. Numericaldiﬁerentiationand integration Numerical diﬁerentiation with Richardson Extrapolation Assume Matlab Code: Trapezoid Rule Integration. Specifically, the integral is introduced by using the best approximation scheme (Legendre Polynomials) to approximate a vector valued function whose indefinite integral is not easy to be explicitly written down. are accepted. C Program for Numerical Integration (Trapezoidal Rule, Simpson's Rule and Boole's Rule Program /* This program is for numerical integration of numerical methods Here we are going to solve the integration of defined functio. Solving Numerical Integral Implicitly. A followup post of my previous entry Using Quadrature method for option valuation, where I tested the alternative numerical method for option valuation, QUAD. in the function. This book will enable readers to solve problems without needing to understand all the details of the underlying theory of numerical methods. Matlab code. The order of integration (and therefore the bounds) is from the innermost integral to the outermost one. Dynamics and Vibrations MATLAB tutorial School of Engineering Brown University This tutorial is intended to provide a crash-course on using a small subset of the features of MATLAB. b) computes a numerical approximation of. Numerical Integration and Differentiation Quadratures, double and triple integrals, and multidimensional derivatives Numerical integration functions can approximate the value of an integral whether or not the functional expression is known:. Array-valued function flag, specified as the comma-separated pair consisting of 'ArrayValued' and a numeric or logical 1 (true) or 0 (false). MATLAB EXAMPLES Interpolation and Integration. The numerical evaluation in this case was performed using numerical routines borrowed from MuPAD, which takes care of symbolic calculations. A brief introduction to the Simpson’s 1/3 rd rule and a uniform interval Composite Simpson’s 1/3 rd Rule implementation. Victor Zalizniak, in Essentials of Scientific Computing, 2008. Body of the package implementing numerical integration: package body Integrate is. We can do this in (at least) three diﬀerent ways. In fact, the built-in capabilities of MATLAB are used to perform numerical computations, which are very useful in enormous fields of applied science and engineering, including: Root finding and equation solving Solving system of equations Eigenvalues, eigenvectors and eigendecomposition Singular Value. Table 2: A Matlab module for DFT calculations. The goal of the book. MATLAB code demo in class. Midpoint (Rectangular) Numerical Integration Matlab Code by admin in Math, Statistics, and Optimization, MATLAB Family, Numerical Integration. MATLAB code to perform numerical integration and differentiation % Numerical integration and differentiation % Using built-in Matlab functions % Clear the command window. SoDiOpt is a MATLAB-based code that performs numerical integration of Optimization-Constrained Differential Equations (OCDE). Learn more about numerical integration, random number generator, trapz, integration, cumtrapz, digital image processing. , Part Five, Chapters 17 and 18 PGE 310: Formulation and Solution in Geosystems Engineering Dr. Matlab Gauss Jordan Code Matlab Gauss Seidel Code Notes on linear and nonlinear least squares Data for homework 2 Practice Midterm Notes on Taylor methods Matlab code for Euler's method Matlab code for mid-point method Backward Euler notes Adam's Moulton Code O and A stability notes Boundary value problems and shooting Practice Final. Miranda, M. To figure this out, consider exactly what it is that both processes do. Matlab code for incompatible mode elements, short beam input file long beam input file; Matlab code demonstrating volumetric locking linear quad input file quadratic quad input file; L10 Hourglass control, selective reduced integration, B-bar elements. Search for jobs related to Integration matlab or hire on the world's largest freelancing marketplace with 15m+ jobs. Numerical Methods or Numerical Analysis is a subject included in all types of engineering curriculum around the world. Here is my implementation of Martin Floden's matlab code for the routine. In the numerical analysis literature, the Verlet method is also knows as the explicit central difference method''. To derive an expression for the indefinite integral of a function, we write − int(f); For example, from our previous example − syms x int(2*x) MATLAB executes the above statement and returns the following result − ans = x^2 Example 1. Help with numerical integration in matlab. My simpson method is correct, but my adaptive method does not seem to work for the integral( sin(2*pi*x)² ) ranging from -1 to 1 The following code represents the adaptive simpson method. Given ) = !(#)the approximation of the Area (5) under the curve can be found dividing the area up into. Plot the results against the. A numerical library for adaptive Sparse Grids (mingw-w64) matlab-r2018b: 9. I need help developing a C-code that numerically integrates using N = 20 and N = 40, where N is the number of steps or interval. For the majority of you, it has been nearly six months since you last used MATLAB. Compound Trapezoidal Method for Numerical Integration by admin in Math, Statistics, and Optimization , MATLAB Family , Numerical Integration$4. It provides tools for building applications with custom graphical interfaces. C++ from Python and MATLAB, because C++ is faster. An algorithm to numerically invert functions in the Laplace field is presented. To figure this out, consider exactly what it is that both processes do. Geometric numerical integration is synonymous with structure-pre-ser-ving integration of ordinary differential equations. 141120007827708. Goal: given continuous function f(x) of one variable, compute ∫ f(x) dx over interval from a to b. The Simpson’s 1/3 rule is a numerical method to find the integral within some finite limits and. We'll now consider how to implement these in MATLAB. • In the time domain, ODEs are initial-value problems, so all the conditions. Hello: I have not been able to find out what is the underlying quadrature formula in Matlab's builtin function integral. Numerical Integration "Numerical Methods with MATLAB", Recktenwald, Chapter 11 and "Numerical Methods for Engineers", Chapra and Canale, 5th Ed. Garcia,∗ A. numerical integration - MatLab algorithm for composite Simpson's rule I have tried, just for the fun of it, to write a MatLab-code for the composite Simpson's rule. Numerical integration using SCILAB Integrals can be interpreted as the area under the curve of the function f(x) in a given interval a < x < b. Numerical Integration with the Trapezoidal Rule. An Introduction to Numerical Methods: A MATLAB® Approach, Fourth Edition continues to present a wide range of useful and important algorithms for scientific and engineering ap. Converting serial MATLAB applications to parallel MATLAB applications generally requires few code modifications and no programming in a low-level language is necessary. Description: This is an introductory numerical analysis course. Summary of first day w/ MATLAB in class. The choice of numerical methods was based on their relevance to engineering prob-lems. These notes, prepared for the Durham summer school 2002, are complementary to the monograph of Hairer, Lubich and Wanner "Geometric Numerical Integration". It approaches the subject from a pragmatic viewpoint; theory is kept at a minimum. The second output FY is always the gradient along the 1st dimension of F, going across rows. quadl Numerical integration with adaptive Lobatto quadrature. Simpsons Algorithm for numerical integration using Trapezoid rule for numerical integration using MAT REDS Library: 15. numeric::quadrature(f(x), x = a. It provides tools for building applications with custom graphical interfaces. Question: Problem 2. In addition, it scales well with many workers. The name MATLAB stands for matrix laboratory. the vectorized methods are not as easy to read, and take fewer lines of code to write. Numerical Solution using MATLAB. Numerical Methods for ODE in MATLAB MATLAB has a number of tools for numerically solving ordinary diﬀerential equations. There are various reasons as of why such approximations can be useful. Verschelde's MCS 320 Symbolic Computing with MATLAB (and Maple) Lectures Desmond J. numerical integration code Search and download numerical integration code open source project / source codes from CodeForge. MATLAB is widely used. You can integrate from 1 down to some number larger than r, where x=r is the location of the singularity. It is executed at the command line prompt by typing: >> trapezoidal( a,b,nintervals) where a and b are the lower and upper limits of integration. If you were to take the integral of 2x from 0 to 2, where 0 is the lower bound and 2 is the upper bound you would get the following:. Compared to the numerical integration methods, like the program of Simpson 1/3 rule in C given above, the analytical method of integration is quite difficult and time consuming while applying to complex engineering problems. In numerical analysis, Romberg's Method (Romberg 1955) generates a triangular array consisting of numerical estimates of the definite integral by applying Richardson extrapolation (Richardson 1910) repeatedly on the trapezium rule or the rectangle rule (midpoint rule). in Matlab command window. Subscribe to our newsletter to get notifications about our updates via email. Introduction. In the first type, derivative of a function is given and we want to find the function. Initial Value Problem. As we see from the plot, this is more than we need. Numerical Integration 209 Quadrature Integration 216 the work you’re doing can’t be done by hand and will require a numerical solution. See the Matlab help ﬁles for other integration commands. E-Book Review and Description: Numerical Methods using MATLAB, 3e, is an in depth reference offering numerous of useful and crucial numerical algorithms that could be carried out into MATLAB for a graphical interpretation to help researchers analyze a selected consequence. We'll now consider how to implement these in MATLAB. Numerical Solution of Diﬀerential Equations: MATLAB implementation of Euler's Method The ﬁles below can form the basis for the implementation of Euler's method using Mat-lab. You may redistribute it and/or modify it under the terms of the GNU General Public License (GPL) as. This method assumes linear behavior between the data points, and accuracy may be reduced when the behavior between data points is nonlinear. I think this is where my code fails. trapz performs discrete integration by using the data points to create trapezoids, so it is well suited to handling data sets with discontinuities. Research Experience for Undergraduates. If Y is a multidimensional array, then trapz(Y) integrates over the first dimension whose size does not equal 1. Introduction. Watch Online Four sections of this video tutorial are available on YouTube and they are embedded into this page as playlist. quadl Numerical integration with adaptive Lobatto quadrature. Numerical Integration with the Trapezoidal Rule. Trapezoidal Rule for Numerical Integration Trapezoidal Rule for Numerical Integration Internet hyperlinks to web sites and a bibliography of articles. numeric::quadrature returns itself symbolically if the integrand f(x) contains symbolic objects apart from the integration variable x that cannot be converted to numerical values via float. Simpson's rule for numerical integration 25754-simpson-s-rule-for-numerical-integration), MATLAB Central the trapz code but then the simps seems to not work. Applied numerical methods using matlab (wiley,2005) 1. Ofdm matlab code using bpsk. MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages. Hi, So I have this function that takes data sample locations and function samples at those locations as input and returns an approximation of the integral over the sample range based on the trapezoidal rule. Parallel processing operations such as parallel for-loops and message-passing functions let you implement task- and data-parallel algorithms in MATLAB. Compound Trapezoidal Method for Numerical Integration by admin in Math, Statistics, and Optimization , MATLAB Family , Numerical Integration \$4. An example to price an Arithmetic Average fixed strike Call option in the Black-Scholes framework using Monte Carlo Control Variate. topic of numerical integration is taken up in Chapter 7 and in Chapter 8 meth-ods for the numerical solution of ordinary diﬀerential equations are explored. Doing Physics with Matlab op_rs1. = ] = ] ENGRD 241 / CEE 241: Engineering Computation Numerical Integration 14 Numerical Integration Improving the estimate of the integral fit Lagrange polynomials to three points (a pair of segments) integrate those polynomials to obtain a general formula the resulting function must correctly integrate quadratics x 0 x n ENGRD 241 / CEE 241. a guest Sep 19th, 2017 53 Never Not a member of Pastebin yet? % the little t steps for numerical integration %obtain numerical ODE45 solution to use. MATLAB codes for Romberg integration. pdf from MAE 284 at University of Alabama, Huntsville. When writing codes for this lab, it is surely best to use M-ﬁles for each approximate integration scheme. In its simplest form, you pass the function you want to differentiate to diff command as an. Matlab code for selective reduced integration; Matlab code for reduced integration with. Numerical gradients, returned as arrays of the same size as F. Numerical Integration. Miranda, M. Apply MATLAB to carry out numerical differentiation and integration. 9) Explain why numerical differentiation is inferior to integration in the presence of noise. The following MATLAB code gives a generalized illustration of numerical integration using Trapezoidal rule. How do I improve Numerical Integration Speed?. MATLAB - Differential - MATLAB provides the diff command for computing symbolic derivatives. Ample material is presented so that instructors will be able to select topics appropriate to their. Calculation of numerical integration of an expression is made easier. To solve the Falkner-Skan equation a fourth-order Runge-Kutta integration scheme was used. First results of axisymmetric. Repeat for the midpoint rule, trapezoidal rule, and Simpson’s rule. Does Matlab provide any alternatives to speed up the operation. Area integral over a triangle in MATLAB -- is numerical integration possible? a triangle in MATLAB -- is numerical integration possible? the rest of the code. Numerical Integration §1 The Newton-Cotes Rules §2 Composite Rules §3 Adaptive Quadrature §4 Gauss Quadrature and Spline Quadrature §5 Matlab's Quadrature Tools An m-point quadrature rule Q for the deﬁnite integral I(f,a,b) = Zb a f(x)dx (4. ALL PRODUCTS FROM Gauss Quadrature Method for Numerical Integration MATLAB Family, Numerical Integration. For watching full course of Numerical Computations, visit this page. Choose M-file. This creates a circular reference which I can't figure out how to code in Matlab. All MATLAB code should also be submitted as an. How to apply numerical integration on a symbolic Learn more about integration. Numerical Integration and Differentiation Quadratures, double and triple integrals, and multidimensional derivatives Numerical integration functions can approximate the value of an integral whether or not the functional expression is known:. though I'd like to know what I should have fixed in the code (more cleaner now). 999e3 numerical representation in Matlab [closed] Comparing the FFT to numerical integration in Matlab.


How can I prove that $x_{n+1} = x_n \sin(x_n)$ converges for any $x_0$?

I have already prove that it is true if exist $$\sin(x_m) = 1$$ or $$\sin(x_m) = -1$$. So I need make proof only for absolute-decreasing progression. But I am afraid that $$\sin(x_n)$$ can has limit $$1$$ and can go to $$1$$ very fast. Is it a good way to count limit $$\sin(x_n)$$? And what solution is correct?

• Welcome to the website. In future, please typeset your equations using Mathjax for better presentation. – Shubham Johri Dec 25 '18 at 20:35
• I think you mean $x_n\to 0$ or $\sin x_n\to 1$. – J.G. Dec 25 '18 at 20:41
• If the limit exists it should satisfy $x_{n+1} = x_n$. Think about what this tells you about possible limit points, and then look at what happens if $x_n$ is above these points or below these points. – tch Dec 25 '18 at 20:43
• @TylerChen "If the limit exists, it should satisfy $x_{n+1} = x_n$". What the heck does this mean – mathworker21 Dec 25 '18 at 20:45
• @Cesareo There are infinitely many solutions. Any $\pi/2+2k\pi$ works. – ImNotTheGuy Dec 25 '18 at 21:12

Let $$y_n = |x_n|$$

Then $$y_{n+1} = y_n |\sin y_n| \leq y_n \forall n$$ (*)

So $$y_n$$ is decreasing and bounded below by $$0$$. Therefore it converges to some limit $$l$$. By passing to the limit in (*) we get that either $$l=0$$ or $$sin l= 1$$ giving the family of solutions discussed in the comments, namely $$l=2k\pi+\frac{\pi}{2}$$

Now note that if $$y_n$$ converges to $$0$$ then $$x_n$$ also converges to $$0$$. If $$y_n$$ converges to a nonzero value $$l$$ then a little more work will also prove that $$x_n$$ also converges to either $$l$$ or $$-l$$ because for n large enough $$y_n$$ will be between $$l$$ and $$l+\frac{\pi}{2}$$ hence $$x_n$$ will have constant sign

Either way, $$x_n$$ will also be convergent

Note that $$0\le|x_{n+1}|=|x_n\sin x_n|\le|x_n|$$, so the sequence of absolute values, $$|x_0|,|x_1|,|x_2|,\ldots$$ definitely converges to a nonnegative limit $$L(x_0)$$ satisfying the equation $$L(x_0)=L(x_0)|\sin L(x_0)|$$. If $$L(x_0)=0$$, we're done: $$|x_n|\to0$$ implies $$x_n\to0$$. If $$L(x_0)\gt0$$, we need only worry about the possibility that $$x_n$$ approaches both $$L(x_0)$$ and $$-L(x_0)$$. But this can't happen: If $$x_n\approx\sigma L(x_0)$$ where $$\sigma=\sin L(x_0)\in\{1,-1\}$$, then, using the fact that $$\sin(\sigma u)=\sigma\sin u$$ for all $$u$$ and $$\sigma^2=1$$, we have

$$x_{n+1}=x_n\sin x_n\approx\sigma L(x_0)\sin(\sigma L(x_0))=\sigma L(x_0)(\sigma\sin L(x_0))=\sigma L(x_0)(\sigma^2)=\sigma L(x_0)\approx x_n$$

Remarks: As ImNotTheGuy observes in a comment beneath the OP, $$\pi/2+2k\pi$$ (with $$k\in\mathbb{Z}$$) is a fixed point for the mapping $$f(x)=x\sin x$$, which means there are sequences that tend to each such limit, as well as sequences that tend to $$0$$. There are, in fact, uncountably many sequences tending to each of the possible limits: If $$k\ge0$$, for example, and $$x_n=\pi/2+2k\pi+\epsilon$$ with $$\epsilon\gt0$$ but very small, then $$x_{n+1}=x_n\cos\epsilon =\pi/2+2k\pi+\epsilon'$$ with

$$\epsilon'=\epsilon\cos\epsilon-(1-\cos\epsilon)(\pi/2+2k\pi)\approx\epsilon-(\epsilon^2/2)(\pi/2+2k\pi)\lt\epsilon$$

(but still positive), so each positive limit has a "basin of attraction" that includes an open inteval of values for $$x_0$$ slightly greater than the limit (and likewise, for each negative limit, an open interval of values slightly less than the limit -- since $$|x_{n+1}|=|x_n\sin x_n|\le|x_n|$$, successive terms in any sequence always get closer to the origin).

In general If $$x_0$$ is an initial approximation of a ﬁxed point , the ﬁxed point iteration generates a sequence of approximants by $$x_{n+1}=\varphi (x_n),$$ where $$\varphi$$ is a continuous function. Suppose that at the ﬁxed point that we indicate with $$\alpha$$ we have $$\varphi '(\alpha)=\varphi ''(\alpha)=\cdots\varphi ^{p-1}(\alpha)=0, \quad \varphi ^p(\alpha)\neq 0 \qquad (*);$$ then we have the following theorem:

Let $$\alpha$$ be a fixed point of $$\varphi$$ and $$I_{\epsilon}:=\{x\in\Bbb R: |x-\alpha|<\epsilon\}$$. Asuume that $$\varphi \in \Bbb C^p[I_{\epsilon}]$$ satisfes $$(*)$$. If $$M(\epsilon):=|\varphi '(t)|<1$$ then the fixed point iteration converges to $$\alpha$$ for every $$x_0\in I_{\epsilon}$$ and the order the convergence is $$p$$.

Note that to use this theorem you have to know tha fxed point $$\alpha$$ (you can plot the function for example and obtain an approximation of point). You can find this argument in this book.


# Understanding the difference between pre-image and inverse

I am a little confused as to what the difference between the pre-image and the inverse of a function are and how to find each given a particular function ( I had though they were essentially the same thing but I realise now I was mistaken in that thought ).

From Wikipedia the definitions given are :

Inverse

Let $$f$$ be a function whose domain is the set $$X$$, and whose image (range) is the set $$Y$$. Then $$f$$ is invertible if there exists a function $$g$$ with domain $$Y$$ and image $$X$$, with the property: $$f ( x ) = y \iff g ( y ) = x .$$ If $$f$$ is invertible, the function $$g$$ is unique, which means that there is exactly one function $$g$$ satisfying this property (no more, no less). That function $$g$$ is then called the inverse of $$f$$, and is usually denoted as $$f ^{−1}$$

Pre-image

Let $$f$$ be a function from $$X$$ to $$Y$$. The preimage or inverse image of a set $$B\subseteq Y$$ under $$f$$ is the subset of $$X$$ defined by $$f ^{− 1 }[ B ] = \{ x \in X \mid f ( x ) \in B \}$$.

So using an example I want to see if I have this about right ( please correct any mistakes I make)

Example 1:

Lets say $$f:\Bbb R \rightarrow \Bbb R$$

$$f(x)=x^2$$

For this example, clearly $$f$$ cannot be invertible (hence no inverse) as there exists no function $$g$$ which will satisfy $$f ( x ) = y \iff g ( y ) = x$$. (as it would only map to positive values of $$\Bbb R$$ (i.e. not the whole set))

The pre-image of this function I believe is related to the inverse except it does not require that we map to the whole set $$\Bbb R$$, but rather just a subset of it. Therefore we can find the function $$f^{-1}$$ in an analogous way to to finding the inverse we just have to be more considerate about what the co-domain of this function is.

So if $$f(x)=x^2 \Rightarrow y=x^2$$swap variables to get $$x=y^2 \Rightarrow \sqrt{x}=y=f^{-1}$$

So the pre-image is the set $$f ^{− 1 }[ \Bbb R_+ ] = \{ x \in X \mid f ( x ) \in \Bbb R_+, f^{-1}=\sqrt{x} \}$$

Example 2:

An example of an invertible function would be $$f:\Bbb R \rightarrow \Bbb R$$

$$f(x)=5x$$, as a function $$g(x)=x/5$$ has domain $$\Bbb R$$ and range $$\Bbb R$$ and satisfies $$f ( x ) = y ⇔ g ( y ) = x .$$

The pre-image in this case will be equal to the inverse.

Could anyone please explain to me any mistakes I'm making here ?

• For starters, they are two very different objects. The pre-image of a function is a subset of the domain and the inverse function is a function from the range back to the domain that satisfies certain properties. A function may not be invertible but we can always talk about pre-image of a function. – Anurag A Jul 7 '19 at 20:58
• @AnuragA I know now that they are not the same thing , I was just wondering if I was correct in identifying how they are different – excalibirr Jul 7 '19 at 21:00
• No, one peaks in almost all cases of the preimage of a subset of the target space. Take, for instance, the squaring function $f(x)=x^2$, and ask for the preimage of the set of odd numbers. Then this will be the set of all $\pm\sqrt{2k+1}$, with $k$ running through all integers. If one were to speak of the “preimage of a function”, presumably that would be the preimage of the whole target space, which is all of the domain of definition of the function. – Lubin Jul 7 '19 at 21:09

The biggest difference between a preimage and the inverse function is that the preimage is a subset of the domain. The inverse (if it exists) is a function between two sets.

In that sense they are two very different animals. A set and a function are completely different objects.

So for example: The inverse of a function $$f$$ might be: The function $$g:\mathbb R \to \mathbb R: g(x) = \sqrt[3]{x-9}$$. Whereas the preimage of a set $$B$$ of the function might be $$[1,3.5)\cup \{e, \pi^2\}$$.

Now $$g(x) = \sqrt[3]{x-9}$$ and $$[1,3.5)\cup \{7, \pi^2\}$$ are completely different types of things.

This will be the case if $$f$$ is $$f:\mathbb R \to \mathbb R: f(x) = x^3 + 9$$ and $$B= [10, 51.875) \cup \{352, \pi^6 + 9\}$$.

The inverse $$f^{-1}(x)$$ (if it exist) is the function $$g$$ so that if $$f(x) = y$$ if and only if $$g(y) = x$$. So if $$f(x) = x^3 + 9 = y$$ then if such a function exists it must be that $$g(y)^3 + 9 = y$$ so $$g(y)^3 = y-9$$ and $$g(y) = \sqrt[3]{y-9}$$ so $$g(x) = \sqrt[3]{x-9}$$.

That's that.

The pre-image of $$A= [10, 51.875) \cup \{352, \pi^6 + 9\}$$ is the set $$\{x\in \mathbb R| f(x) \in [10, 51.875) \cup \{352, \pi^6 + 9\}\}=$$

$$\{x\in \mathbb R| x^3 + 9 \in [10, 51.875) \cup \{352, \pi^6 + 9\}\}=$$

$$\{x\in \mathbb R| x^3 \in [1, 42.875) \cup \{343, \pi^6 \}\}=$$

$$\{x\in \mathbb R| x \in [1, 3.5) \cup \{7, \pi^2 \}\}=$$

$$[1, 3.5) \cup \{7, \pi^2 \}\}$$.

And that's the other.

........

Now that's not to say the inverse of a function and the pre-image of a set under the function aren't related. They are. But they refer to different concepts. This is similar to how a rectangle and its area are related. But one is a geometric shape... the other is a positive real number. THey are two different types of animals.

....

I'll add more in an hour or so but I have to take the dog for a walk. I'll be back.

.....

It occurred to me as I was walking the dog that maybe what is confusing you is that the inverse function (if it exists) and the preimage of a set have very similar notation and the only way to tell them apart is in context.

If $$f$$ is invertible then the inverse function is written as $$f^{-1}$$ so if $$f(x) = x^3 + 9$$ then $$f^{-1}(x) = \sqrt[3]{x-9}$$.

But the preimage of $$B$$ under $$f$$ whether $$f$$ is invertible or or not is writen as $$f^{-1}(B)$$.

So if $$f(x) = x^3 + 9$$ then $$f^{-1}(17) = 2$$ means that if you enter $$17$$ into the function $$\sqrt{x -9}$$ you get $$2$$. But $$f^{-1}(\{17\})=\{3\}$$ and $$f^{-1}(\{36,17\}) = \{2,3\}$$ means that set of values that will output $$\{17\}$$ is the set $$\{2\}$$ and the set of values that will output $$\{36,17\}$$ is the set $$\{2,3\}$$.

A few things to note:

If $$f$$ is invertible then the preimage of a set is the same thing as the image of the set under the inverse function and that means the notation is compatible.

If $$f(x) = x^3 + 9$$ then $$f^{-1}([1,36)) = [1,3)$$ can be interpretated as both the the image of the set under the inverse function: $$f^{-1}([1,36))= \{f^{-1}(x) = g(x) = \sqrt[3]{x-9}| x\in [1,36)\}$$

OR it can be interpreted as the preimage for $$f$$: $$f^{-1}([1,36)) = \{x\in \mathbb R| f(x) \in [1,36)\}$$.

but this is not the case if $$f$$ is not invertible.

Say $$f:\mathbb R \to [-1,1]; f(x)\to \sin x$$. This is not invertible.

The pre-image of$$B= \{\frac {\sqrt 2}2\}$$ is $$\{...-\frac {11\pi}4, -\frac {9\pi}4,-\frac{3\pi}4,-\frac \pi 4, \frac \pi 4, \frac {3\pi}4, \frac {9\pi}4, \frac {11\pi}4,....\}$$ this is still written as $$f^{-1}( \{\frac {\sqrt 2}2\})$$ even though there is no function $$f^{-1}:[-1,1]\to \mathbb R$$.

Another thing to note is that not all the elements in $$B$$ have to have pre-image values.

If $$f= x^2+9$$ then $$f^{-1}(\{8\}) = \emptyset$$. This is because $$\{x\in \mathbb R| f(x) = x^2 + 9 \in \{8\}\} = \emptyset$$.

And some elements may have many preimages.

And $$\sin^{-1}(\{\frac {\sqrt2} 2}$$ showed.

• Thank you for such a brilliantly comprehensive answer :) there's literally nothing else I could think to ask . – excalibirr Jul 15 '19 at 7:34
• Actually , I did manage to think of question lol, (it's in the context of continuity in topology) say we have the function $f=x^2$ and a basis set $(-q,q), q \in \Bbb Q$ in our target. then I know that $f^{-1}((-q,q))=\{ x \in X| x\in (-\sqrt{q}, \sqrt{q})\}$ but why isn't it $(\sqrt{-q}, \sqrt{q})$ instead ?, also say we have the set (a,b) (a<b) with the same function then is $f^{-1}=(-\sqrt{b},-\sqrt{a}) \cup (\sqrt{a},\sqrt{b})$ ? – excalibirr Jul 15 '19 at 9:28

When we talk about pre-image then it has two components: a set and a function. So when we say $$f^{-1}[B]$$, then we want the pre-image of the set $$B$$ (a subset of the co-domain) under the function $$f$$. So asking about pre-image of a function is a bit ambiguous.

Let us consider $$f:\{1,2,3\} \rightarrow \{a,b,c\}$$ such that $$f(1)=a, f(2)=a$$ and $$f(3)=c$$. Then \begin{align*} f^{-1}\left[\{a\}\right] & =\{1,2\}\\ f^{-1}\left[\{c\}\right] & =\{3\}\\ f^{-1}\left[\{a,c\}\right] & =\{1,2,3\}\\ f^{-1}\left[\{b\}\right] & =\emptyset\\ f^{-1}\left[\{a,b,c\}\right] & =\{1,2,3\} \end{align*}

The function $$f$$ (as described above) is not invertible. So relating the inverse function (which doesn't exist) to the inverse image is meaningless in this case.

One can check invertibility of a function $$f: A \rightarrow B$$ by checking the inverse images of singleton subsets of the co-domain.

What it means is that: if we can ensure that for every $$b \in B$$, the inverse image set $$f^{-1}\left[\{b\}\right]$$ has exactly one element (this is to ensure both one-one and ontoness), then $$f$$ is invertible.

So, there's no such thing as the preimage of a function. Functions can have inverses; functions do not have preimages.

An inverse is something that certain functions have, and the inverse of a function is another function.

Given a function, a preimage is something that sets have, and the preimage of a set is another set.

Specifically:

Given a function $$f : A \to B$$, that function may or may not have an inverse. If it does, then that inverse is a function $$B \to A$$.

Given a function $$f : A \to B$$, and a set $$s$$ which is a subset of $$B$$, that set always has a preimage under $$f$$. That preimage is a subset of $$A$$.

That might clear up some of your confusion.


# Stuck trying to prove an inequality

I have been trying to prove (the left half of) the following inequality:

$$\underbrace{\sum_i \sum_j |x_i| \le \sum_i \sum_j |x_i + x_j|}_\textrm{?} \le 2 \sum_i \sum_j |x_i|$$

(All $x_i$s are arbitrary reals and sums are over $1, 2, \dots, n$)

The right half follows by a simple application of the triangle inequality, but the left half isn't as simple.

I tried induction, and I could reduce the above problem to proving the following statement:

$$\sum_i |x_i + x_{n+1}| + \sum_{i=1}^{n+1} |x_i + x_{n+1}| \ge \sum_{i=1}^{n+1} |x_i| + n|x_{n+1}|$$ or more simply (replacing $x_{n+1}$ by $y$), $$2\sum_i |x_i + y| \ge \sum_i |x_i| + (n-1)|y|$$

However, I don't know if the above "reduction" is any simpler than the original problem itself!

Can I continue the above line of thought, or is there an easier way to solve this problem? Any help is appreciated! :)

-
Since the LHS and the RHS has no variable in $j$, you may replace $\sum_i\sum_j|x_i|$ by $n\sum_i|x_i|$. –  AD. Oct 19 '11 at 9:34
In the summation: $\sum_i \sum_j |x_i + x_j|$ - Do you mean that i and j have the domain $0 <=i <=n , \$0 <=j <=n ? Or does each summation have its own lower and upper limits? –  Emmad Kareem Oct 22 '11 at 8:47
Can you explain to me how this works for 1,1,-1? I get: $9 \le 2+2+0+0+0+0$ –  Phira Oct 22 '11 at 12:24
@Phira I get $9\leq 2+0+2+2+0+2+2+0+0=10$. –  Mike Wierzbicki Oct 22 '11 at 13:44
why was this two year old question closed instead of the two week old question? –  robjohn Oct 9 '13 at 23:58

I believe that some smart tricks will solve the problem (e.g. by recasting it into the form of some known inequality), but what came to my mind first was a proof inspired by the simplex method. Although it does not look smart, it may be of some interests to the readers:

1. Note that by scaling the inequality, we may assume, without loss of generality, that $|x_i|\le1$ for all $i$.
2. So we want to prove the inequality for all $(x_1,\ldots,x_n)$ inside the hypercube $[-1,1]^n$.
3. Divide the hypercube $[-1,1]^n$ into pieces by the hyperplanes $x_i=x_j$ and $x_i=0$. For instance, when $n=2$, the four "hyperplanes" (straight lines in this case) $x=y$, $x=-y$, $x=0$ and $y=0$ will divide the square $[-1,1]^2$ into eight pieces in a manner akin to the Union Jack.
4. In mathematics, we call each of these pieces a simplex.
5. Note that inside each simplex, each $x_i$ or $x_i+x_j$ does not change sign.
6. Therefore, inside each simplex, the function $f(x_1,\ldots,x_n)=-\sum_i \sum_j |x_i| + \sum_i \sum_j |x_i + x_j|$ is identical to $-\sum_i \sum_j s_ix_i + \sum_i \sum_j t_{ij}(x_i + x_j)$ for some constants $s_i, t_{ij}=\pm1$.
7. In other words, $f$ is a linear function inside each simplex.
8. In linear programming, it is well known that the extremum of a linear function can be attained at the corners of the simplex. You can imagine that when you move a plane closer and closer to a simplex, it will touch the simplex at a corner first (or it touches the whole face, with the corners of the face included).
9. The corners of our simplices, however, are those points such that $x_i\in\{-1,0,1\}$.
10. So, we only need to prove the inequality for these corner points.
11. Let $a$ of the $x_i$s are equal to 1, $b$ of them are equal to $-1$ and $n-a-b$ of them are equal to zero. Then \begin{align} &-\sum_i \sum_j |x_i| + \sum_i \sum_j |x_i + x_j|\\ =&-n(a+b) + 2a^2+2b^2+2a(n-a-b)+2b(n-a-b)\\ =&2a^2+2b^2 - 2(a+b)^2 + n(a+b)\\ \ge&2a^2+2b^2 - 2(a+b)^2 + (a+b)^2\\ =&(a-b)^2\\ \ge&0. \end{align}
12. Hence the result.

In step 11 of the above, equality holds iff $a-b=0$ and $a+b\in\{0,n\}$. In other words, equality holds iff $a=b=0$ or $a=b=n/2$, that is, iff all $x_i$s are zero, or when $n$ is even, exactly half of the $x_i$s (before scaling) are identical to some $x$ and the other half are $-x$s. However, this condition for equality is derived using the corner points. The above proof does not indicate whether equality can hold in other cases.

-
Wow. That was really slick! I wish I could upvote your answer several times more (need some help here!) for not just solving the above problem, but also for showing a very novel method. Is this part of some standard repertoire for solving inequalities? Where did you come across this? –  quantumelixir Oct 19 '11 at 15:19
The technique itself (i.e. narrowing the domain to corner points) is not new. It is standard material in textbooks on linear programming or operations research. I use it here merely because I am not clever enough to think of a straightforward solution. As I said in the answer, my proof is actually a bit problematic -- although it proves the inequality, it fails to identify all cases where equality holds. –  user1551 Oct 19 '11 at 18:52

Let $p$ be the number of $x_i\ge0$, $m$ be the number of $x_i<0$, and $n=p+m$. $$\small\begin{array}{} &\sum_i\;\:\sum_j|x_i+x_j|\\ &=\sum_{x_i\ge0}\;\:\sum_{x_j\ge0}|x_i+x_j| &+\sum_{x_i\ge0}\;\:\sum_{x_j<0}|x_i+x_j| &+\sum_{x_i<0}\;\:\sum_{x_j\ge0}|x_i+x_j| &+\sum_{x_i<0}\;\:\sum_{x_j<0}|x_i+x_j|\\ &\ge\sum_{x_i\ge0}\;\:\sum_{x_j\ge0}|x_i|+|x_j| &+\left|\sum_{x_i\ge0}\;\:\sum_{x_j<0}|x_i|-|x_j|\right| &+\left|\sum_{x_i<0}\;\:\sum_{x_j\ge0}|x_j|-|x_i|\right| &+\sum_{x_i<0}\;\:\sum_{x_j<0}|x_i|+|x_j|\\ &=2p\sum_{x_i\ge0}|x_i| &+2\left|m\sum_{x_i\ge0}|x_i|-p\sum_{x_i<0}|x_i|\right| &&+2m\sum_{x_i<0}|x_i| \end{array}$$

Subtracting $\displaystyle\sum_i\;\:\sum_j|x_i|=n\sum_i\;|x_i|$ from the inequality above yields \small\begin{align}{} &\sum_i\;\:\sum_j|x_i+x_j|-\sum_i\;\:\sum_j|x_i|\\ &\ge(p-m)\sum_{x_i\ge0}|x_i| +\left|2m\sum_{x_i\ge0}|x_i|-2p\sum_{x_i<0}|x_i|\right| +(m-p)\sum_{x_i<0}|x_i|\\ &=(p-m)\sum_{i}x_i +\left|(m-p)\sum_{i}|x_i|+n\sum_ix_i\right|\\ &\ge0\tag{1} \end{align} In the last inequality, if $p-m$ and $\sum\limits_ix_i$ have the same sign, we can ignore the quantity in absolute values. If $p-m$ and $\sum\limits_ix_i$ have different signs, then the quantities in the absolute values have the same sign and $|m-p|\sum\limits_i|x_i|\ge(m-p)\sum\limits_ix_i$.

Therefore, $(1)$ says that $$\sum_i\;\:\sum_j|x_i|\le\sum_i\;\:\sum_j|x_i+x_j|$$

-
This follows exactly the same approach suggested in my answer. An acknowledgement is in order perhaps? –  quantumelixir Oct 22 '11 at 20:16
Nice work. Does the same inequality and perhaps similar approach work for $x_i$ being complex or a vector? –  Hansen Oct 18 at 23:52

Assume an ordering of the $x_i$ such that $x_1 \le x_2 \le \dots \le x_k < 0 \le x_{k+1} \le x_{k+2} \le \dots \le x_n$. Let's call $T_1 = \sum_{i=1}^k |x_i|$, $T_2 = \sum_{i=k+1}^n |x_i|$, and $T=\sum_i |x_i|=T_1+T_2$ so that $T, T_1, T_2 \ge 0$.

Since we only require a lower bound on the sum $\sum_{i \neq j} |x_i + x_j|$, we only consider $2\binom{k}{2} + 2\binom{n-k}{2}$ terms of the $2\binom{n}{2}$ total terms that the sum contains i.e. we only pick terms where both $x_i$ and $x_j$ have the same sign. This solves the inequality in many cases. For the other cases, we include the cross terms too later.

\begin{align*} \sum_{i \neq j} |x_i + x_j| &\ge \sum_{i=1}^k \sum_{j=1,j\neq i}^k |x_i+x_j| + \sum_{i=k+1}^n \sum_{j=k+1,j\neq i}^n |x_i+x_j|\\ &= \sum_{i=1}^k \sum_{j=1,j\neq i}^k (|x_i|+|x_j|) + \sum_{i=k+1}^n \sum_{j=k+1,j\neq i}^n (|x_i|+|x_j|)\\ &= \sum_{i=1}^k ((k-1)|x_i|+T_1-|x_i|) + \sum_{i=k+1}^n ((n-k-1)|x_i|+T_2-|x_i|)\\ &= \sum_{i=1}^k ((k-2)|x_i|+T_1) + \sum_{i=k+1}^n ((n-k-2)|x_i|+T_2)\\ &= ((k-2)T_1+kT_1) + ((n-k-2)T_2+(n-k)T_2)\\ &= 2\{(k-1)T_1 + (n-k-1)T_2\}\\ \end{align*}

Now, the last expression is a function of $T_1$ and $T_2$. Since we require a lower bound in terms of $T=T_1+T_2$, we can get two equivalent expressions in terms of either $T_1$ and $T$ or in terms of $T_2$ and $T$. Thus,

$$\sum_{i \neq j} |x_i + x_j| \ge 2(2k-n)T_1+2(n-k-1)T$$ $$\sum_{i \neq j} |x_i + x_j| \ge 2(n-2k)T_2+2(k-1)T$$

$$2\sum_{i \neq j} |x_i + x_j| \ge 2\left\{(2k-n)T_1+(n-2k)T_2+(n-2)T\right\}$$ $$\implies \sum_{i \neq j} |x_i + x_j| \ge (2k-n)(T_1-T_2)+(n-2)T \ge (n-2)\sum_i |x_i|$$ $$\text{whenever,} \; (2k-n)(T_1-T_2) \ge 0$$

For the cases when the above inequality doesn't hold, we need to consider the cross terms too. Computing the cross terms alone:

\begin{align*} \sum_{i \neq j} |x_i + x_j| &\ge \sum_{i=1}^k \sum_{j=k+1}^n |x_i+x_j| + \sum_{i=k+1}^n \sum_{j=1}^k |x_i+x_j|\\ &\ge 2\sum_{i=1}^k \sum_{j=k+1}^n |x_i+x_j|\\ &\ge 2\sum_{i=1}^k \sum_{j=k+1}^n \max\{|x_i|-|x_j|,|x_j|-|x_i|\}\\ &\ge 2 \max\{(n-k)T_1-kT_2, kT_2-(n-k)T_1\}\\ \end{align*}

Including the cross terms along with the terms from the previous case, we have:

\begin{align*} \sum_{i \neq j} |x_i + x_j| &\ge 2 \max\{(n-k)T_1-kT_2, kT_2-(n-k)T_1\} + 2\{(k-1)T_1 + (n-k-1)T_2\}\\ &\ge 2 \max\{(n-1)T_1+(n-2k-1)T_2, (2k-n-1)T_1+(n-1)T_2\} \; (*)\\ \end{align*}

The $\max$ term can go one of two ways. Using the first term we get: $$\sum_{i \neq j} |x_i + x_j| \ge 2 \{(n-1)T_1+(n-2k-1)T_2\}$$

We can again write the above in terms of either $T,T_1$ or $T,T_2$ giving two inequalities:

\begin{align} \sum_{i \neq j} |x_i+x_j| &\ge (n-2k-1)T+2kT_1\\ \sum_{i \neq j} |x_i+x_j| &\ge (n-1)T-2kT_2 \end{align}

Summing the above two inequalities,

\begin{align*} \sum_{i \neq j} |x_i + x_j| &\ge (2n-2k-2)T+2k(T_1-T_2)\\ &\ge (n-2)T+(n-2k)T+2k(T_1-T_2)\\ &\ge (n-2)T \quad \text{for the case} \quad (2k-n) \le 0, (T_1-T_2) \ge 0\\ \end{align*}

Similarly, for the other case, when $(2k-n) \ge 0, (T_1-T_2) \le 0$, we use the other $\max$ term from $(*)$ and follow the above steps routinely to prove the inequality.

Q.E.D

-
Well done. (more characters) –  Jonas Teuwen Oct 22 '11 at 16:36
Thanks Jonas! Please correct any errors if you spot them. –  quantumelixir Oct 22 '11 at 16:54
The above presentation can be greatly simplified, but it's rather long because of it's long edit history. –  quantumelixir Oct 22 '11 at 20:17
One simplification: $\max\{(n-k)T_1-kT_2, kT_2-(n-k)T_1\}=|(n-k)T_1-kT_2|$. At least it is easier to read. –  robjohn Oct 22 '11 at 21:31
As I commented before, it helps to use $2|(n-k)T_1-kT_2|$ instead of $2\max\{(n-k)T_1-kT_2,kT_2-(n-k)T_1\}$. Then, use $2T_1=(T+(T_1-T_2))$ and $2T_2=(T-(T_1-T_2))$ to convert $$\sum_{i\not=j}|x_i+x_j|\ge2|(n-k)T_1-kT_2|+2\{(k-1)T_1+(n-k-1)T_2\}$$ into $$\sum_{i\not=j}|x_i+x_j|\ge|(n-2k)T+n(T_1-T_2)|+(n-2)T+(2k-n)(T_1-T_2)$$ If $(2k-n)(T_1-T_2)\ge0$, ignore the stuff in the absolute values. If $(2k-n)(T_1-T_2)<0$, then $(n-2k)$ and $(T_1-T_2)$ inside the absolute values have the same sign and $|n-2k|T\ge(n-2k)(T_1-T_2)$ which cancels $(2k-n)(T_1-T_2)$. –  robjohn Oct 23 '11 at 8:13


# Weak convergence of $(e_n + e_{n+1} +\cdots + e_{2n})_{n=1}^\infty$ in $\ell^\infty$

Let $(e_n)_{n=1}^\infty$ be the canonical vectors in $\ell^\infty$. Consider the sequence $$(e_n + e_{n+1} +\cdots + e_{2n})_{n=1}^\infty$$

Does it converge weakly in $\ell^\infty$?

Obviously $e_n + e_{n+1} + \cdots + e_{2n} \xrightarrow{n\to\infty} 0$ coordinate-wise, so the only possible candidate for the weak limit is $0$.

I believe it indeed weakly converges to $0$.

Let $f \in (\ell^\infty)^*$ be a bounded linear functional. Assume $f(e_1 + e_{n+1} \cdots +e_{2n}) \not\to 0$. Therefore, there exists $\varepsilon > 0$ and a subsequence $$(e_{p(n)} + e_{p(n)+1} +\cdots + e_{2p(n)})_{n=1}^\infty$$ such that $|f(e_{p(n)} + e_{p(n)+1} +\cdots + e_{2p(n)})| \ge \varepsilon$ for all $n \in \mathbb{N}$.

We have $$f(e_{p(n)} + e_{p(n)+1} +\cdots + e_{2p(n)}) = |f(e_{p(n)} + e_{p(n)+1} +\cdots + e_{2p(n)})|e^{i\phi_n}$$

for some $\phi_n \in \mathbb{R}$.

Inductively we construct a further subsequence $(e_{q(p(n))} + e_{q(p(n))+1} +\cdots + e_{2q(p(n))})_{n=1}^\infty$ such that the supports of $e_{q(p(n))} + e_{q(p(n))+1} +\cdots + e_{2q(p(n))}$ and $e_{q(p(n+1))} + e_{q(p(n+1))+1} +\cdots + e_{2q(p(n+1))}$ are disjoint:

Set $q(p(1)) = p(1)$. Let $p(k)$ be such that $p(k) \ge 2p(1)$. Set $q(p(2)) = p(k)$. Le $p(k')$ be such that $p(k') \ge 2p(k) = 2q(p(2))$. Set $q(p(3)) = p(k')$ and so on.

Now consider $$x_n = \sum_{k=1}^n e^{-i\phi_{q(k)}}(e_{q(p(k))} + e_{q(p(k))+1} +\cdots + e_{2q(p(k))})$$ Since the summands have disjoint supports and $|e^{-i\phi_{q(k)}}| = 1$ it follows $\|x_n\|_\infty = 1$ for all $n \in \mathbb{N}$.

However, $$|f(x_n)| = \left|\sum_{k=1}^n e^{-i\phi_{q(k)}} f(e_{q(p(k))} + e_{q(p(k))+1} +\cdots + e_{2q(p(k))})\right| = \sum_{k=1}^n |f(e_{q(p(k))} + e_{q(p(k))+1} +\cdots + e_{2q(p(k))})| \ge n\varepsilon \xrightarrow{n\to\infty} +\infty$$

so $f$ is unbounded. A contradiction.

Therefore $f(e_n + e_{n+1} + \cdots + e_{2n}) \xrightarrow{n\to\infty} 0$ for all $f \in (\ell^\infty)*$ so $e_n + e_{n+1} + \cdots + e_{2n} \rightharpoonup 0$.

Is my proof correct? Is there an easier (and still elementary) way to conclude that it converges weakly to $0$?

Edit: I lied - there is another proof that might well be regarded as much simpler. Inspired by the OP's comment on what he was really trying to do:

Trivial Lemma Suppose $X$ is a Banach space and $Y$ is a closed subspace. If $y_n\to y$ weakly in $Y$ then $y_n\to y$ weakly in $X$.

Proof: Suppose $f\in X^*$. Let $g=f|_Y$. Then $g\in Y^*$, so $$f(y_n)=g(y_n)\to g(y)=f(y).$$

So to answer the original question it's enough to show that $e_n+\dots+e_{2n}\to0$ weakly in $c_0$. This is clear, since $c_0^*=\ell_1$.

Original: Looks right. Is there an easier proof? I doubt it - what you did is already very simple, just applying a few definitions. If it doesn't look simple that's just because of the notation.

I'd write the very same proof as follows - possibly looks simpler, possibly easier to read (in fact I confess I didn't read what you wrote very carefully, just sort of skimmed it and saw that the idea clearly worked):

Say $x_n=e_n+\dots+e_{2n}$. Suppose $x_n$ does not tend to $0$ weakly. Then there exists $f\in\ell_\infty^*$ so $f(x_n)\not\to0$.

So there exist a subsequence $(x_{n_j})$, $\epsilon>0$, and complex numbers $\alpha_j$ with $|\alpha_j|=1$, so that $$f(y_j)\ge\epsilon$$if $$y_j=\alpha_jx_{n_j}.$$We may assume that $n_{j+1}>2n_j$, so that the $y_j$ have disjoint support. Since the $y_j$ have disjoint support we have $$||y_1+\dots+y_n||=1,$$although$$f(y_1+\dots+y_n)\ge n\epsilon,$$contradicting the fact that $f$ is bounded.

That looks simpler to me - I think it's much easier to read, since the displayed formulas are less intricate. But it's exactly the same proof.

• Ok, thanks for the feedback. Not really related to the question, but is there an example of a sequence in $c_0$ which converges weakly in $c_0$ but not in $\ell^\infty$? The sequence $(e_n + \cdots + e_{2n})_{n=1}^\infty$ was my attempt to construct such an example, but we have established that it converges weakly to $0$ in both $c_0$ and $\ell^\infty$. Jan 7 '18 at 12:49
• @mechanodroid See edit. Jan 7 '18 at 13:07
• Great, exactly the kind of thing I was hoping for! Jan 7 '18 at 13:12


Interpolating between the $L^{p}$ norm and the Hölder semi-norm

Set-up.

For a bounded continuous function $u \colon \mathbb{R}^n \to \mathbb{R}$, the $\gamma$-Hölder semi-norm of $u$ is $$\begin{eqnarray} [u]_{C^\gamma} &=& \sup \left\{\frac{|u(x) - u(y)|}{|x-y|^\gamma} : x,y \in U, x \neq y \right\} \\ &=& \inf \left\{ C \geq 0 : |u(x) - u(y)| \leq C |x-y|^{\gamma} \text{ for all } x,y \in U \right\}. \end{eqnarray}$$

The Problem

Fix $1 \leq p < \infty$, $0 < \gamma \leq 1$, and $0 < \lambda < 1$ such that $$0 = \frac{\lambda}{p} - (1-\lambda)\frac{\gamma}{n}.$$ I am trying to prove that there is a constant $C$ such that $$\|u\|_{L^\infty} \leq C \|u\|_{L^p}^{\lambda} [u]_{C^\gamma}^{1-\lambda}$$ for every compactly supported $C^{1}(\mathbb{R}^n)$ function $u$.

My Strategy

My plan is to use the interpolation result for Lebesgue spaces: For every $q,r$ satisfying $p < q < r \leq \infty$ and $$\frac{1}{q} = \frac{\lambda}{p} + \frac{1-\lambda}{r},$$ we have $$\|u\|_{L^q} \leq \|u\|_{L^{p}}^{\lambda} \|u\|_{L^r}^{1-\lambda}$$ for every $u \in L^p \cap L^r$.

Solving for $1/r$ in terms of $q$ and using the relationship between $p$, $\gamma$, and $n$, we find $$\frac{1}{r} = \frac{1/q - \lambda/p}{1-\lambda} = \frac{1/q}{1-\lambda} - \frac{\gamma}{n}$$ So, by letting $q \to \infty$, we have $r \to -n / \gamma$, and $$\frac{1}{q} = \frac{\lambda}{p} + \frac{1-\lambda}{r},$$ goes to $$0 = \frac{\lambda}{p} - (1-\lambda)\frac{\gamma}{n}.$$ Meanwhile, for $u \in L^{\infty}$ (which certainly holds when $u$ is compactly supported and $C^1$), we have that $\lim_{q \to \infty} \|u\|_{L^q} =\|u\|_{L^\infty}$.

So if I could prove that $\|u\|_r \to [u]_{C^{\gamma}}$ as $q \to \infty$ (i.e., as $r \to -n / \gamma$), I'd be done. The problem is that I don't know how to prove this. Moreover, I'm not sure if this is even the right approach to prove the desired inequality.

-
There is no reason that $\|u\|_r$ should tell you anything about $[u]_{C^\gamma}$ on its own (they measure completely different things). Also, your Lebesgue interpolation inequality only holds for $p < q < r$, but you are taking $q \to \infty$ and $r \to -n/\gamma$ (does $r < 1$ even make sense?). – Jeff Nov 17 '11 at 21:18
You may have to assume that $u \in C^\gamma$ (instead of $u$ continuous) and use some kind of Sobolev embedding. – Jeff Nov 17 '11 at 21:21
@Jeff: It was a mistake to not assume $u \in C^{\gamma}$. Thank you for pointing it out. – fferic Nov 17 '11 at 22:03
@Jeff: You are right that $q \rightarrow \infty$ and $r \rightarrow -n/\gamma$ is not compatible with the requirement $p<q<r$ in the Lebesgue interpolation inequality. This is one reason why I am not so sure my strategy will really work. – fferic Nov 17 '11 at 22:06
@Jeff: Could you please elaborate a bit more on your comment about using a Sobolev embedding? – fferic Nov 17 '11 at 22:07

This is my first post on MSE and I'm just a grad student so forgive me if screw anything up. [Disclaimer: This proof is likely to be overkill, however I like that it shows what exactly is going on and these techniques generalize to a lot of different problems.] Hopefully someone else can chime in to validate my answer.

I will only consider the case $U = \Bbb R^n$.

The proof will be similar to the proof of Theorem A.3 in Tao's book "Nonlinear dispersive equations". In Theorem A.3, Tao uses basic Littlewood-Paley theory to prove a fairly general version of the Gagliardo-Nirenberg inequality, which is your equation after your swap out the Hölder space with an appropriate Sobolev space.

First, we consider the case when $\| u \|_{L^p} = \| u \|_{C^\gamma} = 1$ and show that the $L^\infty$ norm is bounded above by a constant. For general $u$ in $L^p \cap C^\gamma$ we can reduce to the first case by considering $v(x) = A u(B x)$ for an appropriate choice of constants $A$ and $B$ which make both of the norms $1$.

The main idea is to decompose $u$ into high and low frequencies. We will use the $L^p$ norm to bound the low frequencies and the Hölder regularity to bound the high frequencies.

To begin, the triangle inequality gives

$$\| u \|_{L^\infty} \le \sum_{k=0}^{-\infty}\| P_k u \|_{L^\infty} + \sum_{k=1}^{\infty} \| P_k u \|_{L^\infty}.$$

The Bernstein inequalities tell us that $$\| P_k u \|_{L^\infty} \le C 2^{k \frac{n}{p}} \| P_k u \|_{L^p} = C 2^{k \frac{n}{p}}$$ which in turns gives a bound on the low frequencies in terms of a convergent geometric sum $$\sum_{k=0}^{-\infty}\| P_k u \|_{L^\infty} \le C \sum_{k=0}^{-\infty} 2^{k \frac{n}{p}} = C_1 < \infty.$$

To deal with the high frequency terms, we use the part of the Littlewood-Paley decomposition of $C^\gamma$ which states that $$\sup_{k \in \Bbb Z} 2^{k \gamma} \| P_k u \|_{L^\infty} \le C' \| u \|_{C^\gamma}$$

This leads to a bound on the high frequencies in terms of another convergent geometric sum:

$$\sum_{k=1}^{\infty}\| P_k u \|_{L^\infty} \le \sum_{k=1}^{\infty} 2^{-k \gamma} C' \| u \|_{C^\gamma} = C' \sum_{k=1}^{\infty} 2^{-k \gamma} = C_2 < \infty$$

Together these shows that $\| u \|_{L^\infty} \le C_1 + C_2$.

-


# Toronto Math Forum

## MAT244-2018S => MAT244--Tests => Final Exam => Topic started by: Victor Ivrii on April 11, 2018, 08:42:26 PM

Title: FE-P3
Post by: Victor Ivrii on April 11, 2018, 08:42:26 PM
Find the general solution of
\begin{equation*}
y''' -6y'' +11y'- 6y=2\frac{e^{3x}}{e^x+1} .
\end{equation*}
Title: Re: FE-P3
Post by: Tim Mengzhe Geng on April 11, 2018, 11:37:34 PM
First we find the solution for the homogeneous system

y^{(3)}-6y^{(2)}+11y^{(1)}-6y=0

The corresponding characteristic equation is

r^3-6r^2+11r-6=0

Three roots are

r_1=1

r_2=2

r_3=3

Then the solution for the homogeneous system is

y_c(t)=c_1e^{x}+c_2e^{2x}+c_3e^{3x}

where

y_1(t)=e^{x}

y_2(t)=e^{2x}

y_3(t)=e^{3x}

Then we follow to find the required solution to the nonhomogeneous equation. We use Variation of Parameters. We have

W[y_1,y_2,y_3]=2e^{6x}

W_1[y_1,y_2y_3]=e^{5x}

W_2[y_1,y_2y_3]=-2e^{4x}

W_3[y_1,y_2，y_3]=e^{3x}

and

g(x)=2\frac{e^{3x}}{e^{x}+1}

And then we have the following integration

\int \frac{W_1\cdot g(x)dx}{W[y_1,y_2,y_3]}=\int\frac{e^{2x}}{e^{x}+1}

\int\frac{e^{2x}}{e^{x}+1}=e^{x}-\ln(e^{x}+1)+c_4

\int \frac{W_2\cdot g(x)dx}{W[y_1,y_2,y_3]}=-2\int\frac{e^{x}}{e^{x}+1}

-2\int\frac{e^{x}}{e^{x}+1}=-2\ln(e^{x}+1)+c_5

\int \frac{W_3 \cdot g(x)dx}{W[y_1,y_2,y_3]}=\int\frac{1}{e^{x}+1}

\int\frac{1}{e^{x}+1}=x-\ln(e^{x}+1)+c_6

And finally, the required general solution $y(t)$

y(t)=\sum_{i=1}^3 y_i(t)\cdot\int\frac {W_i\cdot g(x)dx}{W[y_1,y_2,y_3]}
Title: Re: FE-P3
Post by: Meng Wu on April 11, 2018, 11:47:31 PM
Small Error: $W_2(x)$ should be $2e^{4x}$.
Title: Re: FE-P3
Post by: Tim Mengzhe Geng on April 11, 2018, 11:49:31 PM
Small Error: $W_2(x)$ should be $2e^{4x}$.
For this case I don't think so since when we expand the matrix, we have to times $(-1)^{i+j}$
Title: Re: FE-P3
Post by: Meng Wu on April 11, 2018, 11:54:19 PM
Small Error: $W_2(x)$ should be $2e^{4x}$.
For this case I don't think so since when we expand the matrix, we have to times $(-1)^{i+j}$

Oh, you're right. My mistake.
Title: Re: FE-P3
Post by: Meng Wu on April 11, 2018, 11:56:10 PM
Also for $(20)$, $\ln(e^x)$ can be simplified as $\ln(e^x)=x$.
Title: Re: FE-P3
Post by: Tim Mengzhe Geng on April 11, 2018, 11:57:57 PM
Also for $(20)$, $\ln(e^x)$ can be simplified as $\ln(e^x)=x$.
Thanks again and I will modify it :)
Title: Re: FE-P3
Post by: Syed Hasnain on April 12, 2018, 04:33:47 PM
Since the solution is incomplete after Y(x),
I am attaching a copy of my solution
Title: Re: FE-P3
Post by: Tim Mengzhe Geng on April 12, 2018, 10:01:46 PM
Since the solution is incomplete after Y(x),
I am attaching a copy of my solution
Sorry what do you mean by "the solution is incomplete after Y(x)"
I did write a bit more on the exam (expanding the summation) but I think one should be able to get full marks if he integrates everything and mention how the solution is composed.(Given that the integral is correct)
Title: Re: FE-P3
Post by: Victor Ivrii on April 15, 2018, 03:15:29 AM
Since the solution is incomplete after Y(x),
I am attaching a copy of my solution
The only thing which was missing in the solution, is the final answer, but it warrants neither such claim, nor uploading your solution.

General remark:
It would be better to denote "parameters" by uppercase letters $C_1(x)$, $C_2(x)$,... and constants by lowercase letters $c_1$, $c_2$,...


# What is $\mathbb Z[[t]]$? What are the double brackets?

What does $\mathbb{Z}[[t]]$ mean? Why are there double square brackets?

I can't search through Google, because I can't search Latex.

-
I think it's the ring of formal power series with coefficents from $\mathbb{Z}$, see en.wikipedia.org/wiki/Formal_power_series –  Mikko Korhonen Sep 2 '12 at 16:19
You actually can search LaTeX: latexsearch.com –  huon-dbaupp Sep 2 '12 at 16:22
If this is from a book, it might have an list of symbols in the back that you can check. –  Jair Taylor Sep 2 '12 at 17:10

That is the ring of formal power series in $t$ with integer coefficients, i.e., of $$\sum_{n=0}^\infty a_nt^n,$$ with $a_n\in\Bbb Z$, componentwise addition, and multiplication appropriately defined.

The double brackets distinguish it from $\Bbb Z[t]$, which is the ring of polynomials in $t$ with integer coefficients. We can always evaluate the members of $\Bbb Z[t]$ for any complex value of $t$, but we generally can't evaluate members of $\Bbb Z[[t]]$ for $t\neq 0$. To my mind, the double bracket is a reminder that we need to leave the $t$ alone, and not worry about evaluation.

-
(IMO there is a sense in which can view "evaluation at $t=a$" to be the quotient map $\Bbb Z[[t]]\to \Bbb Z[[t]]/(t-a)$, though this is cheating and doesn't send everything all the way down to $\Bbb Z$.) –  anon Sep 2 '12 at 17:08
Interesting point! –  Cameron Buie Sep 2 '12 at 17:11
I laughed. I'm going to steal this saying. Many thanks. "just leave $t$ alone" ha. –  James S. Cook Sep 2 '12 at 18:21
Have at it, James! –  Cameron Buie Sep 3 '12 at 1:47
@CameronBuie Is it ok to use the symbol $\mathbb{Z}\llbracket t\rrbracket$ in latex instead of $\mathbb{Z}[[t]]$ or is that wrong? –  Pratyush Sarkar Mar 4 '13 at 14:51

If $A$ is any ring, the notation $A[[T]]$ stands for the ring of formal power series with coefficients in $A$, i.e. the ring whose elements are the expressions $$a_0+a_1T+a_2T^2+a_3T^3+\cdots$$ with the obvious sum and product.

-


# How do I represent this sine function?

1. Mar 15, 2015

I was struggling to represent the following for integer values of n:

$$\sin \left( \dfrac {n\pi } {2}\right)$$

I know for even n, we get zero

But for odd n, it alternates beween 1 and -1 for every other odd. Is there a compact way to represent that? I feel like I'm being dumb and missing something obvious.

Thanks!

2. Mar 15, 2015

### piggupiggu

1 when n = 1 + 2x
-1 when n = 3 + 2x

where x is zero or a positive even integer

3. Mar 15, 2015

### Mentallic

What you have is a piecewise function (the variable being n in this case).

$$k\in \mathbb{Z} \\ f(n) = \sin{\frac{\pi n}{2}} = \left\{ \begin{array}{lr} 0 & : n=2k\\ 1 & : n=4k+1\\ -1 & : n=4k+3 \end{array} \right.$$

4. Mar 15, 2015

### LCKurtz

I guess you are looking for something similar to $\cos(n\pi) = (-1)^n$ for $\sin(\frac{n\pi} 2)$. You may be able to find such an expression, but I don't think you will find anything "simpler" than $\sin(\frac{n\pi} 2)$ itself, unless you consider piecewise defined functions simpler. I don't.

5. Mar 17, 2015

Thank you so much for the responses everyone!

6. Mar 18, 2015

### Mentallic

I gave it a little more thought and came up with
$$\sin\left(\frac{n\pi}{2}\right)=\frac{1}{2}\left(-1\right)^{\frac{n-1}{2}}\left(1-(-1)^n\right)$$

7. Mar 19, 2015

### jbunniii

$$\sin\left(\frac{n\pi}{2}\right) = \frac{1}{2i}\left(i^n - (-i)^n\right) = \frac{1}{2}\left(i^{n-1} + (-i)^{n-1}\right)$$

: I guess that's equivalent to Mentallic's answer. Here's how I obtained it:

\begin{aligned} \sin\left(\frac{n\pi}{2}\right) &= \text{Im}\left(e^{in\pi/2}\right) \\ &= \frac{1}{2i} \left(e^{in\pi/2} - \overline{e^{in\pi/2}}\right) \\ &= \frac{1}{2i} \left(i^n - \overline{i^n}\right) \\ &= \frac{1}{2i} \left(i^n - (-i)^n\right) \\ \end{aligned}

Last edited: Mar 19, 2015
8. Mar 20, 2015

### LCKurtz

Yup. As I thought. Nothing "simpler" than $\sin\frac{n\pi} 2$ itself.


# Find closest point on a plane to a given point. Discrepancy with normal vector.

I have a point $(9,5,0)$ and a triangle with points $(1,1,0), (3,3,1), (6,1,0)$, let's label them as $A,B,C$ respectively. In order to get the normal vector, I do the cross product of two vectors. If I do $AB \times AC$ I get $n = \left\langle 0,-5,10\right\rangle$. With this I determine the equation of the plane is $5y - 10z - 5 = 0$. If I project my point onto the plane with this normal vector in mind, the point on the plane I find is $(9, 21/5, 8/5)$. HOWEVER, if I initially choose to cross two different vectors, I get something different.

Example: If I instead choose to do $BA \times BC$ I get $n = \left\langle 0,5,-10\right\rangle$. Now this in a way makes sense to me since it is the inverse of the other normal I found. Basically the other half of the line through the plane, right? If I continue, I find the equation of the plane to be $-5y + 10z + 5 = 0$. This leads me to a projected point of $(9, -29/5, -8/5)$. Why do I get two different points based on which normal vector I choose to solve with? I know the correct answer to this problem, one is right and one is wrong. I am trying to program a general solution to this type of problem. How do I choose the correct normal vector?

Please let me know if I am doing something wrong.

$\vec{AB} = <2,2,1> \quad \quad \vec{AC} = <5,0,0>$.

So, $\vec{AB} \times \vec{AC} = <0,5,-10>$

Then, the plane equation is something like $5y -10z = C$ for some constant $C$.

Plug (for example) the point $(1,1,0)$ into the plane equation to get $C=5$.

Hence, the plane equation is $5y -10z -5 =0$ or equivalently $-5y +10z+5=0$ which is slightly different from the one you found.

Edit: Let's continue with a different approach. The vector $\vec{n} = <0,5,-10>$ is perpendicular to the plane. The line that passes through our point $(9,5,0)$ which is parallel to $\vec n$ is $$x=9, \quad y=5+5t, \quad z=0-10t, \quad t \in \mathbb R$$

Now let's find where this line cuts the plane. Pick an arbitrary point from the line and put into the plane equation:

$$0= 5y-10z-5 =5(5+5t)-10(0-10t)-5$$

$$125t + 25 -5=0 \quad \implies \quad t=-\frac{4}{25}$$

So, the answer is $(9,5+5t,0-10t)=(9,-\frac{21}{5},\frac{8}{5})$.

Edit2: Now we do the projection. Choose an arbitrary point on the plane, say $A(1,1,0)$ and consider the vector $\vec{AP}$ where $P=P(9,5,0)$. $\vec{AP}=<8,4,0>$.

Then,

\begin{align*} proj_{\ \vec n \ } \vec{AP} &= |\vec{AP}| \cdot \cos \alpha \cdot \frac{\vec n}{| \vec n |} \\ &= |\vec{AP}| \cdot \frac{\vec{AP} \bullet \vec n}{|\vec{AP}| \cdot |\vec n|} \cdot \frac{\vec n}{| \vec n |} \\ &= \text{ calculations ... find the projection vector} \\ &= \vec u \end{align*}

Now, the point you are looking for is the point $K$ such that $\vec{KP} = \vec u$

• Ah, I typed it in wrong. You are correct, but the question of the discrepancy still stands. I will edit the post. Can you continue to carry out the projection and see if you get the same results as I did? – kvcwahley Jul 20 '15 at 17:36
• I think you forgot the -5 constant in your last calculation. It should be 125t + 25 = 5. This gives t=-4/25. My answer is then (9,21/5, 8/5). – kvcwahley Jul 20 '15 at 17:54
• Theoretically, should I be getting the same answer? – kvcwahley Jul 20 '15 at 17:54
• @kvcwahley Thanks I edited and got the answer. Now I will edit my answer again and add projection to get the same answer. – ThePortakal Jul 20 '15 at 17:59
• If you solve it with cross product of BA x BC, do you get the same answer? – kvcwahley Jul 20 '15 at 18:03

"I have a point $(9,5,0)$ and a triangle with points $(1,1,0), (3,3,1), (6,1,0),$ let's label them as $A,B,C$ respectively. In order to get the normal vector, I do the cross product of two vectors."

So you mean a normal vector to the plane determined by the three points.

"If I do $AB \times AC$ I get $n = <0,-5,10>$. With this I determine the equation of the plane is $5y - 10z + 5 = 0.$"

No, that does not contain $(1, 1, 0)$ because $0(1)+ 5(1)- 10(0)+ 5= 10$, not 0. The equation of the plane is $0(x- 1)-5(y- 1)+ 10z= 0$ or $5y- 10z- 5= 0$. Perhaps you meant $5y- 10z= 5$.

"If I project my point onto the plane with this normal vector in mind, the point on the plane I find is $(9, 21/5, 8/5)$. HOWEVER, if I initially choose to cross two different vectors, I get something different.

Example: If I instead choose to do $BA \times BC$ I get $n = <0,5,-10>$. Now this in a way makes sense to me since it is the inverse of the other normal I found. Basically the other half of the line through the plane, right? If I continue, I find the equation of the plane to be $-5y + 10z -5 = 0.$"

Which, again, is wrong. The cross product of $BA \times BC$, as you say is $<0, 5, -10>$ and, since the plane contains the point $(1, 1, 0)$, the plane has the equation $0(x- 1)- 5(y- 1)+ 10(z- 0)= -5y+ 10z+ 5= 0$, not $-5y+ 10z- 5$.

"This leads me to a projected point of $(9, -29/5, -8/5)$. Why do I get two different points based on which normal vector I choose to solve with?"

You don't say how you got two different points. Since you have exactly the same equation for the plane in both cases (although wrong!), and the same point, you should be doing exactly the same calculations in both cases.

"I know the correct answer to this problem, one is right and one is wrong. I am trying to program a general solution to this type of problem. How do I choose the correct normal vector?

Please let me know if I am doing something wrong."

Yes, if you get different answers projecting the same point onto the same plane, you must have done something wrong! But since you don't show what you did, it is impossible to say what you might have done wrong.

• You are correct with my equations being wrong. I initially typed them in incorrectly. I have edited the post to show the correct equations. Theoretically, should I be getting the same point? – kvcwahley Jul 20 '15 at 18:00
• Please start using LaTeX, see this guide: meta.math.stackexchange.com/questions/5020/… Almost all of your posts need heavy editing – Hirshy Aug 5 '15 at 8:42


# Finding shortest non-zero vector $x$ satisfying $Ax=0 \pmod q$

Let $n$, $m$, and $q$ be positive integers (with $m > n$), and $A$ be a matrix over $\mathbb{Z}_q^{n \times m}$. Using Mathematica, I want to find the shortest non-zero vectors $x \in \mathbb{Z}_q^m$ such that:

$$Ax=0 \pmod q$$

Note: By "shortest," I mean the vector with the smallest Euclidean norm. I'm not sure if this vector is unique. If it's not, I want a list of vectors with smallest Euclidean norm.

Example:

Let: $n=2, m=3, q=7, A = \left(\begin{matrix} 2 & 1 & 6\\ 1 & 3 & 1 \end{matrix} \right)$. Then, the following vectors are solutions to

{1,1,3} $\quad$ Norm = $\sqrt{11}$

{3,3,2} $\quad$ Norm = $\sqrt{22}$

{2,2,6} $\quad$ Norm = $\sqrt{44}$

{5,5,1} $\quad$ Norm = $\sqrt{51}$

{4,4,5} $\quad$ Norm = $\sqrt{57}$

{6,6,4} $\quad$ Norm = $\sqrt{88}$

Therefore, the vector {1,1,3} is the shortest solution.

PS: I used an exhaustive search to find the above solutions. My approach takes a long time for even small choices of $n$ and $m$, say $n=2, m=8$. Please offer an approach which can at least find solutions for such small parameters.

Edit: As Michael suggested in a comment, I demonstrate the "exhaustive search" code I used. I'm not proud of it at all, as I just wrote the code to find an example for this question.

A = RandomInteger[6, {2, 3}];
x = {a, b, c};
Table[
If[Mod[A.x, 7] == {0, 0}, Print[{x, x // Norm}]],
{a, 0, 6}, {b, 0, 6}, {c, 0, 6}]
-
You might show the code you tried -- perhaps it can be made efficient. Users are much more likely to try out your problem if they can cut and paste a starting point. – Michael E2 Jul 28 '13 at 20:24
@MichaelE2: Thanks for the suggestion. I added the code snippet. It does not use Mathematica's built-in functions like Solve or FindMin. It's nothing more than an exhaustive search, and that's why it takes a long time to find a solution for even relatively small parameters. – M.S. Dousti Jul 28 '13 at 21:05
Yes that would take a long time. :) If you thought of Solve, you should have tried it! Another tip: Don't use Print to accumulate you results. Table will accumulate them; then DeleteCases[table, Null, Infinity], gets rid of the Nulls; then perhaps Flatten. Better yet, learn about Reap/Sow. – Michael E2 Jul 28 '13 at 22:03
(1) You are working in a ring that really does not have a notion of length. Why is a rock-bottom smallest in Euclidean norm result needed? – Daniel Lichtblau Jul 29 '13 at 14:12
(2) One can get small results using lattice reduction. This unfortunately does not force values to be nonnegative. All the same, a usable vector might appear. In a run of your example I have mat = {{2, 3, 2}, {2, 6, 1}}. Then it turns out that {4,3,2} is the null vector of interest (though see (1) above-- I do not know why it is of interest). It appeas in the following lattice reduction. In[35]:= LatticeReduce[ Join[NullSpace[A], 7*IdentityMatrix[Length[A[[1]]]]]] Out[35]= {{-2, 2, -1}, {1, -1, -3}, {4, 3, 2}} – Daniel Lichtblau Jul 29 '13 at 14:14

One way to approach this is to use the Null space of the matrix a, which is a basis for all elements x such that a.x=0. For the OPs problem, this can be done by first finding the null space:

a = {{2, 1, 6}, {1, 3, 1}};
n = First[NullSpace[a, Modulus -> 7]]

{5, 5, 1}

Now, observe that a.x=0 is true exactly when a.(c*x)=0, so it is possible to list all the answers (mod 7) to this problem by

Mod[# n, 7] & /@ Range[7]

{{5, 5, 1}, {3, 3, 2}, {1, 1, 3}, {6, 6, 4}, {4, 4, 5}, {2, 2, 6}}

To find the one with smallest norm, apply the norm to each element,

Norm /@ (Mod[# n, 7] & /@ Range[6])

{Sqrt[51], Sqrt[22], Sqrt[11], 2 Sqrt[22], Sqrt[57], 2 Sqrt[11]}

which gives the same answer as the OP found by search.

More generally, the NullSpace of a is a collection of $m-n$ vectors, and it will be necessary to search over all linear combinations of these $m-n$ vectors (mod $q$) for the one with the smallest norm. While this may still be large, it is certainly smaller than search over $m$ dimensions as in the brute force approach.

-

Using Solve helps a bit. If vars is the list of variables, then

Solve[A.vars == ConstantArray[0, n], vars, Modulus -> q]

finds all solutions in terms of parameters C[1], C[2], etc. depending on the dimension of the solution space.

Another bottleneck is computing the values of the general solution at all possible combinations of values for the parameters C[i] modulo q. The possible combinations can be computed with

Tuples[Range[0, q - 1], n]

where n is the number of parameters C[i]. The result is certainly reasonably fast for the small values of m, n, q mentioned in the question.

Finally Nearest will return the shortest nonzero vector (the zero vector having been deleted).

findSols[q_, A_] :=
Module[{m, n, vars, x, sol, vals, params, vecs},
{n, m} = Dimensions@A;
vars = Array[x, m];
sol = vars /. First @ Solve[A.vars == ConstantArray[0, n], vars, Modulus -> q];
(* Print@sol; *) (*optional output*)
params = Union@Cases[sol, _C, Infinity];
(* Print@params; *) (*optional output*)
vals = Transpose @ Tuples[Range[0, q - 1], Length@params];
vecs = DeleteCases[
Mod[#, q] &@ Transpose[sol /. MapThread[Rule, {params, vals}]],
ConstantArray[0, m]];
Nearest[vecs, ConstantArray[0, m]]
]

Example in OP:

A = {{2, 1, 6}, {1, 3, 1}};
findSols[7, A] // Timing
(* {0.000675, {{1, 1, 3}}} *)

Additional example with $m=8$. (Over 117000 solutions, still less than a second.)

SeedRandom[2];
A = RandomInteger[6, {2, 8}]

findSols[7, A] // Timing
(* {{5, 6, 1, 6, 2, 2, 6, 5}, {2, 1, 5, 5, 0, 0, 6, 4}} *)
(* {0.289682, {{0, 1, 0, 0, 1, 0, 1, 0}, {0, 1, 0, 0, 0, 1, 1, 0}}} *)

Note that for q = 17 there will be over 24,000,000 solutions -- I killed the kernel when it went past 20GB.

-


Series in which terms alternate between positive and negative

In the infinite series notes you saw the series expansions of the sine and cosine functions. Here they are again along with the summation notation. Remember that there's nothing especially complicated about Σ notation; it's just a way of capturing what's going on in the series without having to write all or several of its terms.

\begin{align} sin(x) &= \frac{x^1}{1!} - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \frac{x^9}{9!} - \dots = \sum_{n = 0}^\infty \frac{(-1)^n x^{2n + 1}}{(2n + 1)!} \\ \\ cos(x) &= \frac{x^0}{0!} - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} + \frac{x^8}{8!} - \dots = \sum_{n = 0}^\infty \frac{(-1)^n x^{2n}}{(2n)!} \end{align}

These are called alternating series because of the alternation in the sign of each term.

To describe such an alternation in summation notation we employ the properties of powers of negative numbers:

• $(-1)^1 = -1$

• $(-1)^2 = 1$

• $(-1)^3 = -1,$   and so on.

It's also possible to produce an alternation of sign using the trigonometric functions sin(x) and cos(x), like this:

• $cos(n\pi) = 1$   for even n and -1 for odd n

• $sin\left(\frac{n\pi}{2}\right) = 1$   for odd n and -1 for even n

An example

The alternating harmonic series

Here is an example of an alternating series, the so-called alternating harmonic series. This is just the harmonic series with alternating signs of the terms. The terms alternate on either side of zero as they decrease to zero (blue graph).

The accumulating sum (red graph) converges to a limit of approximately 0.69, but oscillates about that line. It's non-trivial to determine the actual sum of this series, but it does converge.

The alternating series test

The alternating series test, proved below the next box, is very simple.

It says that if, as n→∞, the terms of an alternating series decrease to zero, then the series converges.

Remember, that is NOT necessarily true for non-alternating series. For a non-alternating series, it is not enough that the size of the term diminishes; that series still may not converge.

We can think of many non-alternating, divergent series with decreasing terms, like the harmonic series:

$$\sum_{n = 1}^\infty \frac{1}{n} = 1 + \frac{1}{2} + \frac{1}{3} + \frac{1}{4} + \:\dots$$

In a way, the alternating series test (AST) makes life a lot easier. It's enough that the absolute value of the terms decrease to zero for an alternating series to converge – pretty simple.

The alternating series test

If the terms of an alternating series, $\sum_{n = 1}^\infty \,(-1)^n a_n$

(1) are decreasing, and (2) if the limit of the size of the terms, as n → ∞ is zero:

then the series converges.

Proof of the alternating series test

First, take a look at the alternating series on a number line. We'll let the terms of the series be $a_1, a_2, a_3, \dots$ and so on, and the partial sums will be $s_1 = a_1, \; s_2 = a_1 + a_2, \; s_3 = a_1 + a_2 + a_3,\; \dots$ and so on.

Let's look first at the even sums. The first one (first green arrow in the diagram) is

$$s_2 = a_1 - a_2 \gt 0 \; \leftarrow \; \text{ because } a_1 \gt a_2$$

The second and third are

\begin{align} s_4 &= s_2 + (a_3 - a_4) \ge s_2 \; \leftarrow \; \text{ because } a_3 \gt a_4 \\[4pt] s_6 &= s_4 + (a_5 - a_6) \ge s_4 \; \leftarrow \; \text{ because } a_5 \gt a_6 \end{align}

... and the pattern emerges. In the notation below, 2n is always an even number, 2n-2 is the next smaller even number and 2n-1 is the next smaller odd number:

$$s_{2n} = s_{2n - 2} + (a_{2n - 1} - a_{2n}) \ge s_{2n - 2}$$

Now it's clear that these sums continue to grow, so that

$$0 \le s_2 \le s_4 \le s_6 \le \dots \le s_{2n} \le \dots$$

By regrouping terms with some parenthesis, we can also write s2n as

$$s_{2n} = a_1 - (a_2 - a_1) - (a_4 - a_3) - \dots - (a_{2n - 2} - a_{2n - 1}) - a_{2n}$$

Now because our terms are decreasing, every difference in parenthesis is positive. The sequence of terms {sn} is positive, increasing and bounded from above by the sum of the series, s (see diagram). It therefore has a limit,

$$\lim_{n\to\infty} s_{2n} = s$$

Now because $s_{2n + 1} = s_{2n} + a+{2n + 1},$ we can find the limit of the odd partial sums:

$$\lim_{n\to\infty} s_{2n + 1} = \lim_{n\to\infty} (s_{2n} + a_{2n + 1})$$

What we've shown is that the limits of the even and odd partial sums is the same. This is called "squeezing." If the limits from above and below are s, the sum of the series, then the series must converge to s.

The alternating series test makes determining the convergence of alternating series much easier than that of a non-alternating series. If the series alternates in sign, and if its terms decrease toward zero, the series converges.

Refining the idea of convergence

The difference in convergence between the alternating harmonic series,

$$\sum_{n = 1}^\infty \, (-1)^n \frac{1}{n}$$

which converges, and the harmonic series

$$\sum_{n = 1}^\infty \, \frac{1}{n}$$

which doesn't, hints at a subtle differentiation in how series converge. In fact, the alternating harmonic series is called "conditionally convergent," the condition being that its terms alternate sign.

On the other hand, a series like the convergent p-series,

$$\sum_{n = 1}^\infty \, \frac{1}{n^2}$$

and its alternating series counterpart,

$$\sum_{n = 1}^\infty \, (-1)^n \frac{1}{n^2}$$

both converge, and the alternating version is said to be "absolutely convergent." Here are the rules for absolute and conditional convergence:

Absolute vs. conditional convergence

Test for absolute convergence

Test for conditional convergence

Divergence – the series diverges by any one of the tests for convergence, or the divergence test.

Example 1

Does the series   $\sum_{n = 0}^\infty \, (-1)^{n + 1} \frac{2n + 3}{3n + 4}$ converge?

Solution: This is an alternating series in which terms with even n are negative. To test whether it converges, we ask whether the term, without the alternating part (-1)n+1.

$$\lim_{n\to\infty} \, \frac{2n + 3}{3n + 4} = \frac{2}{3} \neq 0$$

The term does not tend toward zero, so this series does not converge. We could also say that it diverges by the divergence test. Either way, it diverges.

Example 2

Does the series   $\sum_{n = 0}^\infty \, \frac{(-2)^n}{3^n}$   converge?

Solution : We can first rewrite this series with a -1 inside the alternating term, using (xy)n = xn·yn:

$$\sum_{n = 0}^\infty \, (-1)^n \left( \frac{2}{3} \right)^n$$

Now we need to find whether the limit of the term without the alternation is zero:

$$\lim_{n\to\infty} \, \left( \frac{2}{3} \right)^n = 0$$

2/3 < 1, so the limit is zero, and this alternating series converges by the AST.

Practice problems

Decide whether the following series converge.

 1 $$\sum_{n = 1}^\infty \, \frac{(-1)^n}{4 + 3n}$$ 2 $$\sum_{n = 1}^\infty \, \frac{(-1)^n}{n^3 + 2n + 2}$$

 3 $$\sum_{n = 1}^\infty \, \frac{n \cdot cos(n\pi)}{n^2 + 1}$$ 4 $$\sum_{n = 1}^\infty \, \frac{(-1)^n n^2}{n^2 + 1}$$

xaktly.com by Dr. Jeff Cruzan is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. © 2016, Jeff Cruzan. All text and images on this website not specifically attributed to another source were created by me and I reserve all rights as to their use. Any opinions expressed on this website are entirely mine, and do not necessarily reflect the views of any of my employers. Please feel free to send any questions or comments to jeff.cruzan@verizon.net.


# Create 55 sets with exactly one element in common

I have 55 sets $E_1, E_2,\cdots,E_{55}$

There are $n$ different elements.

Each set contains 8 elements $E_1\{x_1^1,x_1^2,x_1^3,x_1^4,x_1^5,x_1^6,x_1^7,x_1^8\}, E_2\{x_2^1,x_2^2,x_2^3,x_2^4,x_2^5,x_2^6,x_2^7,x_2^8\}\cdots$

If I take 2 sets randomly, they must have exactly one element in common, no more, no less.

How many elements do I have ? Is there more than one possibility ?

Actually I was playing a card game and I was curious about the mathematics behind.

Thanks!

EDIT: I'm looking for the lowest solution possible

• If you are curious about he mathematics behind Dobble, the keyword is "block designs". – Michal Adamaszek Jun 8 '18 at 13:34
• One solution is $386$, with one element in all the sets and the other $7\cdot 55=385$ elements distinct. – Ross Millikan Jun 8 '18 at 13:37
• @RossMillikan True, but it wouldn't be a very exciting card matching game :) – Bram28 Jun 8 '18 at 13:40
• Oh, indeed it's a solution. Then I'm looking for the lowest one. – tuxikigo Jun 8 '18 at 13:42
• There's some analog to fractional coloring. What is the fractional chromatic number of an 8-fold coloring of the complete graph on 55 vertices, with the added condition that any two vertices share exactly one color. – David Diaz Jun 8 '18 at 14:23

A lower bound is $n=57$. Take one set. It must have at least one element that it shares with at least seven other sets. Those eight sets all share one element, so all their other elements must be distinct. If there is an element shared $9$ ways $n$ must be at least $64$ because the other seven elements in each set need to be distinct.
There are $55\cdot 54/2=1485$ pairs of sets. An element that is in $8$ of the sets accounts for the match of $28$ pairs. An element that is in $7$ of them accounts for $21$ pairs. As both of these numbers are divisible by $7$ and $1485$ is not, there must be at least one element that is shared by a number other than $7$ or $8$.
As $1485 \equiv 1 \bmod 7$ and an element that is shared $6$ ways accounts for $15$ pairs, which is also equivalent to $1 \bmod 7$ I will guess that there is one element shared $6$ ways. We can then get the required number of pairs if there are $42$ elements shared $8$ ways and $14$ elements shared $7$ ways. This would give $n=57$.
We have not shown that this will work, but we can make a concrete example from the order $7$ projective plane. It has $57$ points, $57$ lines, with every two lines sharing a point and every two points sharing a line. The sets are the lines and the elements of each set are the points on it. We can discard two lines and get the required construction. Thanks to achillehui for pointing this out.
• the finite projective plane of order $7$ contains $57$ points and $57$ lines, each line contains $8$ points and two lines determine a point. – achille hui Jun 8 '18 at 15:02
• @Khoross: why? We could have the first nine sets contain element $1$ and the next eight contain element $2$. – Ross Millikan Jun 8 '18 at 17:31