Generate every permutation of the tail, then insert its missing head at every possible position. The helper preserves order among the elements already present:
sml
fun insertEverywhere x [] = [[x]]
  | insertEverywhere x (y :: ys) =
      (x :: y :: ys) ::
      List.map (fn zs => y :: zs) (insertEverywhere x ys);

fun permutations [] = [[]]
  | permutations (x :: xs) =
      List.concat
        (List.map (insertEverywhere x) (permutations xs));
The first helper result inserts before ; the mapped recursive results put back at the front and insert farther along. For a list of length , it yields exactly positions. The empty list has one permutation, itself, so the base result is [[]], not [].
For correctness, use structural induction. Any permutation of x :: xs has a unique position containing . Removing that position leaves a permutation of xs, supplied by the induction hypothesis; reinserting at its unique position reconstructs the required output. With distinct input elements, neither the tail permutation nor the insertion position can be duplicated, so each output occurs once. Consequently a length- input yields exactly permutations, in an unrestricted order. The explicit output is large; this is not a polynomial-time enumeration with respect to alone.
True in the intended comparison with traditional Unix protection mechanisms. Windows XP provides object-specific access control lists, subject tokens containing identities and privileges, and a security reference monitor. Rights can distinguish operations on files, registry keys, processes and other protected objects. Traditional Unix file permissions distinguish read, write and execute for owner, group and everyone else; unrestricted root authority also makes privilege separation coarse. The richer Windows XP mechanisms can express finer least-privilege policies. Cambridge's access-control notes describe this architectural contrast.
This is an architectural capability comparison, not a claim that every Windows XP installation resists attacks better than every Unix installation. More complex authorization is not itself a proof of security; configuration and implementation matter, and Unix variants can add access control lists and other protection mechanisms. Without specifying that traditional model, the blanket comparison is underspecified.
False as a general performance claim. A microkernel moves services into separate protection domains, which can require extra messages, scheduling and address-space transitions. A monolithic kernel can often call a service directly within its own privileged address space. The microkernel gains isolation and modularity, but these do not imply greater speed. Efficient implementations and particular workloads can change the comparison; the architecture alone gives no universal ordering.
True. In polled input-output, a processor reads device status and handles ready work without interrupt entry and return overhead. If an operation completes very quickly, or requests arrive continuously at a high rate, a short poll or a batch of polls can cost less than an interrupt for every event. Interrupt-driven input-output is usually better for long or infrequent waits because the processor can do unrelated work or sleep instead of busy waiting. The useful choice depends on the event rate and latency requirement.
False. An access matrix is an authorization table, not a numerical matrix representing a linear transformation. Its entries are sets of rights, such as permission to read or write an object. “Inverting” its organization means obtaining subject-oriented capability lists from object-oriented access control lists, or conversely, by enumerating and regrouping entries. Numerical floating-point matrix inversion has neither the relevant operations nor the relevant semantics, and many access tables are not even square.
False. The Windows XP Executive implements core object management, memory management, process management and input-output services in privileged mode, as part of the kernel image. User applications and environment subsystems invoke these services through controlled entry points; they do not turn the Executive into user-mode code. This distinction is explicit in Microsoft's description of the Executive layer.
Assume any of conditions (i)–(iii). The established reflexivity, symmetry and transitivity make an equivalence relation, and it contains both . If is any equivalence relation containing and , then , so transitivity of gives . Thus . This proves that is the unique smallest equivalence relation containing and . Conversely, condition (iv) explicitly makes an equivalence relation, so it has properties (i) and (ii). Together these implications prove all four conditions equivalent.
For the final integer example, let . If and , then is a sum of a multiple of and a multiple of , so . Conversely, if divides , Bezout identity provides integers with . Set . Then is divisible by and by , so . Therefore
Interchanging gives the other equality. The composite is thus exactly congruence modulo the greatest common divisor, an equivalence relation, and all four equivalent conditions hold.
The preceding proofs show that this inclusion forces both symmetry and transitivity of ; its reflexivity already follows from that of . It actually forces equality of the composites, not just a one-way inclusion:
This is the composition of commuting equivalence relations criterion. It remains to establish the asserted smallest-extension characterization, rather than merely to identify an equivalence relation.
If is transitive, then . Since , monotonicity of composition of relations gives
which is condition (iii).
Conversely, condition (iii), associativity of composition of relations, and the identities , give
For a direct chain description, start with . Replace its middle by using condition (iii), then use transitivity inside and to obtain . Hence is transitive. Conditions (ii) and (iii) are equivalent.
A binary relation is symmetric exactly when . By the reversed-chain identity, condition (i) therefore gives , in particular condition (iii). Conversely, if , reversing both sides gives . Thus condition (iii) gives equality and therefore symmetry. Conditions (i) and (iii) are equivalent.
Choose bit zero of each integer to represent the leftmost cell in its group of 32 columns. Then use a quotient to choose the word and a remainder to choose the bit:
java
static boolean getBit(int[][] board, int i, int j) {
    return ((board[i][j >>> 5] >>> (j & 31)) & 1) != 0;
}
For valid , j >>> 5 is and ranges from zero to 31. The bit mask j & 31 is the offset . The logical right bit shift brings the desired bit to position zero; the final mask selects only that bit. Even bit 31 of a negative stored word is extracted correctly, because >>> inserts zeros. A different convention, with the leftmost cell in the most significant bit, would instead shift by 31 - (j & 31) and must be used consistently.
A one-row in-place Life update needs only one saved row plus a few running sums. Before processing row , above[j] stores the old row , and all rows and below are still old. Let a column sum be the number of old live cells in that column in rows . The three adjacent column sums, minus the center, give the required neighbour count.
java
static int columnSum(boolean[][] board, boolean[] above,
                     int i, int j) {
    int total = above[j] ? 1 : 0;
    if (board[i][j]) total++;
    if (i + 1 < board.length && board[i + 1][j]) total++;
    return total;
}

static void stepInPlace(boolean[][] board) {
    int width = board[0].length;
    boolean[] above = new boolean[width];
    for (int i = 0; i < board.length; i++) {
        int left = 0;
        int middle = columnSum(board, above, i, 0);
        for (int j = 0; j < width; j++) {
            int right = j + 1 < width
                ? columnSum(board, above, i, j + 1) : 0;
            boolean oldCenter = board[i][j];
            int neighbours = left + middle + right
                - (oldCenter ? 1 : 0);
            boolean newCenter = neighbours == 3
                || (oldCenter && neighbours == 2);
            above[j] = oldCenter;
            board[i][j] = newCenter;
            left = middle;
            middle = right;
        }
    }
}
When column is processed, left and middle were computed before their cells were overwritten. right is computed now from untouched column , including its untouched above[j+1] entry. Thus all three sums describe old cells. Saving oldCenter into above[j] preserves the old current row for the next row's processing; no later computation in the current row rereads that changed entry, because its old contribution is already in the running sums. This proves the inner-loop invariant and then the row invariant by induction.
Initially above is all false, representing the dead exterior above the board. The missing left and right columns contribute zero; the bottom row omits any row below it. Hence all four boundaries follow the required convention. The update takes time and one -element auxiliary boolean vector, which is exactly a 1000-element vector for the requested board. It uses one board array throughout and does not silently keep a second board or two auxiliary rows.
Use disjoint Java arrays for the old and new generations:
java
static void step(boolean[][] old, boolean[][] next) {
    for (int i = 0; i < old.length; i++) {
        for (int j = 0; j < old[i].length; j++) {
            next[i][j] = nextCell(old, i, j);
        }
    }
}
Every decision reads only old, so all cells undergo the simultaneous Conway Game of Life transition. The second board must have the same dimensions and share no row arrays with the first. Afterwards swap their references for the following step.
Writing each new cell immediately into the input board would expose a mixture of old and new states to later neighbour counts. The result would depend on the traversal order and would no longer be the specified simultaneous automaton. For example, put the three live cells at on an otherwise dead board. The simultaneous result is the vertical triple . During a naive row-major overwrite, becomes live first. The next cell now sees that new cell as well as the old cells , so it is incorrectly born with three counted neighbours. This explicitly exhibits the mixture of generations. A second generation array, or explicit preservation of overwritten old information, is essential.
Count only the existing neighbours, excluding the center, then apply the Conway Game of Life transition:
java
static boolean nextCell(boolean[][] old, int i, int j) {
    int height = old.length;
    int width = old[0].length;
    int neighbours = 0;
    for (int di = -1; di <= 1; di++) {
        for (int dj = -1; dj <= 1; dj++) {
            if (di == 0 && dj == 0) continue;
            int r = i + di;
            int c = j + dj;
            if (r >= 0 && r < height && c >= 0 && c < width
                    && old[r][c]) {
                neighbours++;
            }
        }
    }
    return neighbours == 3 || (old[i][j] && neighbours == 2);
}
The short-circuit bounds test occurs before indexing a neighbour. Out-of-range cells therefore contribute zero, including at corners, and no opposite-edge wrapping occurs. The center is explicitly excluded. Birth requires three neighbours; survival requires two or three. The method accepts a nonempty rectangular board and a valid cell index and does not change the old Java array.
Allocate a rectangular Java array:
java
boolean[][] board = new boolean[1000][1000];
Java initializes every new boolean array element to false, so all cells are initially dead without a filling loop. This allocates a top-level array of row references and a distinct boolean array for every row.
For a nonnegative integer parameter , make both branches of a structural recursion execute:
sml
fun binaryWalk 0 = ()
  | binaryWalk n = (binaryWalk (n - 1); binaryWalk (n - 1));
The semicolon sequences two calls, so this is not a conditional choosing just one branch. The recursion tree has leaves and calls. Its time complexity satisfies , giving . Here is the parameter specified by the question, not its binary encoding length; only calls are simultaneously on the stack.
Traverse the whole original list once for each of its elements:
sml
fun scan [] = ()
  | scan (_ :: xs) = scan xs;

fun scanForEach [] whole = ()
  | scanForEach (_ :: rest) whole =
      (scan whole; scanForEach rest whole);

fun quadratic xs = scanForEach xs xs;
The outer structural recursion runs times, and each scan whole visits constructors. In the ordinary source-evaluation cost model, the time complexity is . This example counts executed traversals, without assuming an optimizing compiler that removes deliberately unused computations.

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