BS Artificial Intelligence · Semester 1 · Week 09

Discrete Mathematics for BSAI

Discrete Sequences and Finite Series

Dr. Hira Benish
Associate Professor & HoD, Mathematics
PMAI Lab, Mathematics Behind AI

Week 9 · Dr. Hira BenishBegin reading  

01 · Opening Scenario: Today’s Count or Total So Far?

A device reports the number of messages recorded on five days: 3, 5, 7, 9, 11. A report asks, “What was the count on Day 4?” Another asks, “How many messages were recorded through Day 4?” These questions use the same data but have different answers.

Predict: Day 4 contributes 9 messages. Through Day 4 the total is 3+5+7+9=24. We will name an individual value, describe an assumed pattern, and write a finite total without confusing them.

Central question

Are we asking for a value at a position, or for everything accumulated through that position?

02 · Learning Objectives and Three-Hour Guide

By the end of Week 9, you should be able to read an indexed term; describe a small arithmetic or geometric sequence with a term rule; distinguish a sequence from a finite series; calculate a finite sum; expand and write sigma notation; and explain the difference between a daily value and a cumulative total.

Class timeEssential work
60 minPattern cards, indices and term rules
55 minFinite sums and sigma notation
45 minDevice-reading scenario and hand plot
20 minQuick checks and feedback

Classroom essentials Sections 01–10 and Problems 1–5. Optional self-study Colab and extended practice. The discovery cards are ungraded and invite a prediction before feedback.

03 · A Sequence Has Positions

A sequence is a list of values in a stated order. We use an index to identify a position. For the device counts, write a₁=3, a₂=5, a₃=7, a₄=9, and a₅=11. The symbol a₄ refers to one term, not the first four terms added.

Day nTerm aₙ · on that dayCumulative total Sₙ · through that day
133
253+5=8
373+5+7=15
493+5+7+9=24
5113+5+7+9+11=35

Here S₄=24 and a₄=9. The sequence can be a finite list of observations even when no reliable formula for future observations is known.

Quick check: A report says “Day 3: 15 messages.” Is it using a daily count or a cumulative total? The table shows 15 is the total through Day 3; the Day 3 count is 7.

04 · Arithmetic Pattern: Add the Same Amount

The example 3,5,7,9,11 rises by 2 each time. If we assume this pattern continues, it is an arithmetic sequence with first term 3 and common difference 2. At Day n≥1, there have been n−1 increases after Day 1:

aₙ=3+2(n−1)=2n+1, for n≥1.

Worked prediction under the rule

a₆=2(6)+1=13. We can also start at 11 and add 2. This is a prediction conditional on the stated arithmetic model; five actual device readings alone do not guarantee the sixth reading will be 13.

For a general arithmetic pattern with first term a₁ and difference d, the term rule is aₙ=a₁+(n−1)d. Check the starting index before using it.

05 · Geometric Pattern: Multiply by the Same Factor

The list 2,6,18,54 multiplies by 3 each time. It is a geometric sequence with first term 2 and common ratio 3. From the first term to position n, we multiply by 3 exactly n−1 times:

bₙ=2·3ⁿ⁻¹, for n≥1.

Work through the index

b₁=2·3⁰=2, b₃=2·3²=18, and b₅=2·3⁴=162. The first four terms add to 2+6+18+54=80, which is a total, not the fourth term.

A constant difference signals arithmetic growth; a constant nonzero ratio signals geometric growth in these examples. A short list such as 2,4,8 can fit other invented rules too; the claimed pattern is an assumption to test or state.

06 · From Terms to a Finite Series

A finite series is the sum of a specified finite number of terms. If aₙ is the value at position n, define Sₙ=a₁+a₂+···+aₙ for the total through position n.

a₅=11, but S₅=3+5+7+9+11=35.

You can total terms one at a time: S₁=3, S₂=8, S₃=15, S₄=24, S₅=35. The next total is the old total plus the next term, but this week our focus is reading and adding the finite list. We study recurrence rules explicitly in Week 10.

Predict → Test → Explain: Under aₙ=2n+1, Day 6 contributes 13. The total through Day 6 is 35+13=48. Explain why 13 and 48 answer different questions.

07 · Sigma Notation Compresses a Finite Sum

The capital Greek letter Σ means “add the listed terms.” In ∑ᵢ₌₁⁵(2i+1), the index i starts at 1 and ends at 5. Substitute each integer 1,2,3,4,5 into the expression 2i+1, then add.

∑ᵢ₌₁⁵(2i+1)=3+5+7+9+11=35.

Worked expansion with different limits

∑ᵢ₌₂⁴ i²=2²+3²+4²=4+9+16=29. The lower limit is 2, so the term for i=1 is not included. There are three terms: 2,3,4.

The letter i only marks positions inside this sum. For example, ∑ⱼ₌₁⁵(2j+1) gives the same total. The limits and the term expression determine the sum.

Quick check: ∑ᵢ₌₁³(2i+1) is 3+5+7=15, not a₃=7.

08 · Plot the Term, Then Read the Total

On a hand-drawn graph put Day n on the horizontal axis and the daily term aₙ on the vertical axis. Mark the five points (1,3),(2,5),(3,7),(4,9),(5,11). These are separate discrete observations; the connecting line below helps the eye follow them and does not add measured days between the integers.

Daily terms 3, 5, 7, 9, 11 at Days 1 through 5, compared with cumulative totals 3, 8, 15, 24, 35 12345Day n Count Total Sₙ Daily aₙ
Figure 1. Both graphs use the same days, but their vertical values represent different quantities.

To read the cumulative plot, use the totals 3,8,15,24,35. The fifth cumulative point is (5,35), not (5,11).

09 · Reading Count Lab

Predict → Test → Explain Use the stated model aₙ=2n+1 for n≥1. Predict the daily value and total before moving the control. Then classify a few small pattern cards.

One day versus the total

Term aₙ · this day
11
Total Sₙ · through this day
35

Pattern card 1 of 4

Compare differences and ratios, then choose.

10 · What the System May Report

A dashboard can show two honest numbers: “11 messages on Day 5” and “35 messages through Day 5.” The first uses a₅; the second uses S₅. A plotted point must label which quantity its vertical axis represents.

Observing a neat five-day pattern does not prove future counts will follow 2n+1. If the rule is adopted as a model, the Day 6 calculation is conditional on that assumption. A real device may miss readings, count duplicates, or change behavior; the mathematical sequence describes the values and rule that were supplied.

Quick interpretation: If Day 5 contributes 11 and Day 6 contributes 13, the two-day total is 24, while the total through Day 6 is 48. State which days are included before adding.

11 · Optional Colab: Tabulate and Check

Self-study · mathematics first Complete the table and hand plot before using Python. Each small cell introduces one idea and tests a calculation you already understand.

1 · Store the observed terms

Square brackets make a list; the order of entries is preserved. The list below contains the five daily counts.

readings = [3, 5, 7, 9, 11]
print(readings)

2 · Read a position

Python list positions start at 0. Thus index 0 holds Day 1, and index 4 holds Day 5. The mathematical index n and Python position n−1 refer to the same entry here.

print(readings[0])
print(readings[4])

The outputs are 3 and 11. Using readings[5] would ask for a sixth stored item, which this five-item list does not contain.

3 · Visit each term

The for line takes one value from the list at a time. The indented line prints that value. Read the two lines together: “for each count in readings, print the count.”

for count in readings:
    print(count)

4 · Compare the finite sum

sum(readings) adds the five stored values, so predict 35 before running:

print(sum(readings))

Finally, if you want a plotted check in Colab, matplotlib.pyplot is a plotting library. This cell pairs each day with its daily reading and draws only those five marked observations.

import matplotlib.pyplot as plt
days = [1, 2, 3, 4, 5]
plt.plot(days, readings, marker="o")
plt.xlabel("Day")
plt.ylabel("Daily messages")
plt.show()

The plot is a visual check of the five values; it does not establish a rule for unobserved days. Explain in a sentence how its vertical values differ from a cumulative-total plot.

12 · Practice

Work with the mathematics first. Selected solutions are at the end.

  1. The arithmetic list is 4,7,10,13,…, beginning at n=1. Find a term rule, the sixth term, and the total of the first six terms.
  2. The geometric list is 2,6,18,54,…. State its first term and ratio, find the fifth term, and add the first four terms.
  3. Expand and calculate ∑ᵢ₌₂⁵(i+1). How many terms does it include?
  4. Write 3+5+7+9+11 with sigma notation using the expression 2i+1.
  5. For daily readings 3,5,7,9,11, state a₄ and S₄, and explain what each counts.
  6. A learner writes S₃=7 for those readings. Identify the confusion and correct the value.
  7. Plot by hand the daily values 2,4,1,3 for Days 1–4. Give the four coordinate pairs and their finite total. Do the four observations alone justify a unique future term rule?
Exit check: In one sentence, distinguish aₙ from Sₙ; in another, explain what the limits on Σ tell you.

13 · Common Mistakes

Tempting moveRepair
Use a₅ and S₅ interchangeably.a₅ is one term; S₅ adds five terms.
Put Day 1 at Python index 1.The first list item is index 0; Day n uses index n−1 in this example.
Always subtract neighboring terms.For geometric patterns, test a common ratio; for arithmetic patterns, test a common difference.
Start a sigma sum at 1 regardless of its limit.Read the lower and upper limits before substituting.
Infer a guaranteed forecast from a short pattern.State the assumed rule and separate its prediction from observed data.
Label a cumulative plot as daily values.Check the vertical axis and the quantity at each point.

14 · Summary

  • A sequence lists indexed terms such as a₁,a₂,…. An arithmetic rule uses a constant difference; a geometric rule uses a constant ratio.
  • A finite series adds a stated number of terms: Sₙ=a₁+···+aₙ.
  • Sigma notation states the index, its start and end, and the expression to add.
  • Daily and cumulative plots answer different questions even when they come from the same observations.
  • Pattern rules should be stated as assumptions when only a short observed list is available.

15 · Visual Concept Map

Indexed sequence branches into arithmetic and geometric term rules; adding finite terms gives a series represented by sigma notation SEQUENCEa₁, a₂, a₃, … ARITHMETICadd a constant difference GEOMETRICmultiply by a constant ratio FINITE SUM Sₙ = ∑ aᵢ
First identify the term rule. Add only the specified terms when the question asks for a total.

16 · Key Terms

Sequence; index
An ordered list of values; a position in that list.
Term aₙ
The value at position n.
Arithmetic; geometric
Constant difference between consecutive terms; constant ratio between consecutive terms.
Finite series Sₙ
The sum of a specified finite number of terms, often the first n.
Sigma notation
A compact instruction to add expressions over stated integer index limits.
Cumulative total
The value added through a chosen position, rather than only at that position.

17 · Looking Ahead

In Week 10 we will describe patterns by an initial value and a rule for obtaining the next value from earlier values. Today’s distinction between a term and a total prepares us to read those recurrence rules carefully.

Selected Solutions

Reading Count Lab

a₆=13 and S₆=3+5+7+9+11+13=48. The first is only Day 6; the second includes Days 1–6. Totals for Days 1–5 are 3,8,15,24,35. Card A is arithmetic (difference +3); B geometric (ratio 2); C neither constant difference nor constant ratio; D arithmetic (difference −3).

1 · Arithmetic list

First term 4 and difference 3 give aₙ=4+3(n−1)=3n+1. a₆=19; the first six terms 4+7+10+13+16+19=69.

2 · Geometric list

First term 2, ratio 3; bₙ=2·3ⁿ⁻¹. Thus b₅=162 and 2+6+18+54=80.

3 · Expand sigma

∑ᵢ₌₂⁵(i+1)=3+4+5+6=18, four terms.

4 · Write sigma

∑ᵢ₌₁⁵(2i+1).

5–6 · Term versus total

a₄=9 counts Day 4; S₄=24 counts Days 1–4. Writing S₃=7 confuses the third term with the total: a₃=7, but S₃=3+5+7=15.

7 · Hand plot

Points (1,2),(2,4),(3,1),(4,3); total 2+4+1+3=10. Four observations alone do not identify a unique future rule.