Your next chapter starts hereExplore admission guide

DUET CSE 2009-2010 - Previous Year

Reading mode — untimed, no attempt is recorded
Back
Question 1a Programming

1. (a) Write the content and purpose of the following header files [নিম্নোক্ত হেডার ফাইলগুলোর কনটেন্ট এবং উদ্দেশ্যগুলি লিখ ।]

(i) <iostream.h> (ii) <stdlib.h> (iii) <math.h> (iv) <string.h>

Solution
HeaderContent ও purpose
iostream.hপুরোনো non-standard C++ stream header; standard C++-এ <iostream>, std::cin/std::cout
stdlib.hmalloc/free, numeric conversion, exit, qsort ইত্যাদি
math.hsqrt, pow, sin ইত্যাদি mathematical function declaration
string.hstrlen, strcmp, strcpy, memcpy ইত্যাদি string/memory operation declaration
Question 1b Programming

1. (b) Using recursion write a program in “C” Language to calculate the factorial of any integer. [রিকারসন ব্যবহার করে যে কোন পূর্ণ সংখ্যার ফ্যাক্টরিয়াল গণনা করার জন্য “C” ভাষায় একটি প্রোগ্রাম লিখ।] (06)

Solution

কোনো function নিজেকে call করলে তাকে recursion বলে। Base case recursion থামায়।

\[0!=1,\qquad n!=n(n-1)!\quad(n\ge1)\]

#include <stdio.h>

unsigned long long factorial(unsigned int n) {
    return n < 2 ? 1 : n * factorial(n - 1);
}

int main(void) {
    int n;
    if (scanf("%d", &n) != 1 || n < 0 || n > 20) {
        puts("Enter an integer from 0 to 20.");
        return 1;
    }
    printf("%llu\n", factorial((unsigned int)n));
    return 0;
}
Question 3a Historical: Discrete Mathematics

3. (a) Construct a truth table for the following compound proposition [নিম্নলিখিত কম্পাউন্ড প্রোপজিশনের ট্রুথ টেবিল তৈরী কর] $(p \oplus q) \wedge (p \oplus \neg q)$ (03)

Solution
pqp XOR qp XOR NOT qAND
00010
01100
10100
11010

দুটি XOR complementary, তাই compound proposition সর্বদা false (contradiction)।

Question 2b Historical: Discrete Mathematics

2. (b) A die is rolled and a coin is tossed, find the probability that the die shows an odd number and the coin shows a head. [একটি ডাইকে গড়াইয়া এবং একটি কয়েনকে ছুড়িয়া দেওয়া হইল, ডাইটি একটি বেজোড় সংখ্যা এবং কয়েনটি একটি হেড প্রদর্শন করিবার সম্ভাব্যতা বের কর।] (07)

Solution

\[P(\text{odd and head})=\frac36\times\frac12=\boxed{\frac14}\]

Fair die ও fair coin এবং independent outcomes ধরে।

Question 3a Data Structure

3. (a) Prepare a Binary search tree for the following data: 8,10,26,2,78,102,115 [নিম্নোক্ত ডাটাতগুলি ব্যবহার করে একটি binary search tree তৈরি কর।] (8,10,26,2,78,102,115) (04)

Solution

Insertion order অনুসারে 8 root; 2 তার left child; 10 right child। এরপর 26 → 78 → 102 → 115 ক্রমাগত right child।

Inorder: 2, 8, 10, 26, 78, 102, 115।

bst 2009
Question 3b Historical: Discrete Mathematics

3.(b) If $A = \begin{bmatrix} 1 & 3 \\ 2 & 4 \end{bmatrix}$ and $B = \begin{bmatrix} 2 & 0 & -4 \\ 3 & 2 & 6 \end{bmatrix}$ derive the Matrix multiplication of A and B. [যদি $A = \begin{bmatrix} 1 & 3 \\ 2 & 4 \end{bmatrix}$ and $B = \begin{bmatrix} 2 & 0 & -4 \\ 3 & 2 & 6 \end{bmatrix}$ হয়, তাহলে A এবং B ম্যাট্রিক্সের গুণফল বের কর।] (06)

Solution

\[AB=\begin{bmatrix}1(2)+3(3)&1(0)+3(2)&1(-4)+3(6)\\2(2)+4(3)&2(0)+4(2)&2(-4)+4(6)\end{bmatrix}=\boxed{\begin{bmatrix}11&6&14\\16&8&16\end{bmatrix}}\]

Question 4a Database Management

4. (a) What is data abstraction? Mention the levels of data abstraction. [ডাটা অবস্ট্রাকশন বলতে কি বুঝায়? ডাটা অবস্ট্রাকশনের বিভিন্ন স্তর গুলোর নাম লিখ।] (06)

Solution

Data abstraction ব্যবহারকারীকে অপ্রয়োজনীয় storage details থেকে আলাদা রাখে।

Levelঅর্থ
Physicalডেটা কীভাবে disk-এ সংরক্ষিত
Logicalকোন data, structure ও relationship আছে
View/externalনির্দিষ্ট ব্যবহারকারীর দেখা অংশ
Question 4b Database Management

4. (b) What mapping cardinality? What are the types of it? [ম্যাপিং কার্ডিনালিটি বলতে কি বুঝায়? ইহা কত ধরনের?]

Solution

SQL = Structured Query Language। Mapping cardinality বোঝায় একটি entity-এর সঙ্গে অপর set-এর কত entity সম্পর্কিত হতে পারে।

Typeউদাহরণ
One-to-oneএক country-এর একটি capital, model-এর assumptions সাপেক্ষে
One-to-manyএক department-এ বহু employee
Many-to-oneবহু employee-এর একটি department
Many-to-manyবহু student বহু course নেয়
Question 5a Database Management

5. (a) What is encryption of data? Write the name of recovery techniques. [ডাটা এনক্রিপশন বলতে কি বুঝায়? রিকভারী কৌশলগুলোর নাম লিখ] (05)

Solution

Encryption key ও algorithm ব্যবহার করে plaintext-কে ciphertext-এ রূপান্তর করে যাতে অননুমোদিত ব্যক্তি data পড়তে না পারে। এটি backup/recovery-এর বিকল্প নয়।

  1. Log-based recovery: undo/redo।
  2. Checkpointing।
  3. Shadow paging।
  4. Backup restore এবং transaction-log replay।
Question 5b Database Management

5. (b) Compare and contrast between unique key and foreign key in a database system [ডাটাবেস সিস্টেমের ইউনিক কি এবং ফরেন কি এর মধ্যে তুলনামূলক পার্থক্য ও বৈসাদৃশ্য বর্ণনা কর।] (05)

Solution
Unique keyForeign key
Column set-এর uniqueness enforce করেReferenced primary/unique key-এর সঙ্গে referential integrity enforce করে
এক table-এ একাধিক unique constraint সম্ভবএক table-এ একাধিক foreign key সম্ভব
NULL handling DBMS অনুযায়ী ভিন্নNullable হলে NULL reference অনুমোদিত হতে পারে
নিজ table-এর duplicate value নিয়ন্ত্রণParent-child relation বজায় রাখে; নিজে uniqueness বোঝায় না
Question 6a Historical: Software Development

6. (a) What is the disadvantage of SDLC (System Development Life Cycle)? How can it be removed [SDLC এর অসুবিধাগুলো কি কি এগুলো কিভাবে দূর করা যায়?] (05)

Solution

SDLC নিজে একটি lifecycle ধারণা; সব SDLC model-এর একই সীমাবদ্ধতা নয়। Strict waterfall-এ requirements বদলানো ব্যয়বহুল, user feedback ও working software দেরিতে আসে এবং বড় risk দেরিতে ধরা পড়ে।

Iterative/incremental delivery, prototyping, early testing এবং নিয়মিত stakeholder feedback দিয়ে এই সমস্যাগুলো কমানো যায়।

Question 6b Historical: Software Development

6. (b) How is beta testing performed in software development. [সফটওয়্যার ডেভেলপমেন্টে বেটা টেস্টিং কিভাবে করা হয়।] (05)

Solution
  1. Internal/alpha testing শেষে নির্বাচিত external users-কে release candidate দেওয়া হয়।
  2. Users নিজেদের বাস্তব environment-এ স্বাভাবিক কাজ করেন।
  3. Bug, usability ও compatibility feedback সংগ্রহ করা হয়।
  4. Issue triage, fix ও regression test শেষে final release প্রস্তুত হয়।
Question 7 Historical: Software Development

7. What types of tests are performed during unit testing of software development [সফটওয়্যার ডেভেলপমেন্টের ক্ষেত্রে ইউনিট টেস্টিং এ কি কি টেস্ট করা হয়।] (10)

Solution
  1. Module interface ও parameter validation।
  2. Normal, boundary ও invalid input cases।
  3. Independent control-flow path/branch।
  4. Local data structures ও state transitions।
  5. Error/exception handling ও resource cleanup।

Dependencies প্রয়োজনে stub/mock করা হয়; unit testing পুরো system integration test নয়।

Question 8 Operating System

8. Define Through put, Turnaround time, Waiting time and Response time in respect of operating system. [অপারেটিং সিস্টেমের ক্ষেত্রে Throughput, Turnaround time, Waiting time এবং Response time এর সংজ্ঞা লিখ ।] (10)

Solution
Metricসংজ্ঞা
Throughputপ্রতি unit time-এ completed process সংখ্যা
Turnaround timeCompletion time − arrival time
Waiting timeReady queue-এ মোট অপেক্ষা
Response timeপ্রথম CPU service/response time − arrival time
Question 9a Operating System

9. (a) What are the functions of ‘Kernel’ in the operating system. [অপারেটিং সিস্টেমের কার্নেলের কাজ কি?] (04)

Solution

Operating system হলো system software যা hardware resource পরিচালনা করে এবং application-এর জন্য service দেয়।

  1. Process/CPU scheduling ও process coordination।
  2. Memory allocation, protection ও virtual memory।
  3. File, storage ও I/O device management।
  4. User authentication, access control ও system-call interface।
Question 9b Operating System

9. (b) What is the important of File Management of the Operating system. [অপারেটিং সিস্টেমের ফাইল ব্যবস্থাপনার গুরুত্ব কি ।] (06)

Solution
  1. File/directory creation, reading, writing ও deletion।
  2. Storage allocation ও free-space tracking।
  3. Naming, metadata ও directory organisation।
  4. Permission এবং access control।
  5. Concurrent access, consistency ও recovery support।
Question 10 Microprocessor & Microcomputer

10. Explain ‘write’ operation of Programmable Interval Timer (PIT) or 8253. [Programmable Interval Time (PTT) or 8253 এর “Write” operation ব্যাখ্যা কর ।] (10)

Solution
  1. CS low, RD high এবং A1A0 = 11 দিয়ে control-word register নির্বাচন করো।
  2. WR pulse-এর মাধ্যমে counter number, byte order, mode এবং binary/BCD format লেখো।
  3. A1A0 = 00/01/10 দিয়ে counter 0/1/2 নির্বাচন করো।
  4. নির্বাচিত format অনুযায়ী count লেখো: LSB only, MSB only, অথবা প্রথমে LSB তারপর MSB।
  5. Clock ও GATE এবং নির্বাচিত mode অনুযায়ী counting/output চলে।

উদাহরণ: counter 0, binary, mode 3, LSB-then-MSB-এর control word = 36H। Count 1000 = 03E8H হলে E8H তারপর 03H লেখো।

Intel 8253 datasheet

Question 11 Data Communication & Computer Network

11. Identify the several layers of OSI reference model and write the main task of data link layer. [OSI reference মডেলের বিভিন্ন লেয়ারগুলি চিহ্নিত কর এবং ডাটা লিংক লেয়ারের প্রধান কার্যাবলী লিখ। ] (10)

Solution
OSI (উপর থেকে নিচে)মূল কাজ
ApplicationApplication-level network service
PresentationData representation, encoding, encryption
SessionSession/dialog coordination
TransportEnd-to-end process delivery, ports
NetworkLogical addressing ও routing
Data linkFraming, MAC addressing, media access, error detection
PhysicalMedium-এ bits/signals পাঠানো
Question 12 Data Communication & Computer Network

12. Explain simplex, Half-Duplex and Full Duplex data transmission. [সিমপ্লেক্স, হাফ-ডুপ্লেক্স এবং ফুল-ডুপ্লেক্স ডাটা ট্রান্সমিশন ব্যাখ্যা কর] (10)

Solution
Modeদিকউদাহরণ
Simplexশুধু এক দিকেBroadcast television
Half-duplexদুই দিকে, তবে একই সময়ে নয়Walkie-talkie
Full-duplexদুই দিকে একই সময়েTelephone conversation
Question 13 Digital Electronics

13. Design full adder circuit using only NAND gate. [শুধুমাত্র ন্যান্ড গেট এর সাহায্যে ফুল এডার সার্কিট ডিজাইন কর।] (10)

Solution

\[S=A\oplus B\oplus C_{in},\qquad C_{out}=AB+C_{in}(A\oplus B)\]

ABCinSCout
00000
00110
01010
01101
10010
10101
11001
11111

নিচের 9টি two-input NAND connection পূর্ণ circuit নির্ধারণ করে:

GateConnection
n1NAND(A,B)
n2NAND(A,n1)
n3NAND(B,n1)
PNAND(n2,n3)
n4NAND(P,Cin)
n5NAND(P,n4)
n6NAND(Cin,n4)
SNAND(n5,n6)
CoutNAND(n1,n4)
nand full adder
Question 14 Digital Electronics

14. For the emitter bias network of the following figure determine. [নিম্নের Emitter bias নেটওয়ার্ক থেকে বের কর]

(i) $I_B$, (ii) $I_C$, (iii) $V_{CE}$, (iv) $V_C$, (v) $V_{BC}$

(Circuit diagram showing an NPN transistor emitter-bias configuration with $+20\text{ V}$ Vcc, $2\text{ k}\Omega$ collector resistor, $430\text{ k}\Omega$ base resistor, $1\text{ k}\Omega$ emitter resistor, $\beta = 50$, and coupling capacitors $10\ \mu\text{F}$ and $40\ \mu\text{F}$)

Solution

Source-এর described emitter-bias circuit: VCC = 20 V, RB = 430 kΩ, RC = 2 kΩ, RE = 1 kΩ, β = 50; VBE = 0.7 V ধরে।

\[I_B=\frac{20-0.7}{430000+(50+1)1000}=\boxed{40.1247\,\mu\mathrm A}\]

\[I_C=50I_B=\boxed{2.00624\,\mathrm{mA}},\quad I_E=51I_B=2.04636\,\mathrm{mA}\]

\[V_C=20-I_C(2000)=\boxed{15.9875\,\mathrm V}\]

\[V_E=2.04636\,\mathrm V,\quad V_{CE}=V_C-V_E=\boxed{13.9412\,\mathrm V}\]

\[V_{BC}=V_E+0.7-V_C=\boxed{-13.2412\,\mathrm V}\]

Question 15a Basic Electricity

15. (a) Write the formula for total capacitance connected in a parallel and series circuit? [প্যারালাল এবং সিরিজ সার্কিট এর Total capacitance এর সূত্র লিখ]

Solution

\[C_{parallel}=C_1+C_2+\cdots+C_n\]

\[\frac1{C_{series}}=\frac1{C_1}+\frac1{C_2}+\cdots+\frac1{C_n}\]

Parallel-এ voltage একই; series-এ প্রতিটি capacitor-এর charge-এর magnitude একই।

Question 15b Basic Electricity

15. (b) If A parallel combination of $4\ \Omega$ and another unknown resistor are connected across a $12\text{ V}$ supply, where the total current is $5\text{ A}$. Determine the value of unknown resistor. [$4\ \Omega$ এর একটি এবং অজানা মানের আরেকটি রেজিস্ট্রী প্যারালাল সংযুক্ত করে $12\text{ V}$ সরবরাহের সাথে সংযোগ করা হলো সার্কিটে মোট $5\text{ A}$ কারেন্ট প্রবাহিত হয়। অজানা রেজিস্টারের মান নির্ণয় কর।] (05)

(Circuit diagram showing a $12\text{ V}$ DC source supplying $5\text{ A}$ total current to two parallel resistors, $R$ and $4\ \Omega$)

Solution

\[I_4=12/4=3\,\mathrm A,\quad I_R=5-3=2\,\mathrm A\]

\[R=12/2=\boxed{6\,\Omega}\]