Professional Documents
Culture Documents
Computer Science
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.
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.
ii
2005 Computer Science Unplugged (http://csunplugged.org/)
.............................................................................................................................................................................. i
......................................................................................................................................................................... ii
.................................................................................................................................................................. i iiiv
: : 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
2005 Computer Science Unplugged (http://csunplugged.org/)
.iii
: ......................................................................................................... 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
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.
;
, .
(, , ) .
, , , , , ;
, ,
, ,
.
.
2005 Computer Science Unplugged (http://csunplugged.org/)
0 1.
;
*
(*. .: )
: 2 . .
.
: 2 . pattern '
pattern. patterns .
:
:
, set ( . 6).
A4 smiley ( ) .
. 6 .
O :
set .
. 6 .
(. 5)
' ,
:
: (. 7)
: (. 8)
: fax modem (. 9)
: (. 11)
.
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)
' .
' .
.
.
2005 Computer Science Unplugged (http://csunplugged.org/)
:
; , !
; ,
, , , , !
,
.
16 '
, :
.
, , , 5 .
3 , 12 19.
; ;
; , ;
Extra : 1, 2, 3, 4 .
, ;
.
2005 Computer Science Unplugged (http://csunplugged.org/)
.
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 .
.
2005 Computer Science Unplugged (http://csunplugged.org/)
:
Tom .
, .
, , . Tom
.
; Tom . !
, ! Tom
. ,
. ;
.
2005 Computer Science Unplugged (http://csunplugged.org/)
: modem
modem,
. . beep
1, 0. .
, , modem ,
, . ,
fax, modem .
Tom ,
.
modem, !
.
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.
.
2005 Computer Science Unplugged (http://csunplugged.org/)
11
;
.
. (
, ). (0 1) bit (binary digit). bit
.
, ,
, , 1 0.
(floppy ) , bit
.
- - .
.
2005 Computer Science Unplugged (http://csunplugged.org/)
12
(. 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
.
.
2005 Computer Science Unplugged (http://csunplugged.org/)
13
2
-
, , .
.
*
(*. .: )
: 2 . .
, (. 16)
14
: (.18 . 19)
.
2005 Computer Science Unplugged (http://csunplugged.org/)
:
1. fax;
2. ; ( ,
, )
3. , ;
( ,
, ' ).
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,
, .
.
2005 Computer Science Unplugged (http://csunplugged.org/)
15
:
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
. , '
!
.
2005 Computer Science Unplugged (http://csunplugged.org/)
17
: .
,
, ; ,
, ,
. ,
. (: ,
).
18
.
2005 Computer Science Unplugged (http://csunplugged.org/)
: .
Extra : ,
(.. 0 , 1 , 2 , .). , pixel
: pixel, .
/ ,
. !
.
2005 Computer Science Unplugged (http://csunplugged.org/)
19
.
1. , ,
, .
2. ' ,
, ' .
.
pixel,
. 12 pixel,
3 bit , , (7);
( pixel, pixel ,
, ).
.
2005 Computer Science Unplugged (http://csunplugged.org/)
20
;
1000x2000 pixel, , modem, fax,
pixel , , . ,
pixel (.., ) pixel ( ).
pixel.
, .
, run-length encoding (
), . ,
. fax .
, . ,
fax.
( ).
web.
,
.
.
2005 Computer Science Unplugged (http://csunplugged.org/)
21
: Kid Fax
22
.
2005 Computer Science Unplugged (http://csunplugged.org/)
3
! -
,
.
. ,
.
* :
(*. .: )
: patterns .
: . .
, ! (. 25)
: ! (. 26)
: extra (. 27)
: , (. 28)
: Extra (. 29)
.
2005 Computer Science Unplugged (http://csunplugged.org/)
23
. ,
.
.
.
. 25. .
,
; , ,
.
24
.
2005 Computer Science Unplugged (http://csunplugged.org/)
: !
.
;
.
2005 Computer Science Unplugged (http://csunplugged.org/)
25
: !
, .
, ;
.
........
'
...
.........
........
...
........
...
'
......
...
....
; puzzle.
.
, ,
.
: !
: ,
( , ..., , ..., ).
: .
, .
puzzle,
.
26
.
2005 Computer Science Unplugged (http://csunplugged.org/)
: xtra
puzzle;
B a n -- - , , , , .
, , . '
, , .
.
.
, ..:
Banana
Ban(2,3). 2 2 ,
' .
Ban-- 3 .
Bana-BananBanana
2 , ,
2 , . ,
2 .
, , .
;
.
2005 Computer Science Unplugged (http://csunplugged.org/)
27
: , ...
;
.
2 .
( ,
, ).
.
,
- ,
, ,
,
, ,
-
28
.
2005 Computer Science Unplugged (http://csunplugged.org/)
: xtra
;
499 2281 ,
( , ).
; 2
. !
' , ,
. ,
. ,
look .
.
,
, . - , .
", , !" .
" !" .
" , " ,
. -
. , , .
", , !" .
" !" .
" , " ,
, , -.
.
, ' .
", , !" .
" !" .
" , " ,
, , , . , :
! , , . ,
, !
, ' ' ,
. ,
, . '
, , ' .
.
2002 Computer Science Unplugged (http://csunplugged.org/)
29
;
/ , 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 .
36 , .
( ).
36 , .
.
2002 Computer Science Unplugged (http://csunplugged.org/)
31
.
, (
, . ,
.
, .
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).
.
2002 Computer Science Unplugged (http://csunplugged.org/)
33
, .
.
, 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
, ,
. ' , !
.
2002 Computer Science Unplugged (http://csunplugged.org/)
35
- 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), .
.
2002 Computer Science Unplugged (http://csunplugged.org/)
37
(
,
!
:
: ' : , ;
: .
:
:
, , .
.
,
, .
attraction Disneyland California.
, ,
. ( parrotty error), parity error,
.
, bit odd
, bit !
38
.
2002 Computer Science Unplugged (http://csunplugged.org/)
1000 ;
1000 1000 , Tolkien The Lord of the
rings; ,
. , ;
, .
.
10
, :
: (. 42)
.
2002 Computer Science Unplugged (http://csunplugged.org/)
39
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 . ,
. ,
. ' -.
; ; ;
' .
.
.
2002 Computer Science Unplugged (http://csunplugged.org/)
41
:
,
.
(. 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 .
.
2002 Computer Science Unplugged (http://csunplugged.org/)
43
/ , 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
.
, . 3
: , hash.
(*. .: )
: , 3 . : ,
: 3 . :
1A, 1B 1
2A, 2B 2
3A, 3B 3
47
1. 15 .
( ). .
2. 4 5 .
. . ,
, .
3. .
4. . ,
' . .
,
, , ,
. ,
3 . , .
, .
, .
48
1. , -. 1A, 1B.
!
2. 26
. .
3. . ( ,
. ,
, ).
,
(.. 2 ).
4. ;
: , .
( 1A' 1B' , ,
. 2A', 2B' 3A', 3B'
).
1. ;
2. ; ( 1 26 ,
.
, ).
49
' ,
' . .
1. , -. 2A, 2B. !
2. 26
. .
3. , . ,
.
, ,
.
, (.. 2
).
4. ;
: , .
1. ;
2. ;
3. ; ( ,
). ; (,
).
4. , ; (5 ).
50
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); (
.
, , ,
).
.
2002 Computer Science Unplugged (http://csunplugged.org/)
52
53
.
2002 Computer Science Unplugged (http://csunplugged.org/)
.
2002 Computer Science Unplugged (http://csunplugged.org/)
54
55
.
2002 Computer Science Unplugged (http://csunplugged.org/)
.
2002 Computer Science Unplugged (http://csunplugged.org/)
56
57
.
2002 Computer Science Unplugged (http://csunplugged.org/)
.
2002 Computer Science Unplugged (http://csunplugged.org/)
58
59
.
2002 Computer Science Unplugged (http://csunplugged.org/)
.
2002 Computer Science Unplugged (http://csunplugged.org/)
60
61
.
2002 Computer Science Unplugged (http://csunplugged.org/)
.
2002 Computer Science Unplugged (http://csunplugged.org/)
62
63
.
2002 Computer Science Unplugged (http://csunplugged.org/)
.
2002 Computer Science Unplugged (http://csunplugged.org/)
64
;
.
, ,
.
, .. , ,
(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/)
, ,
, e-mail , ' .
,
. ,
, , ' ,
.
,
, . , ,
. ' ,
.
(*. .: )
: , 2 . .
8 (..
)
: (. 68)
: (. 69)
.
2002 Computer Science Unplugged (http://csunplugged.org/)
66
.
, . ;
, , 2 . ,
.
67
1.
2.
. . 68, .
3.
.
2002 Computer Science Unplugged (http://csunplugged.org/)
:
: .
: , 8
:
1. . .
2. , .
3. . ;
: .
2 .
4. 3 , ,
. ; ; ;
5. , .
, , , 2
.
(Selection Sort)
, (selection sort).
: . ,
' . ,
.
.
Extra :
8 ; 9 ; 20;
.
2005 Computer Science Unplugged (http://csunplugged.org/)
68
:
Quicksort ( )
Quicksort , . ,
. :
.
, .
, , .
(, , , ' ).
.
. .
,
. ,
.
;
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! , ,
, '
....
.
2005 Computer Science Unplugged (http://csunplugged.org/)
70
;
.
, ,
...! ,
, .
' , .
, '
.
, 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, :
.
2005 Computer Science Unplugged (http://csunplugged.org/)
72
, .
, . '
, .
(*. .: )
: , 2 . : ,
73
6 .
(. 75) ,
.
2005 Computer Science Unplugged (http://csunplugged.org/)
,
:
,
.
1. 6. .
2. , .
3. (IN) .
.
4. ' ,
.
5. , . ,
' , , ,
.
6. ;
, .
() , '
. :
.
2005 Computer Science Unplugged (http://csunplugged.org/)
74
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 (
).
; , ,
, '
.
;
.
2005 Computer Science Unplugged (http://csunplugged.org/)
76
;
-, ,
.
( 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 . :
:
:
: (. 80)
( 40 )
.
2005 Computer Science Unplugged (http://csunplugged.org/)
78
, .. .
. 94, .
. ;
,
( ), ,
,
.
. .
, ,
. , , .
;
.
, ,
.. ,
.
( ),
2 ,
.
79
.
2005 Computer Science Unplugged (http://csunplugged.org/)
:
- , . '
, .
.
, ,
. , , :
1.
. ,
2. .
. () ,
.
, (). ( ,
).
;
.
2005 Computer Science Unplugged (http://csunplugged.org/)
80
, ,
.
,
. . ,
' , , ,
. , , ' .
, .
.
;
;
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 ,
.
.
2005 Computer Science Unplugged (http://csunplugged.org/)
82
10
- deadlock .
(*. .: )
( resource),
, Internet,
. deadlock (
). , ( )
.
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/)
.
.
,
.
, ,
,
.
.
2005 Computer Science Unplugged (http://csunplugged.org/)
85
;
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
set ( ' !)
( . 110), .
, , .
:
: (. 95)
, :
: (. 101)
: (. 102)
.
2002 Computer Science Unplugged (http://csunplugged.org/)
89
.
, .
, A B, .
. , (
). ,
. , ,
.
(:
). ,
, :
, 3 2 . 3
, ,
3 3 . :
' .
, A.
, .
. A.
. '
. , . '
. ' , .
90
.
2005 Computer Science Unplugged (http://csunplugged.org/)
, :
.
2005 Computer Science Unplugged (http://csunplugged.org/)
91
92
.
2005 Computer Science Unplugged (http://csunplugged.org/)
.
2005 Computer Science Unplugged (http://csunplugged.org/)
93
7 . 7 ,
, , .
, , .
, , .
,
, .
( , , ,
).
: ' .
:
; ;
(loops). ; ( , BBBABAB
BBBABBABAB, ).
94
.
2005 Computer Science Unplugged (http://csunplugged.org/)
.
2005 Computer Science Unplugged (http://csunplugged.org/)
95
: (1/4)
96
.
2005 Computer Science Unplugged (http://csunplugged.org/)
: (2/4)
.
2005 Computer Science Unplugged (http://csunplugged.org/)
97
: (3/4)
98
.
2005 Computer Science Unplugged (http://csunplugged.org/)
: (4/4)
.
2005 Computer Science Unplugged (http://csunplugged.org/)
99
, ( )
. ,
;
: (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. ,
.
, . , ,
!
.
2005 Computer Science Unplugged (http://csunplugged.org/)
101
:
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,
, , ,
.
.
2005 Computer Science Unplugged (http://csunplugged.org/)
103
(. 102)
( t ,
c ) :
, 2, 3 , .
104
.
2005 Computer Science Unplugged (http://csunplugged.org/)
12
,
.
, ,
' ,
.
.
*
(*. .: )
: 3
' .
, .
.
2005 Computer Science Unplugged (http://csunplugged.org/)
105
106
.
2005 Computer Science Unplugged (http://csunplugged.org/)
. ,
, , :
;
, ,
' !
, ,
:
1. .
2. ,
, .
3. ,
, .
4. , .
' :
.
2005 Computer Science Unplugged (http://csunplugged.org/)
107
( , . 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.
.
2005 Computer Science Unplugged (http://csunplugged.org/)
109