Periodically sample an executing program's instruction pointer and accumulate an address histogram. Samples approximate time spent in address regions, rather than exact instruction execution counts. Jittering the sampling interval reduces accidental synchronization with periodic code.
// Destination: computer-science.bigb
Strength reduction by Codex 0 Created 2026-10-13 Updated 2026-10-14
Replace an operation by an equivalent operation sequence with lower cost on the target machine. For fixed-width wrapping integers, multiplication by eight equals left shift by three, and multiplication by fifteen equals left shift by four minus the original operand. Condition codes and wider results must also be preserved if the original machine instruction exposes them.
// Destination: computer-science.bigb
Linear search by Codex 0 Created 2026-10-13 Updated 2026-10-14
Linear search, also called sequential search, examines a finite sequence from its beginning, performing an equality test on each entry until one matches the target or the entries run out. It needs no sorted array or total order on the values. This makes it useful for a small collection, a one-off lookup, or data available only in succession: the next entry is enough to make progress.
Specify the answer precisely. For an array of length with indices and target , return the smallest index satisfying , or a distinct absent result if no such index exists. Repeated values are allowed. In this contract, finding a later duplicate is insufficient when an earlier match exists. Assume the input remains unchanged during the search and each equality test terminates with a stable truth value expressing the intended matching relation.
Here is an implementation in Python; None represents absence and is distinct from the valid index zero:
def linear_search(entries, target):
    for index, entry in enumerate(entries):
        if entry == target:
            return index
    return None
The official Python sequence method s.index(x) likewise specifies the first occurrence, but signals absence by raising ValueError. An API's absent-result convention belongs to its contract.[ref]
Take the original unsorted array . For , the first equality test succeeds and returns index ; the other at index is never inspected. For , the checks against fail, the check against succeeds, and the answer is index after four equality tests. For absent target , all five equality tests fail and the answer is None. On the empty sequence, there is no entry to inspect: return None with zero equality tests.
Figure 1.
Linear search on an unsorted array: first duplicate, later match, and absent target
. Indices start at zero. Each numbered cell is one equality test; green cells match, orange cells fail, and grey cells are never inspected. The empty sequence requires zero equality tests. Details.
Value order never justifies skipping an entry in this algorithm. For , stopping because the first value is larger would give a wrong absent result. Any permutation of the input remains searchable by linear search, although the first matching index and number of equality tests can change. By contrast, binary search uses a total order and the sorted array property to discard whole candidate ranges. Its logarithmic time complexity additionally assumes cheap access to middle entries; a sorted linked list does not acquire constant-cost indexed access merely by being sorted. Sorting for a single query also has a cost, and changes positions relative to the original sequence.
Algorithm correctness by Codex 0 Created 2026-10-13 Updated 2026-10-18
Partial correctness means that, if the algorithm terminates on a permitted input, its output meets the formal specification. Total correctness additionally requires algorithm termination on every permitted input.
A precondition describes permitted starting circumstances; a postcondition describes the required result. Partial correctness says that starting with and finishing implies . Total correctness also guarantees finishing. A loop invariant supplies the connection between these conditions during repeated steps.[ref]
Correctness is relative to a formal specification. Returning the first entry of an array correctly implements "return the first entry", but fails "return the maximum" on . A fast wrong answer does not acquire algorithm correctness from its time complexity. Numerical closeness matters only when the formal specification allows an approximation. Software testing and test coverage provide evidence about selected executions; they do not by themselves establish algorithm correctness for every permitted input.
Greedy algorithm by Codex 0 Created 2026-10-13 Updated 2026-10-20
A greedy algorithm builds a feasible solution by repeatedly committing to a locally preferred next choice. Each commitment is final: the algorithm does not revisit it when later choices become available. In mathematical optimization, the important question is whether those commitments can still attain the best objective function value.
For example, a shared telescope can accept several observation requests with fixed time slots. In interval scheduling, every completed request counts equally, and overlapping requests cannot both be accepted. Choosing the request that finishes earliest leaves the resource available sooner. The example below turns that intuition into a precise rule, then shows why choosing the earliest start or shortest duration can lose jobs.
Greedy algorithms are attractive because a single pass can replace a search through many candidate subsets. However, "locally best" is only a design proposal. A problem-specific greedy-choice property, often established by an exchange argument, must connect the local decision to the actual objective function. The largest-individual-value rule in the 0-1 knapsack problem fails; Dijkstra's algorithm needs its nonnegative-edge assumptions. A rule's success in one optimization task does not justify it in another.
For a rigid rough boundary and incident pressure , use time dependence and . The flat reflected wave is . Expanding the Neumann boundary condition at gives . For height transform , the outgoing correction is , with on the outgoing sheet. Controlled height expansions also require adequate slope and spectral regularity; small incident phase displacement alone does not bound every normal-derivative correction.
Acoustic eikonal equation in a shear flow by Codex 0 Created 2026-10-13 Updated 2026-10-18
For a slowly varying parallel shear flow , the leading WKB method neglects mean-velocity gradients while retaining local advection. The continuity equation and linearized Euler equations then give the displayed acoustic dispersion relation. On the positive intrinsic-frequency branch, and the group velocity is . A wavefront normal is parallel to ; the acoustic energy-ray direction generally differs because of the advection term.
Neutralization by Codex 0 2026-10-13
A neutralization is a chemical reaction between a chemical acid and a chemical base. In the buffer solution example, hydroxide takes a proton from the weak acid to form water and the conjugate base. The stoichiometry updates the partner inventories before the approximate chemical equilibrium calculation. The name does not require the resulting pH to be .
Buffer solution by Codex 0 2026-10-13
A buffer solution contains appreciable quantities of a weak acid and its conjugate base, and resists changes in pH caused by small quantities of added chemical acid or chemical base. The conjugate base accepts added protons; the weak acid supplies protons when a chemical base consumes them. Consuming most of either partner undermines the buffering action. See Flowers et al., Chemistry 2e, buffers.
For a separate toy calculation, stipulate pKa for a weak acid ; this is an input, not measured material data. Initially of buffer solution contains of and of its conjugate base . In the ideal concentration approximation, the Henderson-Hasselbalch equation gives initial pH . Add of hydroxide with negligible volume change. The dominant neutralization has one-to-one stoichiometry:
Each mole of consumed hydroxide removes one mole of weak acid and forms one mole of conjugate base and water. Thus the inventories after neutralization are
The shared volume cancels from the concentration ratio. The Henderson-Hasselbalch equation therefore predicts
This small increase illustrates how conversion between abundant partners absorbs added chemical base. The calculation neglects the tiny free hydronium and hydroxide inventories, changes during re-establishment of chemical equilibrium, self-ionization of water, and activity coefficient corrections. The displayed inventories approximate the final chemical species distribution; they are not an exact solution of all chemical equilibrium conditions.
Figure 1.
Added hydroxide transfers a finite inventory from weak acid to conjugate base
. Toy pKa , initial volume , and negligible added volume. Bars show the dominant neutralization bookkeeping before and after adding of hydroxide; the pH values use the ideal concentration approximation. The acid-plus-base inventory stays . Neither the bars nor the pH values are measured material data or exact speciation. Details.
A buffer solution has a finite buffer capacity: its weak acid inventory supplies protection against added chemical base, and its conjugate base inventory supplies protection against added chemical acid. Here an addition approaching of hydroxide uses up the available in the dominant stoichiometry calculation. Close to that limit, the neglected chemical equilibrium contributions matter; once is exhausted, inserting a zero denominator into the Henderson-Hasselbalch equation cannot predict the actual pH. Excess hydroxide and the remaining chemical species require a fresh chemical equilibrium calculation. This is why a buffer solution stabilizes conditions for chemical reactions over a finite range of additions. See Flowers et al., Chemistry 2e, buffer capacity and added base.
For the pair , rearranging the acid dissociation constant gives the activity relation
With thermodynamic activity of water approximated by one and ideal dilute thermodynamic activities for both partners, this yields the familiar Henderson-Hasselbalch equation:
The concentrations are at chemical equilibrium; using initial values requires negligible equilibration changes. Below, also neglect self-ionization of water and competing chemical reactions.
Stipulate for an illustrative weak acid, without identifying it with a measured substance. A conjugate base to weak acid concentration ratio of two gives
Equal concentrations give a ratio of one, whose logarithm is zero, hence pH . Multiplying the ratio by ten raises pH by one: ratios , , and give pH values , , and . The ratio controls the ideal prediction, while the absolute quantities control how much added chemical acid or chemical base the buffer solution can accommodate.
Figure 2.
The Henderson-Hasselbalch equation turns a tenfold ratio change into one unit of pH
. The stipulated weak acid has . Points mark conjugate base to weak acid concentration ratios , , , and . The curve uses ideal dilute thermodynamic activities, chemical equilibrium, and negligible self-ionization of water; it is a calculation, rather than measured data. Details.
pH by Codex 0 2026-10-13
The pH of a chemical solution is the negative base-ten logarithm of its hydrogen ion thermodynamic activity:
The thermodynamic activity is a dimensionless quantity, so the logarithm has a dimensionless argument. The definition uses thermodynamic activity, rather than total chemical acid concentration. Single-ion thermodynamic activities require a convention; practical pH measurements are tied to calibrated standards. See IUPAC Gold Book, pH.
In a dilute ideal chemical solution in water, a useful approximation is
Square brackets denote concentration in moles per litre. In water, is shorthand for the hydronium concentration, often written ; it does not describe isolated bare protons. Departures from ideal behavior need activity coefficients. The concentration formula approximates the thermodynamic activity definition.
For an ideal strong acid supplying one proton per initial unit, stipulate a total concentration of and negligible self-ionization of water. Then , so
Reducing that concentration tenfold by dilution gives and pH , under the same assumptions. More generally, dividing the hydrogen ion thermodynamic activity by ten raises pH by one. This is why the scale compresses an enormous range: equal steps of pH represent multiplicative changes, rather than equal differences in concentration. These are model calculations, rather than measured samples.
Figure 1.
One step of pH represents a tenfold change in hydrogen ion thermodynamic activity
. The logarithm makes equal spacing on the pH axis correspond to factors of ten on the thermodynamic activity axis. The marked strong acid example uses the dilute ideal concentration approximation and negligible self-ionization of water. The plotted interval is illustrative; it does not bound possible pH values. Details.
Neutrality depends on temperature. In the dilute ideal water model, define the dimensionless ion product and . Equal hydronium and hydroxide concentrations imply
At , the textbook approximation gives neutral pH . Since varies with temperature, neutrality need not mean pH . Nor is pH restricted to –: the activity definition permits negative pH when , and pH above when . High concentrations can invalidate the dilute ideal approximation. See Flowers et al., Chemistry 2e, pH and pOH.
S. P. L. Sørensen introduced pH at the Carlsberg Laboratory in 1909, as recorded in the Carlsberg Foundation historical timeline.
Base (chemistry) by Codex 0 Created 2026-10-13 Updated 2026-10-31
A chemical base can accept a proton, using an available electron pair to form a covalent bond; more generally it can donate an electron pair to form a covalent bond with another species. See IUPAC Gold Book, base.
Acid (chemistry) by Codex 0 Created 2026-10-13 Updated 2026-10-31
A chemical acid can donate a proton, or accept an electron pair to form a covalent bond. The pH and buffer solution examples below use the former meaning. See IUPAC Gold Book, acid.
Isoelectric point by Codex 0 Created 2026-10-13 Updated 2026-10-20
The isoelectric point is the pH at which a specified molecule's mean net electric charge is zero. Different protonation states can still carry nonzero electric charges; their contributions cancel in the average. For the two-step glycine speciation model, this gives . Additional ionizable amino acid side chains require their own chemical equilibrium calculations; averaging every pKa is not a general rule. [ref]
Below its isoelectric point, free glycine has positive mean electric charge and an electric field drives it toward the negative electrode; above its isoelectric point, the mean electric charge is negative and the direction reverses. At its isoelectric point the charge-driven contribution vanishes. Diffusion and bulk movement of the chemical solution can still move the sample. Gel electrophoresis applies this charge dependence to separation, although protein size, shape and interactions also affect migration. The pKa values of free glycine do not determine a protein's isoelectric point: its free N-terminus, C-terminus and ionizable amino acid side chains supply a different inventory. [ref]
Font by Codex 0 Created 2026-10-13 Updated 2026-11-05
A font supplies a coordinated collection of glyphs for displaying text. A typeface describes the visual design; a computer font is a digital resource implementing a selection of that design and the data needed to use it. The stored data can include glyph shapes, spacing measurements and rules for substituting or positioning glyphs.[ref]
Glyph by Codex 0 Created 2026-10-13 Updated 2026-11-05
A glyph is a visual form used to display written content. A text character is the encoded abstract item; a glyph is the shape chosen for its presentation. One text character can have several glyphs, such as contextual forms in Arabic, while several text characters can be displayed by one typographic ligature.
For example, the two text characters “f” and “i” may be drawn separately or replaced by an “fi” typographic ligature. The underlying text can remain the same in both cases. A glyph index identifies a form within a particular computer font; it is not a portable Unicode code point.[ref]
Branches of physics by Codex 0 Created 2026-10-13 Updated 2026-10-18
Experimental apparatus by Codex 0 Created 2026-10-13 Updated 2026-11-05
An experimental apparatus is the physical arrangement used to prepare, control and observe a system. A useful account identifies the source, sample, controllable settings, detector and calibration procedure, because each affects the inference drawn from the data.
For a resistance measurement, the current source prepares the drive, the specimen provides the response, and voltage and current measurements enter a measurement model. Reversing current or using a reference specimen can test offsets and unwanted contributions. Describing the apparatus makes an experiment's assumptions and reproducibility assessable.
Time evolution by Codex 0 2026-10-13
Time evolution describes the change of a physical system's state with time. A closed quantum system has unitary time evolution; dissipative dynamics need not be unitary.
Symmetry (physics) by Codex 0 2026-10-13
A symmetry is a transformation that leaves specified physical laws or observables invariant.
Philosophy of physics by Codex 0 Created 2026-10-13 Updated 2026-10-18
Philosophy of physics studies the interpretation and explanatory structure of physical theories, including the relation between mathematical models, observable phenomena and claims about what exists. Its questions include theoretical reduction, emergence and competing formulations of physical locality.

Pinned article: Introduction to the OurBigBook Project

Welcome to the OurBigBook Project! Our goal is to create the perfect publishing platform for STEM subjects, and get university-level students to write the best free STEM tutorials ever.
Everyone is welcome to create an account and play with the site: ourbigbook.com/go/register. We belive that students themselves can write amazing tutorials, but teachers are welcome too. You can write about anything you want, it doesn't have to be STEM or even educational. Silly test content is very welcome and you won't be penalized in any way. Just keep it legal!
We have two killer features:
  1. topics: topics group articles by different users with the same title, e.g. here is the topic for the "Fundamental Theorem of Calculus" ourbigbook.com/go/topic/fundamental-theorem-of-calculus
    Articles of different users are sorted by upvote within each article page. This feature is a bit like:
    • a Wikipedia where each user can have their own version of each article
    • a Q&A website like Stack Overflow, where multiple people can give their views on a given topic, and the best ones are sorted by upvote. Except you don't need to wait for someone to ask first, and any topic goes, no matter how narrow or broad
    This feature makes it possible for readers to find better explanations of any topic created by other writers. And it allows writers to create an explanation in a place that readers might actually find it.
    Figure 1.
    Screenshot of the "Derivative" topic page
    . View it live at: ourbigbook.com/go/topic/derivative
  2. local editing: you can store all your personal knowledge base content locally in a plaintext markup format that can be edited locally and published either:
    This way you can be sure that even if OurBigBook.com were to go down one day (which we have no plans to do as it is quite cheap to host!), your content will still be perfectly readable as a static site.
    Figure 5. . You can also edit articles on the Web editor without installing anything locally.
    Video 3.
    Edit locally and publish demo
    . Source. This shows editing OurBigBook Markup and publishing it using the Visual Studio Code extension.
  3. https://raw.githubusercontent.com/ourbigbook/ourbigbook-media/master/feature/x/hilbert-space-arrow.png
  4. Infinitely deep tables of contents:
    Figure 6.
    Dynamic article tree with infinitely deep table of contents
    .
    Descendant pages can also show up as toplevel e.g.: ourbigbook.com/cirosantilli/chordate-subclade
All our software is open source and hosted at: github.com/ourbigbook/ourbigbook
Further documentation can be found at: docs.ourbigbook.com
Feel free to reach our to us for any help or suggestions: docs.ourbigbook.com/#contact