FONDAMENTI DI INFORMATICA INTRODUZIONE AL CORSO E ALL INFORMATICA Prof. Emiliano Casalicchio
09/26/14 Computer Skills - Lesson 1 - E. Casalicchio 2 Info INGEGNERIA ENERGETICA, EDILIZIA E MECCANICA Canale A L Room: Aula 4
3 The teacher Emiliano Casalicchio emiliano.casalicchio@uniroma2.it Consulting hours When: monday 16:00-18:00 Where: room D1-17 (1 st floor), Ingegneria dell Informazione building
09/26/14 Computer Skills - Lesson 1 - E. Casalicchio 4 Teachers office: Room 17, Building D Ing. Informazione
09/26/14 Computer Skills - Lesson 1 - E. Casalicchio 5 Authoritative sources Official web site Information and teaching material http://didattica.uniroma2.it/informazioni/index/insegnamento/154493- Fondamenti-Di-Informatica The friends The forums The Others
09/26/14 Computer Skills - Lesson 1 - E. Casalicchio 6 Textbook and teaching material Textbook Matlab: A Practical Introduction to Programming and Problem Solving, 3 rd ed. The tools Stormy Attaway (author), Elsevier Science Ed. Matlab - http://www.mathworks.com Octave - http://www.gnu.org/software/octave/ More material Slides presented and suggested readings Slides don t replace the textbook. Slides are complementary material. Both (slides and textbook) are essential to succeed!!!!
09/26/14 Computer Skills - Lesson 1 - E. Casalicchio 7 Why Matlab/Octave It is a framework (a set of tools and a programming language) that allows to manipulate data (e.g. numbers and strings) statistical analysis formulation and solving of mathematical problems data plots simulation Matlab offers a high level programming language, that makes programming easier than other PL (e.g. Java, C, Fortran) It will allow you to turn theory in practice and to develop your computer skill
09/26/14 Computer Skills - Lesson 1 - E. Casalicchio 8 OCTAVE Octave con GUI (versione 3.8.1 e seguenti): 1. Sotto Linux, la versione 3.8 si trova sia su Fedora 21 che su Ubuntu 14.10. 2. Per windows si puo' installar http://mxeoctave.osuv.de/
09/26/14 Computer Skills - Lesson 1 - E. Casalicchio 9 Grading policy for the course The Computer Skills exam is composed by Written exam Practical exam in the lab to evaluate the acquired programming skills
09/26/14 Computer Skills - Lesson 1 - E. Casalicchio 10 About you and your background Do you own a computer (PC/laptop/ipad or similar)? How do you use your PC/laptop? For which purpose? what applications you mainly use? Do you know about or have you ever used Microsoft Excel (or other spreadsheet) Microsoft Access (or database management systems) programming languages Do you know what an algorithm is? Do you know how a computer works? Computer architecture Operating system
09/26/14 Computer Skills - Lesson 1 - E. Casalicchio 11 Why?! Why should you develop a computer skill? to learn the art of solving problems with a computer (it will turn always useful in your life) to learn and practice with a set of tools useful to solve problems related with your specialization This is not MY vision, but the vision of The Obama (US Gov.) vision: Don t Just Play on Your Phone, Program It An US government initiative: Computer Science Education Week, an annual campaign highlighting the importance of learning computer science (Obama) https://www.youtube.com/watch?v=ye6ifcrqg3s (Famous Leaders) https://www.youtube.com/watch?v=nkiu9yen5nc (Astronauts) https://www.youtube.com/watch?v=we2s3647awe Princeton University COS 126 http://www.washingtonpost.com/blogs/the-switch/wp/2013/12/11/presidentobama-talks-about-teaching-everyone-to-code-this-professor-does-it/
Teaching material will be mainly in English 12 There are anywhere from 350 to 500 million native English speakers, and up to 1 billion more who use it as a second or additional language to some extent. That s 20% of the world s 6.9 billion people. There are close to 7,000 languages spoken around the world today, but according to Ethnologue, 39% of the Earth s people speak one of eight brandname languages: Chinese, Spanish, English, Arabic, Hindi, Bengali, Portuguese, and Russian (Japanese is number 9). Of these, only English can claim global dominance n Spanish is the secondmost-spoken language by number of native speakers after Mandarin. It also has 60 million speakers as a second language,and 20 million students as a foreign language. BUT COMPUTER SCIENTISTS LIKE ENGLISH!!!!
Definitions Several definitions 1. the science of computers aka: Computer Science (CS) CS is the discipline dealing with representation, storing, retrieval and processing of information by automated means Computer science is no more about computers than astronomy is about telescopes. E. Dijkstra (Dutch computer Scientist. Turing Award in 1972. 1930-2002) 2. the science of information or 3. the science of information representation and (automatic) processing aka: Informatics 13
Definitions the science of information representation and (automatic) processing what is information? why are we interested in its representation and (automatic) processing? n actually, we are interested in solving problems more precisely, in systematic ways for solving problems Computer Science is concerned with this 14
A problem to be solved what do we need to solve this problem abstractly? a representation of the involved entities a procedure to be followed (based on the adopted representation)? n representation a way of expressing the relevant information for the problem at hand n procedure a step-by-step process to be followed to get the solution a recipe 15
Representation + Process n the science of information representation and (automatic) processing now it should be a bit clearer what we are talking about it remains to discuss more explicitly the meaning of automatic later 16
the box-and-door problem again box representation face A: heigth(a), width(a) e.g.: height(a) = 220 cm, width(a) = 70 cm face B: heigth(b), width(b) e.g.: height(b) = 220 cm, width(b) = 110 cm face C: heigth(c), width(c) e.g.: height(c) = 70 cm, width(c) = 110 cm A B? n door representation heigth(door), width(door) e.g.: height(door) = 210 cm, width(door) = 80 cm 17
the box-and-door problem again procedure ( recipe ) check: height(a)<heigth(door)) AND width(a)<width(door) if true, OK ; else, check face B n OK? check: height(b)<heigth(door)) AND width(b)<width(door) if true, OK ; else, check face C check: height(c)<heigth(door)) AND width(c)<width(door) if true, OK ; else FAILURE hint: try with the numbers given in the previous slide A B? n a new procedure ( new recipe ) check: height(a)<heigth(door)) AND width(a)<width(door) if true, OK ; else, rotate face A check: width(a)<heigth(door)) AND heigth(a)<width(door) if true, OK ; else, check face B 18
general procedure check: height(a)<heigth(door)) AND width(a)<width(door) if true, OK ; else, rotate face A check: width(a)<heigth(door)) AND heigth(a)<width(door) if true, OK ; else, check face B A B? n does this procedure work only for this box and this door? n we are interested in general procedures parametric procedure 19
automatic processing n n box representation face A: heigth(a), width(a) face B: heigth(b), width(b) face C: heigth(c), width(c) door representation heigth(door), width(door) + check: height(a)<heigth(door)) AND width(a)<width(door) if true, OK ; else, rotate face A check: width(a)<heigth(door)) AND heigth(a)<width(door) if true, OK ; else, check face B representation procedure n the science of information representation and (automatic) processing n what do we mean by automatic? 20
A formalism to write recipes X : a named container START END X expr put a value in a container recipe processing begins recipe processing ends input / output true condition false a recipe step selection of alternative paths a collateral recipe 21
an example of recipe Start read m and n x m y n n try this recipe with different pairs of nonnegative integer numbers are you able to get the final answer? n what does it mean? is it necessary to know that, to process this recipe? true x 0 AND y 0 false write: trivial answer or impossible to calculate r remainder of x/y End false r = 0 true write: the answer is y x y End y r 22
23 Summary Course info Definition of computer science Problem solving the receipt way