Long formula looks bad - suggestions?

In summary, the Hidden Markov Model assignment is long and difficult to read. Mark suggested condensing the spacing in the subscripts or making them more readable. He also suggested using an align environment to nicely stack the equations, but said it would be difficult to do so without breaking the line. Finally, Mark said that if the variables are too long, trimming them down may win.
  • #1
Jameson
Gold Member
MHB
4,541
13
I'm currently writing up a homework assignment on a Hidden Markov Model. This involves long strings of conditional probability formulas and lots of subscripts. Here is an example of one that I think is really hard to read. Any ideas how I can condense the spacing in the subscripts or make it more readable?$\small{P[O,o_{1001}=6,q_{1001}=F] = \\
\Big( P[O,q_{1000}=F]P[q_{1001}=F|q_{1000}=F,\lambda]+ P[O,q_{1000}=L]P[q_{1001}=F|q_{1000}=L,\lambda] \Big) P[o_{1001}=6|q_{1001}=F,\lambda]\\= \Big(a\cdot 0.99+b\cdot 0.20\Big)\dfrac{1}{6} } $
 
Physics news on Phys.org
  • #2
Anywhere you wish to reduce spacing you can use the \! command to introduce a negative thin space. I wrapped the equal signs within brackets with this command on either side:

\(\displaystyle \small{P[O,o_{1001}\!=\!6,q_{1001}\!=\!F] = \\
\Big( P[O,q_{1000}\!=\!F]P[q_{1001}\!=\!F|q_{1000}\!=\!F,\lambda]+ P[O,q_{1000}\!=\!L]P[q_{1001}\!=\!F|q_{1000}\!=\!L,\lambda] \Big) P[o_{1001}\!=\!6|q_{1001}\!=\!F,\lambda]\\= \Big(a\cdot 0.99+b\cdot 0.20\Big)\dfrac{1}{6} }\)

I'm not sure if that's what you're after though. :D
 
  • #3
That helps! Thank you Mark.

I think I should investigate making the given line "|" more pronounced and perhaps making the [] brackets bigger. I'll try playing around with those and see what I find.

Another issue is that I would like to use an align environment to nicely stack the equations but since they get so long I can't think of an elegant way to do this. Does anyone think stacking these with the equals sign lining up would look better, even with line breaks within a step?
 
  • #4
Seems to me much of the horizontal space is taken up by the long 1001, 1000 subscripts. Is there a way to condense those into shorter variables, especially since only two of the subscripted variables seem to be used? Then having each expression on a new line with the equals sign lined up would work fine, I think.

I mean, long formula going to be long, but if you can trim unnecessarily long variables that should be a win.
 
  • #5
Something like this?

\(\displaystyle \begin{array}{ll} \small{P\Big[O,o_{1001}\!=\!6,q_{1001}\!=\!F\Big]} & \\ & =\small{\Bigg(P\Big[O,q_{1000}\!=\!F\Big]P\Big[q_{1001}\!=\!F\Big|q_{1000}\!=\!F,\lambda\Big]+ P\Big[O,q_{1000}\!=\!L\Big]P\Big[q_{1001}\!=\!F\Big|q_{1000}\!=\!L,\lambda\Big]\Bigg)P\Big[o_{1001}\!=\!6\Big|q_{1001}\!=\!F,\lambda\Big]}\\&= \small{\Big(a\cdot 0.99+b\cdot 0.20\Big)\dfrac{1}{6}} \end{array}\)
 
  • #6
MarkFL said:
Something like this?

\(\displaystyle \begin{array}{ll} \small{P\Big[O,o_{1001}\!=\!6,q_{1001}\!=\!F\Big]} & \\ & =\small{\Bigg(P\Big[O,q_{1000}\!=\!F\Big]P\Big[q_{1001}\!=\!F\Big|q_{1000}\!=\!F,\lambda\Big]+ P\Big[O,q_{1000}\!=\!L\Big]P\Big[q_{1001}\!=\!F\Big|q_{1000}\!=\!L,\lambda\Big]\Bigg)P\Big[o_{1001}\!=\!6\Big|q_{1001}\!=\!F,\lambda\Big]}\\&= \small{\Big(a\cdot 0.99+b\cdot 0.20\Big)\dfrac{1}{6}} \end{array}\)
After a bit more tinkering, I get
$$\begin{aligned} P\big[O, &o_{1001}\!=\!6,q_{1001}\!=\!F\big] \\ &=\Big(P\big[O,q_{1000}\!=\!F\big]P\big[q_{1001}\!=\!F\,\big|\,q_{1000}\!=\!F,\lambda\big]+ P\big[O,q_{1000}\!=\!L\big]P\big[q_{1001}\!=\!F\,\big|\,q_{1000}\!=\!L,\lambda\big]\Big)P\big[o_{1001}\!=\!6\,\big|\,q_{1001}\!=\!F,\lambda\big] \\ &= \big(a\cdot 0.99+b\cdot 0.20\big)\tfrac{1}{6} \end{aligned}$$
 

FAQ: Long formula looks bad - suggestions?

What are the reasons for long and complex formulas?

Long and complex formulas are often necessary to accurately describe and explain complex systems or phenomena. They may also be the result of combining multiple theories or concepts.

How can I simplify a long formula?

There are several ways to simplify a long formula, such as using mathematical properties and identities, breaking it down into smaller parts, or using computer software to manipulate the formula.

Can a long formula be rewritten in a more concise way without losing accuracy?

Yes, in many cases a long formula can be rewritten in a more concise way without sacrificing accuracy. This can be achieved through careful analysis and manipulation of the formula.

What are some tips for presenting long formulas in a clear and understandable manner?

Some tips for presenting long formulas include breaking them down into smaller parts, using visual aids such as graphs or diagrams, and providing explanations or examples to clarify the meaning.

Are there any alternatives to using long formulas to explain complex systems?

Yes, there are alternative methods for explaining complex systems, such as using simulations, models, or conceptual diagrams. These can provide a more intuitive understanding of the system without relying on long formulas.

Similar threads

Replies
4
Views
3K
Replies
3
Views
939
4
Replies
107
Views
17K
2
Replies
42
Views
8K
Replies
16
Views
5K
6
Replies
175
Views
22K
3
Replies
102
Views
9K
Replies
28
Views
6K
2
Replies
48
Views
10K
Back
Top