Homework 3 Explanation and causality
- Due Oct 2, 2018 by 10pm
- Points 1
- Submitting an external tool
- Available Sep 28, 2018 at 3pm - Jan 10, 2019 at 11:59pm
Reading
Reading: See reading list for lecture 3. You will also want to review the lecture notes from the first two lectures.
Two studies
1) A group of students are asked to write a program solving a specific problem.
Each student may choose one of two groups:
- Group A are instructed to comment all their code according to a given Style Guide.
- Group B does not need to comment their code at all.
When running the resulting programs, it turns out that the best programs were from group A (the commented programs).
Can we draw the conclusion that comments improve the code? Explain!
2) Another group of students are asked to write a program solving a specific problem.
They are randomly assigned to two groups:
- Group C will use Haskell (a functional programming language)
- Group D will use Java
When running the resulting programs, it turns out that the fastest running programs were from group D.
Can we draw the conclusion that functional programming languages give slower code? Explain!
Benford's law
''Thirty percent of all numbers start with the digit 1.''
This statement is supposed to be true for collections of numbers with widely varying orders of magnitude, like populations of cities or byte sizes of files.
- Test Benford's law by downloading a data file from gapminder Links to an external site. and calculating first digit statistics.
- Illustrate your statistics with a graph or bar chart. Do not forget to tell us which data you used.
- Use google scholar Links to an external site. to find an example of how Benford's law is used in practice. Give a reference to the paper you found and explain the idea in one sentence.
- Do you consider Benford's law a hypothesis, a conjecture or a mathematical theorem?