SysManLab/ cheatsheets L1 · Intern · 0 XP
Revision

Formula & fact sheets

The densest facts of every module, in one scroll. Exam: 100 questions, 90 minutes, +1 / −⅓. Print this page (⌘P) for a paper copy.

Module 1: Discrete Mathematics, Probability & Statistics12 marks

Conditional laws
p → q ≡ ¬p ∨ q ≡ ¬q → ¬p; ¬(p → q) ≡ p ∧ ¬q
De Morgan
¬(p ∧ q) ≡ ¬p ∨ ¬q; ¬(p ∨ q) ≡ ¬p ∧ ¬q (sets: (A ∪ B)′ = A′ ∩ B′)
Truth-table counts
n variables → 2ⁿ rows; 2^(2ⁿ) distinct truth functions (16 for n = 2)
Functionally complete
{↑}, {↓}, {¬, ∧}, {¬, ∨}, {¬, →}; not {∧, ∨}
Quantifier negation
¬∀x P(x) ≡ ∃x ¬P(x); ¬∃x P(x) ≡ ∀x ¬P(x)
Power set & products
|P(A)| = 2ⁿ; |A × B| = |A|·|B|; relations A → B: 2^(mn); on A: 2^(n²)
Relation counts (n elements)
reflexive 2^(n² − n); symmetric 2^(n(n+1)/2); antisymmetric 2ⁿ·3^(n(n−1)/2); equivalence = Bell Bₙ (1, 2, 5, 15, 52)
Partial order / lattice
reflexive + antisymmetric + transitive; in (ℤ⁺, |) lub = lcm, glb = gcd; Dₙ Boolean ⇔ n square-free
Inclusion–exclusion
|A ∪ B ∪ C| = Σ|A| − Σ|A ∩ B| + |A ∩ B ∩ C|; 1–100 divisible by 2, 3 or 5: 74
Derangements
Dₙ = n! Σ(−1)ᵏ/k! = (n − 1)(Dₙ₋₁ + Dₙ₋₂): 0, 1, 2, 9, 44, 265; Dₙ ≈ n!/e
Pigeonhole
N objects in k boxes → some box ≥ ⌈N/k⌉; to force r in a box: k(r − 1) + 1
Addition rule
P(A ∪ B) = P(A) + P(B) − P(A ∩ B); P(A′) = 1 − P(A)
Conditional & independence
P(A|B) = P(A ∩ B)/P(B); independent ⇔ P(A ∩ B) = P(A)P(B)
Bayes' theorem
P(Bᵢ|A) = P(Bᵢ)P(A|Bᵢ) / Σ P(Bⱼ)P(A|Bⱼ) (prior × likelihood ÷ total)
Binomial / Poisson
B(n, p): mean np, variance npq; Poisson(λ): mean = variance = λ
Expectation & variance
Var X = E(X²) − [E(X)]²; Var(aX + b) = a² Var X; fair die: 3.5, 35/12
Pearson's r
r = cov/(σxσy) = Σdxdy/√(Σdx²Σdy²); −1 ≤ r ≤ 1; unchanged by origin and scale (apart from sign)
Spearman's ρ
ρ = 1 − 6Σd²/(n(n² − 1)); ties: add m(m² − 1)/12 per tied group
Regression coefficients
byx = r·σy/σx; bxy = r·σx/σy; r = ±√(byx·bxy); both lines pass through (x̄, ȳ)
Least-squares line
Σy = na + bΣx; Σxy = aΣx + bΣx²; y = abˣ → log y = log a + x log b
Multiple correlation
R²₁.₂₃ = (r₁₂² + r₁₃² − 2r₁₂r₁₃r₂₃)/(1 − r₂₃²), 0 ≤ R ≤ 1
Partial correlation
r₁₂.₃ = (r₁₂ − r₁₃r₂₃)/√((1 − r₁₃²)(1 − r₂₃²))
Standard error of the mean
σ/√n; without replacement × √((N − n)/(N − 1)); Var(x̄) = σ²/n
Critical z values
two-tailed 1.96 (5%), 2.58 (1%); one-tailed 1.645 (5%), 2.33 (1%)
Type I / Type II error
Type I = reject a true H₀ (α); Type II = accept a false H₀ (β); power = 1 − β

Module 2: Digital Electronics, Computer Organization & Operating System14 marks

n-bit 2's complement range
−2ⁿ⁻¹ … +(2ⁿ⁻¹ − 1); 8-bit: −128 … +127
Signed overflow
V = Cₙ ⊕ Cₙ₋₁ (carry into MSB ≠ carry out of MSB)
BCD addition
digit sum > 9 or a carry out → add 0110 (6)
Binary → Gray
MSB copied, then Gᵢ = Bᵢ₊₁ ⊕ Bᵢ (G = B ⊕ (B >> 1))
IEEE 754 single precision
1 sign + 8 exponent (bias 127) + 23 fraction; value = (−1)ˢ × 1.f × 2^(e − 127)
Boolean functions of n variables
2^(2ⁿ) — 16 functions of 2 variables, 256 of 3
De Morgan & consensus
(AB)' = A' + B'; (A + B)' = A'B'; AB + A'C + BC = AB + A'C
Fan-out & noise margin
fan-out = min(IOL/IIL, IOH/IIH); NMH = VOH − VIH, NML = VIL − VOL
TTL vs CMOS
TTL: 5 V, fan-out 10, NM 0.4 V; CMOS: 3–15 V, fan-out ≈ 50, power ∝ f
Flip-flop characteristic equations
JK: Q⁺ = JQ' + K'Q; D: Q⁺ = D; T: Q⁺ = T ⊕ Q
Counters
mod-N needs ⌈log₂N⌉ FFs; ring = n states; Johnson = 2n states
8086 physical address
PA = segment × 10H + offset (20 bits → 1 MB); reset → FFFF0H
8086 interrupt vector table
256 types × 4 bytes at 00000H–003FFH; vector = type × 4
Pipeline time
k + (n − 1) cycles for n instructions on k stages; speed-up → k
Amdahl's law
Speed-up = 1 / ((1 − f) + f/s); limit 1 / (1 − f)
CPU time & MIPS
CPU time = IC × CPI ÷ f; MIPS = f ÷ (CPI × 10⁶)
Average memory access time
AMAT = hit time + miss rate × miss penalty; hierarchical Tc + (1 − h)Tm
Cache address split
offset = log₂(block size), index = log₂(lines or sets), tag = rest
Memory chips needed
(total words ÷ chip words) × (word width ÷ chip width)
DMA modes
burst = whole block; cycle stealing = one word; transparent = idle cycles
Turnaround / waiting / response
TAT = CT − AT; WT = TAT − BT; RT = first dispatch − AT
SJF burst prediction
τₙ₊₁ = α·tₙ + (1 − α)·τₙ (usually α = ½)
HRRN response ratio
(W + S) / S — W = time waited, S = service time
fork() count
n forks in sequence → 2ⁿ processes (2ⁿ − 1 children); fork returns 0 in the child
Semaphore value
final = initial − (number of P) + (number of V); a negative value = processes blocked
Coffman deadlock conditions
Mutual exclusion, hold and wait, no preemption, circular wait — all four together
Banker's algorithm
Need = Max − Allocation; grant only if Request ≤ Need, Request ≤ Available and the new state is safe
Deadlock-free resource count
R ≥ Σ(maxᵢ − 1) + 1; identical processes: R ≥ n(k − 1) + 1
Paging address split
page size 2ⁿ: offset = n bits, page number = m − n bits; table = pages × entry size (32-bit, 4 KB, 4 B → 4 MB)
Effective access time
TLB: h(t + m) + (1 − h)(t + 2m); demand paging: (1 − p)·ma + p·fault-service time
Belady's anomaly
FIFO, 1 2 3 4 1 2 5 1 2 3 4 5: 9 faults with 3 frames, 10 with 4; LRU and Optimal never
Inode maximum file size
(12 + n + n² + n³) × block size, n = block ÷ pointer size; 4 KB / 4 B → ≈ 4 TB
Disk access time
seek + rotational latency + transfer; average latency = ½ rotation = 30/RPM s (7200 RPM → 4.17 ms)
RAID usable capacity
RAID 0 = n · RAID 1 and 10 = n/2 · RAID 5 = n − 1 (1 failure) · RAID 6 = n − 2 (2 failures)
Real-time schedulability
RMS: U ≤ n(2^(1/n) − 1) → ln 2 ≈ 0.693; EDF: U ≤ 1
Clock synchronization
Cristian: T = Tserver + RTT/2; Lamport receive: C = max(C, t) + 1
MBR layout
512 B = 446 boot code + 64 partition table (4 × 16) + 2-byte signature 0x55AA
/etc/passwd fields
name:x:UID:GID:GECOS:home:shell — 7 fields; UID 0 = root; hashes in /etc/shadow
umask
file = 666 AND NOT umask, directory = 777 AND NOT umask; 022 → 644 / 755
crontab fields
minute hour day-of-month month day-of-week command

Module 3: Data Structures & Programming in C12 marks

Growth-rate order
1 < log n < √n < n < n log n < n² < n³ < 2ⁿ < n! < nⁿ
Master theorem
T(n) = aT(n/b) + f(n): compare f(n) with n^(log_b a); the larger wins, a tie adds a log factor
P, NP, NP-complete, NP-hard
P ⊆ NP · NP-complete = NP ∩ NP-hard · SAT first (Cook–Levin 1971) · any NP-complete problem in P ⇒ P = NP · halting problem: undecidable, NP-hard
Classic recurrences
T(n/2)+1 → log n · 2T(n/2)+n → n log n · T(n−1)+n → n² · 2T(n−1)+1 → 2ⁿ − 1 (Hanoi)
Searching costs
linear: average (n + 1)/2 · binary: at most ⌊log₂ n⌋ + 1 probes (1,000 → 10; 10⁶ → 20)
Array stack (top starts at −1)
empty: top == −1 · full: top == MAX − 1 · size = top + 1
Circular queue (front/rear = first/last)
full: (rear + 1) % MAX == front · count = (rear − front + MAX) % MAX + 1
Catalan number Cₙ
(2n)!/((n+1)!·n!) = 1, 2, 5, 14, 42, 132 — stack permutations, BSTs on n keys
Heap index arithmetic
0-based: parent ⌊(i−1)/2⌋, children 2i+1, 2i+2 · 1-based: parent ⌊i/2⌋, children 2i, 2i+1
Binary-heap costs
insert / delete-max O(log n) · find-max O(1) · build-heap O(n) · heap sort O(n log n)
Hashing load factor α = n/m
open addressing miss ≤ 1/(1 − α) probes · chaining hit ≈ 1 + α/2 · linear probing → primary clustering
Binary-tree counts
n₀ = n₂ + 1 · edges n − 1 · NULL links n + 1 · max nodes of height h (in edges) = 2ʰ⁺¹ − 1
AVL minimum nodes
N(h) = N(h−1) + N(h−2) + 1, height h in edges (N(0) = 1) → 1, 2, 4, 7, 12, 20, 33 · height ≈ 1.44 log₂ n
Graph edge counts
Kₙ has n(n − 1)/2 edges (directed n(n − 1)) · Σ deg(v) = 2|E| · tree has n − 1
BFS / DFS
queue / stack (recursion) · O(V + E) with adjacency lists, O(V²) with a matrix
Dijkstra
O(V²) array, O((V + E) log V) binary heap · fails with negative edges
Bellman–Ford · Floyd–Warshall
O(VE), V − 1 passes, detects negative cycles · O(V³), d[i][j] = min(d[i][j], d[i][k] + d[k][j])
Prim · Kruskal
O(V²) matrix or O(E log V) heap · O(E log E) = O(E log V) with union–find
Cayley's formula
Kₙ has nⁿ⁻² spanning trees (K₄ = 16, K₅ = 125); every spanning tree has V − 1 edges
Comparison-sort lower bound
⌈log₂ n!⌉ = Ω(n log n) · 3 keys → 3, 4 → 5, 5 → 7 comparisons
Stable vs unstable sorts
stable: bubble, insertion, merge, counting, radix · unstable: selection, quick, heap, Shell
C keywords
32 in ANSI C (C89) · 37 in C99 · 44 in C11 — all lowercase
Typical sizes (64-bit Linux)
char 1 · short 2 · int 4 · long 8 · long long 8 · float 4 · double 8 · any pointer 8 bytes (Turbo C: int and pointers 2)
n-bit integer range
signed −2ⁿ⁻¹ … 2ⁿ⁻¹ − 1 · unsigned 0 … 2ⁿ − 1 (16-bit int: −32,768 … 32,767)
Integer division (C99)
truncates toward zero; a % b takes the sign of a: −7 / 2 = −3, −7 % 2 = −1
Precedence, high → low
postfix → unary → multiplicative → additive → shift → relational → equality → & → ^ → | → && → || → ?: → assignment → comma (unary, ?: and assignment group right-to-left)
Sequence points
end of full expression (;) · after && || ?: and comma · before a function call — changing a variable twice between them is undefined
Storage classes
auto/register: stack, garbage, block scope · static local: 0, keeps value · static global: internal linkage · extern: declaration only
Tower of Hanoi
T(n) = 2T(n − 1) + 1 = 2ⁿ − 1 moves (3 discs → 7, 10 → 1,023)
Row-major address
&a[i][j] = B + (i × C + j) × w (0-based, C columns, w bytes per element)
sizeof vs strlen
char s[] = "abc": sizeof 4 (counts the '\0'), strlen 3 · a char pointer to "abc": sizeof 8 on 64-bit (the pointer itself)
strcmp(a, b)
< 0 if a sorts first · 0 if equal · > 0 if a sorts later — only the sign is guaranteed
Pointer arithmetic
p + n = address + n × (size of the pointed-to type) · q − p = elements between · a[i] ≡ i[a]
struct / union size
struct ≥ sum of members (padding to alignment) · union = largest member rounded up · enum starts at 0
malloc vs calloc
malloc(bytes): uninitialised · calloc(n, size): n × size bytes zeroed · realloc may move · all return NULL on failure
fopen modes
r: must exist · w: create or truncate · a: create, write at end · +: read and write · b: binary · failure → NULL
fseek origins
SEEK_SET 0 (start) · SEEK_CUR 1 (current) · SEEK_END 2 (end) · ftell = current offset · rewind = fseek(fp, 0, SEEK_SET)
Build stages
preprocess (gcc -E → .i) → compile (-S → .s) → assemble (-c → .o) → link (executable); macros expand before compilation

Module 4: Object Oriented Programming through C++ / Java12 marks

class vs struct (C++)
Default member access and default inheritance: class → private, struct → public
Operators C++ cannot overload
:: . .* ?: sizeof typeid — and = () [] -> must be member functions
Copy constructor
X(const X&) — runs for X b = a; pass by value; return by value (often elided)
Construction order
virtual bases → bases (base-list order) → members (declaration order) → body; destruction exactly reverse
Rule of Three / Five
Destructor + copy constructor + copy assignment (+ move constructor + move assignment)
Virtual dispatch
One vtable per class, one vptr per object; virtual void f() = 0; makes the class abstract
C++ access after inheritance
public: pub→pub, prot→prot · protected: both→prot · private: both→priv · base private never accessible
Java primitive sizes
byte 1 · short 2 · int 4 · long 8 · float 4 · double 8 · char 2 bytes · boolean JVM-defined
JDK ⊃ JRE ⊃ JVM
JDK = JRE + tools (javac, java, javadoc, jar, jdb, javap); JRE = JVM + class libraries
Class file
Magic number 0xCAFEBABE; major version = Java release + 44 (Java 8 → 52, Java 17 → 61)
Integer cache
valueOf / autoboxing reuse −128…127 → == true inside, false outside; compare with equals()
String family
String immutable · StringBuffer mutable + synchronized · StringBuilder mutable, unsynchronized; capacity 16, grows ×2 + 2
Java exception hierarchy
Throwable → Error | Exception; RuntimeException and Error are unchecked; IOException, SQLException … are checked
finally
Always runs, even after return; only System.exit() or a dying JVM skips it; a return in finally overrides
Thread states
NEW → RUNNABLE ⇄ BLOCKED / WAITING / TIMED_WAITING → TERMINATED
Thread priorities
MIN_PRIORITY 1 · NORM_PRIORITY 5 (default) · MAX_PRIORITY 10
wait / notify
Object methods; caller must own the monitor (else IllegalMonitorStateException); wait releases the lock, sleep keeps it
Vector / Stack
Vector default capacity 10 and doubles; Stack.search() is 1-based from the top, −1 if absent
StreamTokenizer ttype
TT_EOF −1 · TT_EOL '\n' · TT_NUMBER −2 (nval, a double) · TT_WORD −3 (sval)
Default layouts
FlowLayout: Panel, Applet, JPanel · BorderLayout: Window, Frame, Dialog, JFrame content pane
Listener method counts
ActionListener 1 · KeyListener 3 · MouseListener 5 · MouseMotionListener 2 · WindowListener 7
Applet life cycle
init (once) → start → paint … stop → destroy (once); repaint() → update() → paint()

Module 5: Database Management System12 marks

Three-schema architecture
External (many views) → conceptual (1) → internal (1); ext/conceptual mapping = logical independence, conceptual/internal = physical
Degree vs cardinality
Degree = number of attributes (columns); cardinality = number of tuples (rows)
Superkeys, one key of k attributes
2ⁿ⁻ᵏ (n = number of attributes)
Superkeys, two keys K₁, K₂
2ⁿ⁻|K₁| + 2ⁿ⁻|K₂| − 2ⁿ⁻|K₁∪K₂| — e.g. R(A,B,C,D), keys A and B → 8 + 8 − 4 = 12
Minimum tables (E-R)
M:N → 3; 1:N → 2; 1:1 total on both sides → 1; each multivalued attribute +1
Fundamental relational operators
σ π ρ ∪ − × (six); ∩, ⋈, ÷ are derived
Join sizes
|R × S| = |R|·|S|; 0 ≤ |R ⋈ S| ≤ |R|·|S|; non-null FK ⋈ its PK = |R| rows
Division
R ÷ S = πX(R) − πX((πX(R) × S) − R) — 'for all' queries
Armstrong's axioms
Reflexivity, Augmentation, Transitivity (sound and complete); derived: union, decomposition, pseudotransitivity
Candidate-key shortcut
Attributes on no right-hand side are in every key; X is a superkey ⇔ X⁺ = R
2NF / 3NF / BCNF tests
2NF: no partial dependency of a non-prime attribute; 3NF: X → A needs X superkey or A prime; BCNF: X must be a superkey
Lossless binary decomposition
R1 ∩ R2 → R1 or R1 ∩ R2 → R2 in F⁺ (for 4NF: R1 ∩ R2 →→ R1 − R2)
Normal-form chain
1NF ⊃ 2NF ⊃ 3NF ⊃ BCNF ⊃ 4NF ⊃ 5NF ⊃ DKNF; 4NF = BCNF + no non-trivial MVD
SQL logical order
FROM → WHERE → GROUP BY → HAVING → SELECT → DISTINCT → ORDER BY → LIMIT
COUNT and NULLs
COUNT(*) counts rows, COUNT(col) skips NULLs; over 0 rows COUNT = 0, SUM/AVG/MIN/MAX = NULL
ANY / ALL
> ALL = above the maximum; > ANY = above the minimum; IN ≡ = ANY; NOT IN ≡ <> ALL (fails if a NULL is present)
DELETE vs TRUNCATE vs DROP
DELETE: DML, WHERE, can roll back; TRUNCATE: DDL, all rows, fast; DROP: removes the table itself
ACID owners
Atomicity, Durability → recovery manager; Isolation → concurrency control; Consistency → programmer + constraints
Conflicting operations
Same item, different transactions, at least one write; acyclic precedence graph ⇔ conflict serializable
Number of schedules
(n₁ + n₂)! / (n₁!·n₂!) for two transactions; n! serial schedules for n transactions
Wait-die / wound-wait
Wait-die: older waits, younger dies. Wound-wait: older wounds (aborts) younger, younger waits
Timestamp ordering
read(Q) rejected if TS < W-TS(Q); write(Q) rejected if TS < R-TS(Q) or TS < W-TS(Q) (Thomas: ignore the latter)
Isolation levels
RU: dirty, non-repeatable, phantom; RC: non-repeatable, phantom; RR: phantom; SERIALIZABLE: none
Write-ahead logging
Log record on stable storage before the data page; deferred update = REDO only, immediate = UNDO + REDO
Blocking factor and B+ tree order
bfr = ⌊B/R⌋, blocks = ⌈r/bfr⌉; internal node p·P + (p−1)·K ≤ B; leaf q·(K+Pr) + P ≤ B

Module 6: Client Server Architectures & Web Programming12 marks

Three tiers
Presentation (client) → Application / business logic (middle tier, app server) → Data (DBMS)
2-tier vs 3-tier
2-tier: fat client sends SQL straight to the DB · 3-tier: thin client → app server (rules, pooling) → DB
Port numbers
HTTP 80 · HTTPS 443 · alternate HTTP/Tomcat 8080 · MySQL 3306 · SQL Server 1433 · Oracle 1521
HTTP status classes
1xx informational · 2xx success · 3xx redirection · 4xx client error · 5xx server error
Common status codes
200 OK · 201 Created · 204 No Content · 301/302 redirect · 304 Not Modified · 401 unauthenticated · 403 forbidden · 404 not found · 408 timeout · 500 · 503
Safe / idempotent methods
Safe: GET, HEAD, OPTIONS, TRACE · Idempotent: those plus PUT, DELETE · Neither: POST, PATCH
HTTP connection timing
Non-persistent serial: (n+1) × 2 RTT · persistent: 2 RTT + n × RTT · persistent pipelined: 3 RTT
Cookie attributes
Secure = HTTPS only · HttpOnly = hidden from JavaScript · SameSite = CSRF defence · no Expires/Max-Age = session cookie
XML predefined entities
&lt; &gt; &amp; &apos; &quot; — only < and & must always be escaped
DTD content models
? = 0 or 1 · * = 0 or more · + = 1 or more · no mark = exactly 1 · comma = sequence · | = choice
DOM vs SAX
DOM: whole tree in memory, random access, editable · SAX: event callbacks, streaming, low memory, read-only
CSS specificity
inline 1,0,0,0 > id 0,1,0,0 > class / attribute / pseudo-class 0,0,1,0 > element / pseudo-element 0,0,0,1; !important beats all
JavaScript typeof quirks
typeof null → "object" · typeof [] → "object" · typeof NaN → "number" · typeof a function → "function"
JavaScript falsy values
false, 0, -0, 0n, "" (empty string), null, undefined, NaN — everything else is truthy
VBScript essentials
Variant only · & concatenates · \ integer division · ByRef default · Dim a(4) = 5 elements · MsgBox returns vbYes 6 / vbNo 7
PHP essentials
session_start() → $_SESSION · cookie PHPSESSID · gc_maxlifetime 1440 s · include warns, require is fatal · prepared statements stop SQL injection
ASP.NET page events
PreInit → Init → InitComplete → PreLoad → Load → control events → LoadComplete → PreRender → PreRenderComplete → SaveStateComplete → Render → Unload
ASP.NET state
ViewState in __VIEWSTATE · Session modes InProc (default), StateServer, SQLServer, Custom, Off · timeout 20 min
XMLHttpRequest readyState
0 UNSENT · 1 OPENED · 2 HEADERS_RECEIVED · 3 LOADING · 4 DONE — success when 4 and status 200
SignalR
Transports WebSockets → Server-Sent Events → Long Polling · targets Clients.All / Caller / Others / Group / User
Servlet life cycle
load → init(config) once → service() per request (doGet/doPost) → destroy() once
JSP life cycle
translate → compile → load → jspInit() → _jspService() → jspDestroy()
forward vs sendRedirect
forward: server-side, 1 request, URL kept, attributes kept. sendRedirect: browser, 2 requests, URL changes
JSP include
<%@ include %> = translation time (static); <jsp:include> = request time (dynamic)
JSP scripting tags
<%! decl %> field; <% scriptlet %> in _jspService; <%= expr %> out.print; <%-- comment --%>
9 implicit objects
request, response, out, session, application, config, pageContext, page, exception (error pages only)
Session defaults
JSESSIONID cookie; web.xml timeout in minutes (30); setMaxInactiveInterval in seconds; encodeURL for rewriting
MVC Model 2
Servlet = controller, JavaBean = model, JSP (EL + JSTL) = view

Module 7: Computer Networks & Programming14 marks

OSI layers (bottom-up)
Physical, Data link, Network, Transport, Session, Presentation, Application — Please Do Not Throw Sausage Pizza Away
PDUs
bits → frame → packet → segment / user datagram → data
Nyquist (noiseless)
C = 2B log₂L bps
Shannon (noisy)
C = B log₂(1 + SNR); SNR_dB = 10 log₁₀ SNR (30 dB = 1000)
Baud vs bit rate
bit rate = baud × log₂L; Manchester baud = 2 × bit rate (worst case)
FDM / T1 / E1
FDM BW = n·B + (n − 1)·guard; T1 = 193 × 8000 = 1.544 Mbps; E1 = 256 × 8000 = 2.048 Mbps
Delays
Tt = L/R, Tp = d/v; P packets over k hops: (k + P − 1)·Tt + k·Tp
Link efficiency
stop-and-wait η = 1/(1 + 2a), a = Tp/Tt; sliding window η = min(1, W/(1 + 2a))
ARQ window limits
GBN: Ws ≤ 2ᵐ − 1, Wr = 1; Selective Repeat: Ws = Wr ≤ 2ᵐ⁻¹
Hamming code
2ʳ ≥ m + r + 1; parity at 1, 2, 4, 8…; detect d − 1, correct ⌊(d − 1)/2⌋ errors
CRC & bit stuffing
append r zeros (r = degree), divide mod 2; flag 01111110, stuff 0 after five 1s
ALOHA
pure S = G·e^(−2G), max 18.4% at G = 0.5; slotted S = G·e^(−G), max 36.8% at G = 1
CSMA/CD
Tfr ≥ 2Tp → Lmin = 2·Tp·R (10 Mbps: 512 bits = 64 B); BEB K ∈ 0…2^min(n,10) − 1, give up after 16 tries
Ethernet frame
preamble 7 + SFD 1 | DA 6 | SA 6 | type/len 2 | data 46–1500 | FCS 4 → 64–1518 bytes
IPv4 classes & private
A 0–127 /8, B 128–191 /16, C 192–223 /24, D 224–239, E 240–255; private 10/8, 172.16/12, 192.168/16
Subnet arithmetic
hosts = 2ʰ − 2; IHL × 4 bytes (20–60); fragment offset × 8 bytes
Routing protocols
RIP: UDP 520, hops ≤ 15 (16 = ∞), 30 s; OSPF: IP 89, cost, Dijkstra, area 0; BGP: TCP 179, path vector
Token bucket & TCP cwnd
burst S = C/(M − ρ); slow start ×2 per RTT up to ssthresh, then +1; on loss ssthresh = cwnd/2
TCP RTO (RFC 6298)
SRTT = ⅞SRTT + ⅛R; RTTVAR = ¾RTTVAR + ¼|SRTT − R|; RTO = SRTT + 4·RTTVAR
Well-known ports
20/21 FTP, 22 SSH, 23 Telnet, 25 SMTP, 53 DNS, 67/68 DHCP, 69 TFTP, 80 HTTP, 110 POP3, 143 IMAP, 161/162 SNMP, 443 HTTPS
RMI registry
rmiregistry, default port 1099; Naming.rebind(url, obj) / Naming.lookup(url)
RMI remote interface
extends java.rmi.Remote; every method throws RemoteException
RMI implementation
extends UnicastRemoteObject (or is exported with exportObject)
RMI layers
Stub → Remote Reference Layer → Transport (skeletons not needed since Java 2)
RMI parameter passing
Serializable objects by value (copied); remote objects by reference (stub)
RMI distributed GC
lease-based; default lease 600 000 ms (10 min), renewed at half-time
SOAP message
Envelope (mandatory) → Header (optional) → Body (mandatory) → Fault (inside Body)
SOAP transport
usually HTTP POST (also SMTP); XML payload; W3C standard
WSDL 1.1 → 2.0
portType → interface, port → endpoint; types, message, binding, service
UDDI
registry: white (business), yellow (category), green (technical) pages; tModels
SOA triangle
provider publishes → registry; requester finds → registry; requester binds → provider
REST
Roy Fielding, 2000: resources + URIs, HTTP verbs, stateless, usually JSON
TCP server calls
socket → bind → listen → accept → recv/send → close
TCP client calls
socket → connect → send/recv → close
Byte order
network order = big-endian; htons/htonl host→network, ntohs/ntohl back
UDP socket calls
socket(AF_INET, SOCK_DGRAM, 0) → [bind] → sendto / recvfrom → close (no listen/accept)
TELNET
TCP 23; NVT; IAC = 255, WILL 251 · WONT 252 · DO 253 · DONT 254
TFTP
UDP 69; RRQ 1 · WRQ 2 · DATA 3 · ACK 4 · ERROR 5; 512-byte blocks, short block ends
DNS transport
UDP 53 (classic 512-byte limit, EDNS(0) larger); TC = 1 → retry over TCP 53
Kerberos origin
MIT Project Athena; V4 late 1980s; V5 RFC 1510 (1993), RFC 4120 (2005)
KDC
Authentication Server (AS) + Ticket-Granting Server (TGS)
Message 1-2 (AS)
C→AS: IDc‖IDtgs‖TS1; AS→C: E(Kc,[Kc,tgs‖…‖Tickettgs]) — TGT
Message 3-4 (TGS)
C→TGS: IDv‖Tickettgs‖Authenticator; TGS→C: E(Kc,tgs,[Kc,v‖…‖Ticketv])
Message 5-6 (server)
C→V: Ticketv‖Authenticator; V→C: E(Kc,v,[TS+1]) for mutual auth
Ticket vs authenticator
Ticket: KDC-made, sealed with target's key, reusable. Authenticator: client-made, session key, one-time
Port; tools
UDP/TCP 88; kinit, klist, kdestroy; Windows AD default since Windows 2000
V4 lifetime; skew
8 bits × 5 min = 1275 min ≈ 21 h; typical clock skew 5 min (configurable); V4 realm keys N(N−1)/2

Module 8: Software Engineering12 marks

System design steps (Sommerville)
Partition requirements → identify sub-systems → assign requirements → specify functionality → define interfaces
V-model pairs
Requirements ↔ acceptance, system design ↔ system test, architectural design ↔ integration, module design ↔ unit
Spiral model (Boehm, 1986/88)
Risk-driven meta-model; each loop: objective setting → risk assessment & reduction → development & validation → planning
RUP phases
Inception → elaboration → construction → transition (milestones: LCO, LCA, IOC, product release)
Scrum 3-3-5
Product Owner, Scrum Master, Developers; product backlog, sprint backlog, increment; sprint, planning, daily scrum (15 min), review, retrospective
IEEE 830 SRS
1 Introduction, 2 Overall description, 3 Specific requirements; correct, unambiguous, complete, consistent, ranked, verifiable, modifiable, traceable
Function points
EI 3/4/6, EO 4/5/7, EQ 3/4/6, ILF 7/10/15, EIF 5/7/10; FP = UFP × (0.65 + 0.01 × ΣFᵢ), 14 GSCs rated 0–5
Basic COCOMO (Boehm, 1981)
E = a·KLOCᵇ PM, D = 2.5·Eᵈ months; organic 2.4/1.05/0.38, semi-detached 3.0/1.12/0.35, embedded 3.6/1.20/0.32
Intermediate COCOMO
E = a·KLOCᵇ × EAF (15 cost drivers); a = 3.2 / 3.0 / 2.8 with the same b (1.05 / 1.12 / 1.20)
Putnam (SLIM)
Effort K = Size³ ÷ (Cₖ³ × t_d⁴) — effort ∝ 1/t_d⁴, so schedule compression is costly
Payback and NPV
Payback = investment ÷ annual net benefit; NPV = Σ benefitₜ/(1 + i)ᵗ − investment (accept if > 0)
DFD rules
No store→store, entity→store or entity→entity flows; no black holes or miracles; levels must balance; context = level-0 DFD
UML 2.5
14 diagrams: 7 structural (class, object, component, deployment, package, composite structure, profile) + 7 behavioural
Coupling (best → worst)
Data, stamp, control, external, common, content
Cohesion (best → worst)
Functional, sequential, communicational, procedural, temporal, logical, coincidental
GoF design patterns
23 = 5 creational + 7 structural + 11 behavioural (Gamma, Helm, Johnson, Vlissides, 1994)
Rate-monotonic test
U = Σ Cᵢ/Tᵢ ≤ n(2^(1/n) − 1): 0.828 (n = 2), 0.780 (n = 3), → 0.693; EDF needs U ≤ 1
Reliability metrics
POFOD, ROCOF (≈ 1/MTTF), MTTF; A = MTTF ÷ (MTTF + MTTR); MTBF = MTTF + MTTR; 99.9% ≈ 8.76 h down a year
TMR reliability
R = 3R² − 2R³ with a perfect voter (R = 0.9 → 0.972); worse than one module if R < 0.5
Cyclomatic complexity (McCabe, 1976)
V(G) = E − N + 2P = predicate nodes + 1 = regions = number of basis paths
Boundary value analysis
n variables: normal 4n + 1, robust 6n + 1, worst-case 5ⁿ, robust worst-case 7ⁿ
Test metrics
DRE = E ÷ (E + D); defect density = defects ÷ KLOC; mutation score = killed ÷ (mutants − equivalent)
Maintenance types
Corrective (faults), adaptive (environment), perfective (new functions — largest share), preventive (future maintainability)
PERT & CPM
tₑ = (a + 4m + b)/6, σ = (b − a)/6, path variance = Σσ²; float = LS − ES; critical path = longest (zero float)
CMM levels
1 Initial, 2 Repeatable (CMMI: Managed), 3 Defined, 4 Managed (CMMI: Quantitatively Managed), 5 Optimizing