Fundamentholfundamenthol

Total Probability Theorem And Bayes' Theorem

MathsProbabilityFor JEE aspirants

The total probability theorem finds the chance of an event that can happen through several mutually exclusive and exhaustive causes : . Bayes' theorem works backwards: once is observed, it gives the probability that a particular cause produced it. Together, total probability and Bayes' theorem solve every "which bag, which machine, which plant" problem in JEE Main and JEE Advanced, with trees, priors, posteriors and a natural-frequency shortcut.

On this page1Partition2Total probability3Bayes' theorem4Priors and posteriors5Strategy6Solved examples
Key Formulas - Quick Reference
  1. Partition: for and , so
  2. ★ Must learnTotal probability:
  3. ★ Must learnTwo causes:
  4. ★ Must learnBayes' theorem:
  5. ★ Must learnPosterior prior likelihood, and
  6. Equal priors:
  7. : is a weighted average

1. Partition of a Sample Space

Events form a partition of the sample space if they are mutually exclusive and exhaustive:

so .

Think of the as the different "causes" or "routes" through which a result can come about: which bag was chosen, which machine made the item, which plant built the TV. Any event is cut by the partition into disjoint pieces (Figure 1).

Partition of a sample space and an event split by the partition Sample space divided into four vertical strips E1, E2, E3, E4 that do not overlap and cover everything. An oval event A crosses all four strips, creating the disjoint pieces A intersect E1 to A intersect E4, whose probabilities add to give P of A. Causes E1 to E4 partition S; event A is cut into pieces E1 E2 E3 E4 event A A ∩ E1 A ∩ E2 A ∩ E3 A ∩ E4 A = (A ∩ E1) ∪ (A ∩ E2) ∪ (A ∩ E3) ∪ (A ∩ E4), pieces disjoint P(A) = Σ P(Ei) P(A | Ei)
Figure 1: Every event splits into disjoint pieces , one per cause. Adding the pieces gives the total probability theorem.

A single event and its complement always form a partition: and . That is why two-cause problems (watered or not, leap year or not) need only one prior.

2. Theorem of Total Probability

If partition with each , then for any event :

The term is the contribution of cause to the occurrence of .

Proof. Write . The are mutually exclusive, so the pieces are too. Adding them and using the multiplication theorem on each piece:

On a tree the theorem reads: multiply along each path, then add all paths that end in (Figure 2).

Probability tree for total probability with two bags Tree diagram: choose Bag I or Bag II with probability one half each. Bag I gives white with probability 3 over 5 and black 2 over 5; Bag II gives white 5 over 8 and black 3 over 8. The two white paths, 3 over 10 and 5 over 16, add to 49 over 80. Pick a bag, then draw a ball Bag I Bag II 1/2 1/2 3/5 1/2 × 3/5 = 3/10 2/5 1/2 × 2/5 = 1/5 5/8 1/2 × 5/8 = 5/16 3/8 1/2 × 3/8 = 3/16 P(white) = 3/10 + 5/16 = 49/80
Figure 2: Total probability is "multiply along each path, add the paths": .

2.1 A weighted average

Since the priors are non-negative and add to 1, is a weighted average of the likelihoods . It must lie between the smallest and largest of them, closer to the causes with bigger priors (Figure 3). This gives an instant sanity check.

Total probability as a weighted average of conditional probabilities Beam over a scale from 0.10 to 0.40. A heavy weight 0.8 sits at 0.15, the defect rate of plant A, and a light weight 0.2 sits at 0.35, the defect rate of plant B. The balance point 0.19 is the total probability of a defective TV, closer to the heavier plant. P(A) is a weighted average of the conditional probabilities 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.8 0.2 plant A: P(D | A) = 0.15, weight 0.8 plant B: P(D | B) = 0.35, weight 0.2 balance point P(D) = 0.19 P(D) = 0.8 × 0.15 + 0.2 × 0.35 = 0.19 always between the smallest and largest P(A | Ei), nearer the heavier cause
Figure 3: is the balance point of the conditional probabilities, weighted by the priors. It must lie between and .
Exam Trick

Check every total probability answer against the range of the conditional probabilities: can never fall outside . In the TV problem, lies between and ; an answer of would be wrong on sight.

Key idea
Total probability = multiply along each path, add the paths that end in the result. It is a weighted average of the .
Quick Recall: tap to check
Bag I: 3 white, 2 black; Bag II: 5 white, 3 black. A bag is picked at random and a ball drawn. P(white)?
.
Why must the be exhaustive for the theorem?
Otherwise some part of lies outside every and is never counted.
Can be if and ?
No. must lie between and .

3. Bayes' Theorem

Bayes' theorem, also called the inverse probability theorem, answers: event can occur through causes ; is observed; what is the probability that cause produced it?

If partition and , then

Derivation. By the definition of conditional probability and the multiplication theorem,

and the denominator is exactly the total probability . On a tree: your path divided by all paths ending in (Figure 4).

Total probability and Bayes theorem on the same tree Two copies of a tree for TVs from plant A (0.8) and plant B (0.2) with defect rates 0.15 and 0.35. Left: both paths ending in defective are highlighted and added, 0.12 plus 0.07 equals 0.19. Right: only the plant B path is highlighted and divided by the total, 0.07 over 0.19 equals 7 over 19. Same tree, two questions 0.8 0.2 plant A plant B 0.15 D 0.12 0.85 OK 0.35 D 0.07 0.65 OK Total probability (forward) add every path ending in D P(D) = 0.12 + 0.07 = 0.19 0.8 0.2 plant A plant B 0.15 D 0.12 0.85 OK 0.35 D 0.07 0.65 OK Bayes (backward) your path ÷ all paths ending in D P(B | D) = 0.07/0.19 = 7/19
Figure 4: Total probability adds all paths ending in the result: . Bayes' theorem takes one path over that total: .
Total probability (forward)

The result is not yet known.

"Find the probability that the ball is white."

Add all paths ending in .

Bayes' theorem (backward)

The result is already observed; you want the cause.

"Given the ball is white, find the probability it came from Bag II."

One path divided by all paths.

3.1 Prior, likelihood, posterior

TermSymbolMeaning
PriorBelief in cause before seeing the evidence
LikelihoodHow likely the evidence is if cause is true
EvidenceTotal probability of the observed result
PosteriorUpdated belief in cause after seeing the evidence

Since the denominator is the same for every cause, posterior prior likelihood. A cause gains probability when the evidence is more likely under it than on average, and loses probability otherwise.

3.2 Natural-frequency shortcut

Imagine a round number of cases (100, 1000). Split them by cause using the priors, then keep only those showing the evidence. The answer is (evidence cases from that cause) (all evidence cases). Figure 5 solves the TV problem (Solved Example 11) this way with 1000 TVs.

Natural frequency picture of Bayes' theorem Bar model for 1000 TVs: 800 from plant A and 200 from plant B. Fifteen percent of A gives 120 defective TVs and thirty-five percent of B gives 70 defective TVs. Among the 190 defective TVs, 70 came from plant B, so the probability is 7 over 19. Bayes with natural frequencies: imagine 1000 TVs Produced (1000) Plant A: 800 B: 200 Fail the standard: 15% of A, 35% of B 120 70 from A: 120 from B: 70 defective TVs only (190) P(plant B | defective) = 70/190 = 7/19
Figure 5: Of 1000 TVs, 190 fail the standard and 70 of those come from plant B, so .

The same picture explains the famous base-rate effect. When a cause is rare, even a good test produces more false alarms from the large group than true hits from the small one (Figure 6).

Frequency tree showing the base-rate effect in Bayes theorem Frequency tree for 10000 people: 200 are ill and 9800 healthy. The test is positive for 190 of the ill and, with a 10 percent false positive rate, for 980 of the healthy. Of 1170 positive results only 190 are ill, so the probability of illness given a positive test is 19 over 117, about 16 percent. Base-rate trap: a 95% sensitive test for a 2% disease 10 000 people tested 200 ill 2% base rate 9 800 healthy 98% 190 test + 95% of ill 10 test − missed 980 test + 10% false + 8 820 test − correct all positives: 190 + 980 = 1170 P(ill | test +) = 190/1170 = 19/117 ≈ 16%
Figure 6: With a base rate, false positives from the large healthy group swamp the true positives: .
Exam Trick

When all priors are equal, skip them: each posterior is its likelihood divided by the sum of all likelihoods. Then check that the posteriors add to 1; this catches most arithmetic slips in Bayes problems.

JEE Advanced

Sequential updating. Today's posterior is tomorrow's prior. A bag holds one fair coin and one two-headed coin; one coin is picked at random and tossed. After one head, . Using as the new prior, a second head gives

which is exactly what one update with both heads gives. After heads, : evidence piles up, one observation at a time.

Key idea
Bayes = your path all paths ending in the evidence. Posterior prior likelihood.
Quick Recall: tap to check
Equal priors, likelihoods and . Find the posteriors.
and .
Priors , ; likelihoods , . Find .
.
Why is not the same as ?
They have different denominators: and . A test that is 95% sensitive can still give a small .

4. A Four-Step Method

  1. List the causes and check that they partition (priors add to 1).
  2. Write each prior and each likelihood . Update bag contents after any hidden transfer.
  3. Find . If the question asks for the chance of the result, stop here.
  4. If the result is given, divide the required path by (Bayes), then check that the posteriors add to 1.
Flowchart for choosing total probability or Bayes theorem Problem-solving flowchart: list the causes and check that their probabilities add to 1, write the priors and likelihoods, then if the result has not yet been observed use the total probability theorem; if it has been observed, use Bayes theorem, one path divided by the total, and check that the posteriors add to 1. no yes no yes Read the question List the causes E1, ..., En (bags, machines, plants) Do the P(Ei) add up to 1? Add the missing cause (partition) Write priors P(Ei) and likelihoods P(A | Ei) Is the result A already observed? Total probability: P(A) = Σ P(Ei) P(A | Ei) Bayes: P(Ek | A) = (path of Ek) ÷ P(A) Check: posteriors add to 1
Figure 7: One set-up serves both theorems. Only the last question changes: are you predicting the result (total probability) or explaining it (Bayes)?
Mind map of total probability and Bayes theorem Revision mind map with six branches: partition of the sample space, the total probability theorem, Bayes theorem, prior likelihood and posterior, shortcuts such as natural frequencies and equal priors, and classic problem set-ups. Total Probability and Bayes Partition Ei mutually exclusive Ei exhaustive: ∪ Ei = S Σ P(Ei) = 1 Total probability P(A) = Σ P(Ei) P(A | Ei) multiply along paths, add weighted average of P(A | Ei) Bayes' theorem P(Ek | A) = path ÷ P(A) cause from the effect denominator = total prob. Prior and posterior prior P(Ei): before data likelihood P(A | Ei) posterior ∝ prior × likelihood Shortcuts imagine 1000 cases equal priors cancel posteriors add to 1 Classic set-ups bags and hidden transfers machines, plants, tests lost card, truth-teller
Figure 8: Revision map: one partition, two theorems, and the shortcuts that make Bayes problems quick.

5. Solved Examples

5.1 Total probability

Solved Example 1
A bag contains 3 white and 2 black balls; another contains 5 white and 3 black balls. A bag is chosen at random and a ball is drawn from it. Find the probability that it is white.
Solution:

The first bag is chosen with probability and then gives white with probability ; the second route contributes . The two routes are mutually exclusive (Figure 2):

Solved Example 2
Find the probability that a year chosen at random has 53 Sundays.
Solution:

Let : the year is a leap year. Taking the standard exam assumption, and . Let : the year has 53 Sundays.

A leap year has 366 days = 52 weeks + 2 days. The extra pair is one of 7 equally likely pairs, 2 of which contain a Sunday, so . A non-leap year has 1 extra day, so (Figure 9).

Extra days in leap and non-leap years for the 53 Sundays problem Seven possible pairs of extra days in a leap year, of which Saturday-Sunday and Sunday-Monday contain a Sunday, and seven possible single extra days in a non-leap year, of which one is Sunday. Combined with year probabilities one quarter and three quarters, the chance of 53 Sundays is 5 over 28. Why a leap year is twice as likely to have 53 Sundays Leap year (P = 1/4): 366 days = 52 weeks + 2 extra days Sun-Mon Mon-Tue Tue-Wed Wed-Thu Thu-Fri Fri-Sat Sat-Sun 2 of the 7 equally likely extra pairs contain a Sunday: P(53 Sundays | leap) = 2/7 Non-leap year (P = 3/4): 365 days = 52 weeks + 1 extra day Sun Mon Tue Wed Thu Fri Sat 1 of the 7 extra days is a Sunday: P(53 Sundays | non-leap) = 1/7 P(53 Sundays) = 1/4 × 2/7 + 3/4 × 1/7 = 5/28
Figure 9: The causes are leap () and non-leap () years, with likelihoods and : .
Solved Example 3
One bag contains 4 white and 3 black balls, and a second bag contains 3 white and 5 black balls. One ball is drawn from the first bag and placed unseen in the second bag. What is the probability that a ball now drawn from the second bag is black?
Solution:

Let : a white ball is transferred, : a black ball is transferred. , .

Let : a black ball is finally drawn. After , Bag II has 4 white and 5 black, so . After , it has 3 white and 6 black, so (Figure 10).

Ball transfer between two bags as two cases Bag I with 4 white and 3 black balls sends one ball to Bag II, which had 3 white and 5 black. If a white ball moves, with probability 4 over 7, Bag II holds 4 white and 5 black and P(black) is 5 over 9. If a black ball moves, with probability 3 over 7, Bag II holds 3 white and 6 black and P(black) is 6 over 9. One ball moved unseen from Bag I to Bag II Bag I: 4W, 3B white moved, 4/7 black moved, 3/7 Bag II: 4W, 5B P(black) = 5/9 Bag II: 3W, 6B P(black) = 6/9 P(black) = 4/7 × 5/9 + 3/7 × 6/9 = 38/63
Figure 10: A hidden transfer creates two cases. Update Bag II in each case, then combine: .
Solved Example 4
A real estate agent has 8 master keys to open several new homes; only one master key opens any given house. If 40% of these homes are usually left unlocked, what is the probability that the agent can get into a specific home if he picks 3 master keys at random before leaving the office?
Solution:

Let : the home is unlocked, : the home is locked. , . Let : he gets in.

. If locked, he needs the one correct key among his 3: .

Solved Example 5
A die is thrown. If it shows a multiple of 3, a ball is drawn from Box I (5 red, 4 white); otherwise a ball is drawn from Box II (4 red, 2 white). Find the probability that the ball is white.
Solution:

Let : die shows 3 or 6, so Box I is used; : Box II is used. , . Let : a white ball is drawn.

, .

Solved Example 6
A pack of 52 cards is split into two heaps of 26 cards each, and a card is drawn from one heap chosen at random. Find the probability that it is a king.
Solution:

Let , : heap I or heap II is chosen, each with probability . Suppose heap I holds kings, so heap II holds .

The answer does not depend on how the kings are split.

Solved Example 7
Purse 1 contains 9 fifty-paise coins and one one-rupee coin; purse 2 contains 10 fifty-paise coins. Nine coins are transferred at random from purse 1 to purse 2, and then nine coins are transferred at random from purse 2 back to purse 1. Find the probability that the one-rupee coin is in purse 1 after both transfers.
Solution:

Let : the rupee coin is among the 9 coins moved to purse 2; : it is not. Let : the rupee coin is in purse 1 at the end.

and .

If happened, purse 2 has 19 coins including the rupee, and 9 are sent back: . If happened, the rupee never left: .

Solved Example 8
An unbiased coin is tossed. If it shows a head, a pair of dice is rolled and the sum is noted. If it shows a tail, a card is picked from eleven cards numbered 2, 3, ..., 12 and its number is noted. Find the probability that the noted number is 7 or 8.
Solution:

Let : head, : tail, each with probability . Let : the noted number is 7 or 8.

With dice, 7 occurs in 6 ways and 8 in 5 ways, so . With the cards, .

5.2 Bayes' theorem

Solved Example 9
Bag A contains 2 white and 3 red balls; bag B contains 4 white and 5 black balls. A bag is selected at random and a ball drawn from it is white. Find the probability that bag B was selected.
Solution:

Let : bag A selected, : bag B selected; . Let : a white ball is drawn. , .

Solved Example 10
A card from a pack of 52 is lost. From the remaining cards, two are drawn and both are found to be spades. Find the probability that the missing card is also a spade.
Solution:

Let : the lost card is a spade, : it is not. , . Let : two spades are drawn from the remaining 51 cards.

and . The common cancels:

Solved Example 11
A company makes TVs at plants A and B. Plant A produces 80% and plant B 20% of the total. 85 out of 100 TVs from plant A and 65 out of 100 from plant B meet the quality standard. A TV chosen at random is found not to meet the standard. Find the probability that it was made at plant B.
Solution:

Let (): the TV is from plant A (B). , . Let : the TV does not meet the standard.

and .

Figure 5 gets the same answer by counting 1000 TVs.

Solved Example 12
A friend waters a plant with probability before leaving on a trip. If watered, the plant dies with probability ; if not watered, it dies with probability . On returning, you find the plant dead. Find the probability that the friend forgot to water it.
Solution:

Let : watered, : not watered. , . Let : the plant dies. , .

The posterior is larger than the prior : a dead plant is evidence that it was not watered.

Solved Example 13
In a class, 60% of students are boys. 5% of the boys and 10% of the girls have an IQ above 150. A student chosen at random has an IQ above 150. Find the probability that the student is a boy.
Solution:

Let : boy, : girl; , . Let : IQ above 150; , .

Even though boys are the majority, the evidence favours girls because their likelihood is twice as high.

Solved Example 14
A card is lost from a pack of 52. A card is then drawn from the remaining 51 cards and found to be red. Find the probability that the lost card was red.
Solution:

Let : lost card red, : lost card black; . Let : the drawn card is red.

If the lost card was red, 25 red cards remain: . Otherwise .

Seeing a red card makes it slightly less likely that the lost card was red.

Solved Example 15
A bag holds 6 balls, each white or black. The number of black balls is equally likely to be 0, 1, 2 or 3. Two balls are drawn one after another with replacement, and both are white. Find the probability that the bag has exactly 3 black balls.
Solution:

Let : the bag has 0, 1, 2, 3 black balls; each prior is . Let : both draws are white.

, , , .

The priors are equal, so they cancel:

Similarly , , . They add to 1, a quick arithmetic check (Figure 11).

Prior and posterior probabilities after observing evidence Bar chart comparing prior probabilities of 0.25 for bags with 0, 1, 2 or 3 black balls against the posterior probabilities after two white draws: 36, 25, 16 and 9 over 86. Bayes theorem shifts belief towards bags with fewer black balls. Two white draws: belief shifts towards fewer black balls 0.1 0.2 0.3 0.4 0.5 probability 0.25 36/86 0 black 0.25 25/86 1 black 0.25 16/86 2 black 0.25 9/86 3 black prior (before the draws) posterior (after 2 whites)
Figure 11: Equal priors of become posteriors : each posterior is proportional to its likelihood.

5.3 JEE-style problems

Solved Example 16
Machines A, B and C produce 25%, 35% and 40% of the bolts in a factory, and 5%, 4% and 2% of their output is defective. A bolt drawn at random is defective. The probability that it was made by machine B is
(A)
(B)
(C)
(D)
Solution:
  1. Paths ending in "defective": A: ; B: ; C: .
  2. Total .
  3. . Check: .

Answer: (A) . Machine C makes the most bolts but the fewest defectives.

Solved Example 17
In an MCQ with 4 options, a student knows the answer with probability and otherwise guesses at random. Given that the answer is correct, the probability that the student knew it is
(A)
(B)
(C)
(D)
Solution:

Let : knows, : guesses. , ; , .

Answer: (B) . Option (C) is itself, the denominator.

Solved Example 18
A bag contains one fair coin and one two-headed coin. A coin is picked at random and tossed; it shows a head. Find (i) the probability that it is the two-headed coin (ii) the probability that the same coin shows a head again on a second toss.
Solution:

(i) Bayes, with = two-headed coin:

(ii) Total probability with the updated beliefs as priors:

Answer: and . Bayes first, then total probability: a common JEE Advanced two-step.

Solved Example 19
A disease affects 2% of a population. A test detects it in 95% of patients but also gives a positive result for 10% of healthy people. A person tests positive. Find the probability that the person has the disease.
Solution:

Let : has the disease. , , .

Answer: , only about 16%. Figure 6 shows why: out of 10 000 people, 980 healthy people test positive against only 190 patients.

Solved Example 20
A bag contains 4 balls. Two balls are drawn at random without replacement and both are white. Assuming all numbers of white balls in the bag (0 to 4) are equally likely, find the probability that all four balls are white.
Solution:

Let : the bag has white balls, , each with prior . Let : two white balls drawn. , which is for .

Likelihoods for : , , . Equal priors cancel:

Answer: , with and (total 1).

Practice Questions
  1. Box I has 3 red and 2 blue balls; Box II has 2 red and 3 blue. A fair coin decides the box and one ball is drawn. Find P(red).Answer:
  2. In the same set-up, the ball drawn is red. Find the probability that it came from Box II.Answer:
  3. Machines A, B, C make 50%, 30% and 20% of a factory's output with defect rates 2%, 3% and 4%. Find P(defective), and the probability that a defective item came from C.Answer: ;
  4. A disease affects 1% of people. A test detects it in 99% of patients but also gives a positive result for 5% of healthy people. A person tests positive. Find the probability that the person has the disease.Answer:
  5. A man speaks the truth 3 out of 4 times. He throws a die and reports that it is a six. Find the probability that it is actually a six.Answer:
  6. Bag I has 2 white and 3 red balls, Bag II has 4 white and 5 red. One ball is moved unseen from Bag I to Bag II, and a ball then drawn from Bag II is red. Find the probability that the moved ball was white.Answer:
  7. A doctor comes by train, bus, scooter or other means with probabilities . He is late with probabilities and respectively. He arrives late. Find the probability that he came by train.Answer:

Common Mistakes to Avoid

Watch out
  • Confusing with . The chance of the evidence given a cause is not the chance of the cause given the evidence.
  • Using causes that are not exhaustive, such as forgetting a third machine or the "not watered" case. The priors must add to 1.
  • Assuming equal priors when the question gives unequal ones, such as production shares of 80% and 20%.
  • Forgetting to update a bag's contents after a hidden transfer. Each case changes the second bag differently.
  • Ignoring low base rates. With a rare disease, a positive test can still leave the chance of disease small.
  • Posteriors that do not add up to 1. Recheck the denominator; it must be the full total probability.
  • Taking as the simple average of the . It is a weighted average, weighted by the priors.
  • Using with-replacement likelihoods such as when the balls are drawn without replacement, or the reverse.

Frequently Asked Questions

What is the theorem of total probability?

If causes are mutually exclusive and exhaustive, the probability of any event is . You add the contribution of each route by which can happen. On a tree, multiply along each path and add the paths ending in .

What is Bayes' theorem used for?

Bayes' theorem updates the probability of a cause after a result is observed: . It answers questions like which bag a ball came from, which machine made a defective item, or whether a positive test really means disease.

What is the difference between prior and posterior probability?

The prior is the probability of a cause before any evidence. The posterior is the updated probability after event is observed. Bayes' theorem connects them: the posterior is proportional to the prior times the likelihood .

How do I decide between total probability and Bayes' theorem?

Read what is known. If you must find the chance of a result, use total probability. If the result has already happened and you want the chance of a particular cause, use Bayes' theorem. Bayes' denominator is always the total probability, so both usually appear together.

Why is Bayes' theorem called inverse probability?

Problems usually give probabilities in the forward direction, from cause to effect, such as the defect rate of each machine. Bayes' theorem reverses that direction and gives the probability of the cause from the observed effect. That reversal is why it is also called the inverse probability theorem.

What is the natural frequency method for Bayes problems?

Imagine a round number of cases, such as 1000, split them by cause using the priors, and keep only the cases that show the evidence. The answer is the evidence cases from your cause divided by all evidence cases. For the TV problem this gives without fractions of fractions.

Is Bayes' theorem in the JEE Main 2026 syllabus?

Yes. The JEE Main syllabus under Statistics and Probability explicitly lists Bayes' theorem along with the addition and multiplication theorems. Typical questions involve two or three bags, boxes or machines, often with a transfer of balls before the final draw, and usually take under three minutes with a tree.

What kind of total probability questions appear in JEE Advanced?

The JEE Advanced 2026 syllabus lists total probability and Bayes' theorem, so expect multi-stage set-ups: hidden transfers between purses or bags, a lost card followed by draws, or several causes with unequal priors. Drawing a tree and checking that posteriors sum to 1 keeps such problems manageable.

Previous year questions on Total Probability Theorem And Bayes' Theorem

14 questions from past papers, each with a step-by-step solution.

Show all 14 questions

Ready to master Probability?

Take a full mock test, practice concept-by-concept, and get an AI-powered rank prediction — all on Fundamenthol.