TITLE: Family of sets - cardinality
QUESTION [5 upvotes]: Given a family $H$ subsets of $\lbrace 1, 2, \ldots , n \rbrace$ with conditions: 

Elements of $H$ have got odd cardinality  
$| H_1 \cap H_2 | \  \forall H_1, H_2 \in H \ \ (H_1 \neq H_2)$ is even.

Show that $|H| \leq n$.

REPLY [5 votes]: This is known as Oddtown-problem and has a nice linear algebra proof:
Given a family $H=\{A_1,\dots,A_k\}$, where $A_i\subset [n]$, define, for each $i\in [k]$, the vector $a_i\in\mathbb \{0,1\}^n$, such that the $j$-th coordinate of $a_i$ is $1$, iff $j\in A_i$. Check, that
$$a_i^Ta_j=|A_i\cap A_j|$$
This equation also holds, when the vectors are from $\mathbb F_2^n$, so the preconditions 1) and 2) translate to:

$a_i^Ta_i=1$ for all $i\in [n]$
$a_i^Ta_j=0$ for all $i,j\in [n], i\neq j$

Let $\lambda_i\in\mathbb F_2$, such that
$$0=\lambda_1a_1+\dots+\lambda_ka_k$$
For every $i=1,\dots,k$, multiply with $a_i$ and apply 1) and 2):
$$0=(\lambda_1a_1+\dots+\lambda_ka_k)^Ta_i=\lambda_1a_1^Ta_i+\dots+\lambda_ka_k^Ta_i=\lambda_ia_i^Ta_i=\lambda_i$$
This proves, that $\{a_1,\dots,a_k\}$ are linearly independent. As $\mathbb F_2^n$ is $n$-dimensional and we know, that there are at most $n$ linearly independent vectors over a $n$-dimensional vector space, it follows that $|H|=k\leq n$.