Slides_Lecture1

更新时间:2023-08-13 17:52:01 阅读量: IT计算机 文档下载

说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。

python

Python语言 Version Author 1.0 W. Eric L. Grimson

Introduc-on to Computer Science and Programming 计算机科学和Python编程导论

Level Beginner

计算机科学和 Python 编程导论及计算思维和 数据科学导论。 学会计算思维、编写程序解决问题。 关注的是知识的宽度而不是深度。目标是帮 助学生简要了解更多计算机相关内容,以便 他们在以后事业发展过程中需要考虑如何用 计算法完成某些目标时,能有一些概念。

python

Python

什么是Python

Python(英语发音:/ pa θ n/), 是一种面向对象 、解释型计算机程序设计语言。 由于Python语言的简洁、易读以及可扩展性,在国 外用Python做科学计算的研究机构日益增多,一些 知名大学已经采用Python教授程序设计课程。例如 卡耐基梅隆大学的编程基础和麻省理工学院的计算 机科学及编程导论就使用Python语言讲授。 众多开源的科学计算软件包都提供了Python的调用接口,例如著名 的计算机视觉库OpenCV、三维可视化库VTK、医学图像处理库ITK 。而Python专用的科学计算扩展库就更多了,例如如下3个十分经典 的科学计算扩展库:NumPy、SciPy和matplotlib,它们分别为 Python提供了快速数组处理、数值运算以及绘图功能。因此Python 语言及其众多的扩展库所构成的开发环境十分适合工程技术、科研 人员处理实验数据、制作图表,甚至开发科学计算应用程序。© 2014 中北大学软件学院 Page 1-2

python

Python

Matlab Vs Python

Matlab 商用软件,并且价格不菲 易学 专注于工程和科学计算

Python 完全免费,众多开源的科学计算库都 提供了Python的调用接口 更易学、更严谨 有着丰富的扩展库,可以轻易完成各 种高级任务

© 2014 中北大学软件学院

Page 1-3

python

Python

课程导师介绍W. Eric L. Grimson 是 MIT 的副校长,计算机科学和工程教授,及 医学工程 Bernard M. Gordon 教授。他于 2011 年被任命为 MIT 副 校长之职。Grimson 教授自 1984 年起在 MIT 任职,曾担任电机工 程和计算机科学系主任、系副主任及教育主任。Grimson 教授在计 算机视觉方面的研究得到国际认可,特别是在医学图像分析方面的 应用更是如此。他及他的学生们已经研制出活动和行为识别技术、 物体和人体识别、图像数据库索引、图像导航外科手术、场地建模 等计算机视觉在各领域的应用。

© 2014 中北大学软件学院

Page 1-4

python

Python

―课程搬运工”介绍唐菁 (QQ:35836107,新浪微博:Tang 菁cathy) 籍贯:江苏 学历:华北工学院 汽车与拖拉机(学士),NUS 机械工程(硕士) 专业兴趣:机器人、SAP 、数据分析 业余爱好:旅游、美食 主业:软件学院负责对外合作,讲授SAP、人机交互、12210B01班主任 副业:专

职妈妈一枚,养育sons ……

© 2014 中北大学软件学院

Page 1-5

python

Python

课源

学堂在线 /courses/MITx/6_00_1x/2014_T2/about edx https:///course/introduction-computer-science-mitx-6-001x-0#.VRKfp_mUezQ

其他 计蒜客 Python入门课程 /class/info/12 国外MOOC网站 https:///© 2014 中北大学软件学院 Page 1-6

python

Python

Course Overview 课程概览 绪论 程序的核心元素

Introduction to Python Core Elements of Programs Simple Algorithms

简单算法 函数 递归

Functions Recursion Objects

对象 and Debugging 测试和Debug 断定和异常

Testing

Assertions and Exceptions Measuring complexity

算法设计与分析

© 2014 中北大学软件学院

Page 1-7

python

Python

学时 32 成绩判定 1. 到课情况1/3

2. 平时练习1/33. 最后测试1/3 Ps.完成其中两项,这门课才能通过。

QQ群:175013909

© 2014 中北大学软件学院

Page 1-8

python

Python

Course Overview 课程概览 绪论 程序的核心元素

Introduction to Python Core Elements of Programs Simple Algorithms

简单算法 函数 递归

Functions Recursion Objects

对象 and Debugging 测试和Debug 断定和异常

Testing

Assertions and Exceptions Measuring complexity

算法设计与分析

© 2014 中北大学软件学院

Page 1-9

python

Python

Introduction to Python

Abstract Become skillful at making a computer do what you want it to do Learn computational models of thinking Master the art of computational problem solving

本章目标 熟练掌握让计算机做你想让它做事的技巧 学习思维的计算模型 掌握计算问题的解决方法© 2014 中北大学软件学院 Page 1-10

python

Python

What does a computer do?

Fundamentally a computer:- Performs calculations - Remembers the results

What

calculations?primitives our own methods of calculating

- Built in - Creating

© 2014 中北大学软件学院

Page 1-11

python

Python

Is that all it does?

A Billion calculations per second(计算机计算速度之快)

100s of gigabytes of storage(一个100G的硬盘,100个千兆字节)

© 2014 中北大学软件学院

Page 1-12

python

Python

Are simple calculations enough?

Searching the World Wide Web Playing chess Good algorithm design also needed to accomplish a task!

© 2014 中北大学软件学院

Page 1-13

python

Python

… so are there limits?

Despite its speed and storage, a computer does have limitations- Some problems still too complexat a local scale(超级计算机,需 Accurate weather 要速度和存储) Cracking encryption prediction

schemes (编码中的加密)

- Some

problems

are

fundamentallyof

impossiblewill

to computehalt with

Predicting whether a piece an ans

wer for any input

code

always

图灵停机问题(halting problem):问题是对于某程序P,给出某输入I,求 解此程序P是否会到达终止状态。

© 2014 中北大学软件学院

Page 1-14

python

Python

Computational problem solving

What

is

computation?

- What is knowledge? - Declarative knowledge( /di kle( )r tiv/陈述性知识) Statements of fact or recipes

- Imperative ―how to‖

knowledge ( / im per tiv/ 过程性知识)methods

© 2014 中北大学软件学院

Page 1-15

python

Python

Declarative knowledge

―The square root of such that y*y = x‖

a

numberthe

x issquare

a

numberroot of a

y

Can you use this to nd particular instance of x?

© 2014 中北大学软件学院

Page 1-16

python

Python

Imperative knowledge

Here is a ―recipe‖ for deducing a square root of a number x–attributed to Heron of Alexandria in the rst century AD- Start with a guess, called g - If g*g is close enough to x, stop and say that g is the answer Test - Otherwise make a new guess, by averaging g and x/g Calculation

- Using this new guess, repeat the process until we get close Control enough

© 2014 中北大学软件学院

Page 1-17

python

Python

An example

Find

the

square

root

of

25

8 5.5625 5.028

64 30.9414 25.28

3.125 4.4943

5.5625 5.028

© 2014 中北大学软件学院

Page 1-18

python

Python

Algorithms are recipes

1. Put custard mixture over heat (把冻蛋奶混合物放在火上加热)2. Stir 3. Dip spoon in custard (搅拌) (把勺子放进蛋奶冻)

4. Remove spoon and run nger across back of spoon(把勺子拿起,将手指放在勺子背面) 5. If clear path is left, remove custard from heat and let cool

(如果蛋奶在勺子上没有,那么就将混合物从火上拿开,并晾凉)6. Otherwise repeat from step 2 (否则从第2步重复)

© 2014 中北大学软件学院

Page 1-19

python

Python

How do we capture a recipe in a mechanical process?

Build

a

machine

to

compute

square

roots

- Fixed Program Computers 固定程序的计算机 Calculator Atanaso and Berry’s(1941) computer for systems of linear equations Alan Turing’s(1940’s) bombe – decode Enigma codes

Use a machine that stores and manipulates instructions- Stored Program Computer存储程序的计算机

© 2014 中北大学软件学院

Page 1-20

python

Python

Stored program computer

Sequence of instructions (program) stored inside computer- Built from prede nedlogic

set

of

primitive

instructions

Arithmetic and Simple tests Moving data

Special program (interpreter) executes each instruction in order- Use tests to change to stop when done ow of control through sequence,

© 2014 中北大学软件学院

Page 1-21

本文来源:https://www.bwwdw.com/article/2fhj.html

Top