3 thoughts on “12: Pseudocode to calculate googol!”
Wow. I can’t believe you wrote code – that’s amazing.
In your post, I suppose, you start counting n from 1. It’s the most natural thing to do. But some computer programmers and languages start counting from 0 not 1. Can you think of why it may be useful to count from 0 than 1? Hint: ask mom.
3 thoughts on “12: Pseudocode to calculate googol!”
Wow. I can’t believe you wrote code – that’s amazing.
In your post, I suppose, you start counting n from 1. It’s the most natural thing to do. But some computer programmers and languages start counting from 0 not 1. Can you think of why it may be useful to count from 0 than 1? Hint: ask mom.
Is it because of efficiency? Say computing efficiency?
True. It makes the math simpler because counting is usually for indexing.
If you want to divide things into k groups, the nth item is in group n/k when counting from zero but in group 1+(n-1)/k when counting from 1.
If centuries were counted from zero, the year 1905 would be in the 19th century not 20th.
Power series in math begin counting from zero while some others like matrices begin counting from one.
Ultimately, I think it’s because it makes the math simpler. You could call it efficiency of course.