Text Analysis Assignment
Calculate the entropy of the Universal Declaration of Human Rights
(UDHR),
assuming all letters are distributed independently.
To this end, you can use the following facilities:
Instructions:
- Open Tom's JavaScript Machine.
- Enable Advanced mode.
- Copy the UDHR
into the (yellow) input box.
- Copy the program
count_text.js
in the (green) program box.
- Click Run, to get letter frequencies in the (blue) output box.
N.B. Spaces are counted as well, but adjacent whitespace is merged.
- Click Output: Copy to Input.
- Copy the program
freq2prob.js
into the program box.
- Click Run, to get letter probabilities in the output box.
- Click Output: Copy to Input.
- Copy entropy.js
into the program box.
- Click Run, to get the entropy in the output box.
If you are up to it, you can merge the three programs,
so that you can obtain the frequencies, probabilities and entropy
in a single run.
Also do this for some other texts.
©2014, Tom Verhoeff (TUE)
Feedback about this page is welcome