---
title: "False position pseudo-code"
subject: "Numerical Method"
chapter: 2
key: "semester_4/numerical_method:false-position-pseudocode"
source: https://www.bctengineer.com/q/semester_4/numerical_method/false-position-pseudocode
site: BCT Engineering
---

# False position pseudo-code

Numerical Method · Chapter 2: Solutions of Nonlinear Equations

- Asked in: 2074 Bhadra, 6 marks; 2070 Magh, 6 marks (asked 2 times)
- Video: [Regula Falsi and Bisection Method C Program || Computer Oriented Numerical Analysis | #clanguage](https://www.youtube.com/watch?v=3SoMHPQwEAE) — MS MATHS
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_4/numerical_method/false-position-pseudocode
- Whole chapter: https://www.bctengineer.com/md/semester_4/numerical_method/chapter-2

## Question

Write pseudo-code for finding a real root of a non-linear equation using the False Position Method.

## Short answer

The false position method starts with a and b such that f(a)f(b)<0. Iteratively compute c = (a f(b) - b f(a))/(f(b)-f(a)). If f(c)=0 or |c-c_old|<e, stop. Else if f(a)f(c)<0 set b=c else a=c. The root remains bracketed, ensuring convergence.

## Answer

False Position (Regula Falsi) uses the chord joining (a, f(a)) and (b, f(b)) with f(a)·f(b) < 0; the point where the chord cuts the x-axis replaces one end so that the root stays bracketed.

#### Formula
```text
c = (a f(b) − b f(a)) / (f(b) − f(a))
```

#### Pseudo-code
```text
Algorithm: False Position method
Input : f(x), a, b, tolerance e, max iterations N
Output: approximate root

1.  Read a, b, e, N
2.  If f(a) * f(b) >= 0 then
        print "Root not bracketed"; stop
3.  Set i = 1, c_old = a
4.  Repeat steps 5 to 10 while i <= N
5.      c = (a*f(b) - b*f(a)) / (f(b) - f(a))
6.      If f(c) = 0 or |c - c_old| < e then
            print "Root =", c, "after", i, "iterations"
            stop
7.      If f(a) * f(c) < 0 then
            b = c
        else
            a = c
8.      c_old = c
9.      i = i + 1
10. End repeat
11. Print "Method did not converge in N iterations"
12. Stop
```

The root always remains inside [a, b], so the method cannot diverge, and it is usually faster than bisection.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. False position computes c as:
   A. (a f(b) - b f(a))/(f(b) - f(a))
   B. (a+b)/2
   C. a - f(a)/f'(a)
   D. (a f(a) - b f(b))/2
   Answer: A. It is where the chord cuts the x-axis. (Key point: Formula)

2. What stays true throughout?
   A. The root leaves the interval
   B. The root stays inside [a, b]
   C. Both ends are fixed
   D. f'(c) = 0
   Answer: B. One end is replaced to keep the sign change. (Key point: Bracketing)

3. If f(a)*f(c) < 0 the algorithm sets:
   A. a = c
   B. c = a
   C. b = c
   D. stop
   Answer: C. The root lies in [a, c]. (Key point: Update)

4. Compared with bisection, false position is:
   A. Always slower
   B. Needs a derivative
   C. Needs no initial interval
   D. Usually faster, and cannot diverge
   Answer: D. The chord point usually lies closer to the root than the midpoint. (Key point: Versus bisection)

## Related in Numerical Method

- [Bisection method pseudo-code](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Abisection-pseudocode) — Numerical Method, chapter 2, asked 3×
- [False position: e^cos x - sin x - 1](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Afalse-position-ecosx) — Numerical Method, chapter 2
- [Gauss-Jordan pseudo-code](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Agauss-jordan-pseudocode) — Numerical Method, chapter 3, asked 4×
- [Secant algorithm, versus false position](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Asecant-pseudocode-vs-false-position) — Numerical Method, chapter 2
- [False position: cos x = x e^x](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Afalse-position-cosx-xex) — Numerical Method, chapter 2, asked 2×
- [Power method pseudo-code](https://www.bctengineer.com/question.md?key=semester_4%2Fnumerical_method%3Apower-method-algorithm) — Numerical Method, chapter 3, asked 2×

## Related in other subjects

- [Real and pseudo-parallelism](https://www.bctengineer.com/question.md?key=semester_4%2Fmicroprocessor%3Areal-pseudo-parallelism) — Microprocessor, chapter 6
- [Algorithm/pseudo-code for software PID](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Apid-software-algorithm) — Embedded System, chapter 7, asked 3×
- [Algorithm versus pseudo-code](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Aalgorithm-vs-pseudocode) — Computer Programming, chapter 2
- [Preemptive vs non-preemptive; real-time scheduling](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Apreemptive-nonpreemptive-realtime) — Operating System, chapter 2
