Add to the coefficient (common_letter_number / unique_letters_numbers) * 50;
should be
Add to the coefficient (common_letter_number / unique_letters_numbers) * 50%