1 votes 1 votes $\sum_{j \in S} 1$ where S = {1, 3, 5, 7}. if we have $\sum_{j = 1}^{n} 1$ then the answer will be n. But what happens if this a set? Set Theory & Algebra set-theory&algebra summation + – SomnathKayal asked Mar 28, 2016 • edited Mar 28, 2016 by SomnathKayal SomnathKayal 670 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
2 votes 2 votes S = {1,2,3,4,5.......n } Sum = 0; while ( j in S) { Sum = Sum +1 } j = j + 1 Return Sum ; Answer will be 4. Digvijay Pandey answered Apr 3, 2016 • edited Apr 4, 2016 by Digvijay Pandey Digvijay Pandey comment Share Follow See all 12 Comments See all 12 12 Comments reply Show 9 previous comments SomnathKayal commented Apr 4, 2016 reply Follow Share answer of stackexchage is 4, and your answer is 16.. I've read all comments. But which one is correct..?? 0 votes 0 votes Arjun commented Apr 4, 2016 reply Follow Share @Digvijay Sorry. Your first code was correct. We can just translate $\sum_{j \in S} 1$ to for each element in $S$ add 1- so this counts the number of elements in $S$. Stackexchange answer is correct. 3 votes 3 votes srestha commented Apr 4, 2016 reply Follow Share yes it is counting no of element in the set. Answer will be 4 1 votes 1 votes Please log in or register to add a comment.