Indexing Sequences: Do We Start at 0 or 1?

  • Context: High School 
  • Thread starter Thread starter Mr Davis 97
  • Start date Start date
  • Tags Tags
    Periodic Sequence Term
Click For Summary

Discussion Overview

The discussion revolves around the indexing of sequences, specifically whether to start indexing at 0 or 1. It explores implications for periodic sequences, programming practices, and the flexibility of indexing methods in different contexts.

Discussion Character

  • Debate/contested
  • Technical explanation

Main Points Raised

  • One participant suggests that for a periodic sequence like ABCD, starting at 0 may be necessary to align with the use of n mod 4 for finding terms, implying that terms 4, 8, 12, etc., would correspond to 0.
  • Another participant argues that both indexing methods (starting at 0 or 1) are valid and outlines two approaches for indexing the sequence, highlighting the flexibility in how sequences can be defined.
  • A later reply proposes that starting at 0 might be the simplest method for periodic sequences, suggesting a preference without asserting it as the only valid approach.
  • Another participant notes that the choice of indexing can significantly impact programming, indicating a tendency towards starting at 0 for simplicity, while acknowledging that not all programming languages support this convention.

Areas of Agreement / Disagreement

Participants express differing views on the preferred indexing method, with no consensus reached on whether starting at 0 or 1 is definitively better for periodic sequences or programming contexts.

Contextual Notes

The discussion reflects varying assumptions about the implications of indexing choices and their applicability in different fields, such as mathematics and computer programming, without resolving these nuances.

Mr Davis 97
Messages
1,461
Reaction score
44
Say we have a periodic sequencs, ABCDABCDABCDA... etc. We would normally call A term 1, B term 2, C term 3, etc. However, to find the nth term, do we need to designate A as term 0, B as term 1, etc? Since we would use n mod 4 to find the nth term, wouldn't this mean that 4, 8, 12, etc would have to correspond to 0 rather than 1, this showing that we have to start the sequence ordering from 0 rather than 1?
Wouldn't this be in contrast to other sequences such as geometric and arithmetic that start at 1 rather than 0?
 
Mathematics news on Phys.org
We can write it either way. It depends on how we index the four-element vocabulary set and also on how we index the elements of the sequence. Since either can start at 0 or 1, there are four different ways we can do this. Here are two of them:

Least compact method (both start at 1):
##V_1=`A',\ V_2=`B',\ V_3=`C', \ V_4=`D'## then the sequence ##s_n##, numbered starting at 1, has ##s_n=V_{(1+(n-1)\mod 4)}##

Most compact method (both start at 0):
##V_0=`A',\ V_1=`B',\ V_2=`C', \ V_3=`D'## then the sequence ##s_n##, numbered starting at 0, has ##s_n=V_{(n\mod 4)}##
 
So although both ways of numbering are possible, starting at 0 is probably the simplest way for periodic sequences?
 
Yes. This issue often comes up in programming computers. Deciding whether to index a vector starting with zero or one can significantly affect the verbosity of the code that refers to that vector. Usually, but not always, I have found it is better to start at 0. But not all computer languages allow array indexing to start with numbers other than 1.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 22 ·
Replies
22
Views
5K
  • · Replies 55 ·
2
Replies
55
Views
7K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K