Word Exercise using List functions: Make a histogram of the length of the words and of the occurrences of individual characters in the dictionary

Begin met een schone lei:

Remove["Global`*"]

Read in the words from the file 'words' using the function ReadList. Type specifier is 'Word'. Note that the location is specific to the environment in which this program is run

Indien een file niet gevonden kan worden dient de current working directory aangepast te worden, zie Mathematica Help van Directory

Directory[]

Zet de directory naar de folder waar je woordenlijsten staan:

SetDirectory["zelf invullen"]

dictionary = ReadList["words", Word];

Determine the word length occurences.

First determine the lengths  of the words. Hint:use Characters, Length and Map

Draw a Histogram of these lengths

Determine the character distribution.

Hint: First make a list of all characters using also Flatten and ToLowerCase

Then use Tally en Sort to find the occurences of each character. Call the resulting double list charoccur

Now use BarChartto get a bar chart of characters versus their occurences.

BarChart[Map[Last,charoccur],ChartLabels->Map[First,charoccur]]

To plot a BarChartof characters versus their frequency first determine the total number of characters and call it nchar

Then divide the occurences in charoccur by nchar

Now use BarChartto get a bar chart of characters versus their frequency.

Use the function Timing to time the execution of some of the commands with the file words(this is a long list)

List functions used are Flatten, Map, Length, First, Last, ReadList, Sort. 
Statistics functions used are Histogram, Tally, BarChart.