Lecture 23 Numeric Symbolic Computing Computer Networks SG
Lecture 23 Numeric & Symbolic Computing Computer Networks (S&G, §§ 11. 3– 11. 4, 12. 1– 12. 2) 12/17/2021 CS 100 - Lecture 23 1
Numeric and Symbolic Computing 12/17/2021 CS 100 - Lecture 23 2
Numeric Computation • Applications that make heavy use of real arithmetic • Especially used in science, engineering, economics, statistics, animation • The motivation for the first computers • Still drives the development of supercomputers and parallel computers § a teraflop machine performs at least 1012 (a trillion) floating-point operations per second § 36 Tflops already achieved (Japan’s Earth Simulator, which cost $350– 500 M) 12/17/2021 CS 100 - Lecture 23 3
Computer Science Issues • Performance: – better algorithms – accessing of data in memory hierarchies – parallel computation – data communication in networks • Mathematical software libraries • Accuracy and stability of numerical approximations 12/17/2021 CS 100 - Lecture 23 4
Symbolic Computing • Manipulate mathematical formulas, equations, etc. much the way a mathematician would – automate processes that are mechanical, tedious, and error-prone • Examples: Macsyma, Mathematica, Maple, Mat. Lab 12/17/2021 CS 100 - Lecture 23 5
Example: Simplification • Simplify[(x-1)^2 + (x+2) + (2 x-3)^2 + x] • 12 - 12 x + 5 x 2 12/17/2021 CS 100 - Lecture 23 6
Example: Expansion • Expand[(1 + x + 3 y)^4] • 1 + + + 12/17/2021 + 4 x + 36 xy + 108 xy 2 108 xy 3 6 x 2 + 4 x 3 + x 4 + 12 y 36 x 2 y + 12 x 3 y + 54 y 2 + 54 x 2 y 2 + 108 y 3 + 81 y 4 CS 100 - Lecture 23 7
Example: Solving Equations • Solve[ {2 x + y == 11, 6 x - 2 y == 8}, {x, y}] • {{x -> 3, y -> 5}} 12/17/2021 CS 100 - Lecture 23 8
Typical Expansion Rules Hence, Expand[(n + 1)2] ÞExpand[(n + 1)] ÞExpand[(n + 1)n + (n + 1)1] ÞExpand[n n + 1 n + n 1 + 1 1] 12/17/2021 CS 100 - Lecture 23 9
Digression • Recall our discussion of formalized mathematics, and the idea of reducing mathematics to the mechanical application of formal rules • Formal rules: depend on the form of expressions, not their meaning • Symbolic computation is an application of the idea of a calculus 12/17/2021 CS 100 - Lecture 23 10
Computer Science Issues • Symbolic computation systems are: – very high-level languages – problem-specific – nonprocedural • Depend on many algorithms, e. g. : – pattern matching – efficient management of complex data structures representing formulas • Results should be presented in a form familiar and useful to the mathematically literate 12/17/2021 CS 100 - Lecture 23 11
Computer Networks (S&G ch. 12) 12/17/2021 CS 100 - Lecture 23 12
Communication Links • Switched dial-up phone lines – require modem (modulator-demodulator) to interface between digital interface and analog phone line – use data compression & error correction • Dedicated links – wired (wire proper & fiber optic cable) – wireless 12/17/2021 CS 100 - Lecture 23 13
Kinds of Networks • Local Area Network (LAN) – limited range (building, campus) – typically owned by owners of premises – example: Ethernet • Wide Area Network (WAN) – worldwide (and beyond!) – typically owned by telecommunications services – example: Internet 12/17/2021 CS 100 - Lecture 23 14
Ethernet • Developed at Xerox PARC in mid-70 s • Communication protocols govern use of the network • Ethernet uses contention-based distributed control 12/17/2021 CS 100 - Lecture 23 15
Single-Cable Ethernet intended transmission 12/17/2021 CS 100 - Lecture 23 16
Single-Cable Ethernet (1) Listen 12/17/2021 CS 100 - Lecture 23 17
Single-Cable Ethernet (2) Transmit 12/17/2021 CS 100 - Lecture 23 18
Single-Cable Ethernet (3) Broadcast 12/17/2021 CS 100 - Lecture 23 19
Single-Cable Ethernet (4) Receive 12/17/2021 CS 100 - Lecture 23 20
Single-Cable Ethernet (5) Inactive 12/17/2021 CS 100 - Lecture 23 21
Single-Cable Ethernet (1) Listen 12/17/2021 CS 100 - Lecture 23 22
Single-Cable Ethernet (2) Transmit 12/17/2021 CS 100 - Lecture 23 23
Single-Cable Ethernet (3) Collision 12/17/2021 CS 100 - Lecture 23 24
Single-Cable Ethernet (4) Wait Randomly 12/17/2021 CS 100 - Lecture 23 25
Single-Cable Ethernet (5) Listen 12/17/2021 CS 100 - Lecture 23 26
Single-Cable Ethernet (6) Rebroadcast 12/17/2021 CS 100 - Lecture 23 27
Single-Cable Ethernet (7) Inactive 12/17/2021 CS 100 - Lecture 23 28
Single-Cable Ethernet (8) Listen 12/17/2021 CS 100 - Lecture 23 29
Single-Cable Ethernet (9) Rebroadcast 12/17/2021 CS 100 - Lecture 23 30
Collision Recovery A: B: wait C: wait time 12/17/2021 CS 100 - Lecture 23 31
Wide Area Networks (WANs) • LANs typically broadcast messages • WANs typically use point-to-point communication • Typically use store and forward packetswitching – packet = fixed-size quantity of information – large messages divided into packets 12/17/2021 CS 100 - Lecture 23 32
Point-to-point Communication 12/17/2021 CS 100 - Lecture 23 33
Point-to-point Communication: Node Failure 12/17/2021 CS 100 - Lecture 23 34
Store-and-Forward Packet-Switching A C ACK D: packet B 12/17/2021 CS 100 - Lecture 23 35
What We Need • A way of finding a computer (“server”) on the Internet • A way of locating a Web page on that computer • A way of displaying that Web page on my computer (“client”) 12/17/2021 CS 100 - Lecture 23 (slide < S. Levy) 36
Locating Computers on the Internet • TCP/IP (Transmission Control Protocol/Internet Protocol) – a set of protocols (“rules of the game”) for making transactions • IP address – standard for identifying a computer • TCP – describes how packets are sent and retrieved 12/17/2021 CS 100 - Lecture 23 (slide < S. Levy) 37
IP Address Format • Example: 204. 202. 129. 230 • 4 groups of 3 digits • Range from 0 to 255 (8 bits) • Total of 2564 or over 4 billion computers 12/17/2021 CS 100 - Lecture 23 (slide < S. Levy) 38
Named Address (Domain Name) • It’s hard to remember 12 digits • Provide a name and get the computer (Domain Name Server) to translate it to the IP address • e. g, http: //160. 36. 56. 64/~cs 100 = http: //www. cs. utk. edu/~cs 100 12/17/2021 CS 100 - Lecture 23 (slide adapted < S. Levy) 39
The Internet and the Web • The Web sits on top of the Internet and uses its protocols (HTTP, FTP, MAILTO, etc. ) • URL (Uniform Resource Locator) – allows different computers to use the same protocols for Web-based transactions • HTTP (Hyper. Text Transfer Protocol) format: http: //where/what e. g. , http: //www. cs. utk. edu/~cs 100 12/17/2021 CS 100 - Lecture 23 (slide adapted < S. Levy) 40
The Internet and the Web Internet URL HTTP, FTP, MAILTO, . . . TCP IP 12/17/2021 CS 100 - Lecture 23 (slide < S. Levy) 41
Two Standards for Web Pages • Standard protocol (URL) • Standard language for describing Web pages (HTML – Hyper. Text Markup Language) • HTML: A set of commands formatting Web pages 12/17/2021 CS 100 - Lecture 23 (slide < S. Levy) 42
How HTML Works: Client/Server’s disk Network connection Client’s browser 1. The client sends a request for a page to the server. 2. HTML code is sent as text to the client. 3. HTML code is stored in the client’s cache (temporary memory). 4. The client’s browser interprets the HTML code and formats the page. 12/17/2021 CS 100 - Lecture 23 (slide < S. Levy) 43
How HTML Works: Client-Side • The spirit of HTML: – Content (text, images, videos) + “suggestions” on how to format it – Hyper-links to other web pages • Actual formatting (fonts, positions, colors) should be up to client’s browser (e. g. , lynx entirely text-based) • In practice, web designers want more control (frames, tables, blank spaces) 12/17/2021 CS 100 - Lecture 23 (slide < S. Levy) 44
Typical Network Services • Resource sharing – print, file , compute servers • Information sharing – data interchange, information utilities • Communication – e-mail, bulletin boards, news groups, chat rooms • Electronic commerce • Security issues – authentication, secrecy, fault tolerance 12/17/2021 CS 100 - Lecture 23 45
Read S&G, ch. 13 (Artificial Intelligence) for next class 12/17/2021 CS 100 - Lecture 23 46
- Slides: 46