GRADED ASSIGNMENT 2 , QUESTION 5.

103 views
Skip to first unread message

Ashiraj KT

unread,
Oct 26, 2020, 2:58:32 PM10/26/20
to Discussion forum for Computational Thinking
Why is step 2 not an answer?
shouldn't the initialization be 0 and not 1?
 PLEASE CLARIFY.....

KHUSHI SHARMA

unread,
Oct 26, 2020, 2:59:36 PM10/26/20
to Discussion forum for Computational Thinking, ktas...@gmail.com
you are right
Message has been deleted

Ashiraj KT

unread,
Oct 26, 2020, 3:08:44 PM10/26/20
to Discussion forum for Computational Thinking, khushi...@gmail.com, Ashiraj KT
The professors have said that we should always assign 0 or -1 if finding a maximum value.
And there can be cases when the only product costs 1. Then if we were to initialize 1 to the variable we won't be getting anything.
HOPE THEY CLARIFY IT.    

Dipin Manmadhan

unread,
Oct 27, 2020, 12:49:40 AM10/27/20
to Discussion forum for Computational Thinking, ktas...@gmail.com, khushi...@gmail.com
There is one issue with this question. But let me clear one thing, even though they said max should be initialized with 0 or -1, that was with respect to Marks dataset. In the same lecture or the next lecture, they said that picking a value for initializing max or min should be based on the context of the data set.

So for marks: 0, -1 can be used to initialize Max since the possible range is 0 - 100 / 150 (whatever may be the upper case)
But for Sale, we can initialize MAX with 1 too, because will there be any bill with amount 0 (which means nothing is bought). The possible range of bills is from 1 to the upper limit. So choosing 1 is not an issue. (neglecting the case of 0.50 rs bills, that too impossible nowadays - not sure any supermarket sells anything which costs less than 1).

For more clarification, consider a scenario where we are trying to find out the max temperature in a hill station. Can we initialize MAX with -1 or 0? Absolutely not. Because temperature can have negative values, so we should pick something well below the possible range, like -100.

So we shouldn't always pick -1 or 0 to initialize Max. Should always consider the context of the data.

The problem with this question is that, If they start by initializing MAX as 1, then what if there are no particular bills for the given scenario. Even though there are no records, MAX will be zero, so should we infer that there is a record with 1 rs as the total amount or no record at all.

Pawan Kumar

unread,
Oct 27, 2020, 1:04:58 AM10/27/20
to Discussion forum for Computational Thinking, dipinrm...@gmail.com
you are right all the to the end, almost. But there is no problem with the question, its simple, the step 5th is incorrect as it should have "<" sign and not this ">" sign.

Shankar Vetal

unread,
Oct 27, 2020, 1:09:22 AM10/27/20
to Discussion forum for Computational Thinking, dipinrm...@gmail.com, ktas...@gmail.com, khushi...@gmail.com
  Question5, Step 2- is incorrect step. Max cant be initialise with default initial value 1. It must be zero.
Need to check it once again.

On Tuesday, October 27, 2020 at 10:19:40 AM UTC+5:30 dipinrm...@gmail.com wrote:

Preeth T

unread,
Oct 27, 2020, 1:11:12 AM10/27/20
to Discussion forum for Computational Thinking, ktas...@gmail.com
Step 2 can be partially wrong answer ..please check

On Tuesday, 27 October 2020 at 00:28:32 UTC+5:30 ktas...@gmail.com wrote:

Computational Thinking Support 2

unread,
Oct 27, 2020, 1:15:54 AM10/27/20
to Discussion forum for Computational Thinking, Preeth T, ktas...@gmail.com
Hi,
Please check the pdf solution provided on the portal. The solution video will be uploaded in sometime.
If you have still doubt please write us again.

Regards,
Deepak
IITM Online Degree Team
Reply all
Reply to author
Forward
0 new messages