浙大研究生 2017-2018学年《计算机理论》期末考试英文版及答案

合集下载

英文版计算机试题及答案

英文版计算机试题及答案

英文版计算机试题及答案Section 1: Multiple Choice Questions (MCQs)1. Which of the following is NOT a programming language?a) Javab) HTMLc) Pythond) SQLAnswer: b) HTML2. What does CPU stand for?a) Central Processing Unitb) Computer Processing Unitc) Control Processing Unitd) Central Program UnitAnswer: a) Central Processing Unit3. Which of the following is NOT an input device?a) Keyboardb) Mousec) Printerd) ScannerAnswer: c) Printer4. What does RAM stand for?a) Read-Only Memoryb) Random Access Memoryc) Recordable Audio Mediad) Runtime Activity MonitorAnswer: b) Random Access Memory5. Which of the following is NOT a type of computer network?a) LAN (Local Area Network)b) WAN (Wide Area Network)c) MAN (Metropolitan Area Network)d) CAN (Campus Area Network)Answer: d) CAN (Campus Area Network)Section 2: Short Answer Questions1. Define the term "algorithm."Answer: An algorithm is a step-by-step procedure or set of rules for solving a specific problem or completing a specific task.2. What is object-oriented programming (OOP)?Answer: Object-oriented programming is a programming paradigm that organizes code into objects, which are instances of classes. It emphasizes the concept of objects and their interactions to solve complex problems.3. Explain the difference between static and dynamic memory allocation.Answer: Static memory allocation is performed at compile-time, where memory is allocated for variables and objects before the program execution starts. Dynamic memory allocation, on the other hand, is performed at runtime using functions like malloc() or new(). It allows for the allocation and deallocation of memory during program execution.4. What is the purpose of an operating system?Answer: The operating system is responsible for managing computer hardware and software resources, providing an interface between the user and the computer, and ensuring that various programs and applications can run smoothly. It also provides file management, process management, and memory management.5. Name three programming paradigms.Answer: Three programming paradigms are procedural programming, object-oriented programming, and functional programming.Section 3: Coding Questions1. Write a Java program to find the factorial of a given number.```javaimport java.util.Scanner;public class Factorial {public static void main(String[] args) {Scanner input = new Scanner(System.in);System.out.print("Enter a number: ");int number = input.nextInt();int factorial = 1;for (int i = 1; i <= number; i++) {factorial *= i;}System.out.println("The factorial of " + number + " is " + factorial); }}```2. Write a Python program to check if a number is prime or not.```pythondef is_prime(number):if number < 2:return Falsefor i in range(2, int(number/2)+1):if number % i == 0:return Falsereturn Truenumber = int(input("Enter a number: "))if is_prime(number):print(number, "is prime.")else:print(number, "is not prime.")```3. Write a C program to reverse a given string. ```c#include <stdio.h>#include <string.h>void reverse_string(char* str) {int length = strlen(str);for (int i = 0; i < length/2; i++) {char temp = str[i];str[i] = str[length - i - 1];str[length - i - 1] = temp;}}int main() {char str[100];printf("Enter a string: ");gets(str);reverse_string(str);printf("Reversed string: %s", str);return 0;}```Note: The code provided above is just examples for the coding questions. Please ensure to compile and test the programs before using them in production.Conclusion:In this article, we discussed multiple-choice questions, short answer questions, and coding questions related to computer science and programming. These questions cover various aspects of computer knowledge and can be used for self-assessment or preparation for exams or interviews.。

计算机英语试题及答案

计算机英语试题及答案

计算机英语试题及答案一、选择题(每题2分,共20分)1. What does the term "CPU" stand for?A. Central Processing UnitB. Central Power UnitC. Customer Personal UnitD. Control Power Unit答案:A2. The term "RAM" refers to:A. Random Access MethodB. Random Access MemoryC. Remote Access ModuleD. Real-time Application Module答案:B3. Which of the following is a type of computer virus?A. TrojanB. TractorC. TrackerD. Tracker答案:A4. The acronym "GUI" stands for:A. Graphical User InterfaceB. General User InterfaceC. Graphical Unified InterfaceD. Global User Interface答案:A5. What is the purpose of an "API" in computer programming?A. Application Programming InterfaceB. Advanced Programming InterfaceC. Automated Programming InterfaceD. Advanced Programming Indicator答案:A6. The term "LAN" is short for:A. Local Area NetworkB. Long Area NetworkC. Limited Area NetworkD. Large Area Network答案:A7. Which of the following is a common file extension for a text document?A. .txtB. .jpgC. .exeD. .mp3答案:A8. The process of finding and removing errors in a computer program is called:A. DebuggingB. BuggingC. LoggingD. Tagging答案:A9. What does "FTP" stand for?A. File Transfer ProtocolB. Fast Transfer ProtocolC. Full-Time ProtocolD. Future Technology Protocol答案:A10. The term "URL" stands for:A. Uniform Resource LocatorB. Unique Resource LocatorC. Universal Resource LocatorD. User Resource Locator答案:A二、填空题(每空1分,共10分)11. The basic unit of data in a computer is the _______.答案:bit12. A computer's _______ is the primary component that controls and processes data.答案:CPU13. The _______ is a type of software that protects a computer from malicious software.答案:antivirus14. A _______ is a location on a network where files can be stored and accessed.答案:server15. The process of converting data into a code to protect its confidentiality is known as _______.答案:encryption16. A _______ is a set of data that describes the characteristics of a file or set of files.答案:metadata17. The _______ is the process of recovering data after a system failure.答案:backup18. The term _______ refers to the use of a computer to create visual content, such as images and videos.答案:graphics19. A _______ is a program that controls the way a computer system operates.答案:operating system20. The _______ is the process of connecting two or morenetworks to enable communication between them.答案:networking三、简答题(每题5分,共20分)21. Explain the difference between a "bit" and a "byte".答案:A bit is the smallest unit of data in computing, representing a single binary digit (0 or 1). A byte is a group of eight bits, which is used to represent a character or a string of data.22. What is the role of a "firewall" in a computer system?答案:A firewall is a network security system that monitors and controls incoming and outgoing network traffic based on predetermined security rules. It acts as a barrier between a trusted internal network and untrusted external networks, such as the Internet.23. Describe the purpose of a "router" in a computer network.答案:A router is a networking device that forwards data packets between computer networks. It uses routing tables to determine the best path for data to travel, allowing multiple devices to communicate with each other across different networks.24. What is "cloud computing" and how does it benefit users?答案:Cloud computing is the delivery of computing services, including storage, processing power, and software, over the internet. It benefits users by providing scalable resources, reducing the need for on-premises infrastructure, and allowing for remote access to applications and data.四、翻译题(每题5分,共20分)25. Translate the following sentence into English: "操作系统是管理计算机硬件和软件资源的程序。

计算机专业英语B卷带答案

计算机专业英语B卷带答案

2018-2019学年第二学期期末考试试卷(B卷)年级 2017级专业计算机应用层次大专科目专业英语I. Choose the correct answers.(20%)( D )1. has a range of database system, from which DB2 is the best known.A. MicrosoftB. HPC. OracleD. IBM( A )2. A row in a table of a database is called aA. recordB. fieldC. fileD. relation( A )3. is available for free.A. MySQL B . Oracle C. DB2 D. Access( A )4. can only run on Windows platform.A. Microsoft SQL serverB. OracleC. DB2D. MySQL ( C )5. When considering office automation, three main areas need further discussion. Which of the follow is not the area?A. PeopleB. ToolsC. NetworkD. Workplace( C )6.If the full benefits of automation are to be realized, you must overcome resistance.A. toolsB. peopleC. workplaceD. network( B )7. Usually, office automation system has functions.A. fourB. sixC. sevenD. five( C )8. In administrative organs, office automation is mostly calledA. e-governmentB. paperless officeC. OAD. Government office( C )9. A is a list of instruction for the computer to follow to accomplish the task of processing data into information.A. codeB. programmerC. programD. programming ( B )10.Programming languages are called level when they are closer to the language the computer itself uses.A. higherB. lowerC. advancedD. middleII. Fill in the blanks.(10%)1.Middware describes separate product that serves as the glue between two applications .2.Database is often abbreviated as DB.3.There are two kinds of storage device: internal and external .puters are electronic devices that can follow instructions to accept input, process that input, and produce information .5. An information system has five parts: people procedures, software hardware, and data .III. Match each numbered item with the most closely related lettered item.(20%)( e )1. chip a. 显示器( a )2. monitor b. 程序员( f )3. scanner c. 电子政务( g )4. platform d. 指令( j )5. database e. 芯片( h )6. table f. 扫描仪( c )7. e-government g. 平台( i )8. desktop h. 表格( b )9. programmer i. 台式机( d )mand j. 数据库IV. Translate the following phrases into Chinese.(20%)1. WWW万维网2. control unit控制单元3. dance pad 跳舞毯4. movable disk可移动磁盘5. IT 信息技术6. CPU中央处理器7. assembly language 汇编语言8. OS 操作系统9. OA办公自动化10. source code源代码V. Translate the following sentences into Chinese.(30%)1.Office automation tools may stand alone(without access to information at other computers) or be networked (with such access)办公自动化工具可能是独立的(不从其它计算机获取信息),也可能是网络化的(从其它计算机获取信息)。

《计算机专业英语》习题参考答案

《计算机专业英语》习题参考答案

《计算机专业英语》习题参考答案Lesson 1I.1. Operating System2. Fetch-evaluate-execute3. Front-side bus4. Dual-core processor5. Basic Input/Output System(BIOS)II.1. 指令是特定各式的二进制数列,它们对于每台机器都是唯一的。

2. CPU是中央处理单元的简称,每个字母分开发音。

3. 大多数计算在中央处理器中进行。

4. 双核是指一个处理器上有两个完整运算内核的CPU。

5. 处理器:是微处理器或CPU的缩写。

6. 集成电路:即芯片,是由半导体材料制成的一种电子设备。

III.1. F2. T3. TIV.1.ALU, CU, Register2.memory3.processor4.the CPULesson 2I.1.Static Random Access Memory(SRAM)2.Dynamic Random Access Memory(DRAM)3.Virtual Memory4.Physical Memory5.Level 1 Cache6.Level 2 Cache7.HDD access speedII.1.动态随机存储器之所以称为“动态”是因为它每秒钟被刷新数千次。

2.RAM:是计算机中存储操作系统、应用程序和当前正是用数据的地方。

3.ROM由计算机中一小块长寿命电池供电。

4.RAM缓存是由高速静态随机存储器构成的存储器。

III.1. F2. F3. F4. TIV.1. non-volatile2. compiler3. volatile4. DRAMLesson 3I.1. Motherboard2. PC Case3. Hard Disk Drive(HDD)4. Optical mouse5. RAM6. Mobile DiskII.1.PC是有很多组件构成的一个系统。

计算机英语参考译文和练习答案(doc 78页)

计算机英语参考译文和练习答案(doc 78页)

计算机英语参考译文和练习答案(doc 78页)二、历史第一台加法机,数字计算机的先驱,是1642年由法国科学家、数学家兼哲学家布莱斯•帕斯卡设计的。

这个装置使用了一系列有10个齿的轮子,每个齿代表从0到9的一个数字。

轮子互相连接,从而通过按照正确的齿数向前移动轮子,就可以将数字彼此相加。

在17世纪70年代,德国哲学家兼数学家戈特弗里德•威廉•莱布尼兹对这台机器进行了改良,设计了一台也能做乘法的机器。

法国发明家约瑟夫―玛丽•雅卡尔,在设计自动织机时,使用了穿孔的薄木板来控制复杂图案的编织。

在19世纪80年代期间,美国统计学家赫尔曼•何勒里斯,想出了使用类似雅卡尔的木板那样的穿孔卡片来处理数据的主义。

通过使用一种将穿孔卡片从电触点上移过的系统,他得以为1890年的美国人口普查汇编统计信息。

1、分析机也是在19世纪,英国数学家兼发明家查尔斯•巴比奇,提出了现代数字计算机的原理。

他构想出旨在处理复杂数学题的若干机器,如差分机。

许多历史学家认为巴比奇及其合伙人,数学家奥古斯塔•埃达•拜伦,是现代数字计算机的真正先驱。

巴比奇的设计之一,分析机,具有现代计算机的许多特征。

它有一个以一叠穿孔卡片的形式存在的输入流、一个储存数据的“仓库”、一个进行算术运算的“工厂”和一个产生永久纪录的打印机。

巴比奇未能将这个想法付诸实践,尽管在那个时代它在技术上很可能是可行的。

2、早期的计算机模拟计算机是在19世纪末期开始制造的。

早期型号是靠转动的轴和齿轮来进行计算的。

用任何其他方法都难以解答的方程,可以用这样的机器来求其近似数值。

开尔文勋爵制造了一台机械潮汐预报器,这实际上就是一台专用模拟计算机。

第一次和第二次世界大战期间,机械模拟计算系统以及后来的电动模拟计算系统,被用作潜艇上的鱼雷航线预测器和飞机上的轰炸瞄准具的控制器。

人们还设计了另一个系统,用于预测密西西比河流域春天的洪水。

3、电子计算机第二次世界大战期间,以伦敦北面的布莱切利公园为工作地点的一组科学家和数学家,制造了最早的全电子数字计算机之一:“巨人”。

《计算机英语》期末考试及答案

《计算机英语》期末考试及答案

《计算机英语》B卷本卷满分100分,90分钟完卷。

得分:一、选出下列单词所缺字母组合(共10小题,每小题2分,共20分)。

1.Parti__lar (特别的)A. ceB. cuC.coD. cr2.Determ___(决定)A. ineB. ingC. innD. ino3.Previ___ly (先前地,以前地)A.ocsB. onsC. ousD.obs4.Functionali__(功能)A.tiB. tyC. ttD. to5.Distri__tion (发行版,发布)A.biB. buC. beD. bo6.Catego___ (种类)A.ryB.riC.rtD.ty7.Sophisti__tion (复杂)A.coB.ceC.ca8.Capa__ty (容量,能力)A.ceB.coC.ciD.cr9.Private__ (私下地,私密地)A.lyB.liC.tyD.il10.Dere__lation (违反规定)A.gaB.goC.ggD.gu二、单项选择题(共10小题,每小题2分,共20分)。

11. I can ____ basketball.A. playedB. playsC. playingD. play12. ---Happy birthday to you.---______________A.The same to youB.good luckC. Not at allD.Thank you.13. Happy life rely on_____ hard.A. workB. workingC. worksD. to work14. She is a ____ girl.A. beautyB. beautiesC. beautifulD. beautifully15.---What`s wrong with you?---____________A. I don`t knowB. I feel terribleC. Don`t worryD. Thanks16. ---How about having bread for lunch?---_____________A.Yes,it isB. That`s greatC .I am fine D.Fine,thanks.and you?17. He expresses an interest ___ reading.A. inB. onC. atD.to18.She _______ English for seven years.A. studyB. studiesC. studiedD. has studied19. ---You are Jack, right?---___________.A. Yes,it isB. yes,I amC. Yes,I wasD.Yes,I do20. She goes to the library ______.A. readB. to readC. readingD. reads三、阅读理解(共5题,每小题4分,共20分)。

计算机专业英语D卷带答案

计算机专业英语D卷带答案

2018-2019学年第二学期期末考试试卷(B卷)年级 2017级专业计算机应用层次大专科目计算机英语I. Choose the correct answers.(30%)( B )1.The _______ refers to any program or set of program instructions desined to surreptitiously enter a computer and disrupt its normal operations.A.CodeB. malwareC. softwareD. worm( D )2.To defend your computer against viruses, you should undersrand what they are, how they work, and how to use ______ software.A.NonvirusB. systemC. applicationD. antivirus( A )3.The refers to any program or set of program instructions designed to surreptitiously enter a computer and disrupt its normal operations.A. malwareB. codeC. softwareD. worm( C )4.To define your computer against viruses, you should understand what they are, how they work, and how to use software.A. no virusB. systemC. antivirusD. application( B )5.__________ gains unauthorized access to a computer for malicious purpose.A. hackerB. crackerC. programmerD. thief( D )6. are the most widely used type of computer.A. SupercomputerB. Mainframe computersC. MinicomputersD. Microcomputers( C )7. A computer is another name for a notebook computer.A. midrangeB. handheldC. laptopD. DVD( B )8. device is also known as primary storage device or “memory”.A. External storageB. Internal storageC. USB deviceD. Hard disk( D )9. is not an output device.A. DisplayB. PrinterC. LoudspeakerD. Fax machine ( C )10. is not an input device.A. MouseB. KeyboardC. PrinterD. Scanner( D )11. If you were to think of a computer as a living being, then the hardware would beA. the eyesB. the faceC. the brain D . the body( D )12. is not a system software.A. Window XPB. LinuxC. WordD. PowerPoint ( B )13. is not an application software.A. ExcelB. UnixC. WordD. PowerPoint ( D )14. rose to dominate the home computer operating system market with MS-DOS in the Mid-1980s, followed by the Microsoft Window line of operating systems.A. IntelB. DellC. Apple ComputerD. Microsoft ( C )15. To access information from a database, you need aA. DBB. hardwareC. DBMSD. bandwidth II. Fill in the blanks.(10%)1. There are four types of computers: supercomputers,_minicomputers, _mainframe computers, microcomputers.2. __computers are electronic devices that can follow instructions to accept input, process that input, and produce information.3. an information system has five parts: people, procedures, hardware, __software__, ___data__.4. ___software is another name for a program or programs.5.A _desktop computer fits on a desk and runs on power from an electrical wall outlet.III. Match each numbered item with the most closely related lettered item.(10%)( d )1.超级计算机 a. computer( f ) 2.芯片 b.device( c) 3.信息 rmation( g ) 4.微处理器 d.supercomputer( b ) 5.设备 e.microcomputer( a ) 6.计算机 f.chip( e ) 7.微型计算机g.microprocessor( i ) 8.文本h.capacity( h ) 9.容量i.text( j ) 10.数据j.dataIV. Translate the following phrases into Chinese.(20%)1. PC 个人计算机2. IT 信息技术3. MPC 多媒体个人计算机4.PDA 个人数字助理5. POST 计算机加电自检6. VLSI 超大规模集成电路7. DIY 自己装机8. DTE 数据终端设备9. ENIAC 电子数字积分计算机0.palmtop computer__掌上计算机V. Translate the following sentences into Chinese.(30%)1. An interpreter converts the procedural language one statement at a time into machine code just before it is to be executed.解释程序将过程化语言的一句程序转化成机器代码,然后执行这段程序。

2017级计机导论B卷

2017级计机导论B卷

2017-2018学年第1学期2017 级《计算机导论》考试试题B卷考试时间:2018年1月9日班级教学号姓名✧要求答案写在答题纸上,写上题号,不必抄题,英文答卷;✧要求在答题纸和试题纸上都写上班级、学号和姓名,交卷时一并交上来;✧要求在每个大题号(I, II, III,IV)前划一个满页的横线,以便教师批阅。

I、Choice Questions(20 questions, 1 score for each question)1. A computer uses isolated I/O addressing. Memory has 512 words, If each controller has 16 registers, controllers can be accessed by this computer.A. 16B. 32C. 64D. 5122.Most computers today use the _____ method of integer representation.A. Sign-and-magnitudeB. One’s complementC. two’s complementD. none of the above3.A(n) ________ is a set of rules that controls the interaction of different devices in a network or internetwork .A. modelB. operating systemC. algorithmD. protocol4.The first electronic special-purpose computer was called ________A. ABCB. EDV ACC. PascalineD.Pascal5.________ octal digits are needed to convert a 19-bit pattern?A. 5B. 6C. 7D. 86.If the ASCII code for k is 1101011, the the ASCII code for K is _______.A. 1101110B. 1101111C. 1101001D. 10010117.If the leftmost bit is 1 in _____ number representation, then the decimal number is negative.A. Sign-and-magnitudeB. One’s complementC. two’s complementD. all of the above8. A ________ document has fixed contents.A. staticB. dynamicC. activeD. none of the above9.________ is a memory type with capacitors that need to be refreshed periodically.A. SRAMB. ROMC. DRAMD. EPROM10.For an 8-bit allocation, the smallest decimal number that can be represented in unsigned, sign-and-magnitude, one’s complement, two’s complement form is ______.A. -128,-127,-127,-127B. 0,-128,-128,-127C. 0,-127,-127,-128D. 0,-128,-128,-12811. A computer has 64MB(megabytes) of memory, Each word is 4 bytes. ______bits are needed to address each single word in memory.A. 24B. 26C. 36D. 1612.The ________ model is a theoretical model that shows how any two different systems can communicate with each other.A. ISOB. OSIC. TCP/IPD. WWW13.A______ is a connecting device that acts as a protocol converter.A. routerB. bridgeC. gatewayD. all of the above14.Change the IP addresses 01111110 11111011 01100111 01111111 from binary notation to dotted-decimal notation ______.A. 125. 252.103.127B. 126. 251.103.127C. 125. 252.103.128D. 126.251.103.12815. A word consists of ________ bits.A. 1B. 8C. 16D. none of the above16.For insertion sort, _____ passes are needed to sort the data.A. n-1B. nC. 2nD. n217.Every job is a _______.A. processB. programC. partitionD. all of the above18.______can occur if a process has too many resource restrictionsA. StarvationB. DeadlockC. StoppedD. halted19. A process in the ready state goes to the _____ state when it gets access to the CPU.A. waitingB. runningC. readyD. holding20. A subalgorithm is also known as a ________.A. functionB. subroutineC. moduleD. all of the aboveII、Questions(5 questions, 4 scores for each question)1.What is computer science defined in this book? four types connecting devices for network.3.What’s the memory hierarchy?4.What steps are needed to convert audio data to bit patterns?5.To run an instruction in a program, what are the steps in a machine cycle?III、Calculation(5 subjects, 4 scores for each subject)1.Change the following decimal numbers to 8-bit Sign-and-magnitude, one’s complement andtwo’s complement integers, and fill the blanks with the result value in hexadecimal or “overflow” string.2.3.Change the -11.40625 decimal numbers to binary numbers, and show it in 32-bit IEEE format,Write the detailed calculation process and then convert the result to hexadecimal.4. A gray scale picture is digitized using four different gray levels ,If the picture is composed of100x100 pixles,how many bits are needed to represent the picture?5. A computer has 4GB(gigabyteS) of memory. Each word is 4 bytes. How many bits are needed toaddress each single word in memory?IV、Analyzing and Design(5 subjects, 8 scores for each subject)ing the bubble sort algorithm, manually sort the following list and show your work in eachpass.14 7 23 9 35 78 64 21 17 63 54 2 982. A list contains the following elements. Using the binary search algorithm, trace the steps followedto find 35. At each step, show the values of first, last and mid.3 , 7, 8, 10, 14, 21, 23, 36, 62, 77, 89, 1103.Write an algorithm to find the largest of 1000 integer numbers.4.An imaginary computer has eight data registers(R0,R1,…,R7), 2048 bytes in memory, and 4different instructions(add, subtract, etc..)(1) What is the minimum size of an instruction in bits if a typical instruction uses the followingformat: ADD 65, R2.(2) If the computer uses the same size of word for data and instructions, what is the size ofeach data register?(3) What is the size of the program counter of the computer ?5. A multiprogramming operating system uses paging. The available memory is 100MB divided into25 pages, each of 4MB, The first program needs 13MB, The second program needs 20Mb, thethirds program needs 39MB.The fourth program needs 18MB.(1)How many pages are used by the first program?(2)How many pages are unused?。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

浙江大学2017-2018学年秋冬学期
《计算理论》课程期末考试试卷
课程号:21120520开课学院:计算机学院
考试试卷: A卷 B卷
考试形式: 闭卷 开卷,允许带入场
考试日期:2018年1月24日,考试时间:120分钟
诚信考试,沉着应考,杜绝违纪
考生姓名学号所属院系
题序123456总分
得分
评卷人
Zhejiang University
Theory of Computation,Fall-Winter2017
Final Exam
1.(24pts)Determine whether the following statements are true or false.If
it is truefill a T otherwise a F in the bracket before the statement.
(a)()Let A,B be two languages.If both A and A∪B are regular,then B is
definitely regular.
(b)()If A is regular and B is non-regular,then A◦B must be non-regular.
(c)()Language{xcy|x,y∈{a,b}∗,|x|≤|y|≤3|x|}is context-free.
(d)()Every regular language can be generated by a context-free grammar.
(e)()If A is recursive and B⊆A,then B is recursive as well.
(f)()Recursively enumerable languages are always infinite.
(g)()There’s a functionφsuch thatφcan be computed by some Turing ma-
chines,yetφis not a primitive recursive function.
(h)()Let A and B be recursively enumerable languages and A∩B=∅.If A∪B
is also recursively enumerable,then both A and B is decidable.
(i)()The language{“M”“w”|TM M accepts w in less than2018steps}is
recursive.
(j)()The language{“M”|TM M accepts exactly2018strings}is recursively enumerable but not recursive.
(k)()Let H e={“M”|TM M halts on e}.If H e≤L,then L is recursive enumerable but not recursive.
(l)()A language L is recursive if and only if it is Turing-enumerable.
2.(18pts)On FA and Regular Languages
Say whether each of the following languages is regular or not regular?Prove your answers,where{a,b}+={a,b}∗◦{a,b}.
(a)L1={wtw|w,t∈{a,b}+}
(b)L2={wtw|w,t∈{a,b}∗}
3.(20pts)On PDA and Context-Free Languages
Let L3={ww R ca m b n|w∈{a,b}∗,m,n∈N,m=n}.
(a)Construct a context-free grammar that generates the language L3.
(b)Construct a pushdown automata that accepts L3.
Solution:
(a)
(b)The PDA M=(K,Σ,Γ,∆,s,F)is defined below:
(q,σ,β)(p,γ)
K=
Σ={a,b,c}
Γ=
s=
F=
4.(10pts)On Turing Machine
Design a single tape Turing machine M that decides the language L4
L4={uvcww R|u,v,w∈{a,b}∗,|u|=2|v|}
When describing the Turing machines above,you can use the elementary Turing machines described in textbook.Always assume that your Turing machine starts from the configuration◃⊔x,where x is the input string.
5.(10pts)On Primitive Recursive Function
→N,and k∈N,k≥2 Show the following functionφk:N×N×···×N
k
{n1,n2,···,n k}
φk(n1,n2,···,n k)=max
k
is primitive recursive.
6.(18pts)On Undecidability
Classify whether each of the following languages are recursive,recursively enumerable but not recursive,or non-recursively enumerable.Prove your answers,but you may not simply appeal to Rice’s theorem.
(a)L5={“M”|M is a TM,and L(M)is uncountable}
(b)L6={“M”|TM M accepts at least two strings of different lengths}
Enjoy Your Spring Festival!。

相关文档
最新文档