Three- and four-ring polyamides containing N-methylimidazole and N-methylpyrrole, and their hairpin-linked derivatives, bind side-by-side in the minor groove of DNA in a sequence-specific manner. The sequences recognized by side-by-side molecules are dependent on the pairings of the polyamide rings to the bases. In this study we report a mathematical model for estimating the free energies of binding for gamma-aminobutyric acid-linked polyamides to 5- and 6-bp DNA sequences. The model parameters are calibrated by a least-squares fit to 35 experimental binding constants. The model performs well in cross-validation experiments and the parameters are consistent with previously proposed empirical rules of polyamide-DNA binding. We apply the model to the design of targeted polyamides, evaluating the ability of the proposed polyamides to bind to a DNA sequence of interest while minimizing binding to the remaining DNA sequences.