112 年 國立成功大學製造資訊與系統研究所丙組《計算機概論》
第 1 題10 分
Descriptions of Computer System and Architecture. (10%)
(1) Operating system is a collection of software that manages the hardware and software resources of a computer. Operating system is responsible for managing the computer's memory, processing power, and input/output devices. However, it does not handle tasks such as connecting to networks and managing files.
(2) Each operating system has its own unique features and capabilities, and is designed to work with specific types of hardware and software. Some examples of popular operating systems include Microsoft Office, Linux, Android, iOS, Line.
(3) Distributed systems are designed to be small, lightweight, and low-power, and they often operate in real-time, meaning that they must respond to events within a certain time frame. They are often found in devices that require real-time processing, such as control systems and devices that require precise timing.
(4) Embedded systems are often found in devices that we use every day, such as smartphones, cars, appliances, and industrial control systems. The software in an embedded system is often called firmware, and it is stored in the system's non-volatile memory.
(5) An Instruction Set Architecture (ISA) is part of the abstract model of a computer that defines how the CPU is controlled by the software. The ISA acts as an interface between the hardware and the software, specifying both what the processor is capable of doing as well as how it gets done.
登入後即可作答並保存紀錄。
本題主要在測試考生對作業系統、分散式系統、嵌入式系統以及指令集架構 (ISA) 的基本認知。
(1) 關於作業系統的功能敘述:
作業系統確實是管理硬體與軟體資源的軟體集合,負責記憶體、處理器、輸入/輸出設備的管理。然而,作業系統也負責網路連線管理 (network connection management) 和檔案管理 (file management)。因此,敘述中「不處理」網路連線和檔案管理的部分是錯誤的。
【答案】False
(2) 關於作業系統的特性與範例:
作業系統確實有其獨特的功能,並設計與特定硬體軟體配合。然而,Microsoft Office、Line 並非作業系統,而是應用程式。Linux、Android、iOS 則是作業系統。因此,列舉的範例中有錯誤。
【答案】False
(3) 關於分散式系統的敘述:
分散式系統 (Distributed systems) 的設計目標並非一定是小、輕量、低功耗,且不一定都運行在即時 (real-time) 環境。即時系統 (real-time systems) 是指需要嚴格時間限制的系統,分散式系統可能包含即時系統,但分散式系統本身不必然是即時系統。分散式系統的重點在於多個獨立的計算節點協同工作。
【答案】False
第 2 題10 分
Descriptions of Computer hardware. (10%)
(1) Computer hardware refers to the physical components of a computer, such as the processor, memory, storage, and input/output devices. In addition to these components, a computer may also include other hardware such as a motherboard, power supply, and various ports and connectors for connecting to other devices.
(2) Processor: Also known as the central processing unit (CPU), the processor is the brain of the computer and where the computer stores data that it is currently using or processing. A processor only understands instructions encoded in some numerical fashion, usually as binary numbers.
(3) Memory: Memory, or RAM (random access memory). It executes instructions and performs calculations for the computer.
(4) Storage: Storage devices, such as hard drives and solid-state drives, are where the computer stores long-term data, such as the operating system, software applications, and user files.
(5) Input/output devices: These are the devices that allow a user to interact with the computer, such as a keyboard, mouse, and monitor. Other examples of input/output devices include printers, scanners, and speakers.
登入後即可作答並保存紀錄。
本題旨在測試考生對電腦硬體基本組成部分的理解。
(1) 電腦硬體定義:
電腦硬體是指電腦的實體組成部分,如處理器、記憶體、儲存設備和輸入/輸出設備。此外,還包括主機板、電源供應器、連接埠等。此敘述正確。
【答案】True
(2) 處理器 (Processor) 的定義:
處理器,又稱中央處理單元 (CPU),是電腦的「大腦」,負責執行指令和處理數據。它理解的是以數值(通常是二進位)編碼的指令,而不是儲存數據。數據的儲存主要由記憶體和儲存設備負責。因此,「where the computer stores data that it is currently using or processing」這部分描述不夠精確,CPU 處理數據,但數據主要存放在記憶體中。
【答案】False
(3) 記憶體 (Memory) 的定義:
記憶體,或稱隨機存取記憶體 (RAM),其主要功能是執行指令和執行計算。
第 3 題10 分
Descriptions of Data. (10%)
(1) Data processing is the process of collecting, storing, and organizing data, and then using that data to produce useful information.
(2) The collected data is stored in a database or other storage system. There are many types of databases, including relational databases, object-oriented databases, and NoSQL databases. All databases have the same features and are suited to all types of data and applications.
(3) Object-oriented databases are a type of database that is based on the concept of tables, which are made up of rows and columns, while relational databases are designed to support the storage and management of complex data structures and to provide better integration with specific programming languages.
(4) Data fusion is the process of combining data from multiple sources to produce a more complete, accurate, and useful representation of a system or phenomenon. Common approaches of data fusion include filtering, feature extraction, data association, data integration, and decision making.
登入後即可作答並保存紀錄。
本題主要測試考生對資料處理、資料庫類型及資料融合的理解。
(1) 資料處理的定義:
資料處理 (Data processing) 是收集、儲存、組織資料,並利用這些資料產生有用資訊的過程。此敘述正確。
【答案】True
(2) 資料儲存與資料庫的敘述:
收集到的資料儲存在資料庫或其他儲存系統中。雖然存在關聯式資料庫、物件導向資料庫和 NoSQL 資料庫等類型,但「所有資料庫都具有相同的特性,並且適用於所有類型的資料和應用程式」這句話是錯誤的。不同類型的資料庫有不同的結構、特性和適用範圍。例如,關聯式資料庫擅長結構化資料,NoSQL 資料庫則更靈活,適用於非結構化或半結構化資料。
【答案】False
(3) 物件導向資料庫與關聯式資料庫的比較:
物件導向資料庫 (Object-oriented databases) 是基於物件概念的資料庫,而關聯式資料庫 (relational databases)
第 4 題10 分
Descriptions of Programming language. (10%)
(1) A programming language is a set of instructions, rules, and conventions that are used to create software programs and applications.
(2) In computing, a compiler is a computer program that translates computer code written in one programming language (the source language) into another language (the target language).
(3) Code editors are programming language-specific. Some editors support one or two programming languages whereas some support multiple programming languages. It can give suggestions and highlights based on language support.
(4) Assembly language is a low-level programming language with a very strong correspondence between the instructions in the language and the architecture's machine code instructions.
(5) High level programming languages include BASIC, C/C++, Java and ASCII code.
登入後即可作答並保存紀錄。
本題主要測試考生對程式語言、編譯器、程式碼編輯器、組合語言及高級程式語言的理解。
(1) 程式語言的定義:
程式語言 (Programming language) 是一組指令、規則和約定,用於創建軟體程式和應用程式。此敘述正確。
【答案】True
(2) 編譯器的定義:
在計算機科學中,編譯器 (compiler) 是一種電腦程式,它將用一種程式語言(來源語言)編寫的電腦程式碼翻譯成另一種語言(目標語言)。此敘述正確。
【答案】True
(3) 程式碼編輯器的敘述:
程式碼編輯器 (Code editors) 並非總是程式語言專屬的。有些編輯器支援單一或兩種程式語言,而有些則支援多種程式語言。它們可以根據所支援的語言提供建議和語法高亮。此敘述正確。
【答案】True
第 5 題10 分
Descriptions of Applications and AI. (10%)
(1) An application program (software application, or application, or app for short) is a computer program designed to carry out a specific task other than one relating to the operation of the computer itself, typically to be used by end-users.
(2) Android and iOS use different programming languages for their operating systems. Android apps are written in Objective-C/Swift, whereas iOS apps are written in Java.
(3) An integrated development environment (IDE) is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of at least a source code editor, build automation tools and a debugger. Some IDEs, such as NetBeans and Eclipse, contain the necessary compiler, interpreter, or both; others, such as SharpDevelop and Lazarus.
(4) TensorFlow is a free and open-source software library for machine learning and artificial intelligence. It can be used across a range of tasks but has a particular focus on training and inference of deep neural networks. TensorFlow can only be used in Python.
(5) Supervised learning algorithms take a set of data that contains only inputs, and find structure in the data, like grouping or clustering of data points. The algorithms, therefore, learn from test data that has not been labeled, classified or categorized.
登入後即可作答並保存紀錄。
本題主要測試考生對應用程式、人工智慧 (AI) 相關技術和概念的理解。
(1) 應用程式的定義:
應用程式(軟體應用程式,或簡稱 app)是設計來執行特定任務的電腦程式,這些任務與電腦本身的運作無關,通常供終端使用者使用。此敘述正確。
【答案】True
(2) Android 與 iOS 的開發語言:
Android 應用程式主要使用 Java 或 Kotlin 編寫,而 iOS 應用程式主要使用 Objective-C 或 Swift 編寫。此敘述中提到 Android apps 寫在 Objective-C/Swift,iOS apps 寫在 Java,這是錯誤的。
【答案】False
(3) 整合式開發環境 (IDE) 的定義:
整合式開發環境 (Integrated Development Environment, IDE) 是一種提供軟體開發全面設施的軟體應用程式。IDE 通常包含原始碼編輯器、建構自動化工具和除錯器。此敘述正確。
【答案】True
(4) TensorFlow 的使用:
TensorFlow 是一個用於機器學習和人工智慧的免費開源軟體庫,專注於深度神經網路的訓練和推理。
第 B.1 題10 分
Blank Filling Questions-Networks. (10%)
Please fill in the correct terms according to the description.
Repeaters, hubs, switches, routers, modems, firewalls, multiprocessing, multithreading.
An internetworking device that forwards packets between networks by processing the addressing or routing information included in the packet. The routing information is often processed in conjunction with the routing table.
登入後即可作答並保存紀錄。
本題在測試考生對網路設備和概念的理解。題目要求填入描述中的正確術語,並提供一個術語列表。
首先,我們分析題目所提供的描述:
「An internetworking device that forwards packets between networks by processing the addressing or routing information included in the packet. The routing information is often processed in conjunction with the routing table.」
這段描述指明這是一個「網路互聯設備 (internetworking device)」,它透過處理封包中的「定址或路由資訊 (addressing or routing information)」來轉發封包「在網路之間」。並且,「路由資訊經常與路由表一起處理」。
接著,我們檢視提供的術語列表:
Repeaters, hubs, switches, routers, modems, firewalls, multiprocessing, multithreading.
根據描述,能夠在網路之間轉發封包並處理路由資訊的設備是「路由器 (router)」。
- Repeaters:重複訊號,放大訊號,不處理封包資訊。
第 B.2 題10 分
Blank Filling Questions-Networks. (10%)
Please fill in the correct terms according to the description.
Repeaters, hubs, switches, routers, modems, firewalls, multiprocessing, multithreading.
A network software or device for controlling network security and access rules. They are inserted in connections between secure internal networks and potentially insecure external networks such as the Internet.
登入後即可作答並保存紀錄。
本題在測試考生對網路設備和概念的理解。題目要求填入描述中的正確術語,並提供一個術語列表。
首先,我們分析題目所提供的描述:
「A network software or device for controlling network security and access rules. They are inserted in connections between secure internal networks and potentially insecure external networks such as the Internet.」
這段描述指明這是一個「網路軟體或設備」,其功能是「控制網路安全和存取規則」。它被「放置在安全內部網路與潛在不安全的外部網路(如網際網路)之間的連接處」。
接著,我們檢視提供的術語列表:
Repeaters, hubs, switches, routers, modems, firewalls, multiprocessing, multithreading.
第 B.3 題10 分
Blank Filling Questions-Networks. (10%)
Please fill in the correct terms according to the description.
Repeaters, hubs, switches, routers, modems, firewalls, multiprocessing, multithreading.
It is supported by the operating system that make a central processing unit (CPU) to provide multiple threads of execution concurrently. The resources of a single or multiple cores are shared, including the computing units, the CPU caches, and the translation lookaside buffer (TLB).
登入後即可作答並保存紀錄。
本題在測試考生對網路設備和概念的理解。題目要求填入描述中的正確術語,並提供一個術語列表。
首先,我們分析題目所提供的描述:
「It is supported by the operating system that make a central processing unit (CPU) to provide multiple threads of execution concurrently. The resources of a single or multiple cores are shared, including the computing units, the CPU caches, and the translation lookaside buffer (TLB).」
這段描述指出,這是一個由作業系統支援的機制,讓中央處理單元 (CPU) 能夠「同時提供多個執行緒 (multiple threads of execution concurrently)」。並且,單一或多個核心的資源(計算單元、CPU 快取、TLB)會被共享。
接著,我們檢視提供的術語列表:
Repeaters, hubs, switches, routers, modems, firewalls, multiprocessing, multith
第 B.4 題10 分
Blank Filling Questions-Networks. (10%)
Please fill in the correct terms according to the description.
Repeaters, hubs, switches, routers, modems, firewalls, multiprocessing, multithreading.
A network device forwards frames to the ports involved in the communication based on the destination MAC address in each frame. It learns the association of physical ports to MAC addresses by examining the source addresses of received frames and only forward the frame when necessary.
登入後即可作答並保存紀錄。
本題在測試考生對網路設備和概念的理解。題目要求填入描述中的正確術語,並提供一個術語列表。
首先,我們分析題目所提供的描述:
「A network device forwards frames to the ports involved in the communication based on the destination MAC address in each frame. It learns the association of physical ports to MAC addresses by examining the source addresses of received frames and only forward the frame when necessary.」
這段描述指明這是一個「網路設備」,它根據「封包中的目標 MAC 位址 (destination MAC address)」將「訊框 (frames)」轉發到相關埠。它透過檢查接收到的訊框的「來源位址 (source addresses)」來學習「實體埠與 MAC 位址的關聯」,並且「僅在必要時」轉發訊框。
接著,我們檢視提供的術語列表:
Repeaters, hubs, switches, routers, modems, firewalls, multiprocessing, multithreading.
第 B.5 題10 分
Blank Filling Questions-Networks. (10%)
Please fill in the correct terms according to the description.
Repeaters, hubs, switches, routers, modems, firewalls, multiprocessing, multithreading.
The use of two or more central processing units (CPUs) within a single computer system. The term also refers to the ability of a system to support more than one processor or the ability to allocate tasks between them.
登入後即可作答並保存紀錄。
本題在測試考生對網路設備和概念的理解。題目要求填入描述中的正確術語,並提供一個術語列表。
首先,我們分析題目所提供的描述:
「The use of two or more central processing units (CPUs) within a single computer system. The term also refers to the ability of a system to support more than one processor or the ability to allocate tasks between them.」
這段描述指出,這是指「在單一電腦系統中使用兩個或兩個以上的中央處理單元 (CPU)」。這個術語也指「系統支援多個處理器或在它們之間分配任務的能力」。
接著,我們檢視提供的術語列表:
Repeaters, hubs, switches, routers, modems, firewalls, multiprocessing, multithreading.
第 C.1 題10 分
Blank Filling Questions-Performance metrics. (10%)
Please fill in the correct terms according to the description.
Accuracy, Mean Absolute Error, Precision, Root Mean Squared Error, Mean Squared Error, Fl-score, Recall.
(-)
N
1
j=1
2.
1
N
j=1
3.
1
N
Σ)2 (ز – ز
j=1
4.
the ratio of true positives and total positives predicted
5.
the number of correct predictions divided by the total number of predictions, multiplied by
100.
登入後即可作答並保存紀錄。
核心觀念
本題考查回歸模型與分類模型常見的效能評估指標。
- 回歸指標:MAE、MSE、RMSE
- 分類指標:Accuracy、Precision、Recall、F1-score
設實際值為 ,預測值為 ,樣本總數為 。
解題方法
判斷原則是先看公式形式,再看文字定義。
第 1 空
公式為:
此公式計算預測值與實際值之差的絕對值平均,因此是平均絕對誤差:
第 2 空
公式為:
此公式先將誤差平方,再取平均,因此是均方誤差:
第 3 空
公式為:
它是均方誤差再開平方根,因此是均方根誤差:
RMSE 與原始資料具有相同單位,通常比 MSE 更容易直接解讀。
第 4 空
題目描述為「預測為正例的樣本中,真正為正例的比例」,即:
其中:
- :True Positive,真正例
- :False Positive,假正例
因此答案為:
第 5 空
題目描述為「正確預測數除以總預測數,再乘以 」,即:
其中 為真負例, 為假負例。
因此答案為:
選項分析
1. Accuracy
衡量所有預測中正確預測的比例:
符合第 5 空,不符合第 1 至第 4 空。
2. Mean Absolute Error
計算誤差絕對值的平均:
符合第 1 空。
3. Precision
衡量所有「預測為正例」的樣本中,實際為正例的比例:
符合第 4 空。
4. Root Mean Squared Error
先計算平方誤差平均,再開平方根:
第 D.1 題10 分
Blank Filling Questions-Algorithms. (10%)
There are many different sorting algorithms that can be used to rearrange a list of items in a particular order. Some common sorting algorithms include: Quick sort, Bubble sort, Insertion sort, Selection sort, Merge sort and Heap sort. Each of these algorithms has its own advantages and disadvantages, and the best choice for a particular situation will depend on the specific requirements and constraints of the problem. Please fill in the correct sorting algorithm according to the description.
- This is a simple sorting algorithm that repeatedly compares adjacent elements and swaps them if they are in the wrong order.
- This algorithm repeatedly selects the smallest element in the list and moves it to the front of the list.
- This algorithm works by dividing the list into smaller sublists, sorting those sublists, and then merging them back together.
- This algorithm uses a pivot element to partition the list and then recursively sorts the sublists on either side of the pivot.
- This algorithm works by repeatedly inserting elements into the correct position in a sorted list.
登入後即可作答並保存紀錄。
本題旨在測試考生對常見排序演算法的理解。題目提供了五個排序演算法的描述,要求填入對應的演算法名稱。
常見排序演算法列表:Quick sort, Bubble sort, Insertion sort, Selection sort, Merge sort, Heap sort.
-
描述: "This is a simple sorting algorithm that repeatedly compares adjacent elements and swaps them if they are in the wrong order."
分析: 這種演算法透過重複比較相鄰元素並在需要時交換它們來進行排序。這是「氣泡排序法 (Bubble sort)」的經典描述。
【答案】 Bubble sort -
描述: "This algorithm repeatedly selects the smallest element in the list and moves it to the front of the list."
分析: 這種演算法會不斷地從列表中選出最小的元素,並將其放到列表的開頭(或已排序部分的末尾)。這是「選擇排序法 (Selection sort)」的定義。
答案: Selection sort -
描述: "This algorithm works by dividing the list into smaller sublists, sorting those sublists, and then merging them back together."
分析: 這種演算法採用「分治法 (divide and conquer)」的策略,將列表分割成更小的子列表,對子列表進行排序,然後將它們合併起來。這是「合併排序法 (Merge sort)」的特徵。
答案: Merge sort
第 E.1 題2 分
Blank Filling Questions-Codes. (20%)
There are many different programming languages, each with its own syntax, semantics, and characteristics. Some popular programming languages include C, C++, Java, Python, and JavaScript. Please identify what the programming languages of the following codes in figure 1 to figure 4 and also answer the output of each codes.
登入後即可作答並保存紀錄。
本題為程式碼辨識與輸出預測題,共分為四個小題,每個小題包含一個程式碼片段,考生需要辨識程式語言並預測其輸出結果。
Figure 1:
#include <math.h>
#include <stdio.h>
int main()
{
int n, i, flag = 1;
n = 13;
for (i = 2; i <= sqrt(n); i++) {
if (n % i == 0) {
flag = 0;
break;
}
}
if (n <= 1)
flag = 0;
if (flag == 1) {
printf("Yes");
} else {
printf( "No");
}
return 0;
}
語言辨識:
程式碼包含 #include <math.h> 和 #include <stdio.h>,以及 int main(), printf(), return 0; 等結構,這是典型的 C 語言程式碼。
輸出預測:
程式碼判斷 n = 13 是否為質數。
n被初始化為 13。- 迴圈從
i = 2開始,直到i <= sqrt(13)(約 3.6)。所以i會是 2 和 3。 - 當
i = 2時,13 % 2不等於 0。
-當i = 3時,13 % 3不等於 0。
-迴圈結束後,flag仍然是 1。
-接著檢查if (n <= 1),13 <= 1為 false,所以flag保持為 1。
-最後if (flag == 1)為 true,執行printf("Yes")。
語言: C
輸出: Yes
Figure 2:
#include<iostream>
using namespace std;
void findFact(int, int *);
int main()
{
int num =4, fact=1;
findFact(num, &fact);
cout<<"\nFactorial = "<<fact;
cout<<endl;
return 0;
}
void findFact(int n, int *f)
{
int i;
for(i=n; i>=1; i--)
*f = (*f)*i;
}
語言辨識:
程式碼包含 #include<iostream>, using namespace std;, cout, endl 等,這是典型的 C++ 語言程式碼。
輸出預測:
程式碼定義了一個計算階乘的函數 findFact,它接受一個整數 n 和一個指向整數的指標 f。findFact 函數會計算 n 的階乘,並將結果儲存在指標 f 所指向的變數中。
main函數中,num初始化為 4,fact初始化為 1。- 呼叫
findFact(num, &fact),即findFact(4, &fact)。 - 在
findFact函數中,n = 4,*f = 1。 - 迴圈從
i = 4開始,到i = 1結束:i = 4:*f = 1 * 4 = 4i = 3:*f = 4 * 3 = 12i = 2:*f = 12 * 2 = 24i = 1:*f = 24 * 1 = 24
- 迴圈結束,
fact的值變為 24。 cout<<"\nFactorial = "<<fact;會輸出 "Factorial = 24"。
語言: C++
輸出:
Factorial = 24
Figure 3:
let hcf;
const number1 = 6;
const number2 = 8;
for (let i = 1; i <= number1 && i <= number2; i++) {
if(number1 % i == 0 && number2% i == 0) {
hcf = i;
}
}
let lcm = (number1 * number2) / hcf;
console.log('Answer is ${lcm).');
語言辨識:
程式碼使用 let, const, for (...), console.log() 等關鍵字和語法,這是典型的 JavaScript 程式碼。
輸出預測:
程式碼計算兩個數字 6 和 8 的最大公因數 (HCF) 和最小公倍數 (LCM)。
number1 = 6,number2 = 8。- 迴圈從
i = 1開始,直到i <= 6 && i <= 8(即i <= 6)。 - 當
i = 1時,6 % 1 == 0且8 % 1 == 0,所以hcf = 1。
-當i = 2時,6 % 2 == 0且8 % 2 == 0,所以hcf = 2。
-當i = 3時,6 % 3 == 0但8 % 3 != 0。
-當i = 4時,6 % 4 != 0。
-當i = 5時,6 % 5 != 0。
-當i = 6時,6 % 6 == 0但8 % 6 != 0。
-迴圈結束,hcf的值是最後一次更新的值,即 2。
-計算lcm = (number1 * number2) / hcf = (6 * 8) / 2 = 48 / 2 = 24。 console.log('Answer is ${lcm).');會輸出 "Answer is 24"。
語言: JavaScript
輸出: Answer is 24
Figure 4:
lower = 10
upper = 15
for num in range(lower, upper + 1):
if num > 1:
for i in range(2, num):
else:
if (num % i) == 0:
break
print(num)
語言辨識:
程式碼使用 range(), if/else 結構,縮排來定義程式區塊,這是典型的 Python 語言程式碼。
輸出預測:
這段程式碼的邏輯有些問題,特別是 else 分支下的 if (num % i) == 0: 語句。
lower = 10,upper = 15。for num in range(lower, upper + 1):num將會是 10, 11, 12, 13, 14, 15。- 當
num是 10:if num > 1(10 > 1) 為 true。- 進入內層迴圈
for i in range(2, num),即for i in range(2, 10)。 - 當
i = 2時,if (num % i) == 0(10 % 2 == 0) 為 true,執行break,跳出內層迴圈。 - 程式接著會執行
print(num),輸出 10。
- 當
num是 11:if num > 1(11 > 1) 為 true。