Definition 2.1 provides a formal definition of global alignment. Whilst many possible alignments exist for two strings, the goal of sequence alignment is to find an alignment that optimises some criterion. A scoring function, presented in definition 2.2, can be used to quantify the "appropriateness" of an alignment. An optimal global alignment is then one which is optimal with respect to a given scoring function, as shown in definition 2.3.