0 views

Uploaded by Muhammad Ibraheem

- Bound Energy Alg Exercise With Solutions
- Greedy Practice Problems
- A Beginner’s Guide to Big O Notation « Rob Bell
- Jo Pt Custom Solution
- data structures
- Thesis MS Kammer
- Index.pdf
- Design and Analysis of Algorithms 1
- chGYZ.pdf
- Asymptotic Notations 1
- Write Up
- module01-1up
- Algorithm Analysis
- Quantum Randomness and Free Will
- Takla
- algo - ex2 - incomplete!
- pp
- 5590-5598
- anskey
- Introduction_to_DAA.pdf

You are on page 1of 8

PAF Complex, Sector E-9. ISLAMABAD

14 February, 2019

Note: Attempt all questions. Clearly encircle the correct option. There are five sections

and each section have 5 questions. Since sections have different marks as shown, manage

your time accordingly.

For questions 1 to 3, find the statement that must be true according to the given

information.

Q.1: Ten new television shows appeared during the month of September. Five of the

shows were sitcoms, three were hour-long dramas, and two were news-magazine

shows. By January, only seven of these new shows were still on the air. Five of the

shows that remained were sitcoms.

B. Only one of the hour-long dramas remained on the air.

C. At least one of the shows that was cancelled was an hour-long drama.

D. Television viewers prefer sitcoms over hour-long dramas.

Q.2: Georgia is older than her cousin Marsha. Marsha's brother Bart is older than

Georgia. When Marsha and Bart are visiting with Georgia, all three like to play a

game of Monopoly. Marsha wins more often than Georgia does.

A. When he plays Monopoly with Marsha and Georgia, Bart often loses.

B. Of the three, Georgia is the oldest.

C. Georgia hates to lose at Monopoly.

D. Of the three, Marsha is the youngest.

Q.3: On weekends, Mr. Sanchez spends many hours working in his vegetable and flower

gardens. Mrs. Sanchez spends her free time reading and listening to classical music.

Both Mr. Sanchez and Mrs. Sanchez like to cook.

B. Mr. Sanchez does not like classical music.

C. Mrs. Sanchez cooks the vegetables that Mr. Sanchez grows.

D. Mrs. Sanchez enjoys reading nineteenth century novels.

1 of 8

Q.3: Imagine you have 25 horses, and a track capable of racing 5 horses at a time. This

track lacks new technology allowing for exact timing, and thus only the order of a

race result is known. What is the minimum number of races necessary to determine

your three fastest horses?

A. 6

B. 7

C. 8

D. 9

Q.5: Of the following two statements, both of which cannot be true, but both can also be

false. Which are these two statements?

I. All machines make noise

II. Some machines are noisy

III. No machine makes noise

IV. Some machines are not noisy

A. I & II

B. III & IV

C. I & III

D. II & IV

Q.1: The angle of elevation of a ladder leaning against a wall is 60º and the foot of the

ladder is 4.6 m away from the wall. The length of the ladder is:

A. 2.3 m

B. 4.6 m

C. 7.8 m

D. 9.2 m

Q.2: A man standing at a point P is watching the top of a tower, which makes an angle

of elevation of 30º with the man's eye. The man walks some distance towards the

tower to watch its top and the angle of the elevation becomes 60º. What is the

distance between the base of the tower and the point P?

A. 43 units

B. 8 units

C. 12 units

D. Data inadequate

E. None of these

2 of 8

Q.3: Two cards are drawn together from a pack of 52 cards. The probability that one is a

spade and one is a heart, is:

3

A.

20

29

B.

34

47

C.

100

𝟏𝟑

D.

𝟏𝟎𝟐

Q.4: A card is drawn from a pack of 52 cards. The probability of getting a queen of club

or a king of heart is:

1

A.

13

2

B.

13

𝟏

C.

𝟐𝟔

1

D.

52

Q.5: A bag contains 4 white, 5 red and 6 blue balls. Three balls are drawn at random from

the bag. The probability that all of them are red, is:

1

A.

22

3

B.

22

𝟐

C.

𝟗𝟏

2

D.

77

3 of 8

III. Advanced Engineering Concepts (5 Questions, 3 marks each)

B. Aperiodic discrete time signals

C. Aperiodic continuous signals

D. Periodic continuous signals

Q.2: Determine the convolution sum of two sequences 𝑥(𝑛) = {3, 2, 1, 2} and

ℎ(𝑛) = {1, 2, 1, 2}

B. 𝑦(𝑛) = {3, 8, 3, 12, 9, 4, 4}

C. 𝑦(𝑛) = {3, 8, 8, 12, 9, 1,4}

D. 𝑦(𝑛) = {3, 8, 8, 1, 9, 4, 4}

Q.3: Curve A is a

B. amplitude response of a lowpass filter

C. both A & B

D. none of the above

Q.4: Label below correct distribution letter to following probability density functions:

A: Exponential Distribution

B: Cauchy Distribution

C: Normal Distribution

D: Uniform Distribution

4 of 8

Q.5: Convert geographical Lat 33.56782° N and Long 70.54362° E into Degree-Minute-

Second coordinate format (DD° MM’ SS.S”)

Q.1: The auxiliary space of some insertion-sort algorithm is 𝑂(1), what does 𝑂(1) mean?

B. It means the amount of extra memory Insertion Sort consumes doesn't

depend on the input. The algorithm should use the same amount of memory

for all inputs.

C. It takes only 1 kb of memory.

D. It is the speed at which the elements are traversed.

5 of 8

Q.2: What is time complexity of following 𝑓𝑢𝑛( )?

𝑖𝑛𝑡 𝑓𝑢𝑛(𝑖𝑛𝑡 𝑛)

{

𝑖𝑛𝑡 𝑐𝑜𝑢𝑛𝑡 = 0;

𝑓𝑜𝑟 (𝑖𝑛𝑡 𝑖 = 𝑛; 𝑖 > 0; 𝑖 /= 2)

𝑓𝑜𝑟 (𝑖𝑛𝑡 𝑗 = 0; 𝑗 < 𝑖; 𝑗 + +)

𝑐𝑜𝑢𝑛𝑡 += 1;

𝑟𝑒𝑡𝑢𝑟𝑛 𝑐𝑜𝑢𝑛𝑡;

}

A. 𝑂(𝑛2 )

B. 𝑂(𝑛𝑙𝑜𝑔𝑛)

C. 𝑶(𝒏)

D. 𝑂(𝑛𝑙𝑜𝑔𝑛𝑙𝑜𝑔𝑛)

minimum number of multiplications needed to evaluate 𝑝 on an input 𝑥 is:

A. 3

B. 4

C. 5

D. 6

Q.4: Consider a situation where you don't have function to calculate power (𝑝𝑜𝑤( )

function in C) and you need to calculate 𝑥 𝑛 where 𝑥 can be any number and 𝑛 is a

positive integer. What can be the best possible time complexity of your own power

function?

A. 𝑂(𝑛)

B. 𝑂(𝑛𝑙𝑜𝑔𝑛)

C. 𝑂(𝑙𝑜𝑔𝑙𝑜𝑔𝑛)

D. 𝑶(𝒍𝒐𝒈𝒏)

𝑖𝑛𝑡 𝑚𝑎𝑖𝑛( )

{

𝑖𝑛𝑡 𝑥, 𝑦, 𝑚, 𝑛;

𝑠𝑐𝑎𝑛𝑓 ("%𝑑 %𝑑", &𝑥, &𝑦);

/∗ 𝑥 > 0 𝑎𝑛𝑑 𝑦 > 0 ∗/

𝑚 = 𝑥; 𝑛 = 𝑦;

𝑤ℎ𝑖𝑙𝑒 (𝑚 ! = 𝑛)

{ 𝑖𝑓(𝑚 > 𝑛)

𝑚 = 𝑚 − 𝑛;

𝑒𝑙𝑠𝑒

𝑛 = 𝑛 − 𝑚; }

𝑝𝑟𝑖𝑛𝑡𝑓("%𝑑", 𝑛);

}

6 of 8

What does the program compute?

B. x mod y using repeated subtraction

C. the greatest common divisor of x and y

D. the least common multiple of x and y

Q.1: In MATLAB, which command will return the corner elements of a

10-by-10 matrix A?

A. A([1,end], [1,end])

B. A([1,1], [end,end])

C. A({[1,1], [1,end], [end,1], [end,end]})

D. A(1:end, 1:end)

Q.2: In MATLAB, which command will return the fraction of positive numbers in a

10-by-10 matrix A?

B. numel(A > 0)/numel(A)

C. sum(A > 0)/prod(size(A))

D. nnz(A > 0)/numel(A)

𝑣𝑜𝑖𝑑 𝑚𝑎𝑖𝑛()

{

𝑙𝑜𝑛𝑔 𝑚 = 1024;

𝑖𝑛𝑡 𝑖 = 1;

𝑤ℎ𝑖𝑙𝑒 (𝑚 >= 1)

{𝑚 = 𝑚/2;

𝑖 = 𝑖 + 1; }

}

A. 10

B. 11

C. 12

D. 1023

7 of 8

𝑖𝑛𝑡 𝑚𝑎𝑖𝑛( )

{

𝑖𝑛𝑡 𝑎𝑟𝑟[5] = {8,6,4,2,0};

𝑖𝑛𝑡 ∗ 𝑝𝑡𝑟 = 𝑎𝑟𝑟;

𝑠𝑡𝑑: : 𝑐𝑜𝑢𝑡 <<∗ (𝑝𝑡𝑟 + 1) << " " <<∗ 𝑝𝑡𝑟 + 2 << " " <<∗ (𝑎𝑟𝑟 + 3)

<< " " <<∗ 𝑎𝑟𝑟 + 4;

𝑟𝑒𝑡𝑢𝑟𝑛 0;

}

Q.5: Write a program that multiples two 𝑁 x 𝑁 matrices. You may write in any preferred

programming language (mention its name), with complete/correct syntax.

~ Good Luck ~

8 of 8

- Bound Energy Alg Exercise With SolutionsUploaded byfatima_akram
- Greedy Practice ProblemsUploaded byFidaHussain
- A Beginner’s Guide to Big O Notation « Rob BellUploaded byUmesh Narayanan
- Jo Pt Custom SolutionUploaded byndliu2891
- data structuresUploaded bymanasa008
- Thesis MS KammerUploaded byShine Nagpal
- Index.pdfUploaded byarno9bear
- Design and Analysis of Algorithms 1Uploaded byLohidas Paila
- chGYZ.pdfUploaded byfilecom
- Asymptotic Notations 1Uploaded byRajendranbehappy
- Write UpUploaded byShivam Gautam
- module01-1upUploaded byHarsh Shah
- Algorithm AnalysisUploaded bybeenagodbin
- Quantum Randomness and Free WillUploaded byahsbon
- TaklaUploaded bysheoranl
- algo - ex2 - incomplete!Uploaded byShai Deshe
- ppUploaded byPREMENDRA SAMEER
- 5590-5598Uploaded byVignesh Balakrishnan
- anskeyUploaded byLuis Vigueros Cárdenas
- Introduction_to_DAA.pdfUploaded byAkhter Jahangir
- Rangkuman 2Uploaded byNelsonRumuy
- Xu ly anh Lab 3Uploaded byLêHưng
- Moment Distribution MethodUploaded byKshitiz Shrestha
- valuetools-preprintUploaded byKernel5
- solve8Uploaded byzvisar
- 5.5_caUploaded byalex
- viterbialgorithmUploaded byRandhir Kumar
- Dr. Dileep AssignmentUploaded byDileep Singh
- Structural Theory 2Uploaded byGinoOcampo
- Online Semi-Supervised LearningUploaded byWeslley Caldas

- CL 625 Term PaperUploaded byjansks
- A Macroprudential Assessment for Sri LankaUploaded byMèoMập
- Yearly Lesson Plan f3Uploaded byhazwani_s
- Quartal Triads for a Coltrane SoundUploaded byPim Van Harten
- Components Reaction MixtureUploaded bybiotech_vidhya
- Study of Heat Transfer Coefficient in a Double Pipe Heat ExchangerUploaded byMd. Hasib Al Mahbub
- The Application of Image Enhancement on Color and Grayscale ImagesUploaded byNisar Ahmed Rana
- 2011 Yamaguchi Control of a Five-Axle, Three-steering Coupled-Vehicle System and Its Experimental VeriﬁcationUploaded bySubhajeet Rath
- Klima ProduktiUploaded byPavle Perovic
- Constructive-Anatomy-by-George-Bridgman.pdfUploaded bymgarbini8361
- BSc ChemistryUploaded byRavi Gupta
- summing_buss.pdfUploaded byDarren Winslow
- The Divine Proportion - Corey BarkerUploaded byGordonWinnow
- Coleman - Vacuum decay .pdfUploaded byGuillermo Gerardo Rivera Gambini
- maple_cheatsheet.pdfUploaded bypzeaiter111
- 201601 Euroguss IntDgTag MAMGA Bramann EnUploaded bySüleymanŞentürk
- PUB111-002!00!0316 Centork CK Range FlyerUploaded byFelipe Gamboa Gálvez
- Post HF Method_SouravUploaded byRimple Mahey
- april4Uploaded byリズキー
- Wolfgang Nolting-Theoretical Physics 8_ Statistical Physics-Springer (2018)Uploaded byJavier Chuchullo Tito
- The Effect of Heat on Metals PRAC - CopyUploaded byAnonymous 9YbbIRGbMd
- Lexan Polycarbonate 9030 Technical Properties Data SheetUploaded byenki95823
- C 695Uploaded byJGD123
- Development and Evaluation of Amoxicillin Formulations by Direct CompressionUploaded bymeta
- IT_SYLLABUSUploaded byharij_1
- Supercritical fluid extraction from vegetable materialsUploaded byJonatas Lopes
- rao don DA p 29, 37Uploaded byhoanglanhou
- RENR9855-02-01-ALLUploaded bymoussa
- Granul SalutUploaded byInTan Permata
- Nitinol Af Testing StrategiesUploaded byTodd Dickson