# Solving an equation for B

I am having an issue solving this. I wrote this equation to find the with of a bar for a bar chart that is comparative. $$D-P*(N+1) = ((N-1)*M)*B*0.75+N*B$$

-
D and P are numbers, integers. D is the size of the drawable area, P is the padding between bars. – Jaybit Jul 3 '12 at 18:38
some one else edited it... should be fixed – Jaybit Jul 3 '12 at 18:40
@RossMillikan Yeah, my bad sorry for confusion. – data Jul 3 '12 at 18:41

No guarantee that the result will be an integer, but just distribute the $B$ out of the terms on the right and divide.

$$$D-P*(N+1) = ((N-1)*M)*B*0.75+N*B$$$

$$$D-P*(N+1) =( ((N-1)*M)*0.75+N)*B$$$

$$$(D-P*(N+1))/( ((N-1)*M)*0.75+N)=B$$$

-
Thanks, Looks good. Forgot about taking B out of the terms on the right. – Jaybit Jul 3 '12 at 18:44
Is "*" a common operator for multiplication? I thought it was "\times" or "\cdot"? – Gigili Jul 3 '12 at 18:56
@Gigili: Some people use it. It is easier in handwriting to distinguish from the variable $x$. Many programming languages use it. I followed the OP which let me copy/paste. – Ross Millikan Jul 3 '12 at 18:59
@RossMillikan: Ah OK, good to know. Thanks. Actually I was aware of the programming usage of it but I recalled someone recommended to avoid using it in LaTeX. – Gigili Jul 3 '12 at 19:10
My first math question on math.stackexchange... I am a programmer so I always use stackOverflow. In programming * is a common for multiplication. Here is the equation in objective-c: float barWidth = (drawableArea-SECTION_SPACING*([barArray count]+1)) / ((([barArray count]-1)*[barSetArray count])*0.75+[barArray count]); – Jaybit Jul 3 '12 at 21:33