Grades assignment 1 Q7 explanation needed!!

666 views
Skip to first unread message

Avinash Roy

unread,
Oct 19, 2020, 11:30:08 PM10/19/20
to Discussion forum for Computational Thinking
While reading the ques, it seems the answer should be "Total number of sentences with only one verb in it"
But while practically looking at the data set, it does not satisfy the condition because the very first sentence has only one verb only not ending with full stop but still A remains "0" whereas as the ans suggested it should have been incremented.
Please proof the ans with the provided data set in the ques.
What will variable A represent after execution of the following procedure on the “Paragraph Words” dataset?

Step 1. Arrange all cards in a single pile called Pile 1
Step 2. Maintain two variables A, B and initialize them to 0
Step 3. If Pile 1 is empty then stop the iteration
Step 4. Read the top card in Pile 1
Step 5. If part of speech is “Verb” then increment B
Step 6. If the word does not end with a full stop then execute step 9
Step 7. If the word ends with a full stop and B is equal to 1 then increment A
Step 8. Reset the variable B to 0
Step 9. Move the current card to another pile called Pile 2 and repeat from step 3
  •  Total number of verbs in the dataset
  •  Total number of sentences with only one verb in it
  •  Total number of sentences in the dataset
  •  Total number of sentences with at least one verb in it
  •  None of the above

Archita Singh

unread,
Oct 20, 2020, 12:23:43 AM10/20/20
to Discussion forum for Computational Thinking, avina...@gmail.com
A increments only when it encounters the word with a fullstop given the condition that B was already 1 and not when it encounters a verb with a fullstop. Nowhere do the steps mention a verb with a fullstop. It says if the word doesn't have a fullstop skip to the 9th step.
You seem to be confused between the word and the verb thing. Have a closer look. 

Avinash Roy

unread,
Oct 20, 2020, 2:41:07 AM10/20/20
to Discussion forum for Computational Thinking, archita2...@gmail.com, Avinash Roy
Thanks Archita for the explanation. I did it wrongly.

Computational Thinking Support 2

unread,
Oct 20, 2020, 2:54:46 AM10/20/20
to Discussion forum for Computational Thinking, avina...@gmail.com, archita2...@gmail.com
Explanation of each and every question of the Graded Assignment of Week 1 is uploaded in the portal. Also video solution of the  same will be updated soon.   Please go through the solution.  And if you are still having doubt after going through the solution, we will be discussing about your specific doubts.

Thanks and Regards,
Nijin
IITM Online Degree Programme 

nithish s

unread,
Oct 21, 2020, 2:37:26 PM10/21/20
to Discussion forum for Computational Thinking, archita2...@gmail.com, avina...@gmail.com
Hello Archita,

I have one query regarding the dame question.
Any help to understand the answer better is appreciated.

Consider the below condition:

Suppose cards are not arranged and two words which are verbs come to the loop before a word with a full stop. this will leads to incrementing the B variable to 2. 
When a word with a full stop goes through iteration and goes through step 8 which requires satisfying both words with a full stop and B=1 condition. since B=2 the condition will never be met and A will be 0 at the end of the execution.
considering this I marked None of the above as the answer.
Can you please let me know if this condition occurs how the answer will be the Total number of sentences with only one verb in it?
Please let me know if my understanding is correct.

regards,
Nithish S
Reply all
Reply to author
Forward
0 new messages