IT용어위키



Fibonacci Sequence

Fibonacci Sequence is a mathematical sequence where each number is the sum of the two preceding numbers. It is widely used in mathematics, computer science, and nature to model growth patterns and recursive structures.

Definition

The Fibonacci sequence is defined recursively as:

  • F(0) = 0, F(1) = 1 (Base cases)
  • F(n) = F(n-1) + F(n-2) for n ≥ 2

Example Sequence

The first few Fibonacci numbers are: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...

Closed-Form Formula (Binet's Formula)

The nth Fibonacci number can be computed directly using Binet’s formula:

  • F(n) = (φⁿ - ψⁿ) / √5

where:

  • φ = (1 + √5) / 2 (Golden Ratio)
  • ψ = (1 - √5) / 2

Properties

  • Recurrence Relation: Each term is the sum of the previous two.
  • Golden Ratio Connection: The ratio of consecutive Fibonacci numbers converges to φ.
  • Parity Pattern: Even numbers appear at every third position.
  • Sum of Fibonacci Numbers: The sum of the first n Fibonacci numbers is F(n+2) - 1.

Computational Methods

There are several ways to compute Fibonacci numbers:

  • Recursive Approach:
    • Uses the recurrence relation directly.
    • Complexity: O(2ⁿ) (Exponential, inefficient for large n).
  • Iterative Approach:
    • Uses a loop to compute Fibonacci numbers.
    • Complexity: O(n) (Linear, more efficient than recursion).
  • Matrix Exponentiation:
    • Uses matrix multiplication to compute Fibonacci numbers efficiently.
    • Complexity: O(log n).
  • Binet’s Formula:
    • Uses the closed-form expression.
    • Complexity: O(1), but limited by floating-point precision.

Applications

Fibonacci numbers appear in various fields:

  • Computer Science: Recursive algorithm analysis, dynamic programming.
  • Mathematics: Number theory, combinatorial counting.
  • Nature: Leaf arrangements, branching patterns in plants.
  • Financial Markets: Fibonacci retracement in technical analysis.
  • Art and Architecture: Proportions related to the golden ratio.

Comparison of Computational Methods

Method Approach Complexity
Recursion Direct recursive relation O(2ⁿ)
Iteration Loop-based calculation O(n)
Matrix Exponentiation Fast exponentiation of Fibonacci matrix O(log n)
Binet’s Formula Direct computation using golden ratio O(1)

See Also


  출처: IT위키(IT위키에서 최신 문서 보기)
  * 본 페이지는 공대위키에서 미러링된 페이지입니다. 일부 오류나 표현의 누락이 있을 수 있습니다. 원본 문서는 공대위키에서 확인하세요!