Ένα βιβλίο για πληροφορική

of 117 /117
Computer Science Unplugged Ένα κείμενο για να μάθουμε την Πληροφορική διασκεδάζοντας Για μαθητές Δημοτικού και Γυμνασίου Γράφτηκε από τους: Tim Bell, Ian H. Witten και Mike Fellows Προσαρμόσθηκε για τη χρήση μέσα στη τάξη από τους: Robyn Adams και Jane McKenzie Εικονογραφήσεις από τον Matt Powell Ελληνική μετάφραση: Κωστής Μουσαφείρης Επεξεργασία και προσαρμογή γραφικών στα Ελληνικά: Στέφανος Μουσαφείρης Αύγουστος 2010

Embed Size (px)

description

Ένα κείμενο για να μάθουμε την Πληροφορική διασκεδάζοντας Για μαθητές Δημοτικού και Γυμνασίου

Transcript of Ένα βιβλίο για πληροφορική

  • Computer Science

    Unplugged

    :

    Tim Bell, Ian H. Witten Mike Fellows

    :

    Robyn Adams Jane McKenzie

    Matt Powell

    :

    :

    2010

  • 2005 Computer Science Unplugged (http://csunplugged.org/)

  • .

    . ; ;

    , , ;

    . ,

    , ,

    !

    .

    ' . ,

    .

    ;

    .

    , .. ,

    , patterns .

    . ,

    , , , ,

    .

    3 2

    . .

    , . ' ,

    (unplug) .

    download, ,

    Google, Inc.

    Creative Commons Attribution Non

    Commercial - NoDerivs, , , , (

    ).

    , ).

    , .

    (

    http://csunplugged.org/).

    . ,

    .

    i 2005 Computer Science Unplugged (http://csunplugged.org/)

  • .

    .

    South Park School (Victoria, BC), Shirley, Ilam

    Westburn (Christchurch, )

    . : Linda Picciotto, Karen Able, Bryon Porteous, Paul Cathro,

    Tracy Harrold, Simone Tanoa, Lorraine Woodfield Lynn Atkinson,

    . Gwenda Bensemann

    . Richard Lynders Sumant

    Murugesh .

    Ken Noblitz.

    Victoria Mathmania Kathy Beveridge.

    Malcolm Robinson Gail Williams, Hans Knutson. Matt Powell

    project Unplugged.

    Brian Mason Scientific Technical Trust

    .

    Paul Ruth Ellen Howard,

    . Peter

    Henderson, Bruce McKenzie, Joan Mitchell, Nancy Walker-Mitchell, Gwen Stark, Tony Smith, Tim A. H. Bell1, Mike

    Hallett Harold Thimbleby.

    : Bruce, Fran, Grant, Judith Pam

    , Andrew, Anna, Hannah, Max, Michael Nikki,

    2 .

    Google Inc. Unplugged project

    download.

    .

    http://csunplugged.org/.

    1

    2

    , , Michael.

    i i 2005 Computer Science Unplugged (http://csunplugged.org/)

  • ..............................................................................................................................................................................i

    .........................................................................................................................................................................ii

    .................................................................................................................................................................. i i i iv

    : : H - A ................................................... 1

    : ................................................................................................................................................ 2

    1 : ............................................................................... 3

    ............................................................................................................................................................. 4

    : .............................................................................................................................. 5

    : ...................................................................................................... 6

    : ...................................................................................... 7

    : ........................................................................................................... 8

    : modem ............................................................................................ 9

    : 31 ...................................................................................................... 10 ...................................................................................................... 11

    ;.................................................................................................................................................. 12

    ......................................................................................................................................................... 13

    2 : : ............................................... 14

    .................................................................................................................................... 15

    : ........................................................................... 16

    : Kid Fax ...................................................................................................................................................... 17

    : ...................................................................................................... 18

    : ...................................................................................................... 19

    ; .................................................................................................................................................... 21

    ......................................................................................................................................................... 22

    3 : ! .............................................................. 23

    ! .................................................................................................................................................... 24

    . i i i 2005 Computer Science Unplugged (http://csunplugged.org/)

  • : ......................................................................................................... 25

    : ! ....................................................................................................................... 26

    : Extra .................................................................................................................................. 27

    : , K ........................................................................................................... 28

    : Extra .................................................................................................................................. 29

    ; ................................................................................................................................................... 30

    4 : ........ 31

    ............................................................................................................................................................... 32

    , ............................................................................. 34

    : Detective ..................................................................................... 35

    ; .................................................................................................................................................. 37

    ........................................................................................................................................................ 37 5 : - .......................................................................... 39

    ..................................................................................................................................................................... 40

    ....................................................................................................................................... 41

    : ............................................................................................................................... 42

    ; ................................................................................................................................................... 43

    ......................................................................................................................................................... 44

    : - ..................................................... 46

    .................................................................................................................. 46

    6 : .............................................................................................. 47 ................................................................................................................................................................................ 48

    ................................................................................................................... 49

    ..................................................................................................................... 50

    Hash ........................................................................................................................... 51

    ................................................................................................................................................. 52

    ; ..................................................................................................................................................... 65

    iv 2005 Computer Science Unplugged (http://csunplugged.org/)

  • 7 : .................................................... 66

    .............................................................................................................................. 67

    : ...................................................................................... 68

    : .................................................................................... 69 ; ........................................................................................................................................... 71

    ................................................................................................................................................. 72

    8 : ............................................................................. 73

    ..................................................................................................................................................... 74

    : ........................................................................................... 75

    ; ......................................................................................................................................... 77

    9 : - Minimal Spanning Trees ................................................................ 78

    .................................................................................................................................................... 79

    : ....................................................................................................................... 80

    ; / ............................................................................................. 82

    10 : .............. 83

    . ................................................................................................................................... 84

    ; ....................................................................................................................................... 86

    III : ................................................................... 87

    .......................................................................................... 88 11 : finite states) ............................................................. 89

    ............................................................................................................................................... 90

    .......................................................................................................... 92 /93

    ........................................................................................................................................................... 94

    : ....................... 95

    : (4 ) .............................................................. 96 / 99

    Finite State Automata (FSA) ................................................................................................................................ 100

    v 2005 Computer Science Unplugged (http://csunplugged.org/)

  • : ....................................................................................................................... 101

    : .......................................................................................... 102 ; ................................................................................................................................................ 103

    ......................................................................................................................................................... 104

    12 : ............................................................... 105

    ................................................................................................................................................................. 107

    ; ................................................................................................................................................. 108

    vi 2005 Computer Science Unplugged (http://csunplugged.org/)

  • : -

    .

  • : .

    ;

    computer computare, , ! , , , . ; , : 0 1.

    ;

    , . (, , ) .

    , , , , , ;

    , , , , .

    . 2 2005 Computer Science Unplugged (http://csunplugged.org/)

  • 1

    0 1. ;

    * (*. .: )

    : 2 . . . : 2 . pattern '

    pattern. patterns .

    :

    :

    7

    , set ( . 6). A4 smiley ( ) .

    . 6 .

    O :

    set . . 6 .

    (. 5)

    ' , :

    : (. 7)

    : (. 8)

    : fax modem (. 9)

    : ' ' 31 (. 10)

    : (. 11)

    \

    . 3 2005 Computer Science Unplugged (http://csunplugged.org/)

  • .5, .

    ' , 5 , , . 5 , , , , :

    ; ( ).

    , ' ; (32) ; ...

    , . . 6 ( 4 2), 15 ( 8, 4, 2 1), 21 (16, 4 1)...

    0.

    , ( - ). 5 . , 0. , 1. .

    01001 (: 9) 17 (: 10001) ' .

    ' . .

    4 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • :

    ; , !

    ; , , , , , ! , .

    16 ' , :

    .

    , , , 5 .

    3 , 12 19. ; ; ; , ;

    Extra : 1, 2, 3, 4 . , ;

    . 5 2005 Computer Science Unplugged (http://csunplugged.org/)

  • :

    6 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • :

    . 0 , 1 . :

    10101; 11111 ;

    ; .

    , .

    :

    Extra : 1, 2, 4, 8 16 , , 31 . , , () 1, 2, 4, 8, 16 , , , 0 32 .

    . 7 2005 Computer Science Unplugged (http://csunplugged.org/)

  • :

    Tom . , . , , . Tom . ; Tom . ! , ! Tom . , . ;

    8 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • : modem

    modem, . . beep 1, 0. . , , modem , , . , fax, modem .

    Tom , . modem, !

    . 9 2005 Computer Science Unplugged (http://csunplugged.org/)

  • : 31

    . , ; ; ; , . , :

    1, 2, 4, 8, 16... : 1 + 2 + 4 = ; ;

    : 1 + 2 + 4 + 8 = ;

    , ;

    , , . 10; , , 10, ! , 0 31, , . , ' 2, ' 4 ' . 32 ( 0 !) , 1, . , 0.

    , 0 1023! 1024 !

    (' ' ), . 32 , 2 32 x 32 = 1024 , , 20 ;

    10 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • : .

    1. , .

    10 (), , 10. .. 9 90, 30 300.

    ; :

    1001 10010 (9) (?)

    , . ; , ;

    2. , bit ( bit binary digit ). , , 5 , 5 bits. , , , , , $ %.

    . bit , , ; , SCII (American Standard Code for Information Interchange, ), bit . , , , , , , ., bit.

    . 11 2005 Computer Science Unplugged (http://csunplugged.org/)

  • ; . . ( , ). (0 1) bit (binary digit). bit .

    , , , , 1 0. (floppy ) , bit . - - .

    CD, CD-ROM DVD, bit : bit, .

    bit , ' bit . bit, byte 0 255.

    bit . , 32 bit, , 32 bit. 16 bit, 32 bit, , , .

    bit byte , . , , , .

    . 12 2005 Computer Science Unplugged (http://csunplugged.org/)

  • (. 5)

    3 2 1

    12 8 4

    19 16, 2 1

    ( ) .

    31, 0. .

    Extra : , , , ( , , , , ). (. 7)

    10101 = 21, 11111 = 31

    (. 8)

    Tom: .

    ' 31 (. 10)

    , .

    1024 1024 = 1,048,576 - 0 1,048,575!

    (. 11)

    , .

    1 (. ) ( ), . ( 10, , 10, ).

    7 bit . 128 . , 7 bits byte 8-bit, 1 bit .

    . 13 2005 Computer Science Unplugged (http://csunplugged.org/)

  • 2

    -

    , , . .

    * (*. .: )

    : 2 . .

    7

    , (. 16)

    :

    : Kid Fax (. 17)

    : (.18 . 19)

    14 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • :

    1. fax;

    2. ; ( , , )

    3. , ;

    ( , , ' ).

    .

    , pixel (picture element, ).

    , .

    a , pixel . , , , .

    1, 3, 1 4, 1 1, 4 0, 1, 3, 1 0, 1, 3, 1 1, 4

    . 1 pixel, 3 1 . 1, 3, 1.

    O pixel . pixel , 0. . 23, , .

    . 15 2005 Computer Science Unplugged (http://csunplugged.org/)

  • :

    a PC, o, pixel .

    1, 3, 1 4, 1 1, 4 0, 1, 3, 1 0, 1, 3, 1 1, 4

    ,

    ,

    16 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • : Kid Fax

    . , ' !

    . 17 2005 Computer Science Unplugged (http://csunplugged.org/)

  • : .

    , , ; , , , . , . (: , ).

    18 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • : .

    Extra : , (.. 0 , 1 , 2 , .). , pixel : pixel, . / , . !

    . 19 2005 Computer Science Unplugged (http://csunplugged.org/)

  • .

    1. , , , .

    2. ' , , ' .

    .

    pixel, . 12 pixel, 3 bit , , (7);( pixel, pixel , , ).

    . 20 2005 Computer Science Unplugged (http://csunplugged.org/)

  • ; 1000x2000 pixel, , modem, fax, pixel , , . , pixel (.., ) pixel ( ). pixel. , . , run-length encoding ( ), . , . fax . , . , fax.

    ( ). web.

    , .

    . 21 2005 Computer Science Unplugged (http://csunplugged.org/)

  • : Kid Fax

    22 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • 3

    ! -

    , . . , .

    * : (*. .: )

    : patterns . : . .

    9

    , ! (. 25)

    :

    : ! (. 26) : extra (. 27) : , (. 28) : Extra (. 29)

    . 23 2005 Computer Science Unplugged (http://csunplugged.org/)

  • !

    . , . .

    .

    . 25. . , ; , , .

    ,

    ..., .... ....

    24 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • : !

    .

    ;

    . 25 2005 Computer Science Unplugged (http://csunplugged.org/)

  • : ! , . , ; .

    '

    ,

    '

    .. .. ..

    ; puzzle. . , , .

    : !

    : , ( , ..., , ..., ).

    : . , .

    puzzle, .

    26 . 2005 Computer Science Unplugged (http://csunplugged.org/)

    ........

    .........

    ........

    ........ ...

    ...

    ....

    ...

    ...

  • : xtra

    puzzle;

    B , , , , . , , . ' , , . .

    .

    , ..:

    Banana Ban(2,3). 2 2 , ' .

    Ban---

    3 .

    Bana--

    Banan- Banana

    2 , , 2 , . , 2 .

    , , . ;

    . 27 2005 Computer Science Unplugged (http://csunplugged.org/)

    a n -- - -

  • : , ...

    ;

    . 2 . ( , , ). .

    ,

    - ,

    , ,

    ,

    , ,

    -

    28 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • : xtra

    ;

    499 2281 , ( , ). ; 2 . !

    ' , , . ,

    . , look . .

    , , . - , .

    ", , !" .

    " !" .

    " , " , . - . , , .

    ", , !" .

    " !" .

    " , " , , , -. . , ' .

    ", , !" .

    " !" .

    " , " , , , , . , : ! , , . , , ! , ' ' , . , , . ' , , ' .

    . 29 2002 Computer Science Unplugged (http://csunplugged.org/)

  • ;

    / , 25 , , !

    ' , . , , . (files) , . , .

    ' . , .. , , modem , . , . , .

    . , , Ziv-Lempel , , LZ, ( . Ziv . Lempel) '70. . zip GIF modem . modem, , , .

    , . Morse .

    ! (. 26)

    , ,

    ' ,

    , ',

    .

    30 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • 4

    &

    , , . , . .

    * (*. .: )

    : 3 . (computation) (estimation).

    3 . Patterns .

    9

    36 , . ( ).

    :

    36 , .

    . 31 2002 Computer Science Unplugged (http://csunplugged.org/)

  • .

    , ( , . , . , .

    1. / / 5 x 5, .

    , , .

    , . , , .

    2. / , . , , , .

    ;

    32 . 2002 Computer Science Unplugged (http://csunplugged.org/)

  • :

    1. , 5x5.

    2. ; ; .

    3. 6o , , . (parity card).

    4. 6 , .

    5. . ; ( ). .

    6. , .

    :

    1. . . , ( ), ( ) 0 , 1 , .

    2. 2 ; ( 2 , , . , 1 2 , . 4 , bit , , , ).

    3. , . , ' , . ' ; (, ).

    4. ' ( ). , , ; ( ). , ; , , ; ( , , , . 5x5, 5x9 4x6, 3x4).

    . 33 2002 Computer Science Unplugged (http://csunplugged.org/)

  • , .

    . , 10 , . , bit .

    ISBN (International Standard Book Number), , . .

    :

    10, 9, 8 ' , 2 , , .

    , ISBN 0-13-911991-4, :

    (0 10) + (1 9) + (3 8) + (9 7) + (1 6)

    + (1 5) + (9 4) + (9 3) + (1 2)

    = 172

    11. ;

    172 11 = 15 7

    , ( checksum ) , 11, .

    11 7 = 4

    . ISBN; ! ! 4, SBN , .

    10 , , . X.

    (UPC barcode)

    34 . 2002 Computer Science Unplugged (http://csunplugged.org/)

  • , (barcodes) supermarkets. ,

    , formula. supermarkets

    scanner: laser, ,

    , ,

    . scanner , bip .

    scanner , , scanner

    , ,

    . ' , !

    . 35 2002 Computer Science Unplugged (http://csunplugged.org/)

  • - Detective

    ISBN. .

    . , ISBN.

    ;

    ISBN.

    :

    , .. ,

    .

    X ; , 11 X.

    ; ; ( );

    36 . 2002 Computer Science Unplugged (http://csunplugged.org/)

  • ;

    10 . . , 10 1000 . , .

    .

    - . , , , , - . , , , .. , .

    , , , , , , !

    ( error detection) ( error recovery).

    , . bit , . , , , , .

    , . , , ' . , .

    ; :

    : : , ;

    A: .

    .. . , .. 2 ( 3), 3 ( 2), .

    . 37 2002 Computer Science Unplugged (http://csunplugged.org/)

  • ( , !

    :

    : ' : , ;

    : .

    :

    :

    , , .

    . , , . attraction Disneyland California.

    , , . ( parrotty error), parity error, .

    , bit odd , bit !

    38 . 2002 Computer Science Unplugged (http://csunplugged.org/)

  • 5

    1000 ; 1000 1000 , Tolkien The Lord of the rings; , . , ;

    , . .

    10

    , :

    : (. 42)

    . 39 2002 Computer Science Unplugged (http://csunplugged.org/)

  • 1. .

    2. ; ; ; ' ; 400 , bla, bla, bla, ;

    ' ! ' .. - , . , , , .

    ;

    . : , . , .

    , . .

    40 . 2002 Computer Science Unplugged (http://csunplugged.org/)

  • . , , . , .

    :

    :

    1 100 1 1000 1 1,000,000. 6 , .

    (.. 2, 4, 6, 8, 10)

    . .

    ; ;

    ' 1 100, 7 , . ..:

    50; . 25; . 37; . 43; . 40; . 41; . 42! !

    , 1000, 10 , 3 4 .

    , . , astermind.

    : ;

    , , .

    46 . , . , . ' -. ; ; ; ' . .

    . 41 2002 Computer Science Unplugged (http://csunplugged.org/)

  • :

    , .

    (. decision tree) 0 7:

    / 5;

    / ;

    , : 0, 1, 2, 3... , ( 1).

    . = 0 = 1, ;

    , , , , ' .

    0 15.

    Extra : ; ;

    42 . 2002 Computer Science Unplugged (http://csunplugged.org/)

  • ;

    Claude Shannon, ( -), . bits: / , 1/0 bit. , ' , . , . ' , , . , , 1 bit: . 9 10 , 1 bit: , , . / ; , 2 ; , ~ 80% . 20% , , 2 . , , !

    Shannon . , . , , .

    . , bit . ' , . , (bit) , ! !

    (interface) , ! , . . , , 2 / , mouse . SMS .

    . 43 2002 Computer Science Unplugged (http://csunplugged.org/)

  • / , 1 bit 50 ; , 20 60;

    , , . 3 011 - , , 0 1 .

    , ' , .

    , .

    44 . 2002 Computer Science Unplugged (http://csunplugged.org/)

  • -

  • , ' ..

    , , , .

    , ,

    , .

    .

    .

    .

    , ,

    , .., ,

    ,

    container, ( 100 )

    .

    Mohammed ibn Musa Al-Khowarizmi, . ,

    , Khowarizm - ,

    , 800 .. ,

    , . 1120, Dixit Algorismi -

    Algorismi (, , !)

    . 46

  • 2002 Computer Science Unplugged (http://csunplugged.org/)6

    .

    , . 3

    : , hash.

    * (*. .: ) : , 3 . : ,

    : 3 . :

    9

    :

    1A, 1B 1

    2A, 2B 2

    3A, 3B 3

    1A', 1B', 2A', 2B',

    3A', 3B'.

    47 .

  • 2002 Computer Science Unplugged (http://csunplugged.org/)

    1. 15 .

    ( ). .

    2. 4 5 .

    . . ,

    , .

    3. .

    4. . ,

    ' . .

    , ,

    , , ,

    . ,

    3 . , .

    , .

    , .

    . 48

  • 2002 Computer Science Unplugged (http://csunplugged.org/)

    1. , -. 1A, 1B.

    !

    2. 26

    . .

    3. . ( ,

    . ,

    , ).

    ,

    (.. 2 ).

    4. ;

    : , .

    ( 1A' 1B' , ,

    . 2A', 2B' 3A', 3B'

    ).

    1. ;

    2. ; ( 1 26 ,

    .

    , ).

    49 .

  • 2002 Computer Science Unplugged (http://csunplugged.org/)

    ' , ' . .

    1. , -. 2A, 2B. !

    2. 26 . .

    3. , . , . , , . , (.. 2 ).

    4. ; : , .

    1. ;

    2. ;

    3. ; ( , ). ; (, ).

    4. , ; (5 ).

    . 50

  • 2002 Computer Science Unplugged (http://csunplugged.org/)

    hash

    1. , ,

    .

    2. ' ( 0 9) . ,

    . ,

    . , 2345,

    2+3+4+5, 14. 4,

    . ,

    . hash ( )

    .

    3. . ,

    , .

    ( , 3A' 3B' ,

    , .

    1. .

    2. ; ( ).

    ; ( ).

    3. , ; ;

    3 ; (

    , .

    , , 2, , , .

    , , 3 1,

    .

    51 .

    2002 Computer Science Unplugged (http://csunplugged.org/)

  • 1. , 3 . 2 ,

    ' . hash

    . ( ).

    ; ( ).

    2. ; ( ,

    26 . , 5.

    Hash, ).

    3. ,

    ( 6), 1000 ( 9), ( 19); (

    .

    , , ,

    ).

    . 52 2002 Computer Science Unplugged (http://csunplugged.org/)

  • 53 . 2002 Computer Science Unplugged (http://csunplugged.org/)

  • . 54 2002 Computer Science Unplugged (http://csunplugged.org/)

  • 55 . 2002 Computer Science Unplugged (http://csunplugged.org/)

  • . 56 2002 Computer Science Unplugged (http://csunplugged.org/)

  • 57 . 2002 Computer Science Unplugged (http://csunplugged.org/)

  • . 58 2002 Computer Science Unplugged (http://csunplugged.org/)

  • 59 . 2002 Computer Science Unplugged (http://csunplugged.org/)

  • . 60 2002 Computer Science Unplugged (http://csunplugged.org/)

  • 61 . 2002 Computer Science Unplugged (http://csunplugged.org/)

  • . 62 2002 Computer Science Unplugged (http://csunplugged.org/)

  • 63 . 2002 Computer Science Unplugged (http://csunplugged.org/)

  • . 64 2002 Computer Science Unplugged (http://csunplugged.org/)

  • ;

    . , , . , .. , , (search keys).

    . , , . . , , supermarket 10.000 . , 10.000 , . ' , 10 . - !

    . , . , . . supermarket, 10,000 14 , .

    hash. ' , . , , , 11. , hash 4 - , . , , . , , , , .

    hash , ' , ' .

    65 . 2002 Computer Science Unplugged (http://csunplugged.org/)

  • 7

    , , , e-mail , ' . , . , , , ' , .

    , , . , , . ' , .

    * (*. .: ) : , 2 . .

    8

    :

    8 (.. )

    : (. 68) : (. 69)

    . 66 2002 Computer Science Unplugged (http://csunplugged.org/)

  • O

    . , . ;

    , , 2 . , .

    1. .

    2. . . 68, .

    3. .

    67 . 2002 Computer Science Unplugged (http://csunplugged.org/)

  • :

    : .

    : , 8

    :

    1. . .

    2. , .

    3. . ;

    : . 2 .

    4. 3 , , . ; ; ;

    5. , . , , , 2 .

    (Selection Sort)

    , (selection sort).

    : . , ' . , . .

    Extra : 8 ; 9 ; 20;

    . 68 2005 Computer Science Unplugged (http://csunplugged.org/)

  • :

    Quicksort ( )

    Quicksort , . , . :

    .

    , . , , .(, , , ' ).

    . . .

    , . , .

    ;

    Quicksort selection sort, . , 14 , . 28 selection sort. , quicksort selection sort , , - !

    Extra : quicksort, , , ;

    69 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • . , :

    Insertion sort ( ): , , ( ). , , , . .

    Bubble sort ( ) , - , ' ' . . , .

    Mergesort ( ) . ' , ( , ). , , 2 . :

    ' , 2 2 . , 40 60 gr, 2 , , (' ) 40 gr.

    ; , ... Mergesort! , , , ' ....

    . 70 2005 Computer Science Unplugged (http://csunplugged.org/)

  • ; . , , ...! , , . ' , . , ' . , insertion sort, selection sort bubble sort, , , quicksort. Quicksort concept (recursion). , . . () , ('). quicksort, . ! , .

    71 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • 1. , ' , , , . , 2 , , .

    2. . 3 2 (transitive operator), , A B B C, A C).

    :

    selection sort .

    2 , , 3 2, 4 3 . 8 selection sort, 7 , 6 , 5 , . :

    7 + 6 + 5 + 4 + 3 + 2 + 1 = 28

    n 1 + 2 + 3 + 4 +... + n - 1 .

    , . , 1 + 2 + 3 + ... + 20, :

    (1 + 20) + (2 + 19) + (3 + 18) + (4 + 17) + (5 + 16) +

    (6 + 15) + (7 + 14) + (8 + 13) + (9 + 12) + (10 + 11)

    = 21 10

    = 210

    , 1 + 2 + 3 + 4 ... + n 1 = n(n 1)/2.

    . 72 2005 Computer Science Unplugged (http://csunplugged.org/)

  • 8

    , . , . ' , .

    * (*. .: )

    : , 2 . : ,

    7

    .

    6 .

    (. 75) ,

    73 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • , :

    , .

    1. 6. .

    2. , .

    3. (IN) . .

    4. ' , .

    5. , . , ' , , , .

    6. ;

    , .

    () , ' . :

    . 74 2005 Computer Science Unplugged (http://csunplugged.org/)

  • :

    75 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • 1. , .

    2. (.. , ).

    3. , .

    1. , ; ( )

    , ; ( ! T input ).

    2. . , 3 . .

    3. 2 , 4 inputs. ; ( o 2. 1 , , 2 . 1 , 2 ).

    4. .

    5. input. , 8 : output minimum inputs ( ).

    ; , , , ' . ;

    . 76 2005 Computer Science Unplugged (http://csunplugged.org/)

  • ;-, , .

    ( 6 e 7).

    , , . , 6 , 12 , 3 . 5 . .

    .' , 10 . 10 ' , . 10 2 1. , .

    77 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • 9 - Minimal Spanning Trees* (* )

    : , , . , , . , , .

    * (*. .: )

    : , 2/3 . :

    :

    9

    :

    :

    :

    : (. 80)

    ( 40 )

    . 78 2005 Computer Science Unplugged (http://csunplugged.org/)

  • , .. . . 94, .

    . ;

    , ( ), , , . . .

    , , . , , .

    ;

    . , , .. , .

    ( ), 2 , .

    79 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • :

    - , . ' , . . , , . , , :

    1. . ,

    2. .

    . () , . , (). ( , ).

    ;

    . 80 2005 Computer Science Unplugged (http://csunplugged.org/)

  • :

    , , .

    , . . , ' , , , . , , ' . , .

    .

    ; ;

    81 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • ; , , , , . , . , , .

    (Minimal spanning tree, MST).

    MST . , , , . , , ' , . , , . ' , .

    Minimal spanning trees , .

    () minimal spanning trees . , , ' , . Kruskal ( J.B. Kruskal 1995).

    , , .

    (. 81)

    , n ; , , n1 , n , .

    . 82 2005 Computer Science Unplugged (http://csunplugged.org/)

  • 10

    - deadlock .

    * (*. .: )

    :

    ( resource), , Internet, . deadlock ( ). , ( ) .

    9

    :

    83 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • . , . , , .

    1. 5 , , - .

    2. , (.. ). , . 2 . , 1 , 2 ( , 1 ). , .

    3. , . , , , , . , , .

    4. , , . . :

    ) .

    ) ' , . ( ).

    greedy (. , ), . Greedy , . , greedy (incremental), , , . greedy , . ! .

    ; deadlock ; ( , ....)

    84 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • .

    .

    , .

    , , , .

    . 85 2005 Computer Science Unplugged (http://csunplugged.org/)

  • ;

    deadlock , , , Internet. .

    , deadlock, . . , , , deadlock: ! , , , deadlock . , , , .

    , , . ( ) , (lock operation), . , . , , , , deadlock. , : A , B A. , , 2 A B. A, B, deadlock, 1 B, 2, , 1 A.

    , , , . , ( !), .

    86 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • III

  • , . , ' . !

    , . , , , , , ! . , robot, , , .

    , .

    ' , , .

    1 , () , . Finite State Automata FSA .

    2 . , , . , . , , .

    88 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • 11

    - Finite State Automata (FSA)

    , , . FSA . FSA . FSA: !

    * (*. .: )

    : - patterns

    patterns

    9

    :

    set ( ' !) ( . 110), .

    , , .

    :

    : (. 95)

    , :

    : (. 101) : (. 102)

    . 89 2002 Computer Science Unplugged (http://csunplugged.org/)

  • . , .

    , A B, . . , ( ). , . , , .

    (: ). , , :

    , 3 2 . 3 , , 3 3 . : ' .

    , A. , . . A. . ' . , . ' . ' , .

    90 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • , :

    . 91 2005 Computer Science Unplugged (http://csunplugged.org/)

  • 92 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • . 93 2005 Computer Science Unplugged (http://csunplugged.org/)

  • 7 . 7 , , , . , , . , , . , , .

    ( , , , ).

    : ' .

    :

    ; ; (loops). ; ( , BBBABAB BBBABBABAB, ).

    94 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • :

    . 95 2005 Computer Science Unplugged (http://csunplugged.org/)

  • : (1/4)

    96 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • : (2/4)

    . 97 2005 Computer Science Unplugged (http://csunplugged.org/)

  • : (3/4)

    98 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • : (4/4)

    . 99 2005 Computer Science Unplugged (http://csunplugged.org/)

    !

  • Finite State Automata FSA

    , :

    , ( ) . , ;

    : (a), ( , . . 2), A (.. AB, BABAA AAABABA)

    (b), , ( ) , (AB, ABAB, ABABAB, ...).

    (c) B (, , : A, AA, AAA, AAAA, ...).

    100 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • :

    ; ; !

    1. , . . , ( patterns).

    ( , ), . , . ;

    2. ; . puzzle ' Finite state Automata.

    3. , .

    , . , , !

    . 101 2005 Computer Science Unplugged (http://csunplugged.org/)

  • :

    Internet , robot .

    , 50% , ! . , pattern, . ; , . , , (t , c ):

    . ( ) . ' pattern, ;

    , (: 4 ).

    102 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • ;

    Finite state Automata .

    , , , 1 ' ... 2 .... 3 . input finite states, . finite states, . finite states, . , !

    . . , Finite state Automaton. , Automaton ( ). , 100 , . ( ), . 115. , . '60, Eliza ( Eliza Dolittle, My Fair Lady), . , , . ' , , , ' !

    , . , . finite states, , , , .

    . 103 2005 Computer Science Unplugged (http://csunplugged.org/)

  • (. 102)

    ( t , c ) :

    , 2, 3 , .

    104 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • 12

    , . , , ' , . .

    * (*. .: )

    : 3

    7

    ' .

    :

    , .

    . 105 2005 Computer Science Unplugged (http://csunplugged.org/)

  • 106 .

    2005 Computer Science Unplugged (http://csunplugged.org/)

  • . , , , : ;

    , , ' !

    , , :

    1. .

    2. , , .

    3. , , .

    4. , .

    ' :

    . 107 2005 Computer Science Unplugged (http://csunplugged.org/)

  • ( , . 106). . , , . , . .

    , . , .

    , .

    , . , , , .

    . ( , ) .

    :

    1. .

    2. , , (90 ), (90 ).

    , , .

    3. : .

    108 . 2005 Computer Science Unplugged (http://csunplugged.org/)

  • ;

    , , . , , . , .

    , .

    , , ' , .

    , , . , . (space shuttle), , ! bugs, , ( ) relais, , '40. , , debugging, ( , ).

    , . , , . . , . , bugs , . , , , ' !

    Creative Commons

    - - 3.0 . www.greeklug.gr.

    . 109 2005 Computer Science Unplugged (http://csunplugged.org/)