Find the first three terms in a geometric series using the given sum and product

115 views Asked by At

My goal is to create a C++ program that computes a geometric sequence's first three terms. What is provided is the sum of the first three terms and their multiplication.

It is assumed that the answers have to be real.

I get
b = p¹ᐟ³
and
a² + (b-s)a + b² = 0

1

There are 1 answers

6
tbxfreeware On

Let a b c be real numbers that are the first three terms of a geometric series. Assume none of them are 0. Otherwise, the "series" is degenerate.

Let ratio r be a real number that is the ratio between successive terms. Thus,

r = b/a                                   (1)
r = c/b                                   (2)

Solving equations (1) and (2) for a and c gives:

a = b/r                                   (3)
c = br                                    (4)

Given the product p, equations (3) and (4) let us find b directly:

p = abc = (b/r)(b)(br)
p = bbb = b³
b = p¹ᐟ³                                  (5)

Thus, b is the cube root of the product.

[Note: There are only two fractional exponents used in this answer: 1/3 and 2/3. If the tiny Unicode exponents are hard to read, you may want to zoom in.]

Setting equation (1) equal to equation (2) gives another equation for c:

b/a = c/b
bb = ac
b² = ac
c = b²/a
c = (p¹ᐟ³)²/a
c = p²ᐟ³/a                                (6)

Turning to sum s, we have:

s = a + b + c
s = a + (p¹ᐟ³) + (p²ᐟ³/a)

Mulitplying both sides by a, and then subtracting as from both sides, yields:

as = aa + a(p¹ᐟ³) + a(p²ᐟ³/a)
sa = a² + (p¹ᐟ³)a + p²ᐟ³
0 = a² + (p¹ᐟ³)a - sa + p²ᐟ³
0 = a² + (p¹ᐟ³-s)a + p²ᐟ³                 (7)

Equation (7) can be solved by the familiar quadratic formula. For the quadratic equation 0 = Ax² + Bx + C, where upper-case letters are used to distinguish from the lower-case ones above, we can map equation (7) as follows:

  • A is 1
  • B is p¹ᐟ³-s
  • C is p²ᐟ³
  • x is a

The discriminant, B² - 4AC, determines the number and type of the roots.

  • positive — There are two distinct real number roots
  • zero – There is a single, real number root. This is sometimes called a double root.
  • negative – The two roots are complex conjugates.

For equation (7), we have

B² = (p¹ᐟ³-s)²
B² = (p¹ᐟ³)² + 2(p¹ᐟ³)(-s) +(-s)²
B² = p²ᐟ³ - 2s(p¹ᐟ³) + s²

4AC = 4(1)(p²ᐟ³)
4AC = 4p²ᐟ³

B² - 4AC = p²ᐟ³ - 2s(p¹ᐟ³) + s² - 4p²ᐟ³
B² - 4AC = -3p²ᐟ³ - 2s(p¹ᐟ³) + s²
B² - 4AC = s² - 2(p¹ᐟ³)s - 3p²ᐟ³
B² - 4AC = (s + p¹ᐟ³)(s - 3p¹ᐟ³)          (8)
B² - 4AC = (s + b)(s - 3b)               (9)

Equation (9) shows that the discriminant vanishes in two cases:

  1. s = -b
  2. s = 3b

A program designed to find a, b, and c for the geometric series of this question must analyze the discriminant, and present solutions accordingly.

For the real number solutions that exist:

  • Equation (7) can be can be solved to determine the value of a
  • Equation (5) gives b
  • Equation (6) gives c

The factors of equation (8) provide a good indication of whether round-off error in a computer computation is affecting the analysis of the discriminant. If either factor is "close" to zero, then the sign of the discriminant may not be computed correctly. In addition, a discriminant that should be valued at 0, may be computed as some "small" value, either positive or negative.