Tuesday, August 14, 2012

Numerical integration methods



Introduction to numerical integration:  First here we will understand the concept   What is Numerical Integration As we know in integration that if ɸ(x) is primitive of f(x) defined on [a, b], then integral a to b f(x) dx = ɸ(b) - ɸ (a). In most of the practical problems we are given a set of numerical values of the function f(x) corresponding to some values of x and in some cases either the primitive does not exist or it cannot be easily determined by elementary means; as a result the computation of the definite integral by the above formula may not be possible. In such circumstances, the numerical methods for integration are needed. 

Numerical integration is the process of computing the value of a definite integral when we are given a set of numerical values of the inte-grand f(x) corresponding to some values of the independent variable x. And also Methods of Numerical Integration  are The trapezoidal rule: Let y = f(x) be a function defined on [a, b] which is divided into n equal su-intervals each of width h so that b – a = nh. Let the values of f(x) for (n + 1) equidistant arguments x0 = a, x1 = x0 + h, x2 = x0 + 2h, …., xn = x0 + nh = b be y0, y1, y2, …., yn respectively, then Integral a to b f(x) dx = integral x0 to x0 + nh = y dx = h[1/2 (y0 + yn) + (y1 + y2 + ….. + yn)].

This rule is known as trapezoidal rule. In the derivation of this formula it is assumed that the y is a linear function of x i.e., the equation of the curve is the form y = a + bx and second rule is Simpson’s one-third rule: Let y = f(x) be a function defined on [a, b] which is divided into n (an even number) equal parts each of width h so that b – a = nh. Suppose the function y = f(x) attains values y0, y1, y2, …., yn at n + 1 equidistant points x0 = a, x1 = x0 + h, x2 = x0 + 2h, …., xn = x0 + nh = b respectively. Then Integral a to b f(x) dx = integral x0 to x0 + nh = y dx = h[1/2 (y0 + yn) + (y1 + y2 + ….. + yn)] = h/3[(y0 + yn) + 4(y1 + y3 + ….. + yn-1) + 2(y2 + y4 + ….. + yn-2)] = (one –third of the distance between two consecutive ordinates) × [(sum of the extreme ordinates) + 4(sum of odd ordinates) + 2(sum of even ordinates)] this formula is known as Simpson’s one-third rule.

Its geometric significance is that we replace the graph of the given function by n/2 arcs of second degree polynomials, or parabolas with vertical axes. It is to note here that the interval [a, b] is divided into an even number of subinterval of equal width.

Wednesday, July 25, 2012

Limits: Discontinuity, a function with ‘breaks’



In Calculus, a branch of mathematics we learn about limit of a function, we say that the limit of f(x) is L as x approaches ‘a’ and is written as lim(x->a) f(x)=L, provided we can make f(x) as close to L as we want for all x sufficiently close to a, from both sides, without actually letting x be a.

Discontinuity : A function is said to be continuous at x=a if lim(x->a)f(x) = f(a). In simple words a function is said to be continuous if the graph of the function has no breaks in it, that is, it is a continuous curve. Many functions, however, will have isolated points where they are not connected. Such type of points is called Discontinuity points of that function. Definition of Discontinuity can be given as, a function is discontinuous at ‘a’ if it is defined at ‘a’ but is not continuous at ‘a’. Discontinuity points can be classified into three types.

The function f(x) has a discontinuity of first kind at x=a if there exists left hand limit, lim(x->a-0)f(x) and right hand limit (x->a+0 f(x) and also these one-sided limits are finite.
Point discontinuities are also called the removable discontinuities. Sometimes we come across functions that are defined differently for a certain point. Let us consider the function f(x)=1 for x=3 and f(x) =x^2,  for all positive real numbers. We define the value of the function to be one at the point x=3, though the rest of the function is given by f(x) = x^2. When we graph this function, we can see that the function is continuous except for this tiny hole in the curve at x=1. It is discontinuous at a single point x=1, and this discontinuity is called the point discontinuity or the removable discontinuity. In general, point discontinuities occur when a function is defined specifically for an isolated value of x.

What is Jump Discontinuity
One might wonder what is a Jump Discontinuity. Let us now learn about a Jump Discontinuity, in this type of discontinuity the right hand limit is not equal to the left hand limit of a function f(x). Jump discontinuities are also called simple discontinuities. Let us consider a function, f(x) = x^2 for x less than equal to 1 and f(x) =6-x^2 for x greater than 1. The two pieces have different value at x=1, and the graph of these function f(x) seem to ‘jump’ from one branch to another and this jump makes the function discontinuous. We refer this discontinuity as a jump discontinuity

Tuesday, July 10, 2012

How to do Regression Testing


Regression Testing
Regression in statistics is the relation between selected values of x and observed values of y from which the most probable value of y can be predicted for any value of x. For example, a researcher in the medical field might want to use the age of a person (independent variable) to predict the most appropriate dose for a new drug (dependable variable) The purpose of running the regression is to find the formula that fits the relationship between the two variables. This regression formula helps to predict values for the dependent variable when only the independent variable is known. The end result of the analysis or testing would help a doctor to prescribe the proper dose based on person’s age.  The analysis done along with test procedures involving finding the standard error of the slope, degree of freedom, test statistic (t-score) and p-value which help in interpreting the results of the testing  whether the standard requirements for a simple linear regression are satisfied or not is known as Regressing testing.

Regression Testing Definition
We can define Regression Testing as a statistical tool that investigates the relationship between the dependent and independent variables in a linear regression.
Consider a Regression Testing Example: Using the sample data, determine the slope standard error, the regression line slope, the degree of freedom, the statistic test, and also the P-value accompanying the test statistic. The data given below is a output formed hypothetically for the regression equation y’= 76 +35x [y’= a+bx, b is the slope]

Predictor        Coefficient Standard error coefficient T P
constant                76 30 2.53       0.01
  x 35 20 1.75       0.04

Step1: calculate the slope’s standard error, and for this we use the formula,
SE = sqrt{sigma(y1- y’1)2/(n-2)} divided by {sqrt[sigma(xi- x(bar))2]
xi  is the observed values, x(bar) is considered as the mean of the independent variables, for number of observations we denote with n
Step2: The regression line slope is 35.
Step3: Degree of freedom is calculated using, DF = n-2, where n is the number of observations.
Step4: Test static is a t-score (t) given by t=slope of the regression/standard error of the slope.
Step5:  the probability of observing a sample statistic as extreme as the test static is considered as P value.
A t-Distribution Calculator is used to evaluate the probability considered with the test statistic
using the computed degree of freedom.
Step6: Finally the results are interpreted. Comparing the P-value with the significant level (which is
            mostly taken between 0 and 1) and the null hypothesis is rejected when the P-value is found to be less than the significant level.

Know more about the statistic help, Math Homework Help. This article gives basic information about Regression Testing. Next article will cover more statistic concept and its advantages,problems and many more. Please share your comments.

Monday, June 25, 2012

Simple Interest



ABC Bank
Offers grand Scheme
Double your money in 5 years
Contact: Branch manager

This is an advertisement requesting the investors to deposit the money in ABC bank in order to double their money. It may be puzzling to understand the logic of the advertisement. In commercial sense, yes it is possible.
So What is Simple Interest?
Logic: The bank will be using depositor’s money for five years, for their financial activities such as lending, capital investments in stocks etc. During that time, it will be earning from depositor’s money. It is logical on the part of bank to share a part of its earning. The extra amount that a depositor receives is called interest.
Simple Interest word Problems:
Find the simple interest for an amount of $5000 at the rate percent of 10% for three years.
Simple Interest Vs Compound interest
Simple interest:
 A person can receive interest at regular intervals of time and collect the principal amount after a mutually agreed time.
Compound interest:
 Alternatively, he can ask the bank to add the interest amount to the principal at regular intervals and collect the total amount after the expiry of term along with the principal amount.
As the principal amount increases regularly at certain intervals of time, the amount interest received will also, be more. We call the interest calculations of the first investment pattern as simple interest and the second one as compound interest.
Formula for simple interest calculations:
Interest is calculated for the period during which the investor, keeps his money with the bank. Longer the period, greater will be amount. Hence, the interest is directly proportional to the time (T).
If a person invests more amount of money, he will be earning more interest. Thus, the interest is directly proportional to the amount deposited. We call this amount as principal (P).
Interest is certain part of principal amount. Hence,  it can be represented as a fraction. Since the amount varies, we standardize the fraction with respect to 100. Thus, the interest is always expressed in terms of percentage (R).

Simple Interest Formula:
Simple interest = Principal x Percentage of rate of interest x Time period
SI                  =          P    x                     R%                   x         T

Problem solving strategy:
Step 1: Identify the Principal amount, rate of interest and time period
Step 2: Convert rate percentage of rate of interest into a decimal
[To convert percentage into decimal, divide by 100]
Step 3: Plug in the values and calculate the simple interest
Solved Example on Simple Interest : 
Calculate the simple interest for the principal amount $5000, at the rate of 10% for three years.
Principal = 5000, rate of interest = 10%, time period = 3 years
10% = 10/100 = 0.1
Simple interest = 5000 x 0.1 x 3 = 1500

Wednesday, June 20, 2012

Learn Partial Derivatives



Let z be a function of x and y such that z = f(x,y). z is therefore a function of two variables x and y.

If we keep y as constant and vary z alone, then a is a function of x only. The derivative of z with respect to x, treating y as constant is called the partial derivative of z with respect to x and is denoted by one of the partial derivative symbols listed below:
,provided this limit exists.

Similarly the derivative of z with respect to y, keeping x as constant, is called the partial derivative of z with respect to y and is denoted by one of the following partial derivative symbol:




Similarly if z is a function of three or more variables, x_1, x_2, …… x_n, then partial derivative of z with respect to x_1, is obtained by differentiating z with respect to x_1, keeping all other variables constant and is denoted by dz/dx_1.

Partial derivative examples: