Long formula looks bad - suggestions?

  • Context: MHB 
  • Thread starter Thread starter Jameson
  • Start date Start date
  • Tags Tags
    Formula Suggestions
Click For Summary

Discussion Overview

The discussion revolves around improving the readability of long conditional probability formulas related to a Hidden Markov Model in a homework assignment. Participants explore various formatting techniques to enhance clarity, focusing on spacing, alignment, and variable representation.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant expresses difficulty in reading long strings of conditional probability formulas and seeks suggestions for improving readability.
  • Another participant suggests using the \! command to reduce spacing around equal signs, demonstrating this with an example.
  • A participant considers making the vertical bar "|" more pronounced and increasing the size of the brackets for better visibility.
  • Concerns are raised about the horizontal space taken up by long subscripts, with a suggestion to condense these into shorter variables.
  • Some participants propose using an align environment to stack equations neatly, questioning whether aligning equals signs would improve the presentation.
  • Several formatting examples are shared, showing different approaches to structuring the equations for clarity.

Areas of Agreement / Disagreement

Participants generally agree on the need for improved readability but propose various methods to achieve this, indicating multiple competing views on the best approach. The discussion remains unresolved regarding the optimal formatting techniques.

Contextual Notes

Participants mention specific formatting commands and techniques without consensus on their effectiveness. The discussion reflects a variety of preferences for visual presentation in mathematical expressions.

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 ·
Replies
4
Views
3K
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 107 ·
4
Replies
107
Views
20K
  • · Replies 42 ·
2
Replies
42
Views
11K
  • · Replies 16 ·
Replies
16
Views
7K
  • · Replies 102 ·
4
Replies
102
Views
11K
  • · Replies 175 ·
6
Replies
175
Views
27K
  • · Replies 28 ·
Replies
28
Views
7K
  • · Replies 48 ·
2
Replies
48
Views
12K