digital medicine i
play

Digital Medicine I Introduction to the Course Hans-Joachim - PowerPoint PPT Presentation

Departement Informatik Digital Medicine I Introduction to the Course Hans-Joachim Bckenhauer Dennis Komm Autumn 2020 October 1, 2020 Welcome to the Course Material Lecture website https://courses.ite.inf.ethz.ch/digiMed20 Digital


  1. 3. Algorithms Design Techniques Most practically relevant problems have easy solutions Easy to implement Are based on trying out possibly many possibilities (“solution candidates”) This means impractically large time to spend Many problem allow for “faster” solutions Needs a little more skill Different techniques: greedy algorithms , divide and conquer , dynamic programming etc. Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 13 / 38

  2. Introduction to the Course Projects

  3. Projects During the semester, you work on a few small projects Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 14 / 38

  4. Projects During the semester, you work on a few small projects The project tasks will be published via [code]expert https://expert.ethz.ch Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 14 / 38

  5. Projects During the semester, you work on a few small projects The project tasks will be published via [code]expert https://expert.ethz.ch You work on the tasks on your own The exercise hours are meant for answering your questions Presentation of the solutions via the PELE system https://pele.ethz.ch Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 14 / 38

  6. Projects The projects will be presented in the exercise hours Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 15 / 38

  7. Projects The projects will be presented in the exercise hours Presentation and discussion with assistants via Zoom Teams of 2 students each Grading by assistants, feedback by students Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 15 / 38

  8. Projects The projects will be presented in the exercise hours Presentation and discussion with assistants via Zoom Teams of 2 students each Grading by assistants, feedback by students Presentation is mandatory but without effect on the grade Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 15 / 38

  9. Projects The projects will be presented in the exercise hours Presentation and discussion with assistants via Zoom Teams of 2 students each Grading by assistants, feedback by students Presentation is mandatory but without effect on the grade [code]expert allows you to test your solution before handing it in Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 15 / 38

  10. Python Tutorial Easy introduction to Python, no previous knowledge necessary Time needed: roughly two hours Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 16 / 38

  11. Python Tutorial Easy introduction to Python, no previous knowledge necessary Time needed: roughly two hours Tutorial website https://et.lecturers.inf.ethz.ch/subscriber/course/ 5TLRsNXvLcMaw229P Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 16 / 38

  12. Introduction to Python

  13. Programming Tools Editor: Program to modify, edit and store Python program texts Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 17 / 38

  14. Programming Tools Editor: Program to modify, edit and store Python program texts Compiler: Program to translate a program text into machine language (intermediate code, respectively) Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 17 / 38

  15. Programming Tools Editor: Program to modify, edit and store Python program texts Compiler: Program to translate a program text into machine language (intermediate code, respectively) Computer: Machine to execute machine language programs Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 17 / 38

  16. Programming Tools Editor: Program to modify, edit and store Python program texts Compiler: Program to translate a program text into machine language (intermediate code, respectively) Computer: Machine to execute machine language programs Operating System: Program to organize all procedures such as file handling, editing, compiling, and program execution Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 17 / 38

  17. English vs. Programming Language English “Science is what we understand well enough to explain to a computer. Art is everything else we do. ” D ONALD K NUTH Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 18 / 38

  18. English vs. Programming Language English “Science is what we understand well enough to explain to a computer. Art is everything else we do. ” D ONALD K NUTH Python # computation b = a * a # b = a**2 b = b * b # b = a**4 Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 18 / 38

  19. Syntax and Semantics Like our language, programs have to be formed according to certain rules Syntax: Connection rules for elementary symbols (characters) Semantics: Interpretation rules for connected symbols Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 19 / 38

  20. Syntax and Semantics Like our language, programs have to be formed according to certain rules Syntax: Connection rules for elementary symbols (characters) Semantics: Interpretation rules for connected symbols Corresponding rules for a computer program are simpler, but also more strict because computers are relatively stupid Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 19 / 38

  21. Kinds of Errors Illustrated with English Language The car drove too fast. Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 20 / 38

  22. Kinds of Errors Illustrated with English Language The car drove too fast. Syntactically and semantically correct Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 20 / 38

  23. Kinds of Errors Illustrated with English Language The car drove too fast. Syntactically and semantically correct Thecar drove too fsat. Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 20 / 38

  24. Kinds of Errors Illustrated with English Language The car drove too fast. Syntactically and semantically correct Thecar drove too fsat. Syntax error: word building Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 20 / 38

  25. Kinds of Errors Illustrated with English Language The car drove too fast. Syntactically and semantically correct Thecar drove too fsat. Syntax error: word building Red the car is. Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 20 / 38

  26. Kinds of Errors Illustrated with English Language The car drove too fast. Syntactically and semantically correct Thecar drove too fsat. Syntax error: word building Red the car is. Syntax error: word order Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 20 / 38

  27. Kinds of Errors Illustrated with English Language The car drove too fast. Syntactically and semantically correct Thecar drove too fsat. Syntax error: word building Red the car is. Syntax error: word order I find inspiration in cooking my dog and my cat Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 20 / 38

  28. Kinds of Errors Illustrated with English Language The car drove too fast. Syntactically and semantically correct Thecar drove too fsat. Syntax error: word building Red the car is. Syntax error: word order I find inspiration in cooking , Syntax error: missing punctuation marks my dog , and my cat . Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 20 / 38

  29. Kinds of Errors Illustrated with English Language The car drove too fast. Syntactically and semantically correct Thecar drove too fsat. Syntax error: word building Red the car is. Syntax error: word order I find inspiration in cooking Syntax error: missing punctuation marks my dog and my cat She is not tall and red-haired. Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 20 / 38

  30. Kinds of Errors Illustrated with English Language The car drove too fast. Syntactically and semantically correct Thecar drove too fsat. Syntax error: word building Red the car is. Syntax error: word order I find inspiration in cooking Syntax error: missing punctuation marks my dog and my cat She is not tall and red-haired. Syntactically correct, but ambiguous [no analogon] Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 20 / 38

  31. Kinds of Errors Illustrated with English Language The car drove too fast. Syntactically and semantically correct Thecar drove too fsat. Syntax error: word building Red the car is. Syntax error: word order I find inspiration in cooking Syntax error: missing punctuation marks my dog and my cat She is not tall and red-haired. Syntactically correct, but ambiguous [no analogon] I own an red car. Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 20 / 38

  32. Kinds of Errors Illustrated with English Language The car drove too fast. Syntactically and semantically correct Thecar drove too fsat. Syntax error: word building Red the car is. Syntax error: word order I find inspiration in cooking Syntax error: missing punctuation marks my dog and my cat She is not tall and red-haired. Syntactically correct, but ambiguous [no analogon] Syntactically correct, but gramatically and semanti- I own an red car. cally wrong: wrong article [type error] Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 20 / 38

  33. Kinds of Errors Illustrated with English Language The car drove too fast. Syntactically and semantically correct Thecar drove too fsat. Syntax error: word building Red the car is. Syntax error: word order I find inspiration in cooking Syntax error: missing punctuation marks my dog and my cat She is not tall and red-haired. Syntactically correct, but ambiguous [no analogon] Syntactically correct, but gramatically and semanti- I own an red car. cally wrong: wrong article [type error] The bike gallops fast. Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 20 / 38

  34. Kinds of Errors Illustrated with English Language The car drove too fast. Syntactically and semantically correct Thecar drove too fsat. Syntax error: word building Red the car is. Syntax error: word order I find inspiration in cooking Syntax error: missing punctuation marks my dog and my cat She is not tall and red-haired. Syntactically correct, but ambiguous [no analogon] Syntactically correct, but gramatically and semanti- I own an red car. cally wrong: wrong article [type error] Syntactically and gramatically correct, but semanti- The bike gallops fast. cally wrong [run-time error] Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 20 / 38

  35. Kinds of Errors Illustrated with English Language The car drove too fast. Syntactically and semantically correct Thecar drove too fsat. Syntax error: word building Red the car is. Syntax error: word order I find inspiration in cooking Syntax error: missing punctuation marks my dog and my cat She is not tall and red-haired. Syntactically correct, but ambiguous [no analogon] Syntactically correct, but gramatically and semanti- I own an red car. cally wrong: wrong article [type error] Syntactically and gramatically correct, but semanti- The bike gallops fast. cally wrong [run-time error] We saw her duck. Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 20 / 38

  36. Kinds of Errors Illustrated with English Language The car drove too fast. Syntactically and semantically correct Thecar drove too fsat. Syntax error: word building Red the car is. Syntax error: word order I find inspiration in cooking Syntax error: missing punctuation marks my dog and my cat She is not tall and red-haired. Syntactically correct, but ambiguous [no analogon] Syntactically correct, but gramatically and semanti- I own an red car. cally wrong: wrong article [type error] Syntactically and gramatically correct, but semanti- The bike gallops fast. cally wrong [run-time error] Syntactically and sematically correct, but ambiguous We saw her duck. [no analogon] Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 20 / 38

  37. Introduction to Python Used Software

  38. Used Software There are numerous Python development environments (IDEs) These contain an editor and several tools Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 21 / 38

  39. Used Software There are numerous Python development environments (IDEs) These contain an editor and several tools We use [code]expert https://expert.ethz.ch Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 21 / 38

  40. Used Software There are numerous Python development environments (IDEs) These contain an editor and several tools We use [code]expert https://expert.ethz.ch Also recommended (offline): PyCharm Education https://www.jetbrains.com/pycharm-educational/download/ Download the Community Edition Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 21 / 38

  41. Introduction to Python A First Python Program

  42. A First Python Program print("This is a Python program") x = 20 print("The value of x is", x) y = x*x # y is the square of x print("The value of y is", y) z = y*y # z is the square of y print("The value of z is", x*x*x*x) Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 22 / 38

  43. Behavior of a Program At compile time Program accepted by the compiler (syntactically correct) Compiler error Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 23 / 38

  44. Behavior of a Program At compile time Program accepted by the compiler (syntactically correct) Compiler error During runtime correct result incorrect result program crashes program does not terminate (endless loop) Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 23 / 38

  45. Comments print("This is a Python program") x = 20 print("The value of x is", x) y = x*x # y is the square of x print("The value of y is", y) z = y*y # z is the square of y print("The value of z is", x*x*x*x) Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 24 / 38

  46. Comments print("This is a Python program") x = 20 print("The value of x is", x) y = x*x # y is the square of x Comments print("The value of y is", y) z = y*y # z is the square of y print("The value of z is", x*x*x*x) Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 24 / 38

  47. Comments and Layout Comments are contained in every good program document, what and how a program does something and how it should be used are ignored by the compiler Syntax: # until the line end Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 25 / 38

  48. Comments and Layout Comments are contained in every good program document, what and how a program does something and how it should be used are ignored by the compiler Syntax: # until the line end Please note empty lines are ignored Python dictates indentations that reflect the program logic Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 25 / 38

  49. Introduction to Python Statements

  50. Statements print("This is a Python program") x = 20 print("The value of x is", x) y = x*x print("The value of y is", y) z = y*y print("The value of z is", x*x*x*x) Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 26 / 38

  51. Statements print("This is a Python program") x = 20 statements print("The value of x is", x) y = x*x print("The value of y is", y) z = y*y print("The value of z is", x*x*x*x) Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 26 / 38

  52. Statements Statements are building blocks of a Python program are executed (sequentially) are given in one line Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 27 / 38

  53. Statements Statements are building blocks of a Python program are executed (sequentially) are given in one line Any statement (potentially) provides an effect Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 27 / 38

  54. Statements – Values and Effects print("This is a Python program") x = 20 print("The value of x is", x) y = x*x print("The value of y is", y) z = y*y print("The value of z is", x*x*x*x) Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 28 / 38

  55. Statements – Values and Effects Effect: Output of the string This is... print("This is a Python program") x = 20 Effect: Variable x is created and assigned value 20 print("The value of x is", x) y = x*x print("The value of y is", y) z = y*y print("The value of z is", x*x*x*x) Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 28 / 38

  56. Introduction to Python Variables

  57. Fundamental Types Variables represent (varying) values integers real numbers (float) strings . . . Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 29 / 38

  58. Fundamental Types Variables represent (varying) values integers real numbers (float) strings . . . In contrast to, for example, Java or C , the type is not explicitly stated when a variable is declared (used for the first time) Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 29 / 38

  59. Introduction to Python Expressions

  60. Expressions Expressions represent computations Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 30 / 38

  61. Expressions Expressions represent computations are either primary ( x ) or composed ( x * x ) Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 30 / 38

  62. Expressions Expressions represent computations are either primary ( x ) or composed ( x * x ) . . . from different expressions by operators . . . and parentheses Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 30 / 38

  63. Expressions print("This is a Python program") x = 20 print("The value of x is", x) y = x*x print("The value of y is", y) z = y*y print("The value of z is", x*x*x*x ) Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 31 / 38

  64. Expressions print("This is a Python program") Variable name, primary expression x = 20 print("The value of x is", x) y = x*x print("The value of y is", y) z = y*y print("The value of z is", x*x*x*x ) Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 31 / 38

  65. Expressions print("This is a Python program") Composite expression x = 20 print("The value of x is", x) y = x*x print("The value of y is", y) z = y*y print("The value of z is", x*x*x*x ) Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 31 / 38

  66. Expressions represent computations are primary or composite (by other expressions and operations) Example a * a is composed of variable name, operator symbol, variable name variable name: primary expression can be put into parentheses a * a can be written as (a * a) Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 32 / 38

  67. Introduction to Python Operators and Operands

  68. Operators and Operands print("This is a Python program") x = 20 print("The value of x is", x) y = x*x print("The value of y is", y) z = y*y print("The value of z is", x*x*x*x) Digital Medicine I – Introduction to the Course Autumn 2020 Böckenhauer, Komm 33 / 38

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend