Peptide library

A peptide library is a tool for protein-related study. A peptide library contains a great number of peptides that have a systematic combination of amino acids. Usually, peptide library is synthesized on solid phase, mostly on resin, which can be made as flat surface or beads. The peptide library provides a powerful tool for drug design, protein–protein interactions, and other biochemical as well as pharmaceutical applications.
You can create a mix of desired amino acids at each point in a sequence. In this way, you could create a library of 20 different polypeptides with only one amino acid residue at random and the rest being the same. 
The usefulness of this form of peptide synthesis is limited as you can't go beyond 70 acids in length. This would give you 2070 possible combinations and that's only if you don't include the plethora of available amino acids with pre-installed post-translational modifications. Most drug development does not involve such a random assortment of proteins as you wouldn't learn very much.
Important example. Say you wanted a peptide chain 10 residues in length to use in native chemical ligation with a larger recombinantly expressed protein. 
residue 1: Alanine only
residue 2: glutamine, glycine, arginine, glutamic acid, serine, or methionine
residue 3: any one of all 20 amino acids
residue 4: acetyl-lysine only
residue 5: alanine
residue 6: isoleucine
residue 7: aspartic acid
residue 8: phenylalanine
residue 9: acetyl-lysine
residue 10: argineine with the carboxy terminal thioester.
there would be 20 different proteins at residue 3. each one of those would have 7 different proteins at residue 2. the end result would be 20*7 or 140 different polypeptides.
this peptide library would be useful for analyzing the effect of the post-translational modification acetylation on lysine which neutralizes the positive charge. having the library of different peptides at residue 2 and 3 would let you see if some change in chemical properties in the N-terminal tail of the ligated protein make the protein more useful or useful in a different way.
As a general formula, if you made a completely random peptide library with n amino acids for each link in the chain with a length of x, the total number of possible sequences is n^x. 