Many persons with disabilities lack the fine motor coordination necessary to operate traditional keyboards. For these individuals, ambiguous (or reduced) keyboards offer an alternative access method. By placing multiple characters on each key, the size and accessibility of the individual keys can be enhanced without requiring a larger keyboard. Using statistical disambiguation algorithms to automatically interpret each keystroke, these systems can approach the keystroke efficiency (keystrokes per character) of conventional keyboards. Since the placement of characters on each key determines the effectiveness of these algorithms, several methods of optimizing keyboard arrangements have previously been proposed. This paper presents a new method for optimizing an arbitrary set of N characters over a collection of M keys. While earlier efforts relied upon approximations of keystroke efficiency, the proposed approach optimizes the arrangement under this exact performance measure. Applied to the canonical 26 characters on a nine-key "telephone keypad" problem, this method provides an improvement in efficiency of 2.5 percentage points over previously established layouts. Using only a minimum of calculations, the proposed technique operates quickly and efficiently, deriving optimal arrangements in a matter of seconds using a personal computer. The flexible method is applicable to arbitrary disambiguation algorithms, character sets, and languages.