## Introduction to Computers for Statisticians - 0365.1800

### Course Plan

Week Class Slides Class Slides
22/10/07 General Introduction   Computer structure, First C program, Input and output functions Lesson 1
29/10/07 Development environment, First C program Tirgul 1 Arithmetic expression, logic expression, control flow Lesson 2
5/11/07 scanf & printf, Data types, if structures and while loops Tirgul 2 Flow of control: loops, break, continue, switch case; Use of char type Lesson 3
12/11/07 for, switch case Tirgul 3 Arrays, Functions Lesson 4
19/11/07 Arrays, Functions Tirgul 4 Time complexity, Sieve of Eratosthenes, Binary representation
26/11/07 Functions, Recursion, Pointers Lesson 5 Functions, Recursion Tirgul 5
3/12/07 Dynamic memory allocation, Time complexity Lesson 6 Pointers, Strings, Dynamic memory allocation Tirgul 6
10/12/07 Time analysis of recursive functions; The syntax of the C programming language; Structures, typedef, Muli dimensional arrays Lesson 7 Structures, Two dimensional arrays Tirgul 7
17/12/07 Towers of Hanoi; Sorting [2.1,2.2] Merge sort [2.3] Counting sort [8.2]   Standard Library Functions; Guidelines for ex. 4; Solutions to selected exercises
24/12/07 Greatest common divisor [31.2] Modular exponentiation [31.6] Solutions to selected exercises   Solutions to selected exercises
References are from the book "Intoduction to Algorithms".

### Software

Details concerning the software required for the course can be found here.
If you do not have a Unix account, create one by pressing here, and then here.

### Exercises

Exercises (including the printout of the source code) should be submitted either in class
or to my mail box (box #386, Shrieber building, second floor).
General guidelines for submitting exercises can be found here.

The source code itself should be placed in your home directory.
For example, the source code file relevant to question 3 of exercise 2 must be named ~/intro2cs/ex2/q3/q3.c.

Before you submit each exercise, you must run a script that compiles all the source code files and gives permission to read and execute them.
For example, before submitting exercise 1, you must run the script compile_ex1.
(To be able to do so, you need to run the script ~courses/p once at the beginning of the course.)
When you run compile_ex1, 4 executable files named q1.out, q2.out, q3.out and q4.out will be created in your home directory.
These files are the result of performing "gcc -Wall" on the files q1.c,q2.c,q3.c, and q4.c, respectively.
In case mathematical functions from math.h are needed, then "gcc -Wall -lm" is performed.

You can solve exercises in pairs, but you must clearly say who you worked with.
You must write the solution on your own.

In case you have questions, just make a copy of the file you are working on, and send me an e-mail telling me about the problem.
For example, if you have a question concerning question 4, run the command "cp q4.c q41.c" and send me an e-mail about it.
Do not send me the program itself!