第4章 计算学科中的 基本概念

Download 第4章 计算学科中的 基本概念

If you can't read please download the document

Upload: chars

Post on 09-Jan-2016

73 views

Category:

Documents


10 download

DESCRIPTION

第4章 计算学科中的 基本概念. 李陶深 [email protected]. 4.1.1 计算模型与图灵机. 4.1 计算模型与二进制. 计算模型与图灵机. 计算模型: 刻画计算这一概念的一种抽象的形式系统或数学系统。 在计算科学中,是指具有状态转换特征,能够对所处理的对象的数据或信息进行表示、加工、变化、接收、输出的数学机器。 计算模型的层次: 计算某个(类)具体问题的计算方法; 按照计算方法对应的程序完成某类问题特定计算所需要的平台。 在计算能力上具有某种等价性的形式系统。 计算模型的模型(一切计算模型所内含的机理). 计算模型与图灵机. - PowerPoint PPT Presentation

TRANSCRIPT

  • 4 [email protected]

  • 4.1 4.1.1

  • -POST

  • b b 1 0 1 0 0 0 1 0 b b b

    ql

  • {S0S1S2Sp}S0S1S00S11 01

  • 01S0S1{}{q1q2qm}q1qw

  • qiSjSkRLNql5 qi Sj SkSj RLNql

  • q1S2S2Rq3q3S3S3Lq1q1S2S3q3S2S2Rq4q3S2S4Lq6q3S2

  • bq1 q4101000100q1q1 0 1 L q2 q1 1 0 L q3 q1 b b N q4q2 0 0 L q2 q2 1 1 L q2 q2 b b N q4q3 0 1 L q2 q3 1 0 L q3 q3 b b N q4

    b b 1 0 1 0 0 0 1 0 b b b

    ql

  • 101000111S(x)x1b

    b b 1 0 1 0 0 0 1 0 b b b

    ql

  • 2 1000110, 10011101, 010101011

  • 3 In{1n0nnN}InOut{0n1nnN}N

  • 4 (1) s(x)x1 (2) o(x)0 (3) A(0y)y1 A(x10)A(x1) A(x1y1)A(xA(x1y))

  • W.Ackermann

  • S(x)x1N(x)0Ui(n)(x1x2xn)xi1in333

  • 4.1 4.1.2

  • 01

  • :27997.63=21*104+ 7*103 + 9* 102 +9* 101 + 7* 100 + 6* 10-1 +3* 10-2 S=kn*10n +kn-1*10n-1 ++k1*101 + k0*100 +k-1*10-1 ++ k-m+1*10-m+1 + k-m*10-m (n>1, m>1)10,ki{0,1,2,3,4,5,6,7,8 9}mn

  • 01

  • Sknkn-1 k0. k-m kn2nkn-12n-1k020k-m2-m -m ki2i in 2ki{0,1},m,n

  • R :(11111111.11)2=1*27 + 1*26 + 1* 25 +1* 24 + 1* 23 + 1* 22 +1* 21+ 1* 20+1*2-1+1*2-2 =(255.75)10(3506.2)8=3*83 + 5*82 + 0*81 + 6*80 +2*8-1 =(1862.25)10(0.2A)16=2*16-1 +10*16-2=(0.1640625)10

  • R2 68 2 34 0 2 17 0 2 8 1 2 4 0 2 2 0 2 1 0 0 1 681010001002

  • R 0.31252 = 0 .625 0.625 2 = 1 .25 0.25 2 = 0 .5 0.5 2 = 1 .0 0.312510 = 0.01012

  • (1011010.10)2=(001 011 010 .100)2 =(132.4)8(1011010.10)2=(0101 1010 .1000)2 =(5A.8)16(F7)16(1111 0111)2(11110111)2

  • (bit)(byte)(1 byte = 8 bit)K 1 K = 1024 byteM 1 M = 1024 KG 1 G = 1024 M T 1T=1024G

  • ASCII727=128EBCDIC828=256""(GB2312-80)

  • 4.2 4.2.1

  • ----

  • ENIAC19466Von Neumann

  • /

  • AASCII10000011000001A

  • ,

  • RAMROM

  • CPU( )central processing unit

  • RegisterCPUCPUregisterRegisterCPUregisterregister

  • CPUCPUCPUMooreJ.P.EchertJohn von Neumann

  • CPU

  • 4.3 4.3.1

  • 11 P=A B C11 P=A + B + C 1001

  • P P P A B C A B C A a b c

  • 4.4 4.4.1

  • CPU

  • (1)(2)(3)(4)(5)(6)/

  • CPUCISC(complex instruction set computer)RISC(reduced instruction set computer)

  • CISCCISCCISCIBM1964IBMIBM 360

  • CISC80%20%VLSI

  • RISC:CISC

  • {01}

  • 4.4 4.4.2

  • add idiv mul neg xchg test jmp

  • 3.10 2+62+6 1011000000000110 0000010000000010 1010001001010000000000002+6 MOV AL6 ADD AL2 MOV VCAL

  • 4.5

  • 4.5 4.5.1

  • 825AlKhowarizmiPersian TextbookAlgorithm

  • DiophantusArithmetica

  • ax=babb/a

  • ax+by=cabddc 13x+26y=521326131352x=2y=14.2 2x+4y=15242215

  • mnmn1nmrrn2r=0n33nmrn1

  • 4.3 m=56n=32mn:1325624224328382408mn8mn1mn

  • The Art of Computer Programming

  • 1 1 (1) (2) (3) (4)

  • 1 1 (1) (2) (3) (4)

  • 2Knuth (1) (2) (3) (4) (5)

  • 2 mn1rnr01nmn1

  • 2 1nmnmmn

    mn

  • 2 2n

  • 2 2n

  • 2

  • 3 QIF1QI2I34FQqQF(q)=q

  • 4.4 1+2+3++100 XY11X22Y3XYX4Y1Y5Y1003X

  • 4.5 XI10X21I3X1/IX4I1 5INX3

  • 4.6 0112358132134 11202L.P.FibonacciLiber Abaci

  • 1Fnn F0=0F1=1Fn+2=Fn+1+Fnn0

  • XFnYFn+1ZFn+2

  • 1=00YY1120X1Y3XY41I5I-1116XYZ7YX8ZY9Y10I1511

  • Visiting grandchildren can be nerve-racking,

  • 1

  • 2 ANSIAmerican National Standard Institute

  • 14.4

    N

    Y

    Y>100

    Y=Y+1

    X=X+Y

    Y=2

    X=1

  • 24.5

    Y

    N

    I>=N

    I=I+1

    X=X+1/I

    I=1

    X=0

  • 34.6

    N

    Y

    N

    Y

    Print Y

    Y=0

    I=I+1

    Print Y

    Y=Z

    X=Y

    Z=X+Y

    I>n-1

    I=1

    Print XY

    X=0Y=1

    n = 0

  • 314.4BEGIN() 1 X 2 YwhileY
  • 24.5BEGIN0 X1 Ido{ X+1/I X I+1 I }while(I>=n)END

  • 34.6 BEGINif n = =0 { 0 Y Print Y } else {

    0 X 1 Y Print XYfor(i=1;i

  • 4

  • 4.4C main(){ int X,Y; X=1; Y=2; while(Y
  • 4.5C main(){ int n; float X,I; printf("Please input n:"); scanf("%d",&n); X=0; I=1; do { X=X+1/I; I=I+1; }while(I
  • 3 1 2 3

  • 1 123n149n2n2(n2)

  • 1 nn

  • 1 T(n)nOrder=n2+n+1=(n2)

  • 1 f(n)nn0Cnn0T(n)C f(n)f(n)T(n)T(n) T(n)= (f(n))

  • (1) (logn) (n) (nc) (cn) (n!)

  • h(n)=2n-1(2n)4.4(1)4.5(n)4.6(n)

  • n10103628800101110

  • S(n)SSpaceS(n) S(n)= (g(n))

  • Euclidean

  • Godel

  • 4.5 4.5.2

  • 4.5.2 1.

  • Data Structure

  • 3 DS= D RD

  • Data

  • Data ElementnoderecordABCZN={ABCZ}

  • R

  • 1 2 3 4 5

  • 4.5.2 2.

  • nX[1]X[2]X[3]X[i]X[n]Last In First OutLIFOFirst In First OutFIFO

  • mnA[i,j] A[i,1]A[i,2]A[i,n]A[1,j]A[2,j]A[m,j]

  • Treenn0n=0 n>0mm0

  • 12AT1={BEFK}T2={CG}T3={DHIJL}4.412AT1={BEFK}T2={CG}T3={DHIJL}

    L

    K

    J

    I

    H

    G

    F

    E

    D

    B

    C

    A

  • nn0n0

  • G= V E

  • G=V={ABCD} E={(AB)(AC)(BD)(BC) (DC)(AD)}

    C

    D

    B

    A

  • 4.5 4.5.4

  • Nikiklaus Wirth1976 +=

  • 4.6 4.6.1

  • CobolForturnAlgolPascalAdaCLispSISALVALSmalltalkCLUC++PrologSNOBOLConcurrent PascalModula 2

  • 2050Noam ChomskyBackusNaurALGOL60BNF

  • 205060, 2060

  • 3

  • 4.6 4.6.2

  • 4.7 4.7.1

  • 4.7 4.7.2

  • 1983IEEE

  • 3

  • ---

  • 4.7

  • 4.8 4.8.1

  • (ISO)

  • ->-> -- -- -- -- -- -- -- -- --

  • GUI))(GISGPS)

  • 4.8 4.8.2

  • 4.8 4.8.3

  • CAD/CAM

  • 4 4.9

  • --- ---

  • 1 ---(Haugeland1985 ---Bellman,1978) 2 --Charniak,1985) ---Winston,1992)

  • 3 ---(Kurzweil1990 ---Rich,Knight,1991)4 ---Poole,1998) ---AI.Nilsson,1998)

  • 428--- --- --- --- ---

  • 800--- --- --- ---1776 --- --- ---

  • 1861--- ---1879 ---1940--- ---1948 ---1957 ---

  • Knoweledge Presentationn Problem solving Pattern Recognition (Automatic Theorem Proving) Automation Programming Natural Language ProcessingExpert Systerms Machine Learning Robotics Artificial Nueral Network (Computer Vision) Game Plaging

  • 4 4.10

  • IBM 360Architecture1964

  • LSI/VLSI

  • CPU

  • 4 4.12

  • CPU

  • M. J. Flynn1966SISDSIMDMISDMIMD

  • -

  • ISOOSI A B

  • OSI-

  • OSI--

  • OSI

  • 4 4.15 CC1991

  • CC1991

  • 1. Binding

  • 2. Complexity of Large Problems

  • 3. Conceptual and Format ModelsE-R

  • 4.Consistency and Completeness

  • 5. Efficiency

  • 6Evolution

  • 7. Levels of Abstraction

  • 8.Ordering in Space

  • 9. Ordering in Time

  • 10. Reuse

  • 11. Security

  • 12.Tradeoff and Consequences

    203020302310

    nHn nnnP.Bachmann1892Analytische ZahlentheorieOrder=n2+n+1=(n2)nn2nnnP.Bachmann1892Analytische ZahlentheorieOrder=n2+n+1=(n2)nn2nnnP.Bachmann1892Analytische ZahlentheorieOrder=n2+n+1=(n2)nn2nnnP.Bachmann1892Analytische ZahlentheorieOrder=n2+n+1=(n2)nn2nnnP.Bachmann1892Analytische ZahlentheorieOrder=n2+n+1=(n2)nn2nnnP.Bachmann1892Analytische ZahlentheorieOrder=n2+n+1=(n2)nn2nnnP.Bachmann1892Analytische ZahlentheorieOrder=n2+n+1=(n2)nn2nnnP.Bachmann1892Analytische ZahlentheorieOrder=n2+n+1=(n2)nn220302030