Write the solutions for the following quizzes by using functional programming:
Let's write a module (a pool of functions) that given a quite large text (over than 2000 words) counts how frequent each word occurs in the text. In particular the module should provide the function freqs that given a filename and a number would return a list of words (with their frequencies) that occur more than the given number; the list is sorted by frequency with the higher first.
The text is read from a file and it is a real text with punctuation (i.e., commas, semicolons, ...) that shouldn't be counted.
Note that words that differ only for the case should be considered the same.
sin(x) can be approximate by the Taylor's series:
x - x^3/3! + x^5/5! ...
Let's write a library to implement sin(x, n) by using the Taylor's series (where n is the level of approximation, i.e., 1 only one item, 2 two items, 3 three items and so on).
Let's compare your function with the one implemented in the math module at the growing of the approximation level.
Hint. Use a generator for the factorial and a comprehension for the series.