{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Example\n\nLet $n \\ge 1$.\nThe fence $Z_n$ is the [[partially ordered set|0QV2JS9RJ3]] on $x_1, \\ldots, x_n$ with these covering relations:\n$$x_1 \u003c x_2 \u003e x_3 \u003c x_4 \u003e \\cdots.$$\nThat is, $x_i \u003c x_{i+1}$ for odd $i$ and $x_i \u003e x_{i+1}$ for even $i$, with $1 \\le i \u003c n$.\nIt is also called a zigzag poset.\nIts Hasse diagram is a path that goes up and down in turn.\n\nA [[linear extension|W8DZ5KGGHN]] of $Z_n$ is a bijection $f \\colon \\set{x_1, \\ldots, x_n} \\to \\set{1, \\ldots, n}$ with $f(x_1) \u003c f(x_2) \u003e f(x_3) \u003c \\cdots$.\nSo the linear extensions of $Z_n$ correspond to the alternating permutations of $\\set{1, \\ldots, n}$, and their number is the Euler zigzag number $E_n$.\nCheck for $n = 3$: the poset $x_1 \u003c x_2 \u003e x_3$ has the two linear extensions $x_1, x_3, x_2$ and $x_3, x_1, x_2$, and $E_3 = 2$.\n\n## Remarks\n\nThe number of down-sets of $Z_n$ is the Fibonacci number $F_{n+2}$, with $F_1 = F_2 = 1$.\nFor $n = 3$ the down-sets are $\\varnothing$, $\\set{x_1}$, $\\set{x_3}$, $\\set{x_1, x_3}$ and $\\set{x_1, x_2, x_3}$, which makes $5 = F_5$.\nEvery fence has height at most $2$.\n\n## Explanations\n\n### L1 human\n\nA fence is a zigzag: up, down, up, down.\nPutting its elements in a row that respects the zigzag is the same as writing the numbers $1$ to $n$ so that they go up, down, up, down.\nThis links a simple poset with a classical counting problem.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "illustrates": [
      "W8DZ5KGGHN"
    ],
    "instance_of": [
      "0QV2JS9RJ3"
    ],
    "kind": "example",
    "msc": [
      "06A07",
      "05A05"
    ],
    "name": "Fence",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Fence_(mathematics)"
      }
    ],
    "tag": "8T9S6F9HRW",
    "uses": [
      "W8DZ5KGGHN"
    ]
  },
  "kind": "example",
  "link": "https://tamnd.github.io/math2/node/8T9S6F9HRW/",
  "links": [
    {
      "field": "instance_of",
      "target": "0QV2JS9RJ3"
    },
    {
      "field": "illustrates",
      "target": "W8DZ5KGGHN"
    },
    {
      "field": "uses",
      "target": "W8DZ5KGGHN"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/8T9S6F9HRW.md",
  "msc": [
    "06A07",
    "05A05"
  ],
  "name": "Fence",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/8T9/8T9S6F9HRW.md",
  "status": null,
  "tag": "8T9S6F9HRW",
  "uri": "m2://8T9S6F9HRW",
  "url": "https://tamnd.github.io/math2/wiki/fence/",
  "writing": {
    "tag": "8T9S6F9HRW",
    "kind": "example",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
