  We characterize the multipartite entanglement of a system of n qubits in
terms of the distribution function of the bipartite purity over balanced
bipartitions. We search for maximally multipartite entangled states, whose
average purity is minimal, and recast this optimization problem into a problem
of statistical mechanics, by introducing a cost function, a fictitious
temperature and a partition function. By investigating the high-temperature
expansion, we obtain the first three moments of the distribution. We find that
the problem exhibits frustration.
