  We study the thermodynamic limit of random partition models for the instanton
sum of 4D and 5D supersymmetric U(1) gauge theories deformed by some physical
observables. The physical observables correspond to external potentials in the
statistical model. The partition function is reformulated in terms of the
density function of Maya diagrams. The thermodynamic limit is governed by a
limit shape of Young diagrams associated with dominant terms in the partition
function. The limit shape is characterized by a variational problem, which is
further converted to a scalar-valued Riemann-Hilbert problem. This
Riemann-Hilbert problem is solved with the aid of a complex curve, which may be
thought of as the Seiberg-Witten curve of the deformed U(1) gauge theory. This
solution of the Riemann-Hilbert problem is identified with a special solution
of the dispersionless Toda hierarchy that satisfies a pair of generalized
string equations. The generalized string equations for the 5D gauge theory are
shown to be related to hidden symmetries of the statistical model. The
prepotential and the Seiberg-Witten differential are also considered.
