Monday, June 21, 2010

Cauchy's Theorem

Statement:-
If f(x) is a continuous in a closed interval [a,b], differentiable in (a,b) then there exists at least one c in (a,b) such that f’(c)/g'(c) = f(b)-f(a)/g(b)-g(a).
Proof:-
Let us define a function
F(x) = f(x){g(b)-g(a)} - g(x){f(b)-f(a)}
This function is continious in [a,b] and differentiable in (a,b), since f(x) and x are continious in [a,b] and differentiable in (a,b).
Here F(a) = f(a){g(b)-g(a)} - g(a){f(b)-f(a)}
= f(a)g(b)-g(a)f(b)
F(b) = f(b){g(b)-g(a)} - g(b){f(b)-f(a)} = F(a)

The by Rolle's Theorem there exist at least one point c in (a,b) such that F'(c) = 0.
f'(c){g(b)-g(a)} = g'(c){f(b)-f(a)}
f’(c)/g'(c) = f(b)-f(a)/g(b)-g(a) g'(x) not equal to 0 in (a,b) and g(b) not equal to g(a)

Lagrange's Theorem

Statement:-
If f(x) is a continuous in a closed interval [a,b], differentiable in (a,b) then there exists at least one c in (a,b) such that f’(c) = f(b)-f(a)/b-a.
Proof:-
Let us define a function
F(x) = f(x)(b-a)-[f(b)-f(a)]x........(i)
which is continious in [a,b] and differentiable in (a,b), since f(x) and x are continious in [a,b] and differentiable in (a,b).
Here F(a) = f(a)(b-a)-[f(b)-f(a)]a
= bf(a)-af(b)-af(b)+af(a)=bf(a) - af(b)

F(b) = f(b)(b-a)-[f(b)-f(a)]b
= bf(b)-af(b)-bf(b)+bf(a)
=bf(a)-af(b) = F(a)

The by Rolle's Theorem there exist at least one point c in (a,b) such that F'(c) = 0.
But F'(c) = f'(c)(b-a)-[f(b)-f(a)].
f'(c)(b-a)-[f(b)-f(a)] = 0
f'(c) = f(b)-f(a)/b-a

Rolle’s Theorem

Statement:-
If f(x) is a continuous in a closed interval [a,b], differentiable in (a,b) and f(a) = f(b), there exists at least one c in (a,b) such that f’(c) = 0.
Proof:-
Since f(x) is continuous in closed interval [a,b], there exist c,d in [a,b] such that
f(c) = M(the maximum value of f(x))
f(d) = m the minimum value of f(x)

CASE I
If M = m, then f(x) is constant in [a,b] and in this case f’(x) = 0 for all x in (a,b). That is theorem is true in this case.
CASE II
If M = m, then at least one of them is different from f(a) and f(b). Let M = f(a). We shall show that f’(c) = 0 with c in (a,b)
At x = c, with h>0
RHD = lim h 0 f(c+h)-f(c)/h
= lim h 0 f(c+h)-M/h = -ve/+ve <= 0 ……….i
LHD = lim h 0 f(c-h)-f(c)/-h
= lim h 0 f(c-h)-M/-h = -ve/-ve >= 0 ……….ii

Since f’(x) exist in (a,b), I and ii must be equal and this will be possible only when both i and ii are equal to zero.
Hence f’(c) = 0 with c in (a,b).
CASE III
If m is different from f(a) and f(b) we can similarly show that f’(d) = 0 with d in (a,b). This completes the proof.

Sunday, June 13, 2010

Self Induction

When there is change in current through a solonoid then there will be induced emf in opposite direction of cause which produces it. This process is called as self induction
Now flux linked with the coil of solonoid
φ α I
φ = LI----------1 where L is called inductance of coil
Now we have
e = -dφ/dt
e = -d(LI)/dt
= -LdI/dt--------2
If dI/dT = 1amp/sec
Then e=L
Hence inductance of a solonoid can be defined as the back emf induced when the rate of change of current is 1 unit

Self inductance of a solonoid
Let a solonoid of length L having total no, of turns of coil N
Let Current I passes through it
then B = UonI
= UoN/l *I

φ = BAN
= UoAN^2I/L
we have
L = φ/I = UoAN^2/L

Brewsters Law

We can get polarized light from reflection according to Brewsters law which states that when a light incident on a glass slab at certain angle then, we can get the polarized light in reflected part polarized in direction perpendicular to plane of incidence. This particular angle is called polarizing angle and in this case the sum of angle of refraction and angle of polarization will be 90 i.e angle between reflected and refracted rays will be 90
p+r = 90
i.e r = 90
Now according to snell's lae
refractive index = sini/sinr
= sinp/sin(90-p)
= sinp/cosp
=tanp

Therefore refractive index of material is equal to tangent of polarizing angle.

Malus law
The intensity of the light coming out from analyzer will be directly proportional to the square of cosine of angle between polarizer and analyzer.
Now, if a be the amplitude of the light used and (theta) be the angle between analyzer and polarizer then acos(theta) will be the component of a along analyzer and asin(theta) will be that along perpendicular direction. Therefore intensity of light which pass through analyzer is
I = (acos(theta))^2
since a is constant
I α cos^2(theta)

Calcite crystal
It is a cuboid made up of six 119m having angle 109 and 71. There will be two corners in which all parallepgram will meet at obtuse angle are called blunt corners. The axis of crystal. The light incident on optical axis will pass without splitting. In actual practice light incident parallel to potical axis will pass without splitting. SO that optical axis is not just a line, it is a direction

Principal section
Principal section is a plane which contains optical axis and perpendicular to opposite faces

Quarter wave plate
A special type of crystal which introduces a path difference of λ/4(i.e quarter of wavelength) between two emergent light is called quarter wave plate
optical path for o-ray = Uot
optical path for e-ray = Uet

In case of clacite crystal UeUot - Uet = λ/4
In case of quarts crystal Ue>Uo
Uet - Uot = λ/4

Half wave plate
A special type of crystal which introduces path diference of λ/2(i.e) half of wave length) between two emergent light is called half wave plate
In case of clacite crystal UeUot - Uet = λ/2
In case of quarts crystal Ue>Uo
Uet - Uot = λ/2

Dopplar's effect

When source of sound and observer in motion either or both (or relative motion) then their will be apparent change in frequency. This phenomenon is known as Doppler's effect.
CaseI : Sound in motion observer in rest
Let us consider a source of sound which generates sound of frequency f wavelength λ and velocity V be moving toward a stationary observer O with velocity Us. Then observer feels apparent change in wave length as
λ = (V-Us)/f--------------1
Now relative motion of wave with respect to observer will be V - 0 = V
So the apparent frequency observered by the observer will be
f1 = v /λ = V/(V-Us) * f-----------2
Here V-Uo < U so clearly f1 > f SO loud sound is heared when the source moves towards stationary observer.

CASEII: When source is moving away the observer then Us will be negative and hence apparent freq.
f1 = V/(V+Us) * f--------------3

CASEIII : WHen observer in motion and source in rest
Let an observer O be in motion and source is in rest. Let the observer wave toward the source with velocity Vo, let the velocity of sound wave be V. Wave length λ and frequency f
In this case the wave length of sound remains unchanged and be given as V/P - λ
Here since the observer is moving towards source relative velocity of wave with respect to observer is V+Vo
Therefore the apparent change in frequency will be
f1 = relativevelocity/wave length = V+Vo\λ
.-.f1 = (V+Uo)/V * f------------4
Since V+Vo is greater than V the pitch of sound increases and sound will be heard louder

CASE IV:
If the observer is moving away from source relative velocity will be V-Vo apparent freq.
f1 = (V-Vo)/V * f --------------5

Faradays Lenz

Faraday's Law of Electromagnetic induction states that
1) When there is change of flux linked iwth a conductor then emf will be induced.
2) Induced emf will continue till the change in flux continues.
3) The induced emf is directly proportional to change of flux

Lenz law
It states that the induced emf is in the direction so as to oppose the cause producing it
Lenz law is in accordance with conservation of energu. If we are taking a magneti with north pole pointing towards the coil, then the magnetic field of coil due to induced emf will be in near end of magnet which repel magnet. So some work must be done against this force of repulsion which will be converted into electrical energy.

Ampere's Circutial law:

It states that the line integral of magnetic field over a closed surface is equal to Uo times the total current enclosed by the surface.
i.e {B.dl = UoI

If we consider a straight conductor I, then it will produce a circular magnetic field. Now magnetic field at a point at a distance r from conductor can be give as
B = UoI/2πr
Now {B.dl = {Bdlcosϴ
={Bdl
= {UoI/2πr dl
=UoI/2πr 0{2πr dl
{B.dl = UoI

Applicatiojn of Ampere's law
1) Magnetic field due to straight conductor
Let us consider a straight conductor carrying current I. Consider a point P at distance R from conductor where magnetic field is to be determined. Since this is straight conductor magnetic lines of force are circular. Let us draw a circle of radius r passing through P.
then from Ampere's Law,
{B.dl = UoI
{Bdlcosϴ = UoI
B = UoI/2πr

2) Magnetic field due to solenoid
Let us consider a solonoid having number of turns per unit length n carry current I through it. It produces magnetic field along its axis Now to find magnetic field draw a rectangle of length PQ = l
By ampere's law
{B.dl = UoI
{B.dl = P{Q B.dl + R{Q B.dl + S{R B.dl + P{S B.dl
{B.dl = B P{Q dl =Bl----------1
Now
{B.dl = UoI
{B.dl = UonlI--------2

From I and 2
B = UonI

Biot-Savart Law

It states that if a conductor carry current I having length l produces magnetic field that is directly proportional to I sinϴ dl and inversly proportional to square of r.
Let us consider a wire of length lcarries conductor I through it. Let us consider a point P at a distance r from an elementary length dl And ϴ be the angle made by r with dl. Then there will be magnetic field produced at P.
Now Biot and Savart kaw states that:
Magnetic field produced at p due to elementry length dl is
1) directly proportional to I
dB α I
2)directly proportional to sine of ϴ
dB α sinϴ
3)directly proportional to dl
dB α dl
4)inversly proportional to the square of r
dB α 1/r^2
Therefor
dB α Idlsinϴ/r^2
dB = KIdlsinϴ/r^2
dB = Uo/4π * Idlsinϴ/r^2

Application of Biot-Savart's Law
1) Magnetic field at centre of circular coil
Let us consider a circular coil of radius r carrying current in the direction as shown in figure. To calculate the magnetic field at centre of this coil, consider an elementary length dl which makes an angle of ϴ with radius vector r.
Now according to Biot-savart law the magnetic field at the centre of coil can be given as,
dB = Uo/4π * Idlsinϴ/r^2
Now, total magnetic field at centre due to whole coil can be given as,
B = 0[2πr U0/4π Idlsinϴ/r^2
B = U0Isinϴ/4πr^2 0[2πr dl
B = UoI/4πr^2 [l] 0-2πr
B = UoI/2r
if there are n coils
B = U0nI/2r

2)Magnetic field on axis of coil
Let us consider a circular coil of radius a which carry current I through it. Let its plane be perpendicular to the plane of paper such that its axis lied on plane of paper. Let us consider a point p at a distance x from centre of coil on its axis. Let us consider an elementary length dl on coil and r be the distance between p and dl. Let β be the angle between dl and r.
Now, magnetic field at P due to this elementary length dl is
dB = Uo/4π * Idlsinϴ/r^2
Here we can take
β =π/2
dB =Uo/4π * Idl/r^2--------------1
Now direction of dB is perpendicular to both dl and r. Let it be along PR which can be resloved into tow componentd dBcosϴ along perpendicular to axis and dBsinϴ along axix. Since coil is symmetric about axis. These perpendicular components, i.e dBcosϴ will cancel each other and therefore their contribution is zero. SO the magnetic field is due to the component along x-axis.
The magnetic field due to whole coil at point P can be given as:
B = [dBsinϴ
B = [Uo/4π * Idlsinϴ/r^2
B = Uo/4π * Isinϴ/r^2 0[2πr dl
B = Uo/4πr^2 Isinϴ*2πa
B = UoIa^2/2r^3
B = UoIa^2/2(a^2+x^2)^3/2

Case I
when P lies at the centre of coil x =0
B = UoIa^2/2a^3
B = UoI/2a
Case II
when P lies at very far disrance a<<<<B = UoIa^2/2x^3

3) Magnetic field due to long cunductor.
Let us consider a long conductor carrying current I. Consider a point P at a distance a from centre of conductor where magnetic field is to be found.
Let us consider on elementary length dl,AB. Let P be at a distance r from A and AB subtend an angle dα at P. Again let r makes an angle α with conductor. Now draw a perpendicular AC from A to BP. The we can have dB = Uo/4π * Idlsinϴ/r^2-----------1
Now in /_\ ACP
sindα = AC/AP
or dα = AC/r
AC = rdα-----------2

Again in /_\ ABC,
sinα = AC/AB = Ac/d1
AC = dlsinα

From 2 and 3
dlsinα = rdα
r = a/sinα
dB = Uo/4π * I/a * sinαdα

Now magnetic field at point P due to whole conductor can be given as
B = α1{α2 Uo/4π * I/a * sinαdα

If we consider the conductor as infinitely long than we can have
B = UoI/4a 0{π sinαdα-----------7
B = UoI/4πa *2
B = UoI/2πa

Electric Dipole

System of two charges equal in magnitude but opposite in nature separated by certain distance is called an electric dipole.
Dipole moment is given as
P = qL, directed from -ve charge to +ve charge.

Electric potential due to electric dipole
Let us consider an electric dipole Ab of length L formed by charges +q and -q. Let p be a point at a distance r from centre of dipole where electric potential is to be found.
We know
V = V1+V2
V1 = 1/4πEo(q/PB)
V2 = 1/4πEo(q/AP)

if we consider dipole of very short length we can have AP = PN and PM = PB
also we know
PM = r-l/2cos(theta)
PN = r+l/2cos(theta)
Now
V = q/4πEo(1/r-l/2cos(theta) - 1/r+l/2cos(theta))
V = q/4πEo(lcos(theta)/r^2-l^2/4cos^2(theta))
since l^2/4cos^2(theta <<< r^2 we can have
V = pcos(theta)/4πEor^2

Gauss Law:

The total lines of force(electric flux) passing through a surface is eqyal to 1/Eo times the total charge enclosed by that surface.
φ = 1/Eo * total charge

Application og gauss law
1) To find electric intnensity due to charged sphere
Let us consdier a charged sphere of radius E and p be a point at distance r from the centre of sphere
CASE I when P lies outside the sphere
To find the intensity at { drae a concentric sphere of radius r such that it will enclose charge on given sphere. Let it be q then according to gauss law,
Elelctrc flux, φ = 1/Eo * q
E *A = 1/Eo *q
E = 1/4πr^2 * q/Eo
E = 1/4πE0 *q/r^2

CASE II P lies on surface of sphere
IN this r = R
E = 1/4πE0 *q/R^2

CASE III P lies inside the sphere
In this case the total charge enclosed by a gaussian surface draws through P(sphere) will be zero.
φ = 1/Eo * q = 0
E *A =0
E = 0

II) Intensity due to a line charge
Let us consider a infinitely long conductor which contains the charge as linear charge density λ. Let p be a point at a distance r from the conductor where electric intensity is to be found. To find this let us draw a cylinder through P co-axial with the conductor of length L.
Then. from Gauss law, flux through this cylinder,
φ = 1/Eo * total charge
φ = 1/Eo * λ
E * A = 1/Eo λ L
E * 2πrl = 1/Eo λ l
E = λ/2πEor

III) Intensity due to charged plane sheet
Let us consider a plane charged sheet having surface charge density E. Let P be a point at distance r from plane sheet where intensity is to be found. To find the intensity, let us draw a cylinder enclosing P, perpendicular to plane sheet having surface area A. The form gauss law
φ = 1/Eo * total charge
φ = 1/Eo * 6A
E *A = 1/Eo * 6A
E = 6/Eo

Ultrasound

The sound wave which has the frequency greater then 20khz i.e beyond the audible region is called the untrasound. The sound wave which has frequency less than 20hz are known as infrasonic sound wave or infrasound.

Production of ultrasound
1) Piezo electric method
When a force is applied into a pair faces of quartz crystal then an electric potential will be setup into the opposite pair faces. Conversly, if an electric potential be applied on a pair of quartz crystal then there will be tension on the opposite faces. This effect in quartz crystal is known as piezo electric effect.

Now When an alternating potential be applied on a pair forces of a quartz crystal then opposite force will be in longitidunal vibration when freq. of applied potential becomes equal to natural frequency of quartz crystal then resonance will occur. In that case crystal will vibrate with maximum amplitude and a sound wave will be produced with ultrasound properties.

2) Magnetic striction method
In this method a ferromagnetic material is wounded closely by a coil and alternating current is passed through it. Then we may experience a longitudinal vibration in the ferromagnetic substance. When the frequency of the alternating current becomes equal to the natural frequency of ferromagnetc substance then resonance will occur and the material will vibrate with maximum amplitude. And a sound wave is generated with unltasound Properties.

Use of ultrasound
1) To find the depth of Seas
2) To locate distance object
3) To kill unwanted tissue(blood less surgery)

Characterstics of Sound
1) Pitch: Pitch is a characterstics of sound which directly related with frequency. Sound wave having high frequency is called high pitched sound and vice versa.
2) Intensity: Sound energy flowing per unit area per unit time is called intensity
3) Threshold frequency of hearing: The minimum value of sound intensity that can be heared by human being in general
4) Loudness: It is the magnitue of sensation of hearing and it is directly proportional to the logarithm of intensity of sound
5) Quality: Quality of sound depends on no. of harmonics presents in sound. HIgher no. of harmonic reveals high quality and vice versa.

Beat and Beat frequency

When two sound of nearly equal frequency are sounded together then periodic rise and fall in sound intensity is heared. This phenomeno is called beat. For this phenomenon the difference between frequencies of two sound wave must not exceed 10hz

Beat frewuency
Let us consider two sound waves with frequency f1 and f2 such that f1-f2 <10 hz are sounded together then at the starting points can be given as
y1 = asinw1t
y2 = asinw2t
By the principal of superpostion the resultant wave will be,
y = y1+y2
y = asinw1t + asinw2t
y = A sin(pi)(f1+f2) * t
This is a periodic function with amplitude
A = 2acos(pi)(f1-f2) *t

CASE I Loud sound
Loud sound will be heard when value of A becomes maximum i.e when
cos(pi)(f1-f2)*t = 1
cos(pi)(f1-f2)*t = cpsn(pi)
f = n/(f1-f2)

loud sound will be heared at f = 0, 1/(f1-f2),2/(f1-f2)
Beat frequency = (f1-f2) hz

CASEII Soft Sound
Soft sound will be heared when amplitude is minimum i.e when
cos(pi)(f1-f2)*t = cos((2n+1)/2)*pi
f = 1/(f1-f2)
Beat frequency = (f1-f2)Hz

Wave

Wave is the disturbance( means a change in pressure, density or displacement of the particles of the medium about their equilibrium position) produced in the particles of the medium when an energy transfers through the medium.

Transverse wave
If the particle of the medium vibrate along the direction perpendicular to the direction of wave motionm then this tyoe if wave is called a transverse wave.
Longitudinal wave.
If the particle of the medium vibrate along the direction parallel to the direction of wave motion then this type of wave is called longitudinal wave.

Progressive wave
A wave in which the crest and trough( in transvers) or compression and refraction( in lonbgitudinal) travel is called progressive. They vary continiously.

Equation of Progressive wave
Let us consider a progressive wave originating from O travels along the positive x-axis. Let is have frequency f, wavelength λ amplitude a angular velocity V
Since the motion in the medium is simple harmonic motion, the displacement of the particle be given as,
y = a sinwt-----------1
Let us consider a point p at a distance x, from origin O where the wave lags. Let wave lags at P(i.e phase difference) by φ. Then the displacement equation will be
y = asin(wt- φ)-------------2
We know that at distance λ phase difference will be 2 so that the phase difference at distance x will be
φ = 2 x/ λ
equation 2 becomes
y = asin(wt-2 x/ λ)---------------------3
Again,
y = asin(wt-kx)---------------------4
Where k = 2 / λ = wave number
Again using w = 2 / λ we get
y = asin(2 / λ(vt-x))-------------5
These equation 3 4 and 5 are equation of progressive wave.

Particle velocity
The displacement of particle per unit time is called particle velocity we have the displacement of particle when a wave is travelling alon x-axis as
y = asin(wt-kx)---------------------1
Diffrentiating the equation wrt time we get
dy/dx = acos(wt-kx)w
dy/dt = awcos(wt-kx)------------2
Now
Differentiating equation wrt x we get
dy/dx = -akcos(wt-k)-----------3
we have w = 2(pi)f = 2(pi)V/ λ = kV
Equation 2 becomes
dy/dt = akvcos(wt-kx)-------------4
Now from equation 3 and 4 becomes
dy/dt = -v^2dy/dx-------------5
partical velocity = -(wave velocity) * slope of displacement curve at that point

Simple Harmonic Motion(SHM)

If in an oscillatory motion the acceleration is directly proportional to displacement and is always directed towards the mean position then it is called SHM
If F be the force applied on the particle and x be the displacement then,
F α –x (-ve sign shows they are opposite in direction)
.-. F = -kx----------1 where k is force constants
If m be the mass of the particle then from Newtons second law of motion.
F = ma-------2
From 1 and 2
ma = -kx
a = -k/m*x
a = -ω^2x----4
This is the equation of simple harmonic motion

Motion of a helical(loded Spring)
Let us consider a negligible helical spring suspended through a rigid support. Now it will attach a mass in its free end then it will be elongated through same distance. let it be L. Then according to Hooke’s law, the restoring force is directly proportional to the elongation produces
F1 α L
F1 = -CL-------------1 (where –ve shows that the force is in the opposite direction of elongation.
Now let the mass be pulled down through a distance x and then realesed. The spring then starts to oscillate. Now elongation on spring will be l+x & restoring force is given as,
F2 = -C(l+x)--------------2
The resulting force is
F = F1 + F2 = C(L+x) + cl = -cx
.-. F = -Cx----------------3
Now
From Newtons second law of motion,
F=ma------------------4
From 3 and 4
ma = -Cx
a = -c/m * x------------5
equation 5 is similar to the equation of SHM. Hence loaded spring executes SHM.
Comparint the equation with SHM we can have
ω^2 = C/m
Now time period of oscillation T = 2 /√(c/m)

Mass attached in two spring
Let us consider a mass m be attached in between two strings s1 and s2 having force constant c1 and c2 respectively.
Let the mass and system be placed in a frictionless surface. Now suppose the mass be pulled toward the right direction through the distance x. Then clearly the spring S1 will be elongated by distance x and spring S2 will be compressed through distance x.
THerefore from Hook’s law restoring force acting on the mass will be
F = -C1x – C2x
F = -(C1+C2)x-------------1
This cause oscillation in mass from Newton’s second law of motion force acting on mass
F=ma-------------2
From 1 and 2
ma = -(C1+C2)x
a = -(C1+C2)/m *x--------3
This equation is similar to equation of SHM. Hence this executes SHM


Simple Pendulum
A point heavy mass suspended with mass less, weightless, extensible string through a rigid support. It is also called ideal pendulum.
Drawbacks of simple pendulum.
It is impossible to have heavy point mass.
It is impossible to have weightless string.
There will be relative motion between the bob and string at extreme position.
Length of pendulum, is difficult to measure exactly accurately.
Compound Pendulum
Compound pendulum is a rigid body of whatever shape capable to oscillate freely about a horizontal axis passing through it.
The point in which pendulum is suspended through rigid suppost is called point of suspension.
The distance between point of suspension and centre of gravity of the pendulum is called the length of pendulum.

Consider a compound pendulum having mass m and length l i.e SG = L. Let pendulum be displace through an angle ϴ. At this instant the weigh of pendulum mf act vertically downward direction. Then the restoring force that tends to bring pendulum torque acting on the body will be,
Ʈ = -mglsin ϴ------------1
Now,
If I be the moment of intertia and
α = a be angular accleration then the restoring torque will be given as
Ʈ = I * α = I * a--------------2
From equation 1 and 2
I * a = -mglsin ϴ
a = -mgl/I * ϴ --------------3
This equation 3 is also similar to equation of SHM. Hence compound also executes SHM.


Point of Suspension and point of oscillation are interchangeable. We have time period for a compound pendulum having length L as
T = 2 √((k^2/L + L)/g)
T = 2 π(√l1 + l)/g-------------1
such that k^2/L = L1
Now, let point of oscillation becomes point of suspension. Then length of pendulum
k^2/L = L1
Hence, time period in this case will be
T1 = 2 π(√k2/l1+l)/g
We have k^2 = LL1
T1 = 2π√LL1+L1/(l/2)
= 2 π√L1 + l)/g-------------2

Wednesday, June 9, 2010

Structure

Array vs. Structure
1. An array is a collection of related data elements of same type. Structure can have elements of different data types.
2. An array is derived data type whereas a structure is a programmer-defined one.
3. Any array behaves like a built-in data type. All we have to do is to declare an array variable and use it. But in the case of a structure, first we have to design and declare a data structure before the variables of that type are declared anbd used.

Defining a structure
struct tag_name
{
data_type member1;
data_type member2;
};
1. The template is terminated with a semicolon
2. Wgile the entire difinition is considered as a statement, each member is declared independently for its name and type in a separate statement inside the template.
3. The tag name such as book_bank can be used to declare structure variables of the type, later in the program.

Declaring Structure Variables
struct book_bank, book1, book2,book3;
Elements included in declaring structure variable
1. The keyword struct
2. The structure tag name
3. List of variable names separated by commas
4. A terminating semicolon

Accessing Structure members
Members of a structure can be accesed by structure variable( member operator .) variable name

Structur Initialization
Rules for Initialization of Structure
1. We cannot initialize individual members inside the structure template
2. The order of values enclosed in braces must match the order of members in the structure difinition.
3. It is permitted to have a partial initialization. We can initialize only the first few members and leave the remaining blank. The uninitialized member should be only at the end of the list
4. The uninitialized members will be assigned default value as zero for intiger and #0 for character string

Unions
Major distinction between structure and union is in terms of storage. In structure, each member has its own storage location, whereas all the members of a union use the same location. This implies that, although a union may contain many member of different types, it can handle only one member at a time

Pointers

Why Pointers
1. Pointers are more efficient in handling arrays and data tables.
2. Pointers can be used to return multiple values from a function via function arguments.
3.Pointers permit references to functions and thereby facilitating passing of function s argument to another function.
4.The use of pointer arrays to character strings results in saving of data storage space in memory.
5.Pointers allow C to support dynamic memory managment.
6. Pointers reduce length and complexity of programs
7. They reduce the execution speed and thus reduce the program execution time.

Pointer Constant Pointer values Pointer Variable
Memory addresses within a computer are referred to as pointer constants. We can not change them; we can only use them to store data values. They are like house numbers.

We cannot save the value of a memory address directly. We can only obtain the value through the variable stored there using the address operator &. The value thus obtained is known as pointer value. The pointer value(i.e. the address of a variable) may change from one run of the program to another.

Once we have a pointer value, it can be stored into another variable. The variable that contains a pointer value is called pointer variable.

Rules of Pointer Operations
1. A pointer variable can be assigned the address of another variable.
2. A pointer variable can be assigned the values of another pointer variable.
3. A pointer variable can be initialized with NULL or zero value.
4. A pointer variable can be pre-fixed or post-fixed with increment or decrement operators
5. An integer value may be added or subtracted from a pointer variable.
6. When two pointers point to the same array, one pointer variable can b e subtracted from another.
7. When two pointers points to the objects of the same data types, they can be compared using relational operators.
8. A pointer variable can not be muktiplied by a constant
9. Two pointer variables can not be added
10. A value can not be assigned to an arbitary address

Decision Making and Looping

THE WHILE STATEMENT
while (test condition)
{
body of the loop
}
The while is an entry-controlled loop statement. The test-condition is evaluated and if the condition is true, then the body of the loop is executed. After execution of the body, the test-condition is once again evaluated and if it is true, the body is executed once again. This process of repeated execution of the body continues until the test-condition finally becomes false and the control is transferred out of the loop. On exit the program continues with the statement immediately after the body of the loop.

THE DO STATEMENT
do
{
body of the loop
}
while (test-condition);
The di statement is an exit-controlled loop. On reaching the do statement, the program proceeds to evaluate the body loop first. At the end of the loop, the test-condition in the while statement is evaluated. If the condition is true, the program continues to evaluate the body of the loop once again. This process continues as long as the condition is true. When the condition become false, the loop will be terminated and the control goes to the statement that appears immediately after the while statement. As it is a exit controlled loop and therefore the body of the loop is always executed at least once.

THE FOR STATEMENT
The for loop is another entry-controlled loop that provides a more consise loop control structure. The general form of the for loop is
for (initialization)
{
body of the loop
}
The execution of the for statement is as follows:
1.Initialization of the control variables is done first, using assignment statements such as i=1 and count = 0. The varianles i and count are known as loop-controlled variables.
2.The value of the control variable is tested using the test-condition. The test-condition is a relational expression, such as i<10 that determines when the loop will exit. If the condition is true, the body of the loop is executed; otherwise the loop is terminated and the execution continues with the statement that immediately follows the loop.
3. When the body of the loop is executed, the control is transferred back to the for statement after evaluating the last statement in the loop. Now the control variable is incremented using an assignment statement such as i=i+1 and the new value of the control variable is again tested to see whether is satisfies the loop condition. if the condition is satisfied, the body of the loop is again executed. This process continues till the value of the control variable fails to satisfy the test-condition.

Break Statement
When a break statement is encountered inside a loop, the loop is immediately exited and the program continues with the statement immediately following the loop. When the loop are nested, the break only exit from the loop containing it. That is, the break exit only a single loop.

Continue Statement
The continue statement tells the compiler, SKIP THE FOLLOWING STATEMENTS AND CONTINUE WITH THE NEXT ITERATION its systax is simply continue;

Functions

Need for user defined function
1. It facilitates top-down modular programming.
2. The length of a source program can be reduced by using functions at appropriate places.
3. It is easy to lacate and isolate a faulty function for further investigations.
4. A function may be used by many other program

Definition of function
A function definition, also known as function implementation shall include the following elements;
1.function name;
2.function type;
3.list of parameteres;
4.local variable decleration;
5.function statement;
6.a return statement;

General format
function_type function_name(parameter list)
{
local variable declaration;
executable statement1;
executable statement2;
.....
......
return statement;
}
Category of function
No arguments and no return values
Argumentd but no return values
Argumentd with return values
No arguments but returns a value
Function that returns multiple value

The scope visibility and lifetime of variables
Types of variables
1.Automatic
They created when the function is called and destroyed automatically when the function is exited.
They are private (local) to the function in which they are declared. So also called local variable.
It is assign to a variable by default if no storage class is specified.

2.External
They are both alive and active through out the program.
Also known as global variables.
They are declared outside of a function

3. Static
The value of the static variables presists until the end of the program.
Key word static can be used to declare the variable
Internal static variable are similar to automatic variable
Static variables can be used to retain values between function calls

4.Register
Variables kept in the machine's registers.
Variables that needs much faster access than that given by memory access.
Most compiler allow only int or char variables to be placed in the register.

Scope Visibility and Lifetime
Scope
The region of a program in which a variable is available for use.
Visibility
The Program's ability to access variable from the memory.
Lifetime
The lifetime of a variable is the duration of time in which a variable exists in the memory during execution.

Rules of use
1. The scope of a global variable is the entire program file.
2. The scope of a local variable begins at point of declaration and ends at the end of the block or function in which it is declared.
3. The scope of a formal function argument is its own function.
4. The lifetime of an auto variable declared in main is the entire program execution time, although its scope is oonly in the main function.
5. The life of an auto variable declared in a function ends when the function is exited.
6. A static local variable, although its scope is limited to its function, its lifetime extends till the end of program execution.
7. All variables have visibility in their scope, provided that are not declared again.
8. If a variable is redeclared within its scope again, it loses its visibility in the scope of the redeclared variable.

Decision Making and Branching

If statement
The if ststement is a powerful decision-making ststement and is used to control the flow of execution of statements. It is basically a two-way decision statement and is used in conjuction with an expression
SIMPLE IF STATEMENT
if (test expression)
{
statement-block;
}
statement-x;

THE IF......ELSE STATEMENT
if (test expression)
{
True-block statement(s)
}
else
{
False-block statement(s)
}
statement-x

THE ELSE IF LADER
if (condition 1)
statement-1;
else if (condition 2)
statement-2;
else if (condition2)
statement-3;
else
default-ststement;
statement-x;

THE SWITCH STATEMENT
The switch statements tests the value of a given variable (or expression) against a list of case values and when a match is found , a block of statements associated with that case is executed. The general form of the switch statement is

switch (expression)
{
case value-1:
block-1
break;
case value-2:
block-2
break;
default:
default-block
break;
}
statemeny-x;

Rules for switch Statement
1. The switch expression must be an integral type.
2. Case labels must be constants or constant expressions.
3. Case label must be unique.
4. It is permitted to nest switch statements
5. There can be at most one default label
6.The default may be placed anywhere but uually placed at the end

Constants, Variables

Keywords
Keywords serve as the building blocks for program statements. All keywords have fixed meanings and these meanings cannot be changed. All keywords must be written in lower case. Example break else long switch void

Identifiers
Identifiers refer to the names of variables, functions and arrays. Thses are user-defined names and consist of a sequence of letters and digits, with a letter as a first character. Both uppercase and lowercase letters are permitted, although lowercase letters are commonly used.
Rules for Identifiers
1. First Character must be an alphabet(or underscore)
2.Must consist of only letters, digits or underscore.
3.Only first 31 character are significant.
4.Cannot use a keyword
5.Must not contain white space.

Constants
Constants in C refer to fixed values that do not change during the execution of a Program.
Types of Constants
Integer Constants refers to sequence of digits
Real Constants referes to number containing fractional parts like 17.548
String Character Constants contains a single character en-closed within a pait of single quote marks.
String Constants is a sequence of characters enclosed in double quotes.
Backslash Character Constants Escape Sequence
\a----audible alert
\b backspace
\f form feed
\n new line
\r carriage return
\\ backshash
\0 null


Variable
A variable is a data name that may be used to store a data value. Unlike constants that remain unchanged during the execution of a program, a variable may take different values at different time during execution.
Points to be noted while having variable
1. They mush begin with a letter. Some system permits underscore as a first character
2. A length of only 31 character are recognize by ANSI standared
3.Uppercase and Lowercase are significant
4.It should not be a keyword
5.White Space is not allowed



Data Types
Integer Types
Integers are whole numbers with a machine dependent range of values. C has three classes of integer storage namely short int, int and long int. All of this data types have signed and unsigned form

Floating Point types
Floating point number represents a real number with 6 digits precision. Floating point numbers are denoted by the key word float. When the accuracy of float is insufficient we can use the double to define the number. The double is same as float but with longer precision.

Void Type
Using void data type we can specify the data we can specify the type of function. It is a good practice to avoid functions that doesnot return any value to the calling function.

Character Type
A single character can be defined as a character type of data. Characters are usually stored in 8 bits of internal storage

Friday, June 4, 2010

Magic Square

Magic Square
3*3

816
357
492

4*4

16020313
05111008
09070612
04141501

5*5

2306190215
1018011422
1705132109
0412250816
1124072003

Crypto

Cryptos
SEVEN
+EIGHT
TWELVE

85254
+50671
135925

DONALD
+GERALD
ROBERT

526485
197485
723970

SEND
+MORE
MONEY

9567
+1085
10652

LETS
+WAVE
LATER

1567
+9085
10652

WRONG
WRONG
RIGHT

12734
12734
25468

(ATOM)^(1/2) = A+TO+M
(1296)^(1/2) = 1+29+6

FIVE
ONE
FOUR

1032
652
1684

Pattern

Determine the pattern to prove the identity
1 = 1
3+5 = 8
7+9+11 = 27

According to the given pattern in question
the general pattern is
(n^2-n+1) + (n^2-n+3) + (n^2-n+5).....(n^2-n+(2n-1)) = n^3

Here we need tp proof LHS = RHS
left hand side has n summands
n*n^2 - n*n + (1+3+5+.....2)
i.e n mumbers of n^2+1 and sum of odd numners only
Now, 1+3+5+.....(2n-1) equals to
(2*1-1)+(2*2-1)+(2*3-1)+....(2n+1)
2(1+2+3+4+....n)-1(1+1+1+1+1...)
2(n^2-n)/2 - n = n^2
n*n^2-n*n + n^2
n^3 = RHS

Pattern
1 = 1
2+3+4 = 1+8
5+6+7+8+9 = 8 + 27

1^3 = 1^3
(1^2+1) + (1^2+2) + 2^2 = 1^3 + 2^3
(2^2+1) + (2^2+2) + (2^2+3) + (2^2+4) + 3^2 = 2^3 + 3^3
((n-1)^2+1) + ((n-1)^2+2) + ((n-1)^2+3) + ((n-1)^2+4)+n^2 = (n-1)^3 + n^3
sum of integer upto n^2 - sum of integer upto (n-1)^2
(1+2+3+.....9)-(1.2...4) = (5+6+7+8+9)
[n^2*(n^2+1)]/2 =[(n-1)^2(n+1)^2+1]/2


Pattern
1=1
1-4= -(1+2)
1-4+9 = +(1+2+3)
1-4+9-16 = -(1+2+3+4)

general pattern is


1^2 - 2^2 + 3^2 - 4^2 + h^2 .......[(-1)^(n+1) - n^2] = (-1)^(n+1)(1+2+3...n)
For even
(1^2-2^2) + (3^2-4^2)+......[(n-1)^2 - n^2]
(1-2)(1+2) + (3-4)(3+4)......-1(n-1)+n
-1(1+2+3+4+.....(n-1)+n)

For odd
(1^2-2^2) + (3^2-4^2)+......[(n-2)^2-(n-1^2)] + n^2
(1^2-2^2) + (3^2-4^2)+......(n-2-n+1)(n-2+n-1) + n^2
-1(1+2)-1(3+4)+ -1[(n-2)+(n-1)^2] + n^2
-1{(1+2+3+4...(n-2)+(n-1)} + n^2
-n(n+1)/2 + n(n+1)
n(n+1)/2
1+2+3+4...n

k positive integers

Find the sum of k positive integers
1+2+3+4+........+k = s(k)
1+2+3+4+(k-1)+k+(k+1) = s(k+1)

using linear equation
(k+1)^2 = K^2 + 2K + 1
(k+1)^2 - k^2 = 2K + 1-----------1

When k = 1
2^2-1^2 = 2*1 +1
When k = 2
3^2-2^2 = 2*2 +1
When k = 3
4^2-3^2 = 2*3 +1
When k = 4
5^2-4^2 = 2*4 +1
When k = k
(k+1)^2 - k^2 = 2K + 1

Now adding both sides
(2^2-1^2)+(3^2-2^2)+.........(k^2-(k-1)^2) + (k+1)^2 - k^2 = 2(1+2+3+4....k) + (1+1+1+1+ to k)


(k+1)^2 - 1^2 = 2s(k) + k
K^2 + 2k +1 -1 = 2s(k) + k
s(k) = (K^2 + k)/2 - k(k+1)/2

Find the sum of k^2 positive integers
1^2 + 2^2 + 3^2 + 4^2 +.......k^2 = s(k^2)
1^2 + 2^2 + 3^2 + 4^2 + (k-1)^2 k^2 + (k+1)^2 = s((k+1)^2)

using equation.
k^3 - (k-1)^3 = 3k^2 - 3K + 1

put k = 1,1,2,3 ....... respectively
0^3 - (0-1)^3 = 3*0^2 - 3*0 + 1
1^3 - (1-1)^3 = 3*1^2 - 3*1 + 1
2^3 - (2-1)^3 = 3*2^2 - 3*2 + 1
..
..
..
k^3 - (k-1)^3 = 3k^2 - 3*k + 1
-------------------------------Adding both sides
k^3 = 3(0^21^2 + 2^2 + 3^2 + 4^2 + k^2) - 3(1+2+3.....k) + k
k^3 = 3s(k) - 3k(k+1)/2 + k
k^3 + 3k(k+1)/2 - k = 3s(k)
s(k) = K^3/3 + (3k^2 + 3k)/6 - k/3
(2k^3 + 3k^2 + 3K - 2k)/6
.....
.....
s(k) = (k(2K+1)(k+1))/6


Claculate the sum of first k odd positive integer
1+3+5+7+......(2k-1)
First adding all numbers from 1 + (2k-1) and subtracting even numbers
1+2+3+4+.....(2k-1)-[2+4+6+....2k-2]
((2k-1)^2 +(2k-1))/2 - 2[(k-1)^2)+(k-1)]/2
[(2k-1).2k]/2 - 2/2(k-1) * k
2k^2 - k^2
k^2

Tuesday, June 1, 2010

Road Foundation

1.Preperation

- Survey to determine

* line of road

* Amount of excavation and refilling likely to be needed

* Amount of surfacing material

* Quality of soil



2. Factors to take into account

Soil should be permeable for good drainage and easily compacted to good bearing capacity otherwise the road surface will not be durable



3. Process

Site should be excavated unsuitable soil should be replaced various machine are available. It depends on the depth of the cut and how much space there is at the site.
Final compacting is done with a roller. This complets the sub-grade
Then sub-base layer is added should also consist of material that drains easily
This layer must be compacted carefully so that its density is uniform all over it
The layer must be sealed

The use and Mis-use of Science

1)) An invention can be good or bad

the motorcar--facilitates business and gives harmless enjoyment/////strew the roads with dead

the radio--link the world together in a moment////instrument of lying

the cinema--means of instruction and recreation/////channel of vulgarity and false values
aeroplanes---makes travel rapid and easy/////weapon of

Knowledge and Wisdom

Knowledge and wisdom are two entirely different thing though they sound alike. We can find a lot of difference between knowledge and wisdom. Knowledge is defined as the perception or learning of various things we go through but wisdom is actually the accumulated knowledge where we use such knowledge and experience with common sense. Knowledge in some field helps us to think deeply and come up with some wonderfull discovery in that particular fiels only but wisdom helps us to think rationally on what impact can that discovery has to the other field associated with it along with these discoveries. Wisdom allows us to think for the mankind and also motivates ourselves to make continual approaches towards impartiallywhich knowledge simply can not do. Sometimes resulting in the destruction. But wisdom never takes the mind towards it. These are the difference we can find between knowledge and wisdom.

Customs

Two definition of culture

The first definition has given is from an anthropologist prespectives. He says that culture is the total life way of a people. The social legacy the indivudual acquires from his group. In other words, cl#ulture can be regared as that part of the environment that is the creation of man. The first definition has a wider meaning because the concept od culture needs a clear explanation of an individuals past experience. past experience of other people in the society has. Every activity from birth to death and total relation with the patterns which is not his own making. It is bacuse culture is a man made phenomenon and much of derived from the culture.

In second definition of culture is that a person who know about literature, philosophy history and fine arts is a cultured person. Culture denotes one's knowledge of language pther than his own. It is not a man made environment and it it limits the culture into a kind of mental ability. It also suggent that culture is the knoeledge about picaso.

At bottom all human being are very much alike
By asserting that at bottom all human being are very much alike he is not contradicting himself. rather he is useing a technical device in his persuasive essay. As an anthropologist kluckhohn does not conclude his essay with definition of cultur and some examples of cultural differences but he begins his essay with rhetorical question defines culture and develops his points with some supportive arguments to answer the questions and examiners human being's behaviours and character culturally and at last biologically too. Thus his essay eventually turns out to be through examination of human beings- their biological properties way of living and how they are shared by a certain pattern created by themselves.

Until paragraph 8 the author argues and draws examples and anologies to show that human being are different because of their cultural difference. It is bacasue they are btought up in different way, every cultural f#group has differemt customs such as chinese, japanese, indians Europeans, americans Africans and so on. These are some obvious directives or diversities among human being because of diverse cultural heritage.

However in the concluding pe#aragraph hr treats human being as one species if we observe human being's biological peoperties. the sum biologycal equipments and the inevitable of biology are found. All man undergo the same biologicaal life experience as birth , helplessness illness oldage death irrespective of cultural gropus their biological needed and same social behaviours such as marriage ceremony life crisis rite and incest taboos are alike.

Beauty

Conventional attitude about beauty that sontag seeks to discredit?
The conventionally used beauty signifiesthe attraction of physical appearance. Beauty has been distinguished as inner beauty(character intellect and vision) and outer beauty(facial attraction, physique or sense of proportion of the body) which is attributed to women only. The author seeks to discredit this outer beauty because it has devalued the concept of beauty which signified the wholeness, the excellence and the virtue of human during the classical time.
Sontag wants to revive the old Greek concept of inner beauty. Soctates diciples had observed the inner beauty in their teacher although he was ugly looking person.

If beauty is a source of power, why does sontag object to wone’s striving to attain it?
Beauty is a form of power. She always looked at with suspicious eye even if she has good rise in work, politics, law, medicine, business or whatever. She is always pressure to confess that she stills works at being attractive. This power is not the power to do but to attract. As a result, women’s striving to attain it makes them feel inferior to what they actually are. They can not choose this power freely on her capacity is always under social censorship. That’s why the author objects women’s striving to attain beauty

What change in attitude do you think sontag wants to bring about in her female readers?
Sontag wants to bring a complete change in attitude in her female readers. The conventional attitude on beauty has confined women’s potentiality. The author wants to emphasize inner beauty- vision and wisdom, which is long lasting and more fruitfull. Woman should not limit their to be beautiful outwardly, if they feel that to be or to try to be beautiful is their aim in life. It will certainly make them more inferior and dependant to male. Without being beautifuk too women can act as complemently as males. She has been able to generate sympathy for women from them.

What do you think sontag is saying to beautiful women? How do you think they would respond?
Sontag is advocating for the inner beauty which is considered to be more important than outward beauty especially for women. Our Society always teaches women to be fair and beautiful. SO, most women think that their only aim and responsibility is to be beautiful. Such a concept has not only degraded women’s dignity but has also made them inferior and dependent. The author is telling these women to think over the uselessness of outer looks. Their beauty should not be used to attract men. They should be excellent, competant, independent thoughtfull in order to revive the ideal valve of beauty and preserve their identity in the society. WOmen should not be flattered by men.