function pdf = english_letter_pdf ( c )

%*****************************************************************************80
%
%% english_letter_pdf() evaluates the English Letter PDF.
%
%  Discussion:
%
%    PDF('c') = 0.02782
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    05 March 2016
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Robert Lewand,
%    Cryptological Mathematics,
%    Mathematics Association of America, 2000,
%    ISBN13: 978-0883857199
%
%  Input:
%
%    character C, the letter whose probability is desired.
%    'a' <= c <= 'z', but case is ignored.
%
%  Output:
%
%    real PDF, the value of the PDF.
%
  pdf_vec = [ ...
    0.08167, 0.01492, 0.02782, 0.04253, 0.12702, ...
    0.02228, 0.02015, 0.06094, 0.06966, 0.00153, ...
    0.00772, 0.04025, 0.02406, 0.06749, 0.07507, ...
    0.01929, 0.00095, 0.05987, 0.06327, 0.09056, ...
    0.02758, 0.00978, 0.02361, 0.00150, 0.01974, ...
    0.00074 ]; 

  if ( 'a' <= c && c <= 'z' )
    i = c - 'a' + 1;
    pdf = pdf_vec(i);
  elseif ( 'A' <= c && c <= 'Z' )
    i = c - 'A' + 1;
    pdf = pdf_vec(i);
  else
    pdf = 0.0;
  end

  return
end
