Computer Science formula solvers

Amdahl's Law (Speedup from Parallelisation)

S=1(1p)+pNS = \frac{1}{(1 - p) + \dfrac{p}{N}}

Computer ScienceSpeedup of a fixed workload on N processors when a fraction p of it can be parallelised. The serial remainder sets a hard ceiling no amount of hardware can pass.

Availability from MTBF and MTTR

A=MTBFMTBF+MTTRA = \frac{\mathit{MTBF}}{\mathit{MTBF} + \mathit{MTTR}}

Computer ScienceFraction of time a system is up: mean time between failures divided by the whole cycle of running plus repairing. This is where the marketing nines come from.

Average Memory Access Time (AMAT)

AMAT=th+mtp\mathit{AMAT} = t_h + m\,t_p

Computer ScienceWhat a memory reference costs on average once cache misses are counted: the hit time every access pays, plus the miss penalty paid on the fraction that miss. Stated in clock cycles.

Bandwidth-Delay Product

BDP=RRTT\mathit{BDP} = R\,\mathit{RTT}

Computer ScienceHow many bits are in flight on a link at any instant: the rate multiplied by the round-trip time. A sender whose window is smaller than this can never fill the pipe, however fast the link is.

Bit Rate from Baud Rate

R=BnR = B\,n

Computer ScienceBit rate from a symbol rate and the number of bits each symbol carries. Baud counts symbols per second; a 16-QAM symbol carries 4 bits, so 2400 baud is 9600 bits per second.

Compression Ratio

CR=SuSc\mathit{CR} = \frac{S_u}{S_c}

Computer ScienceHow many times smaller a file got: original size divided by compressed size. A ratio of 4 means the file shrank to a quarter, which is a 75% saving, not a 25% one.

Erlang B Blocking Probability

B=AN/N!k=0NAk/k!B = \frac{A^{N}/N!}{\displaystyle\sum_{k=0}^{N} A^{k}/k!}

Computer ScienceProbabilityFraction of calls turned away by N circuits carrying A erlangs of offered traffic, on the assumption that a blocked call simply goes away. The standard sizing tool for trunks, agents and connection pools.

File Transfer Time

t=SRt = \frac{S}{R}

Computer ScienceTime to move a file at a sustained throughput: size divided by rate. Enter the size in megabytes and the rate in megabytes per second, and the answer comes back in seconds.

Gustafson's Law (Scaled Speedup)

S=(1p)+pNS = (1 - p) + p\,N

Computer ScienceSpeedup when the problem grows to fill the machine rather than staying fixed: linear in the processor count, with no ceiling. Here p is the parallel share of the run time on the large machine.

Hamming Code Parity Bits

2rm+r+12^{r} \ge m + r + 1

Computer ScienceParity bits r needed to correct any single-bit error in m data bits. The r check bits must be able to name every bit position plus the no-error case, which is where the +1 comes from.

M/M/1 Average Number in System

L=λμλL = \frac{\lambda}{\mu - \lambda}

Computer ScienceProbabilityAverage number of jobs in a single-server queue, waiting plus in service. It rises gently until the server is about 70% busy and then goes vertical.

M/M/1 Average Time in System

W=1μλW = \frac{1}{\mu - \lambda}

Computer ScienceProbabilityAverage time a job spends in a single-server queue, from arrival to departure. It depends on the difference between the two rates, not on their ratio.

M/M/1 Queue Utilisation

ρ=λμ\rho = \frac{\lambda}{\mu}

Computer ScienceFraction of time a single server is busy: the arrival rate divided by the service rate. Below 1 the queue is stable; at 1 or above it grows without limit.

Nyquist Bit Rate (Noiseless Channel)

C=2Blog2MC = 2B\log_2 M

Computer ScienceMaximum bit rate through a perfectly noiseless channel of bandwidth B using M distinct signal levels. It is the theoretical best case, and noise is what stops you reaching it.

Nyquist Sampling Rate

fs=2fmaxf_s = 2 f_{max}

Computer ScienceMinimum sampling rate that captures a signal without aliasing: twice the highest frequency present. Sample any slower and the lost detail reappears as a false low-frequency tone.

Parallel System Reliability (Redundancy)

Rs=1(1R)nR_s = 1 - (1 - R)^{n}

Computer ScienceProbabilityReliability of n identical components when any single one is enough: the chance that they do not all fail together. Redundancy buys nines fast, provided the failures are genuinely independent.

Quantization Signal-to-Noise Ratio

SNR=6.02n+1.76\mathit{SNR} = 6.02n + 1.76

Computer ScienceBest signal-to-noise ratio in decibels an ideal n-bit converter can achieve on a full-scale sine wave. Every extra bit is worth almost exactly 6 dB.

Series System Reliability

Rs=RnR_s = R^{n}

Computer ScienceProbabilityReliability of n identical components that must all work: the individual reliability raised to the nth power. Every dependency you add makes the whole thing worse, never better.

Shannon Entropy of a Binary Source

H=plog2p(1p)log2(1p)H = -p\log_2 p - (1 - p)\log_2(1 - p)

Computer ScienceProbabilityAverage information carried by each symbol of a two-outcome source, in bits. It peaks at exactly 1 bit for a fair coin and falls to zero as the outcome becomes certain.

Shannon-Hartley Channel Capacity

C=Blog2 ⁣(1+SN)C = B\log_2\!\left(1 + \frac{S}{N}\right)

Computer ScienceHighest error-free bit rate a channel of bandwidth B can carry at a given signal-to-noise power ratio. Bandwidth in hertz gives a capacity in bits per second.

Usable Hosts in an IPv4 Subnet

H=232p2H = 2^{32-p} - 2

Computer ScienceUsable host addresses in an IPv4 subnet with a prefix of p bits. Two addresses are subtracted because the all-zeros network address and the all-ones broadcast address cannot be assigned to a machine.