Skip to first unread message

S. Athreya Shankar

unread,
Nov 12, 2020, 12:37:16 AM11/12/20
to Discussion forum for Computational Thinking
In the 3rd question of Activity 4.1, Why should we keep Y? Since the comparison is only between two cards X and Y, if one doesn't match with another then both can be discarded from the deck! 

please clarify.

Anand Iyer

unread,
Nov 12, 2020, 4:34:17 AM11/12/20
to Discussion forum for Computational Thinking, athre...@gmail.com
Y is a loop variable.  

Let's say you've 5 cards,  Take card-1. It's compared with the rest of the cards in a loop.  Here, card-1 is X and card-2 is the card-2, 3,4,5.

You wouldn't want to throw away any card other than card-1 after the rest of the cards are compared with card-1.  Agreed?

Computational Thinking Support 2

unread,
Nov 12, 2020, 4:40:52 AM11/12/20
to Discussion forum for Computational Thinking, anandd...@gmail.com, athre...@gmail.com
Hi,
I think Anand explained well. You can go through his explanation.

If you still have doubt please write us again.

Regards,
Deepak
IITM Online Degree Team

S. Athreya Shankar

unread,
Nov 12, 2020, 6:32:38 AM11/12/20
to Discussion forum for Computational Thinking, ct-su...@onlinedegree.iitm.ac.in, anandd...@gmail.com, S. Athreya Shankar
But here there are only 2 cards , cards X and Y, so why keep Y for further iteration ?

Anand Iyer

unread,
Nov 12, 2020, 8:02:40 AM11/12/20
to Discussion forum for Computational Thinking, athre...@gmail.com, ct-su...@onlinedegree.iitm.ac.in, Anand Iyer
no, it's not only two cards,

We're dealing with all cards in the dataset.

We're using X to represent one card, and Y to represent to all the rest of the cards (one at a time in a loop)

S. Athreya Shankar

unread,
Nov 13, 2020, 12:23:28 AM11/13/20
to Discussion forum for Computational Thinking, anandd...@gmail.com, S. Athreya Shankar, ct-su...@onlinedegree.iitm.ac.in
is it? ohk then fine.

SNEHA R

unread,
Nov 13, 2020, 10:52:23 AM11/13/20
to cs1001-...@nptel.iitm.ac.in
Can you please help me to solve question number 3 and 4 in assignment 3 activity 3. 
Reply all
Reply to author
Forward
0 new messages