0% found this document useful (0 votes)
3 views44 pages

Class12 UnitTest StudyGuide

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views44 pages

Class12 UnitTest StudyGuide

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CBSE CLASS 12

Complete Unit Test Study Guide

Subject Chapters Covered

Physics Electric Charges & Fields | Electric Potential & Capacitance | Current Electricity

Chemistry Haloalkanes & Haloarenes | Alcohols, Phenols & Ethers

Mathematics Inverse Trigonometric Functions | Matrices | Determinants

English The Last Lesson | My Mother at Sixty-six | The Third Level | Writing Skills

Computer Science Python Review | Text File Handling | Binary File Handling

Covers 20 years of CBSE Board Paper patterns. High-yield content only.


Formula sheets | Derivations | Definitions | Numericals | Common Mistakes | Rapid Revision
SUBJECT 1: PHYSICS
Chapters: Electric Charges and Fields | Electric Potential and Capacitance | Current Electricity

SECTION 1: COMPLETE FORMULA SHEET

ELECTRIC CHARGES AND FIELDS


Coulomb's Law:

F = kq1q2/r2

F=force(N), k=9x109 Nm2C-2, q=charges(C), r=distance(m)

Electric Field:

E = F/q = kQ/r2

E=field(N/C or V/m), Q=source charge, r=distance

Electric Field (line charge):

E = lambda/(2pi*epsilon_0*r)

lambda=linear charge density(C/m), r=perpendicular distance

Electric Field (infinite plane):

E = sigma/(2*epsilon_0)

sigma=surface charge density(C/m2)

Electric Field (conducting sheet):

E = sigma/epsilon_0

Between two plates

Electric Dipole Moment:

p = q x 2a

p=dipole moment(C.m), 2a=separation, direction: -q to +q

Field on axial line of dipole:

E = 2kp/r3

r >> a; direction along p

Field on equatorial line of dipole:

E = kp/r3

Direction antiparallel to p

Torque on dipole:

tau = pE sin(theta)

tau=torque(N.m), theta=angle with E


Gauss's Law:

Phi = q_enc/epsilon_0

Phi=flux(N.m2/C), q_enc=enclosed charge

Electric Flux:

Phi = E.A = EA cos(theta)

A=area(m2)

ELECTRIC POTENTIAL AND CAPACITANCE


Electric Potential:

V = W/q = kQ/r

V=potential(Volt=J/C), W=work done bringing unit +ve charge from infinity

Potential due to dipole (axial):

V = kp cos(theta)/r2

theta=angle with dipole axis

Potential difference:

V_A - V_B = W_AB/q

Work done per unit charge moving from B to A

Relation E and V:

E = -dV/dr

E points in direction of decreasing V

Energy of system of charges:

U = kq1q2/r

Potential energy(J)

Energy of dipole in field:

U = -pE cos(theta) = -p.E

Stable equilibrium at theta=0

Capacitance:

C = Q/V

C=capacitance(Farad), Q=charge(C), V=potential(V)

Parallel plate capacitor:

C = epsilon_0*A/d

A=plate area(m2), d=separation(m)

With dielectric:

C = K*epsilon_0*A/d

K=dielectric constant (dimensionless)


Series combination:

1/C_eq = 1/C1 + 1/C2 + ...

Charge same on each

Parallel combination:

C_eq = C1 + C2 + ...

Voltage same across each

Energy stored:

U = (1/2)CV2 = Q2/(2C) = (1/2)QV

U=energy(J)

Energy density:

u = (1/2)epsilon_0*E2

u=energy per unit volume(J/m3)

CURRENT ELECTRICITY
Ohm's Law:

V = IR

V=voltage(V), I=current(A), R=resistance(Ohm)

Resistance:

R = rho*L/A

rho=resistivity(Ohm.m), L=length(m), A=cross-section area(m2)

Resistivity and temp:

rho_T = rho_0(1 + alpha*T)

alpha=temperature coefficient of resistance(per degree C)

Drift velocity:

v_d = I/(nAe)

n=number density of electrons, e=1.6x10-19 C

Relation I and v_d:

I = nAev_d

Current from microscopic parameters

Mobility:

mu = v_d/E = e*tau/m

mu=mobility(m2/V.s), tau=relaxation time

Series resistance:

R_eq = R1 + R2 + ...

Same current through each


Parallel resistance:

1/R_eq = 1/R1 + 1/R2 + ...

Same voltage across each

Power:

P = VI = I2R = V2/R

P=power(W)

EMF and terminal voltage:

V = E - Ir

E=EMF(V), r=internal resistance(Ohm), during discharge

Kirchhoff's Current Law:

Sum I_in = Sum I_out

At a junction (node)

Kirchhoff's Voltage Law:

Sum V = 0 around loop

Algebraic sum in any closed loop

Wheatstone bridge:

P/Q = R/S (balanced)

No current through galvanometer when balanced

Metre bridge / Slide wire:

R = S*(100-l)/l

l=balancing length(cm), S=known resistance

Potentiometer (EMF ratio):

E1/E2 = l1/l2

l1,l2=balancing lengths for two cells

Cells in series:

E_eq = E1+E2, r_eq = r1+r2

EMFs add up

Cells in parallel (same EMF):

E_eq = E, r_eq = r/n

n=number of cells
SECTION 2: DERIVATIONS RANKED BY FREQUENCY
Frequency key: ***** = appears almost every year | **** = very frequent | *** = frequent

1. [*****] Expression for Electric Field due to an Infinite Plane Sheet of Charge
(Gauss's Law)
• Consider an infinite plane sheet with uniform surface charge density sigma.
• Choose a Gaussian surface: a cylinder (pill box) with cross-section area A, extending equal distance on both
sides of the sheet.
• By symmetry, E is perpendicular to the sheet and acts away from it on both sides.
• Electric flux through curved surface = 0 (E parallel to surface).
• Total flux through flat faces: Phi = 2EA
• Charge enclosed: q_enc = sigma * A
• By Gauss's Law: 2EA = sigma*A/epsilon_0
• Therefore: E = sigma/(2*epsilon_0)
• For a conducting sheet (charge on one side only): E = sigma/epsilon_0

2. [*****] Capacitance of a Parallel Plate Capacitor


• Consider two large parallel plates, each of area A, separated by distance d in vacuum.
• Let +Q charge on one plate, -Q on other. Surface charge density: sigma = Q/A
• Electric field between plates (using Gauss's Law for conducting sheets): E = sigma/epsilon_0 = Q/(epsilon_0 *
A)
• This field is uniform between the plates.
• Potential difference: V = E * d = Qd/(epsilon_0 * A)
• Capacitance: C = Q/V = epsilon_0*A/d
• With dielectric of constant K inserted: C = K*epsilon_0*A/d

3. [*****] Equivalent Resistance in Series and Parallel


• SERIES: Three resistors R1, R2, R3 connected end-to-end.
• Same current I flows through all.
• V = V1 + V2 + V3 = IR1 + IR2 + IR3 = I(R1+R2+R3)
• So V = I*R_eq, giving R_eq = R1 + R2 + R3
• PARALLEL: Three resistors connected between same two points.
• Same voltage V across all.
• I = I1 + I2 + I3 = V/R1 + V/R2 + V/R3 = V(1/R1 + 1/R2 + 1/R3)
• So I = V/R_eq, giving 1/R_eq = 1/R1 + 1/R2 + 1/R3

4. [*****] Electric Field on Axial Line of an Electric Dipole


• Consider a dipole with charges +q and -q separated by 2a. Point P is at distance r from centre on the axial
line.
• Distance of P from +q = (r - a); from -q = (r + a)
• E+ = kq/(r-a)^2 (along P, away from +q, i.e., in direction of p)
• E- = kq/(r+a)^2 (towards -q, opposite to direction of p)
• Net E = E+ - E- = kq[1/(r-a)^2 - 1/(r+a)^2]
• = kq * [4ar/(r^2-a^2)^2]
• For r >> a: E = 4kqa/(r^3) = 2kp/r^3 (since p = q*2a)
• Direction: along the dipole moment p

5. [****] Wheatstone Bridge (Derivation of Balance Condition)


• Four resistors P, Q, R, S in a bridge. Galvanometer between B and D. Battery between A and C.
• At balance, I_g = 0 (no current through galvanometer).
• Applying KVL to loop ABD: I1*P = I2*R ... (1)
• Applying KVL to loop BCD: I1*Q = I2*S ... (2)
• Dividing (1) by (2): P/Q = R/S
• This is the balance condition of Wheatstone bridge.

6. [****] Drift Velocity and its Relation to Current


• In a conductor, free electrons move randomly. On applying E, they gain drift velocity v_d in direction opposite
to E.
• Consider a conductor of length L, area A, n = number density of free electrons.
• In time dt, electrons within volume A*v_d*dt will cross a cross-section.
• Number of such electrons = n * A * v_d * dt
• Charge crossing = n*A*v_d*dt*e
• Current I = charge/time = nAev_d
• Also: v_d = eE*tau/m = eV*tau/(mL) where tau = relaxation time
• So: I = nAe * (eE*tau/m) = ne^2*tau*A*E/m
• This gives Ohm's law: J = sigma*E where sigma = ne^2*tau/m (conductivity)

7. [***] Energy Stored in a Capacitor


• When charging a capacitor, work is done against the electric field.
• At any instant, charge on capacitor = q, potential = q/C
• Small work done to add charge dq: dW = V*dq = (q/C)*dq
• Total work done (charge from 0 to Q): W = integral from 0 to Q of (q/C)dq
• W = [q^2/(2C)] from 0 to Q = Q^2/(2C)
• Using Q = CV: W = (1/2)CV^2 = (1/2)QV
• This work is stored as electrostatic potential energy: U = Q^2/(2C) = (1/2)CV^2

8. [***] Torque on an Electric Dipole in Uniform Electric Field


• Dipole of moment p = q*2a placed in uniform E at angle theta.
• Force on +q: F = qE (along E)
• Force on -q: F = qE (opposite to E)
• Net force = 0 (equal and opposite), but they form a couple.
• Perpendicular distance between forces = 2a sin(theta)
• Torque = Force x perpendicular distance = qE * 2a*sin(theta)
• tau = pE sin(theta) = p x E (vector form)
• Torque tends to align dipole with field.
9. [***] Potentiometer - Comparison of EMFs
• A potentiometer has a long resistance wire AB connected to a battery of known EMF.
• Cell E1 connected in secondary circuit. Balance length = l1 (current through galvanometer = 0).
• At balance, EMF = potential drop across length l1 = k*l1 (k = potential gradient)
• Similarly for cell E2: balance length = l2, E2 = k*l2
• Dividing: E1/E2 = l1/l2
• This method is superior to voltmeter as it draws no current from the cell at balance.
SECTION 3: DEFINITIONS, LAWS AND STATEMENTS
Coulomb's Law

The force of attraction or repulsion between two point charges is directly proportional to the product of their
magnitudes and inversely proportional to the square of the distance between them, and acts along the line
joining them. F = kq1q2/r^2

Electric Field Intensity

The electric field at a point is defined as the force experienced per unit positive test charge placed at that
point. E = F/q0. It is a vector quantity. Unit: N/C or V/m

Electric Field Lines

Electric field lines are imaginary lines or curves drawn in an electric field such that the tangent to the field line
at any point gives the direction of E at that point. They start from +ve and end at -ve charge. They never cross
each other.

Electric Flux

Electric flux through a surface is the total number of electric field lines passing normally through that surface.
Phi = E.A = EA cos(theta). Unit: N.m^2/C or V.m. It is a scalar quantity.

Gauss's Law

The total electric flux through any closed surface is equal to 1/epsilon_0 times the total charge enclosed within
that surface. Phi = q_enc/epsilon_0. It holds for any shape of closed surface (Gaussian surface).

Electric Potential

Electric potential at a point is defined as the work done per unit positive test charge in bringing it from infinity
to that point without any acceleration. V = W/q0. Unit: Volt (J/C). It is a scalar quantity.

Equipotential Surface

A surface on which all points are at the same electric potential. No work is done in moving a charge along an
equipotential surface. Electric field lines are always perpendicular to equipotential surfaces.

Capacitance

The capacitance of a conductor is its ability to store electric charge. C = Q/V. Unit: Farad (F). 1 F = 1 C/V.

Dielectric Constant (K)

The ratio of capacitance of a capacitor with dielectric to its capacitance without dielectric. Also equals ratio of
permittivity of medium to permittivity of vacuum. K = epsilon/epsilon_0. It is dimensionless and always > 1 for
insulators.

Electric Current

The rate of flow of electric charge through a cross-section of a conductor. I = Q/t. Unit: Ampere (A). 1 A = 1
C/s. It is a scalar quantity.
Ohm's Law

The current flowing through a conductor is directly proportional to the potential difference across its ends,
provided the temperature and physical conditions remain constant. V = IR (or V proportional to I). R is
resistance.

Resistivity

Resistivity of a material is defined as the resistance of a conductor of unit length and unit cross-sectional area
made of that material. R = rho*L/A, so rho = RA/L. Unit: Ohm.m

Drift Velocity

The average velocity acquired by free electrons in a conductor under the influence of an applied electric field.
v_d = eE*tau/m, direction opposite to E for electrons. v_d is of order 10^-4 m/s.

Kirchhoff's Current Law (KCL)

The algebraic sum of currents at a junction (node) is zero. Equivalently, the sum of currents entering a junction
equals the sum of currents leaving it. Based on conservation of charge.

Kirchhoff's Voltage Law (KVL)

The algebraic sum of potential differences (EMFs and IR drops) around any closed loop in a circuit is zero.
Based on conservation of energy.

EMF of a Cell

The EMF of a cell is the work done per unit charge by the cell to move charge from the negative terminal to
the positive terminal inside the cell. E = W/q. Unit: Volt. It equals the terminal voltage when no current flows.

Internal Resistance

The resistance offered by the electrolyte and electrodes of a cell to the flow of current through it. Terminal
voltage V = E - Ir (during discharge); V = E + Ir (during charging).
SECTION 4: HIGH-YIELD NUMERICAL PROBLEMS

Q1 [*****] Coulomb's Law


Q: Two charges of 4 microcoulombs and -8 microcoulombs are placed 0.3 m apart. Find the force between
them.

Solution:
• q1 = 4x10^-6 C, q2 = -8x10^-6 C, r = 0.3 m, k = 9x10^9 Nm^2/C^2
• F = kq1q2/r^2 = 9x10^9 * 4x10^-6 * 8x10^-6 / (0.3)^2
• F = 9x10^9 * 32x10^-12 / 0.09
• F = 288x10^-3 / 0.09 = 3.2 N (attractive, since opposite charges)

Q2 [*****] Capacitors in Series-Parallel


Q: Three capacitors of 2 muF, 3 muF, and 6 muF are connected in series. Find equivalent capacitance.

Solution:
• 1/C_eq = 1/2 + 1/3 + 1/6 = 3/6 + 2/6 + 1/6 = 6/6 = 1
• C_eq = 1 muF
• Note: For parallel: C_eq = 2 + 3 + 6 = 11 muF

Q3 [*****] Ohm's Law / Power


Q: A 100 W bulb and a 60 W bulb are connected in series across 220 V. Which glows brighter?

Solution:
• R100 = V^2/P = 220^2/100 = 484 Ohm
• R60 = 220^2/60 = 806.7 Ohm
• In series, same current flows. Power P = I^2*R
• Higher R means more power dissipated.
• So 60 W bulb glows brighter in series connection.
• Trick: In series, higher resistance = more power. In parallel, lower resistance = more power.

Q4 [****] Energy in Capacitor


Q: A 4 muF capacitor is charged to a potential of 400 V. Find energy stored.

Solution:
• U = (1/2)CV^2 = (1/2) * 4x10^-6 * (400)^2
• U = (1/2) * 4x10^-6 * 160000
• U = 0.32 J = 320 mJ

Q5 [****] Potentiometer
Q: In a potentiometer experiment, balancing length for cell E1 = 60 cm and for E2 = 40 cm. Find E1/E2.

Solution:
• At balance, EMF is proportional to balancing length.
• E1/E2 = l1/l2 = 60/40 = 3/2 = 1.5
• So E1 : E2 = 3 : 2

Q6 [****] Kirchhoff's Laws


Q: In a circuit, E = 12 V, r = 1 Ohm, R1 = 3 Ohm, R2 = 6 Ohm (R1 and R2 in parallel). Find current from
battery.

Solution:
• Parallel combination: 1/R_p = 1/3 + 1/6 = 2/6 + 1/6 = 3/6, R_p = 2 Ohm
• Total resistance = R_p + r = 2 + 1 = 3 Ohm
• Current I = E/(R_p + r) = 12/3 = 4 A

Q7 [***] Drift Velocity


Q: A copper wire of cross-section 10^-7 m^2 carries a current of 1.6 A. Number density n = 8x10^28/m^3. Find
drift velocity.

Solution:
• v_d = I/(nAe)
• v_d = 1.6 / (8x10^28 * 10^-7 * 1.6x10^-19)
• v_d = 1.6 / (8x10^28 * 1.6x10^-26)
• v_d = 1.6 / (128x10^2) = 1.6/1280 = 1.25x10^-3 m/s

Q8 [***] Electric Field due to point charge / field along line


Q: An electric dipole of dipole moment 4x10^-9 C.m is placed in uniform field of 5x10^4 N/C. Find max torque.

Solution:
• Max torque when theta = 90 degrees
• tau_max = pE = 4x10^-9 * 5x10^4
• tau_max = 2x10^-4 N.m

SECTION 5: COMMON MISTAKES


• Writing E = kQ/r instead of E = kQ/r^2 (always square the distance in Coulomb's law and point charge field).
• Confusing electric field lines with field lines. Field lines NEVER cross each other.
• For dipole: E on axial line = 2kp/r^3; E on equatorial line = kp/r^3. Students often swap the factor of 2.
• Gauss's law: The enclosed charge means charge INSIDE the Gaussian surface, not on it.
• Capacitors in series: charge is same (not voltage). In parallel: voltage is same (not charge).
• Energy formula: U = (1/2)CV^2. Common error: writing U = CV^2 (forgetting the half).
• Terminal voltage: V = E - Ir (discharging) but V = E + Ir (charging). Students always use minus.
• Kirchhoff's law sign convention: EMF is positive if you traverse from -ve to +ve terminal. IR drop is negative if
current direction matches traversal.
• Metre bridge formula: R = S*(100-l)/l not R = Sl/(100-l). Always put unknown on left gap.
• Drift velocity direction: it is OPPOSITE to E for electrons (electrons are negative).
• Resistivity does NOT depend on dimensions of conductor. Resistance does.
• Equipotential surfaces: Work done is zero on moving along them, NOT perpendicular to them.
SECTION 6: ONE-PAGE RAPID REVISION SUMMARY

ELECTRIC CHARGES AND FIELDS


• Coulomb: F = kq1q2/r^2 (k = 9x10^9). Field: E = kQ/r^2
• Dipole: p = q*2a. Axial E = 2kp/r^3 (along p). Equatorial E = kp/r^3 (anti-p). Torque = pEsin(theta)
• Gauss: Phi = q_enc/epsilon_0. Infinite plane: E = sigma/2epsilon_0. Conductor sheet: E = sigma/epsilon_0
• Field lines start +, end -. Never cross. Tangent gives E direction.

ELECTRIC POTENTIAL AND CAPACITANCE


• V = kQ/r (scalar). E = -dV/dr. Equipotential: perpendicular to E, W = 0.
• Capacitance C = epsilon_0*A/d. With dielectric K: C_new = KC.
• Series: 1/C_eq = sum(1/Ci), charge same. Parallel: C_eq = sum(Ci), voltage same.
• Energy U = (1/2)CV^2 = Q^2/2C. Energy density u = (1/2)epsilon_0*E^2.

CURRENT ELECTRICITY
• I = nAev_d. Ohm's: V = IR. R = rho*L/A. rho increases with temperature for metals.
• Series: R_eq = R1+R2 (same I). Parallel: 1/R_eq = sum(1/Ri) (same V).
• Power: P = VI = I^2R = V^2/R. Terminal V = E - Ir (discharge), E + Ir (charge).
• KCL: sum I at junction = 0. KVL: sum V in loop = 0.
• Wheatstone: P/Q = R/S (balanced). Potentiometer: E1/E2 = l1/l2.
SUBJECT 2: CHEMISTRY
Chapters: Haloalkanes and Haloarenes | Alcohols, Phenols and Ethers

SECTION 1: COMPLETE REACTION SHEET

HALOALKANES - KEY NAMED REACTIONS

Wurtz Reaction [*****]


2R-X + 2Na (dry ether) --> R-R + 2NaX

Reagent: Sodium metal in dry ether. Used to prepare higher alkanes. Limited use: cannot prepare odd-carbon alkanes
cleanly.

Finkelstein Reaction [****]


R-Cl/R-Br + NaI (dry acetone) --> R-I + NaCl/NaBr

Converts alkyl chloride/bromide to alkyl iodide. NaI is soluble in acetone; NaCl/NaBr precipitate out, driving reaction
forward.

Swarts Reaction [****]


R-Cl + AgF --> R-F + AgCl

Preparation of alkyl fluorides. Reagent: AgF or SbF3/CoF3.

SN1 Reaction [*****]


R-X --> [R+] carbocation --> R-Nu (two steps, racemisation)

Favoured by: tertiary substrates, polar protic solvents (water, ROH), weak nucleophiles. Rate = k[R-X]. First order.

SN2 Reaction [*****]


Nu: + R-X --> [Nu---R---X] transition state --> Nu-R + X- (one step, inversion)

Favoured by: primary substrates, polar aprotic solvents (DMSO, acetone), strong nucleophiles. Rate = k[R-X][Nu].
Second order. Walden inversion of configuration.

Elimination (E2) / Dehydrohalogenation [****]


R-CH2-CHX-R' + KOH(alc) --> R-CH=CH-R' + KX + H2O

Reagent: Alcoholic KOH. Saytzeff's rule: H is removed from carbon with fewer H atoms, giving more substituted (stable)
alkene.

Grignard Reagent Formation [****]


R-X + Mg (dry ether) --> R-MgX

Dry conditions essential (reacts with water). R-MgX is versatile nucleophile.


Sandmeyer Reaction [****]
ArN2+ Cl- + CuCl/HCl --> ArCl + N2 (also with CuBr/HBr -> ArBr)

Diazonium salt reacts with CuCl or CuBr to give aryl halide. Source of aryl halides without direct halogenation.

Balz-Schiemann Reaction [***]


ArN2+ BF4- (heat) --> ArF + N2 + BF3

Preparation of aryl fluorides from diazonium tetrafluoroborate.

Nucleophilic Substitution on Haloarene [****]


Ar-X + NaOH (aq, 300-400 deg C, 300 atm) --> Ar-OH + NaX (Dow Process for phenol)

Aryl halides are less reactive than alkyl halides due to: C-X partial double bond character, higher sp2 C-X bond energy,
delocalisation of lone pairs into ring.

Reaction with Mg (Haloalkane) [***]


R-X + Mg (dry ether, Grignard)

Order of reactivity: R-I > R-Br > R-Cl > R-F

ALCOHOLS, PHENOLS AND ETHERS - KEY REACTIONS

Lucas Test [*****]


ROH + HCl + ZnCl2 (Lucas reagent, RT) --> R-Cl (turbidity = cloudiness)

3° alcohol: immediate turbidity. 2°: turbidity in 5 min. 1°: no turbidity at RT (requires heating). Used to distinguish 1°, 2°, 3°
alcohols.

Victor Meyer Test [****]


1°ROH gives red colour; 2° gives blue; 3° gives colourless with Victor Meyer reagent

Uses CS2/AgNO3 and HNO3 sequence. Distinguishes 1°, 2°, 3° alcohols definitively.

Esterification [*****]
R-OH + R'COOH <--> R'-COO-R + H2O (conc. H2SO4, heat, reversible)

Fischer esterification. Acid catalyst. Reversible, so excess acid or alcohol or removal of water shifts equilibrium right.

Kolbe's Reaction [****]


C6H5ONa + CO2 (300 deg C, 5 atm) --> sodium salicylate (aspirin precursor)

Phenol sodium salt with CO2 under pressure gives salicylic acid on acidification. Key industrial reaction.

Reimer-Tiemann Reaction [****]


C6H5OH + CHCl3 + NaOH --> o-hydroxy benzaldehyde (major) + p-hydroxy benzaldehyde

Introduction of -CHO group into phenol ring. Ortho product is major.


Williamson Synthesis [*****]
R-O-Na + R'-X --> R-O-R' + NaX (SN2)

Best method to prepare ethers. R'-X must be primary (SN2 favoured). If secondary or tertiary R'-X is used, elimination
dominates.

Reactions of Phenol with FeCl3 [****]


C6H5OH + FeCl3 (aqueous) --> violet/purple colour

Characteristic test for phenol. Violet colour with neutral FeCl3 solution.

Dehydration of Alcohol [****]


R-OH + conc.H2SO4 (170 deg C) --> alkene (elimination). At 140 deg C: R-O-R (ether)

Temperature determines product: lower temp gives ether (substitution), higher temp gives alkene (elimination).

Oxidation of Alcohols [*****]


1° ROH --[K2Cr2O7/H2SO4]--> RCHO --[further]--> RCOOH; 2° ROH --> ketone; 3° ROH: no oxidation with
mild agent

PCC (pyridinium chlorochromate) oxidises 1° alcohol to aldehyde only (stops there). CrO3 or KMnO4 gives carboxylic
acid.

Reaction of Phenol with Br2 water [****]


C6H5OH + 3Br2 (water, RT) --> 2,4,6-tribromophenol (white precipitate) + 3HBr

Electrophilic aromatic substitution. -OH group is strong activating group. All ortho and para positions substituted. Instant
white ppt = test for phenol.

Acid strength: Phenol vs Alcohol [***]


Phenol (pKa ~ 10) is more acidic than alcohol (pKa ~ 16-18) but less acidic than carboxylic acid

Phenoxide ion is stabilised by resonance with ring. Electron-withdrawing groups (NO2 at o/p) increase acidity of phenol.
SECTION 2: MECHANISMS (STEP BY STEP)

SN1 MECHANISM [Most Tested]


• Step 1 - Ionisation (slow, rate-determining): R-X --> R+ (carbocation) + X-
• The C-X bond breaks heterolytically. The central carbon becomes a planar carbocation (sp2 hybridised).
• Step 2 - Nucleophilic attack (fast): Nu:- + R+ --> Nu-R
• Nucleophile attacks from both faces of the planar carbocation (racemisation occurs).
• Result: ~50% retention + 50% inversion = racemic mixture.
• Favoured by: tertiary > secondary >> primary substrates (stability of carbocation); polar protic solvents (water,
ethanol) that stabilise ions.
• Order of reactivity: tert > sec > primary > methyl

SN2 MECHANISM [Most Tested]


• One-step concerted mechanism. No intermediate.
• Nu:- approaches R-X from the back (180 degrees to C-X bond).
• Transition state: Nu---C---X (pentacoordinate, trigonal bipyramidal, partial bonds on both sides)
• As Nu-C bond forms, C-X bond breaks simultaneously.
• Inversion of configuration (like an umbrella turning inside out) -- Walden inversion.
• Result: Complete inversion of configuration at chiral centre.
• Favoured by: primary > secondary >> tertiary substrates; strong nucleophiles (OH-, CN-, I-); polar aprotic
solvents (DMSO, acetone, DMF); less bulky substrates.

ELECTROPHILIC SUBSTITUTION ON PHENOL (Brief)


• Step 1: The -OH group donates electrons to the ring by resonance (activating group, ortho-para director).
• Step 2: Electrophile (E+) attacks at ortho or para position (higher electron density) forming sigma complex
(arenium ion, carbocation).
• Step 3: Loss of H+ restores aromaticity.
• This is why phenol undergoes electrophilic substitution much more readily than benzene.
• With Br2/water: all three available o/p positions (2,4,6) are substituted (tribromophenol).
SECTION 3: IUPAC, PROPERTIES AND DISTINGUISHING TESTS

IUPAC NAMING RULES


• Haloalkane: halogen is prefix (fluoro-, chloro-, bromo-, iodo-) with lowest locant. Chain selected includes max
substituents.
• Haloarene: naming as halobenzene. Example: chlorobenzene, 1,2-dichlorobenzene (ortho), 1,4 (para).
• Alcohol: suffix -ol. Longest chain containing -OH is parent. Lowest locant to -OH. Example: propan-1-ol,
propan-2-ol.
• Phenol: parent phenol. -OH on ring. Substituents given lowest possible locants.
• Ether: named as alkoxyalkane. Smaller group = alkoxy. Example: CH3-O-C2H5 = methoxyethane.
• Priority order of functional groups: -COOH > -SO3H > -CHO > -CO- > -OH > -NH2 > halogen > alkyl
• Cyclic compounds: cyclo- prefix. Bridged: bicyclo notation.

PHYSICAL PROPERTIES
• Haloalkanes: bp > parent alkane (higher molar mass, van der Waals forces). bp order: RI > RBr > RCl > RF
for same R.
• Haloalkanes: insoluble in water (non-polar), soluble in organic solvents.
• Alcohols: much higher bp than comparable hydrocarbons/ethers due to intermolecular H-bonding (-OH
group).
• Alcohols: miscible with water (small chain); solubility decreases as chain length increases (hydrophobic part
dominates).
• Phenol: mp 43 deg C, polar solid. Slightly soluble in water. More soluble in organic solvents.
• Ethers: bp lower than corresponding alcohols (no H-bonding between ether molecules). Slightly soluble in
water (lone pairs on O can H-bond with water).
• Boiling point trends: n-alkyl > branched (less surface area, less van der Waals).

DISTINGUISHING TESTS (MUST KNOW)


Phenol vs Alcohol:

Add neutral FeCl3: phenol gives violet/purple colour. Alcohol: no colour. Also: phenol decolourises Br2 water
(white ppt), alcohol does not.

1° vs 2° vs 3° Alcohol:

Lucas test: 3° = immediate turbidity; 2° = turbidity in ~5 min; 1° = no turbidity at RT. Victor Meyer: 1° = red; 2°
= blue; 3° = colourless.

Aldehyde vs Ketone:

Tollens' reagent: aldehyde gives silver mirror, ketone does not. Fehling's solution: aldehyde gives brick-red
ppt, ketone does not.

Haloalkane type (1°/2°/3°):

Dehydrohalogenation rate: 3° > 2° > 1° with alcoholic KOH.


Aryl vs Alkyl halide:

Aryl halides are resistant to nucleophilic substitution (requires high temp/pressure). Alkyl halides react readily
with NaOH(aq) at room temperature.
SECTION 4: HIGH-YIELD QUESTIONS

Q1 [*****] SN1 vs SN2


Q: Why is (CH3)3C-Br more reactive in SN1 but less reactive in SN2 compared to CH3Br?

Solution:
• SN1: (CH3)3C-Br gives a stable 3° carbocation. More stable carbocation = faster SN1. CH3Br gives unstable
1° carbocation.
• SN2: (CH3)3C-Br has three methyl groups blocking backside attack by nucleophile (steric hindrance). CH3Br
has no such obstruction.
• SN2 order of reactivity: CH3X > 1° > 2° >> 3°
• SN1 order: 3° > 2° > 1° >> CH3X

Q2 [*****] Williamson Synthesis


Q: Write Williamson synthesis for tert-butyl methyl ether.

Solution:
• To prepare (CH3)3C-O-CH3:
• Use CH3ONa + (CH3)3C-X. But wait: (CH3)3C-X is tertiary; SN2 will not work (elimination dominates).
• Correct approach: Use (CH3)3C-ONa + CH3-X
• (CH3)3C-ONa + CH3I --> (CH3)3C-O-CH3 + NaI
• Rule: Always use primary alkyl halide (R'-X must be 1°) in Williamson synthesis.

Q3 [****] Conversion
Q: Convert: Ethanol to ethanal (acetaldehyde)

Solution:
• CH3CH2OH + PCC (pyridinium chlorochromate) --> CH3CHO
• PCC in CH2Cl2, room temperature.
• PCC is the reagent that stops oxidation at aldehyde stage.
• K2Cr2O7/H2SO4 would further oxidise to acetic acid.

Q4 [****] Reactivity order


Q: Arrange in increasing order of SN2 reactivity: CH3Br, (CH3)2CHBr, (CH3)3CBr, CH3CH2Br

Solution:
• SN2 reactivity decreases with increasing branching at alpha-carbon (steric hindrance).
• Order (least to most reactive): (CH3)3CBr < (CH3)2CHBr < CH3CH2Br < CH3Br
• OR increasing order: (CH3)3CBr < (CH3)2CHBr < C2H5Br < CH3Br

Q5 [****] Phenol reactions


Q: Give the product when phenol reacts with (a) conc. HNO3/conc. H2SO4 (b) Br2 water (c) NaOH

Solution:
• (a) Phenol + conc. HNO3/H2SO4 (mild, dilute conditions) --> o-nitrophenol + p-nitrophenol (EAS, -OH is o/p
director)
• (b) Phenol + Br2 water (RT) --> 2,4,6-tribromophenol (white precipitate) + 3HBr
• (c) Phenol + NaOH --> sodium phenoxide (C6H5ONa) + H2O

Q6 [***] Dehydration
Q: What product forms when propan-2-ol is heated with conc. H2SO4 at 443 K?

Solution:
• Propan-2-ol at high temperature (443 K = 170 deg C): dehydration (elimination).
• CH3-CH(OH)-CH3 + H2SO4 (170 deg C) --> CH3-CH=CH2 (propene) + H2O
• Major product follows Saytzeff's rule: more substituted alkene.

SECTION 5: COMMON MISTAKES (CHEMISTRY)


• Confusing SN1 and SN2 conditions: SN1 needs tertiary substrate + protic solvent. SN2 needs primary
substrate + aprotic solvent + strong nucleophile.
• Williamson synthesis: students use tertiary alkyl halide, forgetting that SN2 does not work on tertiary
(elimination dominates).
• Saying phenol is weaker acid than alcohol: WRONG. Phenol (pKa ~10) is more acidic than alcohol (pKa
~16-18).
• Dehydration temperature confusion: 140 deg C gives ether; 170 deg C gives alkene. Not remembering which
is higher.
• Forgetting that Br2 water test for phenol gives PRECIPITATE (2,4,6-tribromophenol), not just decolourisation.
• Lucas test: 1° alcohol gives NO turbidity at room temperature. Students write 'slow turbidity' for 1°.
• Grignard reagent must be prepared in DRY ether. Any moisture destroys it.
• SN2 gives INVERSION of configuration (Walden inversion). SN1 gives racemisation. Very common to get
these mixed up.
• Kolbe reaction is for PHENOL sodium salt + CO2, not for alcohol.
• Saytzeff's rule in elimination: more substituted alkene is major product (not less substituted).
SECTION 6: RAPID REVISION SUMMARY (CHEMISTRY)

HALOALKANES AND HALOARENES


• Reactivity: RI > RBr > RCl > RF (bond energy). Aryl halides less reactive than alkyl (resonance, sp2 C-X).
• SN1 (3°, protic solvent, weak Nu, racemisation) vs SN2 (1°, aprotic solvent, strong Nu, inversion).
• Wurtz: 2R-X + 2Na --> R-R. Finkelstein: R-Cl + NaI(acetone) --> R-I. Swarts: R-Cl + AgF --> R-F.
• Sandmeyer: ArN2+ + CuCl --> ArCl. Balz-Schiemann: ArN2+BF4- (heat) --> ArF.
• Elimination with alc. KOH: Saytzeff's rule (more substituted alkene).

ALCOHOLS, PHENOLS AND ETHERS


• Bp: alcohol > ether (H-bonding in alcohol). Solubility decreases with chain length.
• Lucas test: 3° (instant) > 2° (5 min) > 1° (no turbidity at RT). FeCl3: violet with phenol.
• Oxidation: 1°-OH --PCC--> aldehyde --[O]--> acid. 2°-OH --> ketone. 3°-OH: no oxidation.
• Dehydration: 140 deg C --> ether; 170 deg C --> alkene.
• Williamson: R-ONa + R'(1°)X --> ether (always use primary R'-X).
• Phenol reactions: FeCl3 (violet), Br2 water (white ppt 2,4,6-tribromophenol), conc. HNO3 (o+p nitrophenol).
• Kolbe: PhONa + CO2 (300 atm, heat) --> sodium salicylate. Reimer-Tiemann: PhOH + CHCl3/NaOH -->
salicylaldehyde.
• Phenol more acidic than alcohol; less acidic than carboxylic acid.
SUBJECT 3: MATHEMATICS
Chapters: Inverse Trigonometric Functions | Matrices | Determinants

SECTION 1: INVERSE TRIG - FORMULA SHEET

DOMAINS AND RANGES


Function Domain Principal Value Range

sin<super>-1</super>(x) [-1, 1] [-pi/2, pi/2]

cos<super>-1</super>(x) [-1, 1] [0, pi]

tan<super>-1</super>(x) R (all reals) (-pi/2, pi/2)

cot<super>-1</super>(x) R (all reals) (0, pi)

sec<super>-1</super>(x) R - (-1,1) [0, pi] - {pi/2}

cosec<super>-1</super>(x) R - (-1,1) [-pi/2, pi/2] - {0}

SPECIAL VALUES
Value sin<super>-1</super> cos<super>-1</super> tan<super>-1</super>

0 0 pi/2 0

1/2 pi/6 pi/3 pi/6

1/sqrt2 pi/4 pi/4 pi/4

sqrt3/2 pi/3 pi/6 pi/3

1 pi/2 0 --

-1 -pi/2 pi --

IDENTITIES (MEMORISE THESE)


Complementary pairs: sin-1x + cos-1x = pi/2 (|x| <= 1)

Complementary pairs: tan-1x + cot-1x = pi/2 (all x)

Complementary pairs: sec-1x + cosec-1x = pi/2 (|x| >= 1)

Negative argument: sin-1(-x) = -sin-1(x) [odd function]

Negative argument: cos-1(-x) = pi - cos-1(x)

Negative argument: tan-1(-x) = -tan-1(x) [odd function]


Reciprocal: sin-1(1/x) = cosec-1(x), |x| >= 1

Reciprocal: cos-1(1/x) = sec-1(x), |x| >= 1

Reciprocal: tan-1(1/x) = cot-1(x), x > 0

Addition: tan-1x + tan-1y = tan-1[(x+y)/(1-xy)], xy < 1

Addition: tan-1x + tan-1y = pi + tan-1[(x+y)/(1-xy)], xy > 1, x > 0

Subtraction: tan-1x - tan-1y = tan-1[(x-y)/(1+xy)], xy > -1

Double: 2tan-1x = sin-1[2x/(1+x2)] = cos-1[(1-x2)/(1+x2)] = tan-1[2x/(1-x2)]

sin-1 and cos-1: sin-1x + sin-1y = sin-1[x*sqrt(1-y2) + y*sqrt(1-x2)]


SECTION 2: MATRICES - PROPERTIES AND THEOREMS

TYPES OF MATRICES
• Row matrix: single row (1 x n). Column matrix: single column (n x 1).
• Square matrix: m = n. Diagonal matrix: all off-diagonal elements are zero.
• Scalar matrix: diagonal matrix with all diagonal elements equal.
• Identity matrix (I): diagonal with all 1s. A.I = I.A = A.
• Zero/Null matrix (O): all elements zero. A + O = A.
• Symmetric matrix: A^T = A (a_ij = a_ji).
• Skew-symmetric matrix: A^T = -A (a_ij = -a_ji; diagonal elements = 0).
• Every square matrix = symmetric + skew-symmetric: A = (A+A^T)/2 + (A-A^T)/2

KEY PROPERTIES
• Addition: commutative (A+B = B+A) and associative ((A+B)+C = A+(B+C)).
• Multiplication: NOT commutative (AB not equal to BA in general). IS associative: (AB)C = A(BC).
• Distributive: A(B+C) = AB + AC.
• Transpose: (A^T)^T = A. (A+B)^T = A^T + B^T. (AB)^T = B^T * A^T (reversal law).
• Transpose of product reversal: (ABC)^T = C^T * B^T * A^T.
• If A is symmetric, A^T = A. If skew-symmetric, A^T = -A, and all diagonal = 0.
• Inverse: A*A^-1 = A^-1*A = I. Exists only if det(A) not equal to 0 (non-singular).
• (AB)^-1 = B^-1 * A^-1 (reversal law for inverse).
• For 2x2 matrix A = [[a,b],[c,d]]: A^-1 = (1/det(A)) * [[d,-b],[-c,a]]
• Number of elements in m x n matrix = m*n.
• Multiplication condition: A(m x p) * B(p x n) = AB(m x n). Inner dimensions must match.

SECTION 3: DETERMINANTS - PROPERTIES AND THEOREMS

PROPERTIES OF DETERMINANTS
• Property 1: |A| = |A^T| (value unchanged by transposing).
• Property 2: Interchange of two rows/columns changes sign of determinant.
• Property 3: If any two rows (or columns) are identical, |A| = 0.
• Property 4: Multiplying a row/column by scalar k multiplies determinant by k. (NOT the whole matrix).
• Property 5: If each element of a row/column is 0, |A| = 0.
• Property 6: Sum property: if one row is sum of two rows, det splits into sum of two dets.
• Property 7: Adding multiple of one row to another does NOT change the determinant (R_i --> R_i + kR_j).
• Key result: |kA| = k^n |A| for n x n matrix A.
• |AB| = |A| * |B| (product rule for determinants).
• If |A| = 0, matrix A is singular and has no inverse.
• Cofactor expansion along any row or column gives the same value.

AREA OF TRIANGLE AND APPLICATIONS


• Area of triangle with vertices (x1,y1),(x2,y2),(x3,y3): Delta = (1/2)|x1(y2-y3) + x2(y3-y1) + x3(y1-y2)|
• Using determinant: Delta = (1/2) * |det of [[x1,y1,1],[x2,y2,1],[x3,y3,1]]|
• If area = 0, points are collinear.
• For collinearity condition, set determinant = 0.
• Cramer's Rule: For system Ax = b, x_i = det(A_i)/det(A) where A_i is A with i-th column replaced by b.
• If det(A) = 0: system either has no solution (inconsistent) or infinite solutions.
• Adjoint: adj(A) = transpose of cofactor matrix.
• Inverse: A^-1 = adj(A)/|A| (valid only if |A| not equal to 0).
• A * adj(A) = adj(A) * A = |A| * I (important theorem).
SECTION 4: HIGH-YIELD QUESTIONS WITH SOLUTIONS

Q1 [*****] Inverse Trig Simplification


Q: Prove: tan-1(1/5) + tan-1(1/7) + tan-1(1/3) + tan-1(1/8) = pi/4

Solution:
• Use tan-1x + tan-1y = tan-1[(x+y)/(1-xy)] when xy < 1
• Step 1: tan-1(1/5) + tan-1(1/7):
• xy = (1/5)(1/7) = 1/35 < 1, so use formula.
• = tan-1[(1/5 + 1/7)/(1 - 1/35)] = tan-1[(12/35)/(34/35)] = tan-1(12/34) = tan-1(6/17)
• Step 2: tan-1(1/3) + tan-1(1/8):
• = tan-1[(1/3+1/8)/(1-1/24)] = tan-1[(11/24)/(23/24)] = tan-1(11/23)
• Step 3: tan-1(6/17) + tan-1(11/23):
• = tan-1[(6/17+11/23)/(1 - 66/391)] = tan-1[(138+187)/(391-66)] = tan-1(325/325) = tan-1(1) = pi/4

Q2 [*****] Matrix Equation


Q: If A = [[1,2],[3,4]], find A2 - 5A + 4I.

Solution:
• A^2 = [[1,2],[3,4]] * [[1,2],[3,4]] = [[1+6, 2+8],[3+12, 6+16]] = [[7,10],[15,22]]
• 5A = [[5,10],[15,20]]
• 4I = [[4,0],[0,4]]
• A^2 - 5A + 4I = [[7,10],[15,22]] - [[5,10],[15,20]] + [[4,0],[0,4]]
• = [[7-5+4, 10-10+0],[15-15+0, 22-20+4]] = [[6,0],[0,6]] = 6I

Q3 [*****] Prove using Determinant Properties


Q: Using properties, prove: det[[a+b+2c, a, b],[c, b+c+2a, b],[c, a, c+a+2b]] = 2(a+b+c)3

Solution:
• Apply C1 --> C1 + C2 + C3 (add all columns to C1).
• New C1: each element becomes (a+b+2c+a+b) = (2a+2b+2c) = 2(a+b+c)
• Take 2(a+b+c) common from C1.
• Now C1 = [1, 1, 1]^T.
• Apply R1 --> R1 - R2, R2 --> R2 - R3.
• This creates zeros to simplify further.
• Expand; result = 2(a+b+c)^3. (Show each step; exact expansion required in exam.)

Q4 [*****] Find Inverse of 2x2 Matrix


Q: Find inverse of A = [[2,1],[5,3]]

Solution:
• det(A) = 2*3 - 1*5 = 6 - 5 = 1
• Since det(A) = 1 (not 0), inverse exists.
• For [[a,b],[c,d]], inverse = (1/det) * [[d,-b],[-c,a]]
• A^-1 = (1/1) * [[3,-1],[-5,2]] = [[3,-1],[-5,2]]
• Verify: A * A^-1 = [[2,1],[5,3]] * [[3,-1],[-5,2]] = [[6-5,-2+2],[15-15,-5+6]] = [[1,0],[0,1]] = I

Q5 [****] Inverse Trig - Principal Value


Q: Find the principal value of cos-1(cos(7pi/6))

Solution:
• 7pi/6 is NOT in the range [0, pi] of cos-1.
• cos(7pi/6) = cos(pi + pi/6) = -cos(pi/6) = -sqrt3/2
• cos-1(-sqrt3/2) = pi - pi/6 = 5pi/6
• (Because cos-1(-x) = pi - cos-1(x))
• Answer: 5pi/6

Q6 [****] System of Equations using Matrices


Q: Solve: x + y + z = 6, x + 2z = 7, 3x + y + z = 12 using inverse

Solution:
• Write as AX = B: A = [[1,1,1],[1,0,2],[3,1,1]], X = [x,y,z]^T, B = [6,7,12]^T
• Find det(A): expand along R1: 1*(0-2) - 1*(1-6) + 1*(1-0) = -2+5+1 = 4
• Find adj(A) (cofactor matrix, then transpose).
• A^-1 = adj(A)/4
• X = A^-1 * B. After calculation: x = 3, y = 1, z = 2

SECTION 5: SHORTCUTS AND TRICKS


• For tan-1 addition: ALWAYS check xy vs 1 first. If xy > 1, add pi to result.
• sin-1x + cos-1x = pi/2: use this to convert one to the other instantly.
• Determinant property shortcut: if elements of two rows are proportional, det = 0.
• For 3x3 determinant, use R1 --> R1 - R2, R2 --> R2 - R3 to create zeros before expanding.
• A^2 computation: use A^2 = A*A. Do NOT square individual elements.
• For symmetric matrix problems: A^T = A. For skew-symmetric: A^T = -A (diagonal elements must be 0).
• tan-1(tan(x)) = x ONLY if x is in (-pi/2, pi/2). Otherwise, adjust.
• For proving det = 0 when rows are related: express one row as linear combination of others.
• Adjoint of 2x2: swap diagonal, negate off-diagonal. Memorise this.
• 2tan-1x = sin-1(2x/(1+x^2)) is frequently used in MCQs - memorise.

SECTION 6: COMMON MISTAKES (MATHS)


• sin-1(sin(x)) is NOT always x. It equals x only if x in [-pi/2, pi/2].
• cos-1(cos(x)) is NOT always x. It equals x only if x in [0, pi].
• Matrix multiplication: AB is NOT equal to BA. Always maintain order.
• Determinant: |kA| = k^n |A| for n x n matrix. NOT k|A|.
• Inverse: (AB)^-1 = B^-1 A^-1 (reversed order). Students write A^-1 B^-1.
• Transpose: (AB)^T = B^T A^T (reversed). Students write A^T B^T.
• tan-1 addition formula: forgetting to add pi when xy > 1 and x > 0.
• For collinearity: area = 0, so determinant = 0 (not area = 1/2 det).
• Identity matrix multiplication: AI = IA = A, not A^2.
• Skew-symmetric diagonal elements: ALL diagonal elements must be 0 (since a_ii = -a_ii implies a_ii = 0).
SECTION 7: RAPID REVISION SUMMARY (MATHS)

INVERSE TRIG
• Principal value ranges: sin-1: [-pi/2,pi/2]; cos-1: [0,pi]; tan-1: (-pi/2,pi/2)
• Complementary: sin-1x + cos-1x = pi/2; tan-1x + cot-1x = pi/2
• Negative: sin-1(-x) = -sin-1(x); cos-1(-x) = pi - cos-1(x)
• tan-1x + tan-1y: formula. Check xy vs 1 first!
• 2tan-1x = sin-1(2x/(1+x^2)) = cos-1((1-x^2)/(1+x^2))

MATRICES
• Symmetric: A^T = A. Skew-symmetric: A^T = -A (diagonal = 0 always).
• Transpose reversal: (AB)^T = B^T A^T. Inverse reversal: (AB)^-1 = B^-1 A^-1.
• Multiplication: inner dimensions must match. Result is outer dimensions.
• 2x2 inverse: swap diagonal, negate off-diagonal, divide by det.

DETERMINANTS
• Interchange 2 rows/cols: sign changes. Identical rows: det = 0. Add multiple of row to row: det unchanged.
• |kA| = k^n |A|. |AB| = |A||B|. |A^T| = |A|.
• A * adj(A) = |A| * I. A^-1 = adj(A)/|A| (only if |A| not 0).
• Area of triangle = (1/2)|det|. Collinear if det = 0.
SUBJECT 4: ENGLISH
Flamingo: The Last Lesson | My Mother at Sixty-six | Vistas: The Third Level | Writing Skills

SECTION 1: THE LAST LESSON (Alphonse Daudet)

ABOUT THE LESSON


Author: Alphonse Daudet. Setting: Alsace, France (a small district school). Period: After Franco-Prussian War
(1870-71). The Germans have taken over Alsace-Lorraine and issued an order: only German to be taught in
schools, not French.

CHARACTER ANALYSIS
Franz:
The narrator. A young boy who has been neglectful of his studies, always late and unprepared. Hates school and
French lessons. On the day of the last French lesson, he undergoes a change of heart. He realises the value of his
mother tongue only when it is about to be taken away. He represents all those who take their language for granted.

M. Hamel:
The French teacher who has taught for 40 years. On the day of the last lesson, he dresses in his formal Sunday
best (green coat, frilled shirt, embroidered black silk cap). He is gentle and patient, unusually so. He blames
himself and the parents for not insisting on education. His farewell shows his deep love for France. When he
cannot speak at the end, he writes 'Vive La France!' on the board - a powerful, emotional gesture.

The Villagers:
Old Hauser and other old men sit at the back of the class on the last day, a sign of respect and regret. They
symbolise collective grief and remorse for not valuing French education earlier.

THEMES
• Patriotism and love for one's mother tongue: the central theme. Language is tied to identity and national pride.
• Regret and awakening: Franz (and the villagers) realise the importance of education and language only when
it is lost.
• The power of language: M. Hamel says 'French is the most beautiful language in the world... as long as we
hold fast to our language we have the key to our prison.'
• Colonialism and cultural suppression: The Prussians' order is a form of cultural imperialism.
• Responsibility and guilt: M. Hamel blames himself for sometimes letting students water his flowers instead of
studying. Parents blamed for sending children to work early.

KEY QUOTES (WORTH MEMORISING)


• "What a thunderclap these words were to me!" - Franz on hearing it is the last French lesson.
• "Ah, how well I remember everything about that last lesson!" - Shows transformation of Franz.
• "French is the most beautiful language in the world... and we must guard it among ourselves and never forget
it, because when a people are enslaved, as long as they hold fast to their language it is as if they had the key to
their prison."
• "He was so gentle and... not a bit of temper." - Franz on M. Hamel behaving differently.
• He turned to the board, took a piece of chalk, and wrote as large as he could: "Vive La France!" - The powerful
ending.
IMPORTANT EXTRACT-BASED AND SHORT QUESTIONS
Q: Why was Franz afraid of being scolded that day?

Franz had not learned his lesson on participles and had been wandering around instead of going to school
early. He expected a scolding from M. Hamel.

Q: Why did M. Hamel wear his formal Sunday clothes on the last day?

M. Hamel wore his Sunday best (green coat, frilled shirt, embroidered silk cap) to show respect for the
occasion — it was his last French lesson after 40 years of teaching, a solemn and significant moment for him.

Q: What did M. Hamel say about the French language?

M. Hamel called French the most beautiful, clearest, and most logical language in the world. He urged
students to guard it, saying that language is the key to freedom for an enslaved people.

Q: Who were sitting at the back benches in the last lesson and why?

The old villagers like old Hauser, former mayor, postmaster, and others were sitting at the back. They came as
a mark of respect to the teacher and to express regret that they had not attended the school more when they
had the chance.

Q: How did M. Hamel's behaviour change from usual on the last day?

Usually M. Hamel scolded latecomers. On the last day, he was unusually gentle and patient. He gave Franz
full marks for his late arrival and explained everything patiently without anger, knowing it was his final day.

Q: What did M. Hamel say about neglect of education?

M. Hamel blamed himself, the parents, and the students for putting off education. He said he had sometimes
let students water his flowers or given a holiday when he wanted to go fishing — this was a form of collective
neglect.
SECTION 2: MY MOTHER AT SIXTY-SIX (Kamala Das)

ABOUT THE POEM


Poet: Kamala Das (also known as Madhavikutty). A short, deeply personal poem about the poet's anxiety over her
ageing mother and the fear of separation by death. Written in free verse with a single sentence structure (no full
stop until the end, stream of consciousness).

THEMES
• Fear of loss / separation: The central emotion. The poet is afraid her mother may not live much longer.
• Old age and decay: The mother's pale, 'corpse-like' face symbolises the approach of death.
• Love and attachment: Despite the painful fear, there is deep love and the poet cannot bring herself to speak
the fear aloud.
• Youth vs Age: Contrast between the sprinting trees/children (symbolising youth and energy) and the mother
(ageing and still).
• Denial and hope: At the end, the poet smiles and says 'see you soon, Amma' — an act of hope against fear.

LITERARY DEVICES
• Simile: 'her face ashen like that of a corpse' - comparing mother's face to a corpse.
• Simile: 'pale as a late winter's moon' - winter moon is pale, dim, about to be lost.
• Symbolism: 'Young trees sprinting' = youth, energy, life. Contrast with mother.
• Symbolism: 'Merry children spilling out of their homes' = youthful energy.
• Free verse with enjambment (ideas flow across lines without stopping).
• Repetition / Stream of consciousness: the poem is one long sentence (no full stop inside).

IMPORTANT EXTRACT-BASED QUESTIONS


Q: What do 'the young trees sprinting' and 'merry children spilling out of their homes' symbolise?

They symbolise youth, energy, and vitality of life. They contrast sharply with the ageing mother who is still and
motionless, highlighting the gap between youth and old age.

Q: What poetic device is used in 'her face ashen like that of a corpse'?

Simile. The mother's pale, lifeless face is compared to a corpse, suggesting extreme old age and nearness to
death.

Q: Why does the poet smile and say 'See you soon, Amma'?

Despite the fear of losing her mother to old age and death, the poet does not verbalise her pain. The smile
and 'see you soon' is an act of hope, love, and a silent prayer — she holds back her anguish to avoid worrying
her mother.

Q: What is the 'pain' the poet has 'held within herself'?

The pain is the fear of separation from her mother forever, the realisation that her mother is old and may not
live much longer — the same childhood fear of losing her mother that has returned.
SECTION 3: THE THIRD LEVEL (Jack Finney) - VISTAS

ABOUT THE STORY


Author: Jack Finney. A science fiction / fantasy story about Charley, a 31-year-old New Yorker who claims to have
found a mysterious third level at Grand Central Station (which has only two levels in reality), which takes him back
to 1894.

CHARACTER ANALYSIS
Charley:
The narrator/protagonist. A middle-class man who is anxious and stressed about the modern world. His
psychiatrist says this is an 'escape mechanism.' He finds the third level at Grand Central Station and desperately
wants to go back to 1894's simpler, peaceful life. He starts collecting old stamps.

Louisa (Wife):
Charley's supportive and understanding wife, though she thinks he is imagining things. She indulges his
stamp-collecting hobby.

Sam Weiner (Friend):


A psychiatrist who calls the third level a 'waking-dream wish fulfilment' and an escape from the modern world's
stress. Ironically, he himself later disappears — a letter confirms he too found the third level and is in Galesburg,
1894.

THEMES
• Escapism: The desire to escape from the stress of the modern world. The third level is a metaphor for an
escape into the past.
• Reality vs Fantasy: Is the third level real or imagined? The story deliberately keeps this ambiguous. Sam's
letter tilts it toward 'real'.
• Insecurity of modern life: The modern world is described as full of war, insecurity, worry — the past (1894)
seems romantic, peaceful, and simple.
• Wish-fulfilment: Freudian idea that humans create alternate realities to cope with what they cannot have.

IMPORTANT QUESTIONS
Q: What does the psychiatrist say about Charley's experience of the third level?

Sam Weiner, the psychiatrist, says the third level is a waking-dream wish fulfilment — an escape mechanism
from the stress, insecurity, and anxiety of the modern world. He does not believe it is real and says Charley is
looking for a way back to simpler times.

Q: How does Charley know he was in 1894 on the third level?

He noticed the differences: the clothes (men in derby hats, side-whiskers; women in long skirts), the gas
lamps, wooden train coaches, newspapers dated 1894, and the President of the USA at the time being Grover
Cleveland.

Q: What is ironic about Sam's advice to Charley?

Sam calls the third level a 'fantasy' and an 'escape mechanism.' Ironically, the letter found in the first-day
cover of stamps confirms that Sam himself found the third level, went to Galesburg in 1894, and set up a hay,
feed, and grain business there, escaping the very modern world he defended.
Q: Why did Charley start collecting stamps?

When Charley tried to buy train tickets to Galesburg, he did not have old-style (pre-1894) currency. He began
collecting old stamps and currency as a way to eventually get enough money to go back through the third level
to 1894.

Q: Do you think the third level was real or a product of Charley's imagination? Justify.

The story deliberately blurs the line between reality and fantasy. While it could be a hallucination (escape
mechanism as Sam says), the letter found in a 1894 first-day cover written BY Sam (in old-fashioned
handwriting, on old paper) strongly suggests it is real. The author seems to lean toward the fantastic — the
third level exists as a metaphor for hope and the human desire to escape to a better time.
SECTION 4: NOTICE WRITING

FORMAT (FOLLOW EXACTLY)


NAME OF ORGANISATION / SCHOOL NOTICE Date: DD Month YYYY HEADING (IN BOLD/CAPS) Body:
Details in short, clear paragraphs. Include: What, When, Where, Who, How (5 Ws). Signature Name
Designation

RULES
• Word limit: 50 words (strictly). Do NOT exceed.
• Box the notice (draw a border around it in exams).
• Date is in the top-right or below heading.
• No personal pronouns (I, we) — use passive or third person.
• Heading must be underlined or bold.
• Issuing authority name and designation at the bottom.
• Language: formal, concise, direct.

MODEL NOTICE 1: Lost and Found


DELHI PUBLIC SCHOOL NOTICE 15 July 2024 LOST: SCHOOL ID CARD This is to inform all students that
a school ID card bearing the name Riya Sharma of Class X-B has been found near the library on 14 July
2024. The owner may collect it from the office by 20 July 2024 after proper identification. Priya Mehta Head
Girl

MODEL NOTICE 2: Annual Sports Day


ST. MARY'S SCHOOL NOTICE 10 August 2024 ANNUAL SPORTS DAY - REGISTRATION OPEN Students
interested in participating in the Annual Sports Day (to be held on 5 September 2024) are requested to
register their names with the sports teacher by 20 August 2024. Events: 100m, 400m, long jump, relay. Only
registered students will participate. Rahul Jain Sports Captain

MODEL NOTICE 3: Book Fair


KENDRIYA VIDYALAYA NO. 1 NOTICE 1 January 2025 INTER-SCHOOL BOOK FAIR An inter-school book
fair will be held in the school auditorium from 10-12 January 2025 between 9:00 AM and 4:00 PM. Students
from Classes VI to XII are encouraged to visit and purchase books at discounted rates. Entry is free. Mohan
Sharma Cultural Secretary
SECTION 5: JOB APPLICATION WRITING

FORMAT - JOB APPLICATION


Sender's Address Date The [Designation], [Organisation Name], [Address] Subject: Application for the Post of
[Designation] Sir/Madam, PARAGRAPH 1: How you learned of the vacancy and your interest. PARAGRAPH
2: Your qualifications and skills relevant to the post. PARAGRAPH 3: Request for interview; mention biodata
attached; availability. Yours faithfully, [Signature] [Full Name] Encl: Biodata

BIODATA FORMAT
BIODATA Name : [Full Name] Date of Birth : [DD/MM/YYYY] Father's Name : [Name] Address : [Full Address]
Contact : [Phone | Email] Educational Qualifications: Class X : [Board] - [Year] - [Percentage] Class XII :
[Board] - [Year] - [Percentage] Skills : [List relevant skills] Experience : [If any] References : [1-2 names with
designation]

RULES FOR JOB APPLICATION


• Formal tone. No colloquial language.
• Subject line must be clear and specific.
• Refer to the advertisement: 'With reference to your advertisement in [paper] dated...'
• Mention specific qualifications matching the job requirements.
• Always state: 'I am enclosing my biodata for your kind perusal.'
• End with: 'I shall be highly obliged if given an opportunity to present myself at an interview.'
• Sign off: 'Yours faithfully' (when recipient name is unknown); 'Yours sincerely' (when name is known).

MODEL JOB APPLICATION


12, Krishna Nagar, New Delhi - 110051 15 July 2024 The Principal, Delhi Public School, R.K. Puram, New
Delhi Subject: Application for the Post of Computer Science Teacher Sir/Madam, With reference to the
advertisement published in The Hindustan Times dated 10 July 2024, I wish to apply for the post of Computer
Science Teacher in your esteemed institution. I have recently cleared my Class XII CBSE board examinations
with 94% marks, with Computer Science as my main subject. I have proficiency in Python, Java, and web
development. I have also served as the Computer Club Secretary in my school, organising workshops and
competitions. I am enclosing my biodata for your kind perusal. I shall be highly obliged if given an opportunity
to present myself at an interview at a time convenient to you. Yours faithfully, [Signature] Arjun Sharma Encl:
Biodata

SECTION 6: RAPID REVISION SUMMARY (ENGLISH)

THE LAST LESSON


• Author: Alphonse Daudet. Setting: Alsace after Prussian takeover. Last French lesson ordered by Germans.
• Franz: lazy boy who transforms. M. Hamel: 40-year teacher. Ends by writing 'Vive La France!'
• Theme: Love for mother tongue; regret; colonialism; language = key to freedom (prison metaphor).
• M. Hamel's quote about French language being the most beautiful is a SURE quote question.

MY MOTHER AT SIXTY-SIX
• Poet: Kamala Das. Free verse. Theme: Fear of losing mother; old age; love.
• Similes: 'pale as late winter's moon'; 'ashen like a corpse'. Young trees = youth (contrast).
• Ending: Smile + 'see you soon, Amma' = hope against fear; pain held within.

THE THIRD LEVEL


• Author: Jack Finney. Charley finds 3rd level at Grand Central (only 2 exist) leading to 1894.
• Sam calls it 'waking-dream wish fulfilment' (escape mechanism). Ironically Sam himself escapes.
• Theme: Escapism; modern anxiety; reality vs fantasy; wish-fulfilment.
• Sam's letter confirms third level is 'real' — found in a first-day cover stamp.

WRITING SKILLS
• Notice: 50 words. Box it. Name of org, date, heading, body, sign. No I/we. Formal.
• Job Application: Sender's address, date, designation/org address, subject, 3 paragraphs, Yours faithfully,
Encl: Biodata.
• Biodata: Name, DOB, father's name, address, contact, qualifications, skills, references.
SUBJECT 5: COMPUTER SCIENCE (PYTHON)
Topics: Python Review (Class 11 concepts) | Text File Handling | Binary File Handling (Pickle)

SECTION 1: PYTHON SYNTAX CHEATSHEET (CLASS 11 REVIEW)

DATA TYPES AND OPERATORS


# Data types x = 10 # int y = 3.14 # float name = "Delhi" # str flag = True # bool lst =
[1,2,3] # list (mutable, ordered) tpl = (1,2,3) # tuple (immutable, ordered) dct = {"a":1}
# dict (key-value, mutable) st = {1,2,3} # set (unordered, no duplicates) # Type conversion
int("5") # 5 float("3.14") # 3.14 str(100) # "100" list((1,2,3)) # [1,2,3] # Arithmetic: +
- * / // % ** # Comparison: == != > < >= <= # Logical: and or not # Membership: in not in

STRINGS
s = "Hello World" [Link]() # "HELLO WORLD" [Link]() # "hello world" [Link]() # removes
leading/trailing spaces [Link](" ") # ["Hello", "World"] [Link]("H","J") # "Jello
World" [Link]("o") # 4 (first occurrence index) [Link]("l") # 3 len(s) # 11 s[0] # "H"
(indexing) s[0:5] # "Hello" (slicing) s[::-1] # reverse string "," .join(["a","b"]) # "a,b"
[Link]("He") # True [Link]("ld") # True [Link]() # True if all chars are
digits [Link]() # True if all chars are alphabets

LISTS
lst = [10, 20, 30, 40, 50] [Link](60) # [10,20,30,40,50,60] [Link](2, 25) # insert
25 at index 2 [Link](20) # removes first occurrence of 20 [Link]() # removes and
returns last element [Link](1) # removes and returns element at index 1 [Link]() # sorts
in place (ascending) [Link](reverse=True)# descending [Link]() # reverses in place
[Link](30) # returns index of 30 [Link](10) # count occurrences of 10 sorted(lst) #
returns new sorted list len(lst) # length lst[1:4] # slicing [20,30,40] lst + [70, 80] #
concatenation 10 in lst # True

DICTIONARIES
d = {"name":"Arjun", "age":17, "city":"Delhi"} d["name"] # "Arjun" [Link]("age") # 17 (no
error if key missing, returns None) [Link]() # dict_keys(["name","age","city"]) [Link]()
# dict_values(["Arjun",17,"Delhi"]) [Link]() # dict_items([("name","Arjun"),...])
d["phone"] = "9999" # add new key del d["city"] # delete key [Link]("age") # remove and
return value len(d) # number of key-value pairs "name" in d # True (checks keys)
[Link]({"age":18}) # update existing or add new # Loop through dictionary for key, value
in [Link](): print(key, ":", value)

FUNCTIONS
def greet(name, msg="Hello"): # default argument return f"{msg}, {name}!" greet("Arjun") #
"Hello, Arjun!" greet("Arjun", "Hi") # "Hi, Arjun!" # *args (variable positional
arguments) def total(*nums): return sum(nums) total(1,2,3,4) # 10 # **kwargs (variable
keyword arguments) def info(**details): for k,v in [Link](): print(k,v) # Lambda
(anonymous function) square = lambda x: x**2 square(5) # 25 # Global variable count = 0 def
increment(): global count count += 1
SECTION 2: TEXT FILE HANDLING - COMPLETE CHEATSHEET

OPENING FILES - MODES


Mode Description

'r' Read only (default). File must exist. Pointer at start.

'w' Write. Creates file if not exists. Overwrites existing content.

'a' Append. Creates file if not exists. Adds to end. Does not overwrite.

'r+' Read and write. File must exist.

'w+' Read and write. Overwrites. Creates if not exists.

'a+' Read and append. Creates if not exists.

ALL READ/WRITE OPERATIONS WITH EXAMPLES


# ■■■■■■■■■ WRITING ■■■■■■■■■ f = open("[Link]", "w") [Link]("Hello World\n") #
writes string (you must add newlines) [Link](["Line1\n", "Line2\n", "Line3\n"]) #
writes list of strings [Link]() # ■■■■■■■■■ READING (ALL METHODS) ■■■■■■■■■ f =
open("[Link]", "r") content = [Link]() # reads ENTIRE file as single string [Link]() f =
open("[Link]", "r") line = [Link]() # reads ONE line (including \n) [Link]() f =
open("[Link]", "r") lines = [Link]() # reads ALL lines, returns LIST of strings
[Link]() # ■■■■■■■■■ SEEK AND TELL ■■■■■■■■■ f = open("[Link]", "r")
print([Link]()) # current position of file pointer (0 at start) [Link](5) # read 5
characters print([Link]()) # now 5 [Link](0) # move pointer back to beginning [Link](0, 2)
# move to end of file [Link]() # ■■■■■■■■■ WITH STATEMENT (BEST PRACTICE) ■■■■■■■■■
with open("[Link]", "r") as f: content = [Link]() # File automatically closed after the
with block # ■■■■■■■■■ COUNT LINES / WORDS ■■■■■■■■■ with open("[Link]", "r") as f:
lines = [Link]() print("Lines:", len(lines)) with open("[Link]", "r") as f: content
= [Link]() words = [Link]() print("Words:", len(words))

MOST REPEATED PATTERNS IN EXAMS


# Pattern 1: Read file, count specific word def count_word(filename, word): count = 0 with
open(filename, "r") as f: content = [Link]() words = [Link]() for w in words: if
[Link]() == [Link](): count += 1 return count # Pattern 2: Read file, search for lines
containing a word def search_lines(filename, keyword): with open(filename, "r") as f:
lines = [Link]() for line in lines: if [Link]() in [Link](): print(line,
end="") # Pattern 3: Append student data to file def add_student(filename, name, marks):
with open(filename, "a") as f: [Link](f"{name},{marks}\n") # Pattern 4: Read CSV-like
file and process def read_students(filename): with open(filename, "r") as f: lines =
[Link]() for line in lines: data = [Link]().split(",") name = data[0] marks =
int(data[1]) print(f"{name}: {marks}")
SECTION 3: BINARY FILE HANDLING WITH PICKLE

WHAT IS PICKLE?
Pickle is Python's module for serialising (converting) Python objects to binary format (byte stream) so they can be
stored in files. This allows storing complex objects like lists, dictionaries, and class objects in files. Binary files store
data as bytes, not as text.

BINARY FILE MODES


# 'rb' - Read binary (file must exist) # 'wb' - Write binary (creates/overwrites) # 'ab' -
Append binary # 'rb+' - Read and write binary

COMPLETE PICKLE OPERATIONS


import pickle # ■■■■■■■■■ WRITE (dump) ■■■■■■■■■ data = [ {"name": "Arjun", "age": 17,
"marks": 95}, {"name": "Priya", "age": 16, "marks": 88}, {"name": "Rahul", "age": 17,
"marks": 72}, ] with open("[Link]", "wb") as f: [Link](data, f) # write entire
list at once print("Data written successfully") # ■■■■■■■■■ READ (load) ■■■■■■■■■ with
open("[Link]", "rb") as f: records = [Link](f) # read entire object
print(records) # ■■■■■■■■■ WRITE RECORDS ONE BY ONE ■■■■■■■■■ students = [ {"name":
"A", "rollno": 1}, {"name": "B", "rollno": 2}, ] with open("[Link]", "wb") as f: for
student in students: [Link](student, f) # dump each record separately # ■■■■■■■■■
READ RECORDS ONE BY ONE ■■■■■■■■■ with open("[Link]", "rb") as f: while True: try:
record = [Link](f) print(record) except EOFError: # IMPORTANT: handle end of file
break

MOST REPEATED PATTERNS (BINARY FILES)


import pickle # Pattern 1: Search record by key value def search_student(filename,
target_name): found = False with open(filename, "rb") as f: while True: try: record =
[Link](f) if record["name"].lower() == target_name.lower(): print(record) found =
True except EOFError: break if not found: print("Record not found") # Pattern 2: Display
all records def display_all(filename): with open(filename, "rb") as f: while True: try:
record = [Link](f) print(record) except EOFError: break # Pattern 3: Update a record
def update_marks(filename, target_name, new_marks): records = [] with open(filename, "rb")
as f: while True: try: [Link]([Link](f)) except EOFError: break for record in
records: if record["name"] == target_name: record["marks"] = new_marks with open(filename,
"wb") as f: for record in records: [Link](record, f) # Pattern 4: Delete a record def
delete_student(filename, target_name): records = [] with open(filename, "rb") as f: while
True: try: [Link]([Link](f)) except EOFError: break records = [r for r in
records if r["name"] != target_name] with open(filename, "wb") as f: for record in records:
[Link](record, f) print("Record deleted") # Pattern 5: Count records meeting
condition def count_above(filename, threshold): count = 0 with open(filename, "rb") as f:
while True: try: r = [Link](f) if r["marks"] >= threshold: count += 1 except EOFError:
break return count
SECTION 4: HIGH-YIELD PRACTICAL QUESTIONS

Q1 [*****] Write and Read Text File


Q: Write a Python program to write names and marks of 5 students to a text file, then read and display those with
marks above 75.

# WRITE with open("[Link]", "w") as f: n = int(input("Enter number of students: "))


for i in range(n): name = input("Name: ") marks = input("Marks: ") [Link](name + "," +
marks + "\n") # READ AND FILTER with open("[Link]", "r") as f: lines = [Link]()
print("Students scoring above 75:") for line in lines: data = [Link]().split(",") name
= data[0] marks = int(data[1]) if marks > 75: print(f"{name}: {marks}")

Q2 [*****] Binary File - Add and Display


Q: Create a binary file to store student records (name, rollno, marks) and write functions to add records and display
all.

import pickle def add_record(filename): record = { "name": input("Name: "), "rollno":


int(input("Roll No: ")), "marks": int(input("Marks: ")) } with open(filename, "ab") as f:
[Link](record, f) print("Record added.") def display_all(filename): try: with
open(filename, "rb") as f: while True: try: r = [Link](f) print(r) except EOFError:
break except FileNotFoundError: print("File not found.") # Usage
add_record("[Link]") display_all("[Link]")

Q3 [*****] Count words in file


Q: Write a program to count the number of words, lines, and characters in a text file.

def file_stats(filename): with open(filename, "r") as f: content = [Link]() lines =


[Link]("\n") words = [Link]() chars = len(content) print(f"Lines :
{len(lines)}") print(f"Words : {len(words)}") print(f"Characters: {chars}")
file_stats("[Link]")

Q4 [****] Search in Binary File


Q: Write a function to search for a student by name in a binary file and display their details.

import pickle def search_by_name(filename, target): found = False try: with open(filename,
"rb") as f: while True: try: record = [Link](f) if record["name"].lower() ==
[Link](): print("Record found:") for k, v in [Link](): print(f" {k}: {v}")
found = True except EOFError: break except FileNotFoundError: print("File does not
exist.") if not found: print(f"No record found for '{target}'.")
search_by_name("[Link]", "Arjun")

Q5 [****] Update Record in Binary File


Q: Write a function to update the marks of a student identified by roll number in a binary file.

import pickle def update_marks(filename, rollno, new_marks): records = [] try: with


open(filename, "rb") as f: while True: try: [Link]([Link](f)) except
EOFError: break except FileNotFoundError: print("File not found.") return updated = False
for r in records: if r["rollno"] == rollno: r["marks"] = new_marks updated = True if
updated: with open(filename, "wb") as f: for r in records: [Link](r, f) print("Marks
updated successfully.") else: print(f"Roll number {rollno} not found.")
update_marks("[Link]", 5, 92)

Q6 [****] Copy lines with keyword


Q: Read a text file and copy only those lines that contain the word 'Python' into a new file.

def copy_lines_with_keyword(source, dest, keyword): with open(source, "r") as f_in: lines


= f_in.readlines() matching = [line for line in lines if [Link]() in [Link]()]
with open(dest, "w") as f_out: f_out.writelines(matching) print(f"{len(matching)} line(s)
copied to {dest}") copy_lines_with_keyword("[Link]", "python_lines.txt", "Python")

SECTION 5: COMMON ERRORS IN FILE HANDLING


• Using 'r' mode when file does not exist: Gives FileNotFoundError. Always handle with try-except.
• Not closing the file: Use 'with' statement. It auto-closes. Forgetting close() can corrupt data.
• Missing EOFError handling in binary file read loop: The loop will crash at end of file. ALWAYS use try-except
EOFError.
• Using 'wb' (write binary) to add records: 'wb' OVERWRITES existing data. Use 'ab' to append.
• Not using strip() when reading lines: readline() includes '\n'. Always strip() before processing.
• Passing a list to write(): write() only accepts strings. Use writelines() for lists.
• Confusing read() and readlines(): read() returns one string; readlines() returns a list.
• Not importing pickle: Will get NameError. Always write 'import pickle' at the top.
• Using text mode ('r','w') for binary files: Binary files require 'rb','wb'. Using text mode will corrupt data.
• Forgetting to convert types: data read from text file is always string. Convert to int/float explicitly.
SECTION 6: RAPID REVISION SUMMARY (COMPUTER SCIENCE)

PYTHON REVIEW (CLASS 11)


• list: mutable, ordered. tuple: immutable, ordered. dict: key-value, mutable. set: unordered, unique.
• String methods: split(), join(), strip(), upper(), lower(), replace(), find(), count()
• List methods: append(), insert(), remove(), pop(), sort(), reverse(), index(), count()
• Functions: def, return, default args, *args, **kwargs, lambda. global keyword for global vars.

TEXT FILE HANDLING


• Modes: 'r'(read), 'w'(write/overwrite), 'a'(append), 'r+'/'w+'/'a+'(both).
• read(): full file as string. readline(): one line. readlines(): all lines as list.
• write(string): writes string. writelines(list): writes list of strings.
• seek(n): move pointer to position n. tell(): returns current position.
• ALWAYS use 'with open(...) as f:' -- auto-closes file.

BINARY FILE HANDLING (PICKLE)


• import pickle. Modes: 'rb' (read binary), 'wb' (write binary), 'ab' (append binary).
• [Link](obj, file): writes object. [Link](file): reads object.
• CRITICAL: Reading loop MUST handle EOFError with try-except to detect end of file.
• Update/delete pattern: read ALL records to list --> modify list --> write ALL back with 'wb'.
• Search pattern: open in 'rb', loop with try-except EOFError, check each record.

END OF STUDY GUIDE | Good luck with your Unit Test!


Physics | Chemistry | Mathematics | English | Computer Science

You might also like