Activity Question - Not Graded

260 views
Skip to first unread message

shubh...@gmail.com

unread,
Oct 5, 2020, 2:09:33 AM10/5/20
to Discussion forum for Mathematics for Data Science I

Query.png

Isn't the answer for second part of this question 6 because under root 49, 7, 22, -35, 1729, -20000 are all integers. But it says Accepted Answer is 5.


Jinal Raval

unread,
Oct 5, 2020, 2:27:04 AM10/5/20
to Discussion forum for Mathematics for Data Science I, shubh...@gmail.com
Here (49)^(1/2) = 7 and 7 is also provided in the list. Need not count twice.

Alistair Brae

unread,
Oct 5, 2020, 2:57:14 AM10/5/20
to Discussion forum for Mathematics for Data Science I, jinalr...@gmail.com, shubh...@gmail.com
But what about taking square root of 49 as -7?

shubh...@gmail.com

unread,
Oct 5, 2020, 3:00:51 AM10/5/20
to Discussion forum for Mathematics for Data Science I, jinalr...@gmail.com, shubh...@gmail.com, ansh...@gmail.com
By convention we take only positive square roots.

Karun Agarwal

unread,
Oct 5, 2020, 5:09:45 AM10/5/20
to Discussion forum for Mathematics for Data Science I, jinalr...@gmail.com, shubh...@gmail.com
But, it is not given anywhere that we have to count only the unique ones. Don't you think it should be explicitly mentioned that we have to find the unique integers?
Message has been deleted
Message has been deleted

Christopher Raphael

unread,
Oct 6, 2020, 3:22:34 AM10/6/20
to Discussion forum for Mathematics for Data Science I, shubh...@gmail.com
The unmodified list will have "6 counts" of "integer", since the question asks one to count the number of integers in the list. (did not ask for unique integers)
Message has been deleted

Christopher Raphael

unread,
Oct 6, 2020, 4:10:31 AM10/6/20
to Discussion forum for Mathematics for Data Science I, shubh...@gmail.com
let listOfReals = [ √3, 2.5, e, √49, 7, 22, pi, -35, √6, 1729, -20000 ];
let numberOfElementsInList = listOfReals.length; //=>length of the array = 11
let integerCount=0;

for(i=0; i<numberOfElementsInList; i++)
 {
  if(listOfReals[i]==INTEGER)
   {
   integerCount++;
   }
 }

Result> integerCount: 6
Because √49=7 and therefore will be counted as an integer.


On Monday, 5 October 2020 11:39:33 UTC+5:30, shubh...@gmail.com wrote:

Venkatesan Shesha Srikanth

unread,
Oct 6, 2020, 7:24:28 AM10/6/20
to Discussion forum for Mathematics for Data Science I, shubh...@gmail.com
Hi,
    You are right, there are 6 integers in the given list. But now, we have corrected the list. Thank you
Warm regards
srikanth venkatesan
IITM Online degree project
3rd floor, IC&SR building, IIT Madras.
Reply all
Reply to author
Forward
0 new messages