Wikipedia:Reference desk/Archives/Mathematics/2011 December 14

= December 14 =

Summation beginner
Hi everyone. I'm extremely new to summation and I just had a question. Using $$\sum_{i=1}^{100}i,$$ how do we find that the answer is 5050 (as the Wikipedia article says)? Surely we don't have to add each of the numbers on the calculator to find the answer if summation is what is used to solve this. 64.229.180.189 (talk) 02:01, 14 December 2011 (UTC)
 * See Carl_Friedrich_Gauss for a famous story about this problem and a brief description of the solution. 98.248.42.252 (talk) 03:55, 14 December 2011 (UTC)
 * There are two fairly intuitive ways to do it.
 * You are summing 100 numbers, where the average number is 50.5 (equal to the average of the first and last numbers. In fact this is not trivial and only guaranteed for arithmetic progressions, but I find it intuitive). The sum is therefore 100*50.5 = 5050.
 * The sum $$S=\sum_{i=1}^{100}i$$ is equal to $$\sum_{i=1}^{100}(101-i)$$, since in both cases you sum the integers from 1 to 100 (this is shown formally using a change of variables in the sum). You can add two sums over the same range element-by-element, so
 * $$2S=\sum_{i=1}^{100}i+\sum_{i=1}^{100}(101-i)=\sum_{i=1}^{100}(i+(101-i))=\sum_{i=1}^{100}101=100\cdot101=10100$$
 * so $$S=5050$$.
 * Arithmetic progression deals with this more technically. -- Meni Rosenfeld (talk) 05:53, 14 December 2011 (UTC)


 * While young Gauss's supposed method is quite elegant, our summation article specifically mentions the use of mathematical induction to prove that
 * $$\sum_{i=1}^ni = \frac{n(n+1)}2$$
 * and the proof is given in the latter article's Example section. Note that induction is typically used to prove that patterns observed in a few initial cases extend to the whole, not to discover those patterns in the first place. -- ToE 06:01, 14 December 2011 (UTC)
 * If $$\sum_{i=1}^{100}i$$ is hard, try $$\sum_{i=1}^{10}i$$ for a start. Bo Jacoby (talk) 18:13, 14 December 2011 (UTC).


 * By any chance are you asking which buttons to press on a calculator (with stats functions) to give you the summation ? StuRat (talk) 21:24, 14 December 2011 (UTC)


 * Well, if there was a way to do that, that'd be great, but I was just thinking what's the point of having this system of summation if we'd have to use a calculator to find the answer and not using arithmetic steps? 64.229.180.189 (talk) 01:35, 15 December 2011 (UTC)


 * I think you're confusing "notation" and "technique". "$$\sum$$" is notation. We write "the sum of all integers from 1 to 100" as "$$\sum_{i=1}^{100}i$$" only because it's more compact and convenient. No calculating power is gained by doing this. The ability to compute 1 + 2 + 3 + ... + 100 without performing 99 additions is a technique. You can use the technique without using the "$$\sum$$" notation, like young Gauss did in his head. Using the "$$\sum$$" notation, that particular technique is written $$\sum_{i=1}^ni = \frac{n(n+1)}2$$, but you could also describe the technique in English if you wanted. 98.248.42.252 (talk) 04:56, 15 December 2011 (UTC)

A relevant article is triangular number. Sławomir Biały (talk) 19:57, 15 December 2011 (UTC)

'Curved' objects
I'm trying to figure out how to generate some 3D geometry (namely railway track).

What I'd like to do is generate some curves, but I got stuck on how to generate appropriate vertex data.

There is a Diagram here -> File:Track curve.svg to which I will refer.

The particular 3D viewer I am using models railway track-types as 'blocks' based on a fixed distance (AB in diagram) along the nominal centre line of the track.

This distance AB can be considered as a chord of an arc through (AB) as shown, which has a specific radius R and origin (shown as O), and typicaly a 'curve' is represented as a pair of rails parrallel to (AB). $$\mathrm{H} \mathrm{J}=\mathrm{I}\mathrm{K}$$ nominaly representing the track guage. The arcs $$\mathrm{H} \mathrm{I}$$ and $$\mathrm{J}\mathrm{K}$$ representing the position of the individual rails.

NB The diagram given is for a lefthand curve.

What I'd like to know is how to work out $$X_c$$, $$X_left$$ , $$X_Right$$ for any given value of Z1, and the four subscripted Z values given , I've tried a number of approaches and failed to get a formulae that worked consistently.

A worked solution for this would be much appreciated as I was intending to generate the actual geometry using some kind of algorthimic approach based on steps w.r.t to z. Sfan00 IMG (talk) 16:04, 14 December 2011 (UTC)


 * It's probably going to be easier to work in polar coordinates, and you'll get much better results if the curved sections get close to 180 degrees. First, find the angles of the endpoints.
 * &theta;1 = atan2(Az,Ax), &theta;2 = atan2(Bz,Bx)
 * Then choose some &theta;s between &theta;1 and &theta;2 and evaluate
 * z = R sin &theta;, x = R cos &theta;
 * If you have to work in cartesian coordinates, use similar triangles to calculate ZRS and friends
 * (ZRS+Z1)/(R+len(AJ)) = Az/R
 * And the equation of the circle is just
 * xc = sqrt(R2 - z2)
 * 130.76.64.120 (talk) 19:06, 14 December 2011 (UTC)


 * You'll have to go through this in idiot level detail as for the typical values I was using I get non sensiscal results. Sfan00 IMG (talk) 19:32, 14 December 2011 (UTC)
 * In the context of the sim, the point marked A is (0,0,0) if that helps Sfan00 IMG (talk) 19:39, 14 December 2011 (UTC)


 * Ah, and here I had assumed that the origin was... at the origin. No matter. The thing is, it's hard to give you a detailed answer without knowing exactly what your inputs are. Do we know R? B? O? The slope of the tangent line at A? 130.76.64.116 (talk) 21:10, 14 December 2011 (UTC)


 * Knowns: The length of AB(it's a constant in the simulator), R is known, as are HJ,  AB is aligned with the Z axis, with A at(0,0) in this example.

(NB There's a different example for the divering curve at switches, but I am trying to understand this example before I do anything more complex.)

I can see why you want to do the math in polar. I'm assuming that to get a more sensible answer I need to do a translation somewhere?

Sfan00 IMG (talk) 21:40, 14 December 2011 (UTC)


 * Yes, a translation is what's needed. The z coordinate of O is len(AB)/2 by symmetry, and the x coordinate you can get from the Pythagorean theorem:
 * $$O_x=\sqrt{R^2-[len(AB)/2]^2}$$
 * Then the angles involved are:
 * $$-\theta_1=\theta_2=\arcsin\left(\frac{len(AB)/2}{R}\right)$$
 * And the translated centerline points are:
 * $$z=O_z+R \sin(\theta),\;x=O_x-R \cos(\theta)$$
 * Replace R with len(OH) or len(OJ) to get the inner and outer track points. 130.76.64.116 (talk) 22:14, 14 December 2011 (UTC)

Thank You :)  I know have enough information I think to build a general 'bend' function, unless it's already a library function :) Sfan00 IMG (talk) 22:27, 14 December 2011 (UTC)

A more generalised solution would involve having a function that converted a point in (x,z) relative to AB, to an equivalent (x,z) in the curve, but I think I should  figure that out myself before asking here again Sfan00 IMG (talk) 22:56, 14 December 2011 (UTC)


 * Hmm. looking at the diagram I've seen another possible method for getting $$X_c$$ for any z

$$ r\cos(t) = z $$

$$ r sin (t) = x $$

So : $$\frac{z}{r}= cos(t) $$ and $$t=\arccos\frac{z}{r}$$

If $$x=r\sin(t)$$ then $$x=r \sin(\arccos(\frac{z}{r}))=\sqrt{1-{(\frac{z}{r})^2}} $$

? Sfan00 IMG (talk) 01:01, 15 December 2011 (UTC)
 * $$\sin\arccos x = \sqrt{1-x^2}$$ Widener (talk) 01:47, 15 December 2011 (UTC)


 * Having tested, the formulae based on arcos doesn't work consistently, sorry. Sfan00 IMG (talk) 10:37, 15 December 2011 (UTC)

OK, having again tried a number of approaches, I am clearly not understanding something. So given the diagram, A at x=0,z=0, with +z axes along AB and the +x axes running from A vertically down the page,  How do I map any general point (x,z) w.r.t to the chord, to a point in a 'curved' space for the following cases : I'm sorry to sound like someone with no math ability at all :( Sfan00 IMG (talk) 11:09, 15 December 2011 (UTC)
 * 1)   'bend'   -  z distances parallel to chord AB get scaled.
 * 2)  'curve'  -  z distances parallel to chord AB are translated to 'arc' distances w.r.t arc AB?


 * It also seems I can't code as I still fail to get consistent 'sane' values when converting the set of equations given by the IP to program code.

Sfan00 IMG (talk) 11:47, 15 December 2011 (UTC)


 * Just noticed this discussion. If you want to do railway tracks well you should be aware of Track transition curve. They don't go directly from straight tocurved because that would cause too much jerk (physics). Dmcq (talk) 12:08, 15 December 2011 (UTC)
 * Yes I am aware of that, this is about generating the 3D geometry. For the purposes of the simulation the 'transition' spiral is a set of chords of fixed length, for each chord the radius is 'fixed', hence the disscussion above.

If you know of a way of a way of approximating a 'transistion' spiral by means of fixed length 'chords' feel free to put the explanation into the disscussion :) Sfan00 IMG (talk) 12:37, 15 December 2011 (UTC)


 * Bezier curves or some relatives are the way to go if you want to approximate 2D or 3D curves or surfaces. Dmcq (talk) 15:55, 15 December 2011 (UTC)


 * That was going to be my next comment. From reading the relevant article the centre line of a railway track transition curve seems to be based on a Euler spiral, at which point my brain shut down :( Sfan00 IMG (talk) 16:53, 15 December 2011 (UTC)


 * The poster has put some stuff on my talk page about what actually happens with railways where they do the approximation with curves with a given radius. I think I better check whether they've contacted some railway enthusiasts before looking deeper as they sound like the appropriate crowd if they want that level of detail! I deal more with spherical cows rather than the versions with four legs and udders ;-) Dmcq (talk) 17:07, 15 December 2011 (UTC)

Why do you want to base yourself on a chord? Doesn't your imaging package support arcs as built-in primitive? I would expect that it does. Then you just input the parameters into it. If not, make a function to show arcs, and use the arcs internally. The two parallel arcs are very easy to get from the central one: the radii are + and - half a gauge, etc. Make yourself a  function and use it extensively. Your points can be  pairs. Forget deriving the ultimate math formula, just write a program instead, tracing the geometric derivation steps with a chain of calls to, collecting the points. If there are no built-in arcs, just generate a sequence of points along your arc - and draw straight chords between them. You will need to assess the needed frequency with which to generate your points along the arc, according to the wanted precision (you don't need shorter chord than the one where the height of a circular segment is less than half a pixel, say). To calculate any point on an arc, just call.

To show transitional curves, you'll need to calculate points along Euler spirals, preferably with precision-controllable density too, or you'd need an algorithm that approximates them with tangential circular arcs, and draw those. It's not something trivial that you could get just by asking for it here on RefDesk, I don't imagine.

Lastly, you mention 3D. Arcs are 2D. To show 3D arcs you could just trace them like a 3D polyline with a lot of  points. WillNess (talk) 20:14, 15 December 2011 (UTC)


 * 1) The chords are a limitation of the current model of trackwork used by the software simulation concerned, (although the source code is available. The simulation concerned is Train Simulation Framework, part of the reason I was asking about this here was to try and get a basis on which appropriate generator functions in the software could be made.
 * 2) I'm trying to derive the 'formulae' so I can code the relevant generator functions consistently.
 * 3) I'm well aware that for 3D i'd need to consider the vertical component as well.. Thankfully the 'vertical' curves for typical trackwork as so small as to be practically non-existent over the distances concerned here.
 * 4) I'm aware of tools like Templot (amongst others used professionally in engineering) which would do accurate track layout, but those are not 'free' software in a form which the authors of Train Simulation Framework would consider viable. I'm trying  to do this the hard way because I don't know of 'free' tools can that do this at present.
 * Sfan00 IMG (talk) 23:07, 15 December 2011 (UTC)
 * Diagram No 2. File:TrackCurve Slide and Bend.svg - explaining what I mean by a 'slide' and 'bend'.  I was trying to figure out how to generalise for Q->Q' and getting hoplessly confused in the process. I'm not even sure if  what I've labelled as $$Q'_{BEND}\!$$ is the correct point. :(.
 * Diagram No 2. File:TrackCurve Slide and Bend.svg - explaining what I mean by a 'slide' and 'bend'.  I was trying to figure out how to generalise for Q->Q' and getting hoplessly confused in the process. I'm not even sure if  what I've labelled as $$Q'_{BEND}\!$$ is the correct point. :(.

NB. In the attached $$Q'_{SLIDE}\!$$ is not labelled as it's obviously $$P'$$ translated appropriately based on PQ

I can also upload the GeoGebra workbook on this second diagram if someone wants to look at it in more depth. I'm sorry I am not seemingly capable of working out the hard math to do it all :( Sfan00 IMG (talk) 23:22, 15 December 2011 (UTC)


 * First we need to understand the setting of the problem. In your 1. you say "chords are ... model of trackwork". Does that mean that you have linear diagrams of trackwork and want to translate them into the curved setting according to the true centerline? If so, the diagram probably refers to the running distance along the axis so your slide function is completely off-base, and each (s,o) point of distance/offset based on chord as axis' representation, should get translated into a point with same (s,o) according to the actual arc. Is this right? WillNess (talk) 23:32, 15 December 2011 (UTC)


 * In the simulation trackwork is approximated by a series of 'straight lines' of a fixed block length. by constructing 'nominal' arcs of the appropriate radius through the endpoints of these lines a better 'graphical' appearance of the track can be generated for each block of track.

I am trying to get from the 'straight' line, namely AB to the curved centere-line... A->B  is along the track.

Your description sounds closer to a 'bend', which can be done by rotating Q about P by an (appropriate amount) and translating $$Q'_{ROT}\to Q'_{BEND}$$ based on $$ P \to P'$$  The later has already been demonstrated in this thread. meaning to do a bend, To do this initial rotation needs a specfic angle?

The 'slide' function ONLY modifies in 'x', in the distance parrallel to the 'x' before the slide remain parallel to 'x' after the 'slide'.

I apologise if I am bad at explaining this.

BTW In writing this, it seems obvious my second diagram is incorrect. I'll upload an updated one that reflects the above explanation as a replacement soon. I'll also upload a 'visual diagram' that explains what happens with a slide and bend. Sfan00 IMG (talk) 00:30, 16 December 2011 (UTC)


 * Explanation of 'slide' and 'bend' operations using a rectangle, File:Curve-Operations.svg apologies for the crude nature of this diagram. Sfan00 IMG (talk) 00:33, 16 December 2011 (UTC)


 * Hmm. I think once 'slide' is worked out, that sorts out the rails.. Next problem would be placing the sleepers, which is thankfully not a 'math' question... Sfan00 IMG (talk) 00:50, 16 December 2011 (UTC)


 * I will reply on my talk page because I don't think we're talking math anymore. :) WillNess (talk) 08:25, 16 December 2011 (UTC)


 * I've now tried a number of approaches for both 'slide' and 'bend', none of which work consistently. Given the respone I am having to conclude I am not able to adequately explain (let alone attempt to code) what I am trying to do. This is unfortunate as it means I am back to relying on 'non-free' tools. Sfan00 IMG (talk) 20:27, 16 December 2011 (UTC)


 * If anyone cares, I uploaded a modified diagram on Wikiversity - http://en.wikiversity.org/wiki/File:P_Slide_Solve.svg,

It's the translation for P->P`_SLIDE I'm trying to find. I already think I know how to do a 'bend', but given the response here I'm not inspired to continue. Sfan00 IMG (talk) 21:35, 16 December 2011 (UTC)

1917 arithmetic problem...
I'm not understanding. The question is:


 * What will be the cost of lining the sides and bottom of a tank 8ft. 8in. long, 4ft. wide and 5ft. deep, with zinc weighing .5pound to the square foot, at $0.12 a pound?

I'm getting $232.32, which seems off. Best, Albacore (talk) 23:50, 14 December 2011 (UTC)
 * I get US$ 9.68 (161+1/3 square feet at 6 ct per square foot). I assume labour is free ;-). --Stephan Schulz (talk) 00:05, 15 December 2011 (UTC)
 * I agree with Stephan. Perhaps you should show us your calculations, Albacore. Widener (talk) 01:08, 15 December 2011 (UTC)
 * How did you guys conclude it's in US dollars? --   Jack of Oz   [your turn]  04:20, 15 December 2011 (UTC)
 * Political incorrectness. I assumed someone who cannot solve this problem has to come from Texas. Since Texas has banned import of foreign books since 1903, chances are that the problem is from a US textbook. ;-) --Stephan Schulz (talk) 07:52, 15 December 2011 (UTC)
 * Wow, what an amazingly rude thing to say...Phoenixia1177 (talk) 11:55, 15 December 2011 (UTC)
 * Did they also ban reprints of foreign books, in Texas? WillNess (talk) 18:22, 15 December 2011 (UTC)


 * Since there are 12 inches in a foot, with L=8+(2/3) a length of a tank in feet, the total area is L*5 twice, for the two sides, L*4 for the bottom, and 5*4 twice, to close the front and the rear, or in total L*(5*2+4) + 5*4*2 = 14*(8+2/3) + 40 = 112 + 28/3 + 40 = 161 + 1/3 square feet (121 + 1/3 if "sides" refer just to the two sides, without the front and the rear of the tank). You need to multiply this by the 6 cents half a pound of zinc costs, that is needed for each square foot. This will come up to 968 cents (or 728 in the other case). WillNess (talk) 18:22, 15 December 2011 (UTC)


 * $9.68 is a correct first order approximation, but it doesn't take into account overlap at the corners, a reasonable omission in this case as the lining is very thin compared to the dimensions of the tank, but something which needs to be taken into account for small tanks with thick linings. To see how insignificant the difference here is, consider that with a density of 7.14 g·cm−3 the zinc lining, at 0.5 lb·ft-2, is only 0.0135 in thick (call this thickness T). If we did want an exact answer, we can do it either of two ways: calculating the overlap directly or taking a difference of volumes.
 * To calculate the overlap directly, visualize the installation of the lining which you have already cut to the exact dimensions of the sides and bottom. You could install two sides opposite one another without problem, but to fit the next two side you will have to trim off T from each end of each side, trimming off an area of 4(5 ft)T. To install the bottom piece, you need to trim off T from all four edges.  For a second order approximation of the cost you could approximate this trimmed area by multiplying the perimeter of 25 ft 4 in by T, but that overcounts the four T2 areas in the corners, so the actual bottom material trimmed is (25 ft 4 in)T - 4T2, for a total trimmed area of (45 ft 4 in)T -4T2 = 7.32 in2 saving you $0.00305, or just under a third of a penny. (Note that the -4T2 term only makes the difference between 7.3227 in2 and 7.3220 in2, well beyond the number significant figures we are using for the density.)
 * An alternate way of calculating the exact price is to compute the difference between the volume of the tank before and after it is lined, thus determining the amount of zinc lining. The "before" volume is (8ft 8in)(4ft)(5ft).  The after volume is (8ft 8in - 2T)(4ft - 2T)(5ft - T) = (8ft 8in)(4ft)(5ft) - (161+1/3)(ft2)T + (45+1/3)(ft)T2 - 4T3.  Subtract the volumes to determine the volume of zinc lining and divide by T to get the area of the zinc sheeting required, which is (161+1/3)(ft2) - (45+1/3)(ft)T + 4T2, the same result as above.
 * While ignoring the overlap was the right thing to do here, it needs to be accounted for when the thickness of the lining is significant compared to the dimensions of the container, such as when lining a beverage cooler with an inch of styrofoam insulation. -- ToE 21:16, 16 December 2011 (UTC)


 * Since 232.32 is 24 times 9.68 I'm wondering if the original calculation was done by converting feet and inches to inches and then forgot that a square foot is 144 square inches (12x12). That still leaves a factor of 2 to explain; maybe forgetting .5 lb/sq ft.  (And if this were a modern book it would be US$ because the problem is in feet and inches rather than metric.) RJFJR (talk) 14:34, 16 December 2011 (UTC)


 * Note Liberian dollar. -- ToE 21:16, 16 December 2011 (UTC)