Skip to content
ChallengesChallenging

The Tape

A stock is in one of two states that you cannot see. Estimate what it is worth from a run of buys and sells.


A stock is always in one of two hidden states:

The two states
StateFundamental valueProbability next trade is a buy
StateWeakFundamental value94Probability next trade is a buy30%
StateStrongFundamental value108Probability next trade is a buy70%

Before any trading occurs, the two states are equally likely. At the start of each minute, the hidden state may switch, with these probabilities:

T =
0.850.15
0.200.80

Rows are the current state and columns the next state, in the order Weak, Strong. For example, if the stock is currently in the Weak state, there is an 85% probability it remains Weak and a 15% probability it becomes Strong.

Immediately after each state transition, one trade occurs. You observe the following sequence:

B, B, S, B, B, B, S, B

where B represents a buy and S represents a sell. After observing the final trade, let V be the expected fundamental value of the stock’s current state, given all eight trades.

Calculate:

round(1000V)

that is, 1000 × V rounded to the nearest whole number.

Enter the result as a whole number.

Hint

You never see the state, only the trades. Keep a probability for each state and update it as the trades come in.