Wednesday, April 25, 2018

Regula - Falsi Method


Formula:-
            xf(x2) – x2 f(x1)

                  f(x2) – f(x1)
Que:- x3 – x2 – 2 = 0

Sol:- 
   f(x)=x3 – x2 – 2 

     f(0)= -2 

     f(1)= -2 

     f(2)= + 2

x1 = 0 ,                      f(x1)=-2
x2 = 2 ,                      f(x2) = 2

1st approx :-
            1(2) – 2(-2)

                         2 –(-2)
                    2 + 4
                       4
                    6 = 1.5
                    4

      (1.5)3 – (1.5)2 – 2 = 0
        3.37 – 2.25 – 2 =0
     f(x1)= - 0.875

2nd approx:-
x1 = 1.5 ,                   f(x1) = - 0 .875
x2 = 2 ,                      f(x2) = 2

          =       1.5(2) – 2(-0.875)
                         2 –(-0.875)
                  4.75
                    2.875
         x1= 1.65217

   (1.652)3 – (1.625)2 – 2 = 0
    4.50847 – 2.729104 – 2 = 0
    f(x1) = - 0.220634

3rd approx:- 
x1 = 1.652    ,             f(x1) = - 0.220634
x2 = 2          ,             f(x2) = 2


                =  1.652(2) – 2(-0.2206)
                      2 –(-0.2206)
              3.7452
                 2.2206 
          x1 = 1.68657

       = (1.6865)3 – (1.6865)2 – 2 = 0
        =  4.79688 – 2.84428 – 2
     f(x1 = –  0.0474
4th approx:- 
x1 = 1.68657   ,          f(x1) = - 0.0474
x2 = 2              ,           f(x2) = 2

           =  1.68657(2) – 2(-0.0474)
                2 –(-0.0474)
        3.4678
           2.0474
     x1 = 1.693757
        
     = (1.693757)3 – (1.693757)2 – 2 = 0
      = 4.85907 – 2.868812 – 2
f(x1)= -0.0101

5th approx:-
x1 = 1.693757   ,          f(x1) = -0.0101
x2 = 2                ,           f(x2) = 2

       =  1.69375(2) – 2(-0.0101)
                2 –(-0.0101)
       3.4077
          2.0101  
       = 1.6952
The real root is 1.69  

        




                     

x3 – 18 = 0 lying between 2.5 and 3 up-to two decimal places.?


Sol:-   x3 – 18 = 0
        f(x)=x3 – 18 
        f(2.5)= (2.5)3 – 18 
                 = 15.625-18
                 = -2.375 

       f(2.6)= (2.6)3 – 18 
                =   17.575-18
                = -0.424

      f(2.7)= (2.7)3 – 18
               = 19.683-18
               = 1.683
1st:-  
       2.7 + 2.6     =  5.3  =  2.65


                 2                2 
      =(2.6)3 – 18 
      = 18.609625 - 18 
      = 0.60925 


2nd:- 
         2.65 + 2.6     =  5.5  =  2.625



                    2                 2
        = (2.625)3 – 18 
        = 0.087890624
3rd:- 
         2.625 + 2.6     =  2.6125
                  2 
        = (2.6125)3 – 18 
        = -0.169279296
4th:- 
        2.6125 + 2.625     =  2.61875
                    2
        = (2.61875)3 – 18 
        = -0.04100122
5th:- 
        2.61875 + 2.625     =  2.621875
                     2
        = (2.621875)3 – 18 
        = 0.023367889

6th:- 
        2.621875 + 2.61875     =  2.6203125
                         2
     = (2.6203125)3 – 18 
     = -8.835857391 

Root is 2.62 .
  





Tuesday, April 24, 2018

Ques. x3 - 3x -5 =0


Sol:-
       f(x)= x3 – 3x – 5 

       f(0)= -5
       f(1)= -7
       f(2)= -3
       f(3)= 13
the root lies b/w 2&3.

1st :- 2+3   =  2.5 = x


                 2
      f(2.5)= (2.5)3  – 3(2.5) – 5 
               = 3.125
the root lies b/w 2.5&2 .
   
2nd  :- 2.5+2   = 2.25 = x
                      2
      f(2.25)= (2.25)3  – 3(2.25) – 5 
                 = -0.359375
the root lies b/w 2.25&2.5 .

3rd  :- 2.5 + 2.25    =  2.375 = x
                       2
       f(2.375)= (2.375)3  – 3(2.375) – 5 
                    = 1.2714844

4th  :- 2.25 + 2.375   =  2.125 = x
                        2
        f(2.125)= (2.125)3  – 3(2.125) – 5 
                     = 0.42896508
the root lies b/w 2.315&2.25 .

5th  :- 2.3125 + 2.25   =  2.28125 = x
                          2
         f(2.28125)= (2.28125)3  – 3(2.28125) – 5
                          = 0.02810
the root lies b/w 2.28125&2.25 .

6th  :- 2.28125 + 2.25    =  2.265625 = x
                         2
  f(2.265625)= (2.265625)3  – 3(2.265625) – 5 
                     = -0.167293548

7th  :- 2.265625 + 2.28125  = 2.2734 = x
                           2
     f(2.2734)= (2.2734)3  – 3(2.2734) – 5 
                    = -0.07047866 .

8th  :- 2.2734 + 2.28125  = 2.277325
                            2

Hence, the root is 2.27 .



Monday, April 23, 2018

Bisection Method

Que:- 
         x3 – x – 1 = 0
Ans:- 
       f(x)=  x3  – x – 1 
       f(1)= 13 – 1 – 1 
             = -1.
       f(2)= 23 – 2 – 1 
             = +5
∴ f(1) is -(negative) and f(2) is +(positive). So, the root lies b/w 1&2 .

1st approx.:- 
             1+2  = 1.5 = x. 

                          2
                   f(x)= (1.5)3 – 1.5  – 1
                         = 0.875
∴ f(1) is -(negative) and f(1.5) +(positive). So, the root lies b/w 1&1.5.

2nd approx.:-
                1+1.5  = 1.5 = x

                                 2
                   f(x)= (1.25)3 – 1.25  – 1 
                         = -0.297
∴ f(1.25) is -(negative) and f(1.5) is +(positive). So, the root lies b/w 1.25&1.5 .

3rd approx. :-
                    1.25+1.5  = 1.375 = x
                                    2

                     f(x)= (1.375)3 – 1.375  – 1 
                        = 0.2246
∴ f(1.375) is +(positive) and f(1.25) is -(negative). So, the root lies b/w 1.375&1.25 .

4th approx.:-
                      1.375 + 1.25  = 1.313 = x
                                      2                   
                      f(x)=(1.313)3 – 1.313  – 1
                          = -0.494
∴ f(1.313) is -(negative) and f(1.375) is +(positive). So, the root lies b/w 1.375&1.313 . 
         
    

Sunday, April 22, 2018

Pitfall of Floating Point Representation


1. Rearrange the formula so that you can avoid subtraction of two nearly equal numbers.
for Ex:- x2 – y can be replaced by x+y.
             x – y



2.Avoid multiplication of large numbers that make left to overflow.


3.Use alternative arithmetic such as internal arithmetic if necessary.


4.Wherever possible use integer arithmetic to avoid conversion and round off errors.


5.Do-not test a floating point number for zero in your algorithm.


6.Wherever possible rearrange your formula so that you use the original data rather than derived data.


7.When finding the sum of set of members arrange the set so that they are in the ascending order of absolute value.
i.e. when | a | > | b | > | c |  , then (c - b)+a is better than (a - b)+c.

8.It necessary use double precision for floating point calculations this would include the accuracy considerably but would take more time on compute the memory space.

approx. value =0.333 and true value = 1/3, find ea ,er and ep..?

Solution:-
      x=0.333    ,    x'=1/3
         
            ea1 0.333 × 3
                      3     1 × 3
                =0.333 - 0.333
           ea= 0
             
           er1/3  –  0.333
                       1/3
             =0.00033
                   1/3 
                 e=0.000999

          ep 0.000333   × 100
                     0.333
          ep= 0.09999.
  


                               
        

      

       
             
                      

 

Errors and Floating Point Representation


Inherit Errors:-

                      Errors which are already present in the statement of a problem before a solution is called Inherit Errors.

Rounding Errors:-

                      The errors on the process of the rounding of the number during the computation.

Truncation Errors:-

                      They are caused by using approx. results or replacing a infinite process by a finite one.

Absolute Errors:-

           True Value  –  approx. value  
                      X=True Value
                      X'= approx. Value
                         |e=X-X'|

        er=true value  –  approx. value 
                         True value      

                  =      Ea
                     True value

       ep=true value  –  approx. value   ×100
                        True value                
       
                  =    ea/Å« × 100      
                                    Here u = x .
                

Operations of Normalized Floating Point


1.Addition
2.Subtraction
3.Multiplication
4.Division.

1.Addition:-
        (i). .4546 E 5 and .5433 E 5
                  = .9979 E 6

          (ii). .459 E 5 and .5433 E 7
                  = .5478 E 5
2.Subtraction:-
       (i). .9432 E -4 from .5452 E -3
           =.9432 E -4 from .5452 E-3 
                                              |
                                       greater no.
              .09432 from.5424 E -3
                           + 5424 
                            . 0993   
                 = .4509 E -3 

       (ii). .5424 E 3 from .5452 E 3
                 = . 5452
                    . 5424 
              . 0028
                 = .0028 E 3
                 = .28 E 1

    (iii). .5424 E -99 from .5452 E -99
                 = . 5424
                    . 5424       
                    .0028 E -99
                = .28 E -101 
                                               underflow


3.Multiplication:-
       (i). .5543 E 12 and .4111 E -15
             .5543 E 12  ×  .4111 E -15
                = 0.2278 E -3

      (ii). .1111 E 10 and .1234 E 15
             .1111 E 12  ×  .1234 E 15
                = 0.01370974 E 10 + E 15
                = 0.01370974 E 25 
                = 1.37094 E 23

      (iii). .1111 E 51 and .4444 E 50
                =.1111 E 51 × .4444 E 50
                =.4437284 E 100
                                               overflow

  (iv). .12134 E -49 and .1111 E -54
         = .12134 E-49  ×  .1111 E -54
                = .1370974 E -104
                                             underflow

4.Division:-
       (i). .9998 E 1  ÷  .1000 E -99
                = .9998 E 1  ÷  .1000 E -99
                = 9.998 E 1-(-99)
                = 9.998 E 100
                = .9998 E 101
                                             overflow

     (ii). .1000 E 5  ÷  .9999 E 3
                = .1000 E 5  ÷  .9999 E 3
                = .100010001 E 5-3
                = .100010001 E 2 .


                                     

Saturday, April 21, 2018

Floating Point Representation

1. Integer Arithmetic 


2.Real Floating Point Arithmetic


                                   word
                | 1   | 2 | 3 | 4 | 5 |
        word is a memory location 

Real no. consist of 2 combinations:-

1.mantissa,
2.Exponent.
        
                  Mantissa
                 <1  . < .1

(1).If a no. is greater then one do left left shift (+).
(2).If a no. is less then one do right shift (-).

                     43.86×106
                         43.86×E 6

(1)  837.149 E 4
                = . 83714 E 7
                   .| 8 | 3 | 7 | 1 | 4 | 9 | E | 7 |

(2) .0004378 E 8
                      =  .4378 E 5
                          .| 4 | 3 | 7 | 8 | E | 5 |

(3) 4296.632 E 2
          = .4296632 E 6
             .| 4 | 2 | 9 | 6 | 6 | 3 | 2 | E | 6|

(4) .00004318 E 9
          = .4318 E 5
             .| 4 | 3 | 1 | 8 | E | 5 |

(5) 1.69 E 2
          =.169 E 3
            .| 1 | 6 | 9 | E | 3 |

                

Friday, April 20, 2018

3.Numerical Differentiation and Integration

Introduction Numerical Differentiation , Numerical Integration , Trapazoidal rule, Differential Equations : Picard's Method , Euler's Method , Taylor's Method , Runge-Kutta methods.

2.Simultaneous Linear Equations

Solutions of system of linear equations , Gauss Elimination direct method and pivoting , III conditioned system of equations , Refinement of solution . Gauss  iterative method , Rate of convergence .Interpolation and approximation : Finite Differences , Difference tables . Polynomial Interpolation : Newton's forward and backward formula Central Difference Formula-e : Gauss forward and backward formula , stir-ling's Bass-else Everett's formula. Interpolation with unequal intervals: Language's Interpolation , Newton Divided difference formula .

Floating Point Arithmetic

Representation of Floating Point numbers , Operation , Normalization , Pitfalls of floating point representation , Errors in numerical computation . Iterative Methods Zeros of a single transcendental equation and zeros of polynomial using , Bisection Method . Iteration method , Regula-falsi method , Newton Raphson method , Secant method , Rate of convergence of iterative methods .

Meaning of C.B.N.S.T

C.B.N.S.T
Full Form:- Computer Based Numerical Techniques.
C.B.N.S.T is a subject when we doing some graduations like B.C.A.

In this subject we read three sub-subjects
1:- Floating Point Arithmetic.
2:- Simultaneous Linear Equations.
3:- Numerical Differentiation and Integration .