Homework 0
Due on Sept 7 Wednesday
Your Name

For problem 1 and 2, try to reproduce the problem text with exactly the same formatting as below.

1. Basic Text Typewriting.

Here is a list:

This is a Boldface words. Newly introduced notion will be emphasized in italic font such as group theory. We could also add boldface to it, e.g., group theory.

Mathematics can be inlined like $E=mc^2$. Or, they can be elegantly presented in standalone blocks like below:

(1)
\[e = \lim_{n\rightarrow\infty}\left(1+\frac1n\right)^n \]

The above theorem can be referenced as Equation (1). We may prove it as a theorem:

Theorem 1. (Euler's theorem)
If $n$ and $a$ are positive integers and $\gcd(n,a)=1$, then

(2)
\[a^{\phi(n)} \equiv 1 \mod n \]

2. Basics of typesetting code

Below is a Javascript program snippet

function hello() {
  return "hello world!"
}

Here is the Java code we mentioned in the first lecture:

  int total = 0;
  for (int i = 1; i <= 10; i++)
    total = total + i;

And typing up Haskell is as easy:

f :: [Int] -> [Int]
f []     = []
f (x:xs) = f ys ++ [x] ++ f zs
  where
    ys = [a | a  xs, a  x]
    zs = [b | b  xs, b > x]

Note. The syntax highlighting works in the PDF output too.

3. Practice Save and Load.

Synchronize and Pull your ongoing work (from github) as you are editing it.

4. More Reading

Read Section 3 and 4 of Madoko reference manual. Describe two of your favorite features that we didn't mention in class.

5. Hands-On

Install the Haskell platform and try out examples we talked in class. Note down two of your favorite trials (you are especially encouraged to try out things we haven't talked about in class). You can copy the command line text-scripts and paste them between two lines of (identical number of) consecutive backquotes. $ ghci GHCi, version 7.10.3: http://www.haskell.org/ghc/ :? for help Prelude λ>

If you want nicer formatting, you could use

$ ghci
GHCi, version 7.10.3: http://www.haskell.org/ghc/  :? for help
Prelude λ> 

6. Submit

Generate html and pdf files to submit along with your mdk file through Canvas.