TamaraThe specification

TCS taxonomy v0.17

Riffle Shuffle

Experimental: structure may change in a subsequent edition. This page is pinned to v0.17.

Interleave two packets, each keeping its relative order

Source fragment

The following is documentation data, not a standalone document or validation schema. Resolve references against the original source schema.

{
  "id": "riffle-shuffle",
  "description": "Interleave two packets, each keeping its relative order",
  "labels": {
    "en": "Riffle Shuffle",
    "es": "Barajada Riffle",
    "fr": "Mélange Riffle",
    "de": "Riffle-Mischen"
  },
  "family_ref": "true-shuffles",
  "action_contract": {
    "parameters": {
      "cut_point": {
        "required": false,
        "description": "The size of the top portion interleaved; unspecified unions over every division",
        "domain": "integer >= 1",
        "default": "unspecified"
      },
      "cut_behaviour": {
        "required": false,
        "description": "How the split of the packet tends to fall when a person divides it by eye: natural (unimodal around the middle, thin tails) or uniform (every division equally likely). It states likelihood only and never narrows the divisions; with cut_point it records the realised division as a draw from that behaviour",
        "domain": [
          "natural",
          "uniform"
        ],
        "default": "unspecified"
      },
      "drop_model": {
        "required": false,
        "description": "How the two portions interleave: proportional (each card drops from a portion with probability proportional to that portion's remaining size, the Gilbert-Shannon-Reeds model of a real riffle) or coin (each card drops from either portion with equal probability until one is empty). It states likelihood only and never narrows the interleavings",
        "domain": [
          "proportional",
          "coin"
        ],
        "default": "unspecified"
      },
      "with": {
        "required": false,
        "description": "A second pile (a pile id) to interleave with the target instead of the target's own bottom portion: the target is the upper portion, this pile the lower. The target takes the interleaved cards and this pile is emptied (a packet disappears), as collect does. It fixes the division, so cut_point and cut_behaviour must be absent",
        "domain": "pile id",
        "default": "unspecified"
      },
      "repeat_count": {
        "required": false,
        "description": "How many times the whole shuffle is performed in succession, each pass on the result of the previous one (a count of passes, not of cards)",
        "domain": "integer >= 1",
        "default": 1
      }
    },
    "post_state_invariant": "target's top portion (cut_point cards, or an unstated size; with the with pile, the target itself) and bottom portion (with the with pile, that pile) interleave in arbitrary clumps; each portion keeps its own relative order. With a with pile the target ends up holding all the cards and the with pile is empty.",
    "post_state": {
      "state_schema_ref": "https://tamaraspec.org/schema/tcs-playing-cards-state-0.1.json",
      "effects": [
        {
          "op": "permute",
          "subject": "target",
          "permutation": "riffle",
          "args": {
            "cut_point": {
              "param": "cut_point"
            },
            "cut_behaviour": {
              "param": "cut_behaviour"
            },
            "drop_model": {
              "param": "drop_model"
            },
            "with": {
              "param": "with"
            },
            "repeat_count": {
              "param": "repeat_count"
            }
          }
        }
      ]
    }
  }
}

Verbatim JSON · Source: schemas/tcs-taxonomy-0.17.json/verbs/riffle-shuffle

See also