{
  "index": "2011-A-4",
  "type": "ALG",
  "tag": [
    "ALG",
    "NT"
  ],
  "difficulty": "",
  "question": "with integer entries such that every dot product of a row with itself is\neven, while every dot product of two different rows is odd?",
  "solution": "matrix, and let $A$ denote the $n\\times n$ matrix all of whose entries\nare $1$. If $n$ is odd, then the matrix $A-I$ satisfies the conditions of\nthe problem: the dot product of any row with itself is $n-1$, and the dot\nproduct of any two distinct rows is $n-2$.\n\nConversely, suppose $n$ is even, and suppose that the matrix $M$ satisfied\nthe conditions of the problem. Consider all matrices and vectors mod\n$2$. Since the dot product of a row with itself is equal mod $2$ to the\nsum of the entries of the row, we have $M v = 0$ where $v$ is the vector\n$(1,1,\\ldots,1)$, and so $M$ is singular. On the other hand, $M M^T =\nA-I$; since\n\\[\n(A-I)^2 = A^2-2A+I = (n-2)A+I = I,\n\\]\nwe have $(\\det M)^2 = \\det(A-I) = 1$ and $\\det M = 1$, contradicting the\nfact that $M$ is singular.",
  "vars": [
    "M",
    "v"
  ],
  "params": [
    "n",
    "A",
    "I"
  ],
  "sci_consts": [],
  "variants": {
    "descriptive_long": {
      "map": {
        "M": "targetmatrix",
        "v": "onesvector",
        "n": "matrixdim",
        "A": "onesmatrix",
        "I": "identity"
      },
      "question": "with integer entries such that every dot product of a row with itself is\neven, while every dot product of two different rows is odd?",
      "solution": "matrix, and let $onesmatrix$ denote the $matrixdim\\times matrixdim$ matrix all of whose entries\nare $1$. If $matrixdim$ is odd, then the matrix $onesmatrix-identity$ satisfies the conditions of\nthe problem: the dot product of any row with itself is $matrixdim-1$, and the dot\nproduct of any two distinct rows is $matrixdim-2$.\n\nConversely, suppose $matrixdim$ is even, and suppose that the matrix $targetmatrix$ satisfied\nthe conditions of the problem. Consider all matrices and vectors mod\n$2$. Since the dot product of a row with itself is equal mod $2$ to the\nsum of the entries of the row, we have $targetmatrix\\ onesvector = 0$ where $onesvector$ is the vector\n$(1,1,\\ldots,1)$, and so $targetmatrix$ is singular. On the other hand, $targetmatrix\\ targetmatrix^T =\nonesmatrix-identity$; since\n\\[\n(onesmatrix-identity)^2 = onesmatrix^2-2onesmatrix+identity = (matrixdim-2)onesmatrix+identity = identity,\n\\]\nwe have $(\\det targetmatrix)^2 = \\det(onesmatrix-identity) = 1$ and $\\det targetmatrix = 1$, contradicting the\nfact that $targetmatrix$ is singular."
    },
    "descriptive_long_confusing": {
      "map": {
        "M": "sailboat",
        "v": "teaspoon",
        "n": "hedgehog",
        "A": "lighthouse",
        "I": "strawberry"
      },
      "question": "with integer entries such that every dot product of a row with itself is\neven, while every dot product of two different rows is odd?",
      "solution": "matrix, and let $lighthouse$ denote the $hedgehog\\times hedgehog$ matrix all of whose entries\nare $1$. If $hedgehog$ is odd, then the matrix $lighthouse-strawberry$ satisfies the conditions of\nthe problem: the dot product of any row with itself is $hedgehog-1$, and the dot\nproduct of any two distinct rows is $hedgehog-2$.\n\nConversely, suppose $hedgehog$ is even, and suppose that the matrix $sailboat$ satisfied\nthe conditions of the problem. Consider all matrices and vectors mod\n$2$. Since the dot product of a row with itself is equal mod $2$ to the\nsum of the entries of the row, we have $sailboat teaspoon = 0$ where $teaspoon$ is the vector\n$(1,1,\\ldots,1)$, and so $sailboat$ is singular. On the other hand, $sailboat sailboat^T =\nlighthouse-strawberry$; since\n\\[\n(lighthouse-strawberry)^2 = lighthouse^2-2lighthouse+strawberry = (hedgehog-2)lighthouse+strawberry = strawberry,\n\\]\nwe have $(\\det sailboat)^2 = \\det(lighthouse-strawberry) = 1$ and $\\det sailboat = 1$, contradicting the\nfact that $sailboat$ is singular."
    },
    "descriptive_long_misleading": {
      "map": {
        "M": "voidscalar",
        "v": "novector",
        "n": "boundless",
        "A": "zeromatrix",
        "I": "nullmatrix"
      },
      "question": "with integer entries such that every dot product of a row with itself is\neven, while every dot product of two different rows is odd?",
      "solution": "matrix, and let $zeromatrix$ denote the $boundless\\times boundless$ matrix all of whose entries\nare $1$. If $boundless$ is odd, then the matrix $zeromatrix-nullmatrix$ satisfies the conditions of\nthe problem: the dot product of any row with itself is $boundless-1$, and the dot\nproduct of any two distinct rows is $boundless-2$.\n\nConversely, suppose $boundless$ is even, and suppose that the matrix $voidscalar$ satisfied\nthe conditions of the problem. Consider all matrices and vectors mod\n$2$. Since the dot product of a row with itself is equal mod $2$ to the\nsum of the entries of the row, we have $voidscalar novector = 0$ where $novector$ is the vector\n$(1,1,\\ldots,1)$, and so $voidscalar$ is singular. On the other hand, $voidscalar voidscalar^T =\nzeromatrix-nullmatrix$; since\n\\[\n(zeromatrix-nullmatrix)^2 = zeromatrix^2-2zeromatrix+nullmatrix = (boundless-2)zeromatrix+nullmatrix = nullmatrix,\n\\]\nwe have $(\\det voidscalar)^2 = \\det(zeromatrix-nullmatrix) = 1$ and $\\det voidscalar = 1$, contradicting the\nfact that $voidscalar$ is singular."
    },
    "garbled_string": {
      "map": {
        "M": "qzxwvtnp",
        "v": "hjgrksla",
        "n": "bxqmcade",
        "A": "plktsdru",
        "I": "mnvcherk"
      },
      "question": "with integer entries such that every dot product of a row with itself is\neven, while every dot product of two different rows is odd?",
      "solution": "matrix, and let $plktsdru$ denote the $bxqmcade\\times bxqmcade$ matrix all of whose entries\nare $1$. If $bxqmcade$ is odd, then the matrix $plktsdru-mnvcherk$ satisfies the conditions of\nthe problem: the dot product of any row with itself is $bxqmcade-1$, and the dot\nproduct of any two distinct rows is $bxqmcade-2$.\n\nConversely, suppose $bxqmcade$ is even, and suppose that the matrix $qzxwvtnp$ satisfied\nthe conditions of the problem. Consider all matrices and vectors mod\n$2$. Since the dot product of a row with itself is equal mod $2$ to the\nsum of the entries of the row, we have $qzxwvtnp hjgrksla = 0$ where $hjgrksla$ is the vector\n$(1,1,\\ldots,1)$, and so $qzxwvtnp$ is singular. On the other hand, $qzxwvtnp qzxwvtnp^T =\nplktsdru-mnvcherk$; since\n\\[\n(plktsdru-mnvcherk)^2 = plktsdru^2-2plktsdru+mnvcherk = (bxqmcade-2)plktsdru+mnvcherk = mnvcherk,\n\\]\nwe have $(\\det qzxwvtnp)^2 = \\det(plktsdru-mnvcherk) = 1$ and $\\det qzxwvtnp = 1$, contradicting the\nfact that $qzxwvtnp$ is singular."
    },
    "kernel_variant": {
      "question": "For which positive integers n does there exist an n × n matrix M with integer entries such that  \n\n1. every diagonal entry of the Gram matrix G := MMᵀ is congruent to 2 (mod 4), and  \n2. every off–diagonal entry of G is congruent to 1 (mod 4)?  \n\nProve your answer in full detail.\n\n──────────────────────────────────────────────",
      "solution": "Notation.  \nAll congruences are taken modulo the modulus that is explicitly written.  \nJ denotes the n × n all–ones matrix, I the n × n identity matrix.  \nThroughout A := M (mod 2) is the reduction of M to F₂, and its i-th row is written aᵢ.\n\nStep 1 – A parity obstruction rules out even n.  \nWorking in F₂ we have, from the hypotheses\n\n AAᵀ = J + I.            (1)\n\nLemma 1.  Over the field F₂,\n\n det(J + I) = 1 iff n is even, and det(J + I) = 0 iff n is odd.        (2)\n\nProof of the lemma.  \nThe matrix J has rank 1.  Over any field it has eigen-values 0 (multiplicity n–1) and n (multiplicity 1).  \nIn characteristic 2, n ≡ 0 (resp. 1) when n is even (resp. odd); hence the eigen-values of J + I are  \n\n 1 (with multiplicity n–1), and 1 + n = 1 (resp. 0) when n is even (resp. odd).\n\nTherefore det(J + I) = 1 when n is even and det(J + I) = 0 when n is odd. ∎\n\nReturn to the main argument.  \nIf n is even, (1) combined with (2) gives det(AAᵀ)=1 in F₂, so det A≠0 and A is invertible over F₂.  \n\nBut each aᵢ has even Hamming weight (since aᵢ·aᵢ=0), hence\n\n Au = 0, where u = (1,1,…,1)ᵗ ∈ F₂ⁿ.                               (3)\n\nEquation (3) exhibits the non-zero vector u in the kernel of the invertible matrix A—an impossibility.  \nThus no admissible matrix M exists when n is even.  Hence\n\n n must be odd.                                                     (4)\n\nStep 2 – Determinant of the model matrix Pₙ modulo 4.  \nLet Pₙ be the integer matrix whose diagonal entries are 2 and whose off-diagonal entries are 1.  \nEvery admissible Gram matrix G satisfies G ≡ Pₙ (mod 4); therefore\n\n det G ≡ det Pₙ (mod 4).                                          (5)\n\nA standard eigen-value computation gives\n\n det Pₙ = (2 − 1)^{n−1}(2 + (n−1)·1) = n + 1.                     (6)\n\nHence\n\n det G ≡ n + 1 (mod 4).                                           (7)\n\nStep 3 – Comparing with the fact that det G is a square.  \nBecause G = MMᵀ, det G = (det M)².  Squares of integers are 0 or 1 modulo 4, so\n\n (det M)² ≡ 0 or 1 (mod 4).                                       (8)\n\nCombining (7) and (8) and recalling that n is odd we have\n\n n + 1 ≡ 0 or 1 (mod 4)  \n   ⇔ n ≡ 3 (mod 4).                                             (9)\n\nThus an admissible n must satisfy n ≡ 3 (mod 4).\n\nStep 4 – Construction for n ≡ 3 (mod 4).  \nWrite n = 4k + 3 (k ≥ 0) and define the integer matrix\n\n M := 3I − J.                                                      (10)\n\nThen M is symmetric, its diagonal entries equal 2, its off-diagonal entries equal −1, and\n\n G := MMᵀ = M² = 9I − 6J + J² = 9I + (n − 6)J.                   (11)\n\nReduce the two possible values of the entries of G modulo 4:\n\n• Diagonal: 9 + (n − 6) ≡ (n + 3) = 4k + 6 ≡ 2 (mod 4);  \n• Off-diagonal: n − 6 = 4k − 3 ≡ 1 (mod 4).\n\nHence G meets the required residue pattern, so a matrix M exists for every n ≡ 3 (mod 4).\n\nStep 5 – Conclusion.  \nNecessity: Steps 1–3 show that an admissible n must satisfy n ≡ 3 (mod 4).  \nSufficiency: Step 4 provides an explicit construction when n ≡ 3 (mod 4).  \n\nTherefore\n\n There exists an n × n integer matrix M whose Gram matrix has all diagonal\n entries congruent to 2 (mod 4) and all off-diagonal entries congruent to 1 (mod 4)\n if and only if n ≡ 3 (mod 4). ∎\n\n──────────────────────────────────────────────",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T19:09:31.819218",
        "was_fixed": false,
        "difficulty_analysis": "• The original kernel variant involves only parity (mod 2); here all computations must be carried out modulo 4, doubling the arithmetic complexity.  \n• Determinant arguments now require distinguishing among three residue classes (0, 1, 2 mod 4) and analysing which can occur as squares, a step absent from the original solution.  \n• The proof must control the entire residue class of every admissible Gram matrix, not just a single example, and show that this class determines det G (mod 4).  \n• An explicit construction is considerably subtler: the naive choice A – I no longer works, so one must invent a different matrix (3I – J) and verify its properties.  \n• Altogether the solution combines modular arithmetic in two different moduli, determinants of rank-one perturbations, and constructive linear algebra, demanding substantially more technique than the original parity-based problem."
      }
    },
    "original_kernel_variant": {
      "question": "For which positive integers n does there exist an n × n matrix M with integer entries such that  \n\n1. every diagonal entry of the Gram matrix G := MMᵀ is congruent to 2 (mod 4), and  \n2. every off–diagonal entry of G is congruent to 1 (mod 4)?  \n\nProve your answer in full detail.\n\n──────────────────────────────────────────────",
      "solution": "Notation.  \nAll congruences are taken modulo the modulus that is explicitly written.  \nJ denotes the n × n all–ones matrix, I the n × n identity matrix.  \nThroughout A := M (mod 2) is the reduction of M to F₂, and its i-th row is written aᵢ.\n\nStep 1 – A parity obstruction rules out even n.  \nWorking in F₂ we have, from the hypotheses\n\n AAᵀ = J + I.            (1)\n\nLemma 1.  Over the field F₂,\n\n det(J + I) = 1 iff n is even, and det(J + I) = 0 iff n is odd.        (2)\n\nProof of the lemma.  \nThe matrix J has rank 1.  Over any field it has eigen-values 0 (multiplicity n–1) and n (multiplicity 1).  \nIn characteristic 2, n ≡ 0 (resp. 1) when n is even (resp. odd); hence the eigen-values of J + I are  \n\n 1 (with multiplicity n–1), and 1 + n = 1 (resp. 0) when n is even (resp. odd).\n\nTherefore det(J + I) = 1 when n is even and det(J + I) = 0 when n is odd. ∎\n\nReturn to the main argument.  \nIf n is even, (1) combined with (2) gives det(AAᵀ)=1 in F₂, so det A≠0 and A is invertible over F₂.  \n\nBut each aᵢ has even Hamming weight (since aᵢ·aᵢ=0), hence\n\n Au = 0, where u = (1,1,…,1)ᵗ ∈ F₂ⁿ.                               (3)\n\nEquation (3) exhibits the non-zero vector u in the kernel of the invertible matrix A—an impossibility.  \nThus no admissible matrix M exists when n is even.  Hence\n\n n must be odd.                                                     (4)\n\nStep 2 – Determinant of the model matrix Pₙ modulo 4.  \nLet Pₙ be the integer matrix whose diagonal entries are 2 and whose off-diagonal entries are 1.  \nEvery admissible Gram matrix G satisfies G ≡ Pₙ (mod 4); therefore\n\n det G ≡ det Pₙ (mod 4).                                          (5)\n\nA standard eigen-value computation gives\n\n det Pₙ = (2 − 1)^{n−1}(2 + (n−1)·1) = n + 1.                     (6)\n\nHence\n\n det G ≡ n + 1 (mod 4).                                           (7)\n\nStep 3 – Comparing with the fact that det G is a square.  \nBecause G = MMᵀ, det G = (det M)².  Squares of integers are 0 or 1 modulo 4, so\n\n (det M)² ≡ 0 or 1 (mod 4).                                       (8)\n\nCombining (7) and (8) and recalling that n is odd we have\n\n n + 1 ≡ 0 or 1 (mod 4)  \n   ⇔ n ≡ 3 (mod 4).                                             (9)\n\nThus an admissible n must satisfy n ≡ 3 (mod 4).\n\nStep 4 – Construction for n ≡ 3 (mod 4).  \nWrite n = 4k + 3 (k ≥ 0) and define the integer matrix\n\n M := 3I − J.                                                      (10)\n\nThen M is symmetric, its diagonal entries equal 2, its off-diagonal entries equal −1, and\n\n G := MMᵀ = M² = 9I − 6J + J² = 9I + (n − 6)J.                   (11)\n\nReduce the two possible values of the entries of G modulo 4:\n\n• Diagonal: 9 + (n − 6) ≡ (n + 3) = 4k + 6 ≡ 2 (mod 4);  \n• Off-diagonal: n − 6 = 4k − 3 ≡ 1 (mod 4).\n\nHence G meets the required residue pattern, so a matrix M exists for every n ≡ 3 (mod 4).\n\nStep 5 – Conclusion.  \nNecessity: Steps 1–3 show that an admissible n must satisfy n ≡ 3 (mod 4).  \nSufficiency: Step 4 provides an explicit construction when n ≡ 3 (mod 4).  \n\nTherefore\n\n There exists an n × n integer matrix M whose Gram matrix has all diagonal\n entries congruent to 2 (mod 4) and all off-diagonal entries congruent to 1 (mod 4)\n if and only if n ≡ 3 (mod 4). ∎\n\n──────────────────────────────────────────────",
      "metadata": {
        "replaced_from": "harder_variant",
        "replacement_date": "2025-07-14T01:37:45.626964",
        "was_fixed": false,
        "difficulty_analysis": "• The original kernel variant involves only parity (mod 2); here all computations must be carried out modulo 4, doubling the arithmetic complexity.  \n• Determinant arguments now require distinguishing among three residue classes (0, 1, 2 mod 4) and analysing which can occur as squares, a step absent from the original solution.  \n• The proof must control the entire residue class of every admissible Gram matrix, not just a single example, and show that this class determines det G (mod 4).  \n• An explicit construction is considerably subtler: the naive choice A – I no longer works, so one must invent a different matrix (3I – J) and verify its properties.  \n• Altogether the solution combines modular arithmetic in two different moduli, determinants of rank-one perturbations, and constructive linear algebra, demanding substantially more technique than the original parity-based problem."
      }
    }
  },
  "checked": true,
  "problem_type": "proof"
}