MHB Long formula looks bad - suggestions?

AI Thread Summary
The discussion focuses on improving the readability of long conditional probability formulas in a homework assignment on Hidden Markov Models. Suggestions include using the negative thin space command to condense subscripts and exploring ways to make certain symbols, like the vertical bar and brackets, more prominent. Participants also discuss the potential benefits of using an align environment to stack equations neatly, while considering the reduction of long variable names to enhance clarity. Ultimately, the goal is to maintain mathematical accuracy while improving visual presentation. Enhancing the layout can significantly aid in understanding complex formulas.
Jameson
Insights Author
Gold Member
MHB
Messages
4,533
Reaction score
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
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:

$$\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
 
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?
 
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.
 
Something like this?

$$\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}$$
 
MarkFL said:
Something like this?

$$\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}$$
 

Similar threads

Replies
4
Views
3K
Replies
3
Views
2K
3
Replies
107
Views
19K
Replies
42
Views
10K
Replies
16
Views
6K
4
Replies
175
Views
25K
3
Replies
102
Views
10K
Replies
28
Views
6K
Replies
48
Views
11K
Back
Top