Firstly sorry if this is in the wrong place, I was not sure.
Secondly, I am terrible at math but i am learning about time complexity for programming, and i have been trying to figure out how one of these answers comes about. The complexity is
[MATH]1 + (n * (1 + (4n + 1) + 2 )[/MATH]The book gives the answer to be 4n2 + 3n + 1 but I just cant see how this answer comes about. If possible could someone please give me to steps which would be involved in calculating this. ( I have also plugged this equation into one of the online calculator but the answer that gives is 4n2 + 4n + 1 so i am not sure if the book is wrong or i am plugging the equation wrong. Either way, I still cant figure out how these answers would come to be).
Thanks for any help provided.
Secondly, I am terrible at math but i am learning about time complexity for programming, and i have been trying to figure out how one of these answers comes about. The complexity is
[MATH]1 + (n * (1 + (4n + 1) + 2 )[/MATH]The book gives the answer to be 4n2 + 3n + 1 but I just cant see how this answer comes about. If possible could someone please give me to steps which would be involved in calculating this. ( I have also plugged this equation into one of the online calculator but the answer that gives is 4n2 + 4n + 1 so i am not sure if the book is wrong or i am plugging the equation wrong. Either way, I still cant figure out how these answers would come to be).
Thanks for any help provided.