Assignment 0

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Natural Language Processing

Assignment- 0
TYPE OF QUESTION: MCQ
Number of questions: 20 Total mark: 20 X 1 = 20
______________________________________________________________________________

QUESTION 1:
Which of the following statements is false?

a. Context Free Language is a subset of Context Sensitive Language


b. Regular Language is a subset of Context Sensitive Language
c. Context Sensitive Language is a subset of Context Free Language
d. Recursively Enumerable Language is a superset of Regular Language

Correct Answer: c

Detailed Solution:

______________________________________________________________________________

QUESTION 2:
Bag I contains 4 Blue and 6 Red balls while another Bag II contains 4 Blue and 3 Red balls. One
ball is drawn at random from one of the bags and it is found to be Red. Find the probability that
it was drawn from Bag II?

a. 0.588
b. 0.407
c. 0.675
d. 0.389

Correct Answer: a

Detailed Solution:

______________________________________________________________________________
QUESTION 3:
Which among the following can parse a Context Free Grammar?

a. Top Down parser


b. Bottom Up parser
c. CYK algorithm
d. All of the above

Correct Answer: d

Detailed Solution:

______________________________________________________________________________

QUESTION 4:
The pumping lemma is often used to prove that a language is:

a. Context free
b. Not context free
c. Regular
d. None of the above

Correct Answer: b

Detailed Solution:

______________________________________________________________________________

QUESTION 5:
When a top-down approach of dynamic programming is applied to a problem, it usually:

a. Decreases both the time complexity and space complexity


b. Decreases the time complexity and increases the space complexity
c. Increases the time complexity and decreases the space complexity
d. Increases both, the time complexity and space complexity

Correct Answer: b

Detailed Solution:

____________________________________________________________________________
QUESTION 6:
Suppose that the probability of event A is 0.2 and the probability of event B is 0.8. Also,
suppose that the two events are independent. Then calculate P(A|B).

a. 0.2
b. 0.16
c. 0.36
d. None of the above

Correct Answer: a

Detailed Solution:

_____________________________________________________________________________

QUESTION 7:
The Context Free Languages are closed under:

a. Intersection
b. Complement
c. Kleene Closure
d. All of the above

Correct Answer: c

Detailed Solution:

______________________________________________________________________________

QUESTION 8:
If A is a 4×4 matrix with det(A)=−1, compute det(−3A).

a. 3
b. -48
c. 81
d. None of the above

Correct Answer: c

Detailed Solution:

______________________________________________________________________________
QUESTION 9:
A medical treatment has a success rate of 0.7. Two patients will be treated with this treatment.
Assuming the results are independent for the two patients, what is the probability that neither
one of them will be successfully cured?

a. 0.4
b. 0.09
c. 0.21
d. 0.49

Correct Answer: b

Detailed Solution:

____________________________________________________________________________

QUESTION 10:
A Context Free Grammar (CFG) is ambiguous if:

a. It has more than one rightmost derivations


b. It has more than one leftmost derivations
c. No parse tree can be generated for the CFG
d. None of the above

Correct Answer: b

Detailed Solution:

______________________________________________________________________

QUESTION 11:
Regular expression for all strings starts with ‘ab’ and ends with ‘bba’ is:

a. aba*b*bba
b. ab(ab)*bba
c. ab(a+b)*bba
d. All of the above

Correct Answer: c

Detailed Solution:

______________________________________________________________________________
QUESTION 12:

Find all eigenvalues for the matrix A if

a. 1, 4, 8
b. 0, 3, −4
c. 3, 7, 2
d. None of the above

Correct Answer: b

Detailed Solution:

______________________________________________________________________________

QUESTION 13:

Find the inverse of the matrix

a.

b.

c.
d. None of the above

Correct Answer: a

Detailed Solution:

______________________________________________________________________________
QUESTION 14:
If we randomly pick two television sets in succession from a shipment of 240 television sets of
which 15 are defective, what is the probability that they will both be defective?

15 2
a. ( )
240
15 14
b. (240 × 239)
15 2
c. 1 − ( )
240
15 14
d. (240 + 239)

Correct Answer: b
15 14
Detailed Solution: First draw is defective with prob. and the second one with prob (as
240 239
one defective TV has already been removed in first draw). It will be a product of these two
probabilities as we need both these events to occur.

_________________________________________________________________________

QUESTION 15:
Find the row rank of the matrix

a. 3
b. 1
c. 4
d. 2

Correct Answer: d

Detailed Solution:

_______________________________________________________________________
QUESTION 16:
In Orange County, 52% of the adults are males. Among males of that county, 9% are smokers
and among females 3% are smokers. For a randomly selected subject, who is a smoker, what is
the probability that the subject is a male?
9
a.
100
9 52
b. ×
100 100
13
c.
17
9
d.
52

Correct Answer: c

Detailed Solution: Apply Bayes Theorem and Law of total probability

___________________________________________________________________________

QUESTION 17:
What is the (Levenshtein) edit distance between “swift” and “sweet”? (Assume costs for
deletion, insertion and substitution to be 1,1,2 respectively)

a. 2
b. 3
c. 4
d. None of the above

Correct Answer: c

Detailed Solution: 2 substitutions or a total of 4 ins + del operations. Both have a cost of 4

______________________________________________________________________________

QUESTION 18:
Which of the following is/are property/properties of a dynamic programming problem?

a. Optimal substructure
b. Overlapping subproblems
c. Greedy approach
d. Both optimal substructure and overlapping subproblems
Correct Answer: d

Detailed Solution:

___________________________________________________________________

QUESTION 19:

1 1
Let A and B be events such that 𝑃(𝑃) = = 𝑃(𝑃) and 𝑃(𝑃𝑃 ∩ 𝑃𝑃 ) = . Find the probability of
2 3
𝑃 𝑃
the event 𝑃 ∪ 𝑃 .

2
a. 𝑃(𝑃𝑃 ∪ 𝑃𝑃 ) =
3
𝑃 𝑃 1
b. 𝑃(𝑃 ∪ 𝑃 ) =
3
𝑃 𝑃 1
c. 𝑃(𝑃 ∪ 𝑃 ) =
2
𝑃 𝑃 3
d. 𝑃(𝑃 ∪ 𝑃 ) =
4

Correct Answer: a

Detailed Solution: Use Venn diagrams or apply the de morgan's law

______________________________________________________________________________

QUESTION 20:
What is the expression for time complexity for finding Fibonacci number using recursion?

a. 𝑃(𝑃) = 𝑃(𝑃 − 1) + 𝑃(𝑃)


b. 𝑃(𝑃) = 𝑃(𝑃 − 1) + 𝑃(𝑃/2)
c. 𝑃(𝑃) = 2 ∗ 𝑃(𝑃/2) + 𝑃(1)
d. 𝑃(𝑃) = 𝑃(𝑃 − 1) + 𝑃(𝑃 − 2)

Correct Answer: d

Detailed Solution: 𝑃(𝑃) = 𝑃(𝑃 − 1) + 𝑃(𝑃 − 2). Since, for fib(n) both fib(n-1) and fib(n-2)
needs to be calculated in recursion.

______________________________________________________________________________

************END*******

You might also like