function pdf = english_word_length_pdf ( x ) %*****************************************************************************80 % %% ENGLISH_WORD_LENGTH_PDF evaluates the English Word Length PDF. % % Discussion: % % PDF(A,B;X) = B(X) if 1 <= X <= A % = 0 otherwise % % Licensing: % % This code is distributed under the GNU LGPL license. % % Modified: % % 31 July 2006 % % Author: % % John Burkardt % % Reference: % % Henry Kucera, Winthrop Francis, % Computational Analysis of Present-Day American English, % Brown University Press, 1967. % % Parameters: % % Input, integer X, the word length whose probability is desired. % % Output, real PDF, the value of the PDF. % word_length_max = 27; pdf_vec = [ ... 0.03160, ... 0.16975, ... 0.21192, ... 0.15678, ... 0.10852, ... 0.08524, ... 0.07724, ... 0.05623, ... 0.04032, ... 0.02766, ... 0.01582, ... 0.00917, ... 0.00483, ... 0.00262, ... 0.00099, ... 0.00050, ... 0.00027, ... 0.00022, ... 0.00011, ... 0.00006, ... 0.00005, ... 0.00002, ... 0.00001, ... 0.00001, ... 0.00001, ... 0.00001, ... 0.00001 ]; pdf_sum = 0.99997; if ( 1 <= x & x <= word_length_max ) pdf = pdf_vec(x) / pdf_sum; else pdf = 0.0; end return end