Concepts / Sequences of Training Examples

Sequences of Training Examples

Lowercase letters commonly denote scalars or abstract objects; boldface lowercase letters emphasize vectors.

  • Programming

A Symbol Is a Clue

Mathematical notation is a compact way to tell you what kind of object you are reading. Before manipulating a symbol, ask two questions: is it a single quantity or a collection, and does its typography signal a special structure? In this course, lowercase letters commonly identify scalars or abstract objects, boldface lowercase letters identify vectors, and uppercase letters identify matrices, sets, or sequences. These conventions reduce ambiguity, but surrounding context still determines the exact meaning.

Notation clueCommon interpretationWhat context must decide
Lowercase letterScalar or abstract objectWhether the symbol represents one quantity or another single object
Boldface lowercase letterVectorWhich vector and which components it contains
Uppercase letterMatrix, set, or sequenceWhich of these collection types is intended
interpret withinterpret withinterpret withlowercase letterscalar or abstract objectcontextdetermines exact meaningbold lowercaselettervectoruppercase lettermatrix, set, or sequence
How can notation suggest whether a symbol is a scalar, vector, matrix, set, or sequence?

Finding a Vector Element

A vector is a collection of elements. An indexed symbol such as x_i identifies one element of a vector. The letter x indicates the vector or object being discussed, while the index i identifies the particular position or element. Reading the index is therefore essential: it tells you which individual part of the vector the notation refers to.

Reading an Indexed Vector Element

Suppose a vector is written as v = (v_1, v_2, v_3). Which element is identified by v_2?

Read the base symbol: The symbol v identifies the vector being discussed.

Read the index: The index 2 identifies the second position in that vector.

Identify the element: The notation v_2 refers to the individual element in the second position.

v_2 identifies the second element of vector v.

containscontainscontainsidentifiesvvectorv_1position 1v_2position 2index 2selects position 2v_3position 3
Given a vector and an index, which specific element does the index refer to?

Reading the Training Sequence

The notation S = z_1, ..., z_m denotes a sequence of m examples. Each z_i represents an individual training example, and its index identifies that example's position in the sequence.

The notation contains two levels of organization. The uppercase S names the collection of training examples. Each lowercase indexed symbol, such as z_1 or z_m, names one example within that collection. The indices do more than count how many examples exist: they identify positions in the sequence.

hashashasidentifiesidentifiesidentifiesSsequence of examplesposition 1z_1z_1first exampleposition 2z_2z_2second exampleposition mz_mz_mexample at position m
How are individual training-example vectors arranged and connected to their positions in the sequence?

Sequence Versus Set

A sequence is not described only by which examples belong to it. Its notation also preserves positions: z_1 is at the first position, z_2 is at the second position, and so on. A set, by contrast, is described by membership. This is why the course uses the word sequence even when the shorthand name training set appears: the notation S = z_1, ..., z_m keeps track of positions rather than recording membership alone.

Why Order Matters in the Notation

Compare the sequence S = z_1, z_2, z_3 with the same examples considered only as a collection described by membership.

Read the sequence: The indices identify positions, so z_1 is first, z_2 is second, and z_3 is third.

Remove positional information: If the examples are treated only as a set, the description records which examples belong but does not use positions to distinguish their arrangement.

Interpret the course notation: The expression S = z_1, ..., z_m is called a training set informally, but its indexed notation describes a sequence of examples.

The sequence notation preserves the positions of examples; a membership-only set description does not.

position 1position 2position 3containscontainscontainssequencepositions preservedz_1first positionz_1memberz_2second positionsetmembership describedz_2memberz_3third positionz_3member
What changes when the same examples are arranged in a particular order instead of being treated as an unordered collection?

Reading Practice

MEDIUM

A notation uses a lowercase symbol x, a boldface lowercase symbol, and an uppercase symbol S. Explain the likely role of each symbol, then explain what z_4 identifies if S = z_1, ..., z_m.

Hints
  • Use typography as an initial clue.
  • Remember that uppercase letters can represent more than one kind of collection.
  • Read the index as a position in the sequence.

What do you think happens?

What does z_4 identify in the sequence S = z_1, ..., z_m?

Reveal answer

Answer: z_4 identifies the example at position 4 in the sequence.

The subscript identifies a position. The uppercase S names the sequence, while z_4 names the individual example occupying the fourth position.

  • Treating every uppercase symbol as a matrix

    Uppercase letters can denote matrices, sets, or sequences. The surrounding context determines which interpretation applies.

    Fix: Use capitalization as a clue, then inspect the notation and context before deciding what the symbol represents.

  • Reading z_i as the entire sequence

    The indexed symbol identifies one element or example, while S names the sequence of examples.

    Fix: Separate the collection symbol S from an individual indexed example such as z_i.

  • Ignoring the index in a training sequence

    The indices identify positions in the sequence.

    Fix: Read each index as positional information.

  • Assuming typography alone gives the complete meaning

    Uppercase letters may represent different collection types.

    Fix: Combine typography with the surrounding notation and explanation.

Final Checklist

  1. Lowercase letters commonly denote scalars or abstract objects.
  2. Boldface lowercase letters emphasize vectors.
  3. An indexed symbol such as x_i identifies an individual element of a vector or an individual example at a position.
  4. Uppercase letters can denote matrices, sets, or sequences, so context determines the exact meaning.
  5. S = z_1, ..., z_m describes a sequence of m training examples because the indices preserve their positions.

Key Takeaways

  • Typography gives an initial clue about the kind of mathematical object a symbol represents.
  • Lowercase letters commonly identify scalars or abstract objects, while boldface lowercase letters identify vectors.
  • An index identifies a particular element or position, as in x_i or z_i.
  • Uppercase notation can represent a matrix, set, or sequence, so context is necessary.
  • The notation S = z_1, ..., z_m preserves positions, which is why the examples are interpreted as a sequence rather than only as a set.