Try now in the
Open Cloud »
(no sign-in required)

Dictionary First Letters

Find how many words in a dictionary start with each possible first letter.

Run the code to get the list of words in the English dictionary. Try other languages, like Spanish or Russian:

In[1]:=
X
Out[1]=

Find the first letter of every dictionary word. Try other languages, like German or Hindi:

SHOW/HIDE DETAILS

This gives the first letter of a text string:

In[1]:=
X
Out[1]=

This gives the first letter of each word in a list:

In[2]:=
X
Out[2]=

This gives the first letter of every word in the dictionary:

In[3]:=
X
Out[3]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Make all the letters upper case. Try making the letters lower case:

SHOW/HIDE DETAILS

Were going to want to treat upper and lowercase letters the same when we count how many words there are that begin with each letter.

The easiest way to do that is to convert all the letters to upper case:

In[1]:=
X
Out[1]=

You can also convert to lower case:

In[2]:=
X
Out[2]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Tally the number of occurrences of each letter. Try other languages, like French or Finnish:

SHOW/HIDE DETAILS

Tally gives the number of times each element occurs in a list.

This list contains two as and three zs:

In[1]:=
X
Out[1]=

Use Tally to count the number of dictionary words that start with each letter:

In[2]:=
X
Out[2]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Display the letters with their size proportional to their count. Compare English with other languages:

Note: adjust the scale factor by 100 if letters are too small or too big.

SHOW/HIDE DETAILS

This makes a 100-point letter A (a point is a printers measure equal to 1/72 inch):

In[1]:=
X
Out[1]=

This does the same thing using a pure function, which is indicated by # and &. A pure function is like a regular function, but it doesnt have a name. The Acalled the argumentis substituted for the # in the expression to the left of &:

In[2]:=
X
Out[2]=

You can give a pure function two arguments, like the letter and a size. The second argument is indicated in the pure function by #2:

In[3]:=
X
Out[3]=

Pure functions are often used to do something to every element of a list.

This makes every letter in the list the specified size:

In[4]:=
X
Out[4]=

Use Row to get a row of letters without braces and commas:

In[5]:=
X
Out[5]=

Do the same thing with the dictionary letter counts. First give the counts the name lettercounts:

In[6]:=
X
Out[6]=

Then size the letters using their counts. You need to divide the counts by 100 to get reasonable sizes:

In[7]:=
X
Out[7]=

HIDE DETAILS
In[1]:=
X
Out[1]=