Processing math: 0%

The nth term of a Fibonacci series.

November 13, 2020 math and physics play , , , ,

[If mathjax doesn’t display properly for you, click here for a PDF of this post.]

I’ve just started reading [1], but already got distracted from the plot by a fun math fact. Namely, a cute formula for the nth term of a Fibonacci series. Recall

Definition 1.1: Fibonacci series.

With F_0 = 0 , and F_1 = 1 , the nth term F_n in the Fibonacci series is the sum of the previous two terms
\begin{equation*} F_n = F_{n-2} + F_{n-1}. \end{equation*}

We can quickly find that the series has values 0, 1, 1, 2, 3, 5, 8, 13, \cdots . What’s really cool, is that there’s a closed form expression for the nth term in the series that doesn’t require calculation of all the previous terms.

Theorem 1.1: Nth term of the Fibonacci series.

\begin{equation*} F_n = \frac{ \lr{ 1 + \sqrt{5} }^n – \lr{ 1 – \sqrt{5} }^n }{ 2^n \sqrt{5} }. \end{equation*}

This is a rather miraculous and interesting looking equation. Other than the \sqrt{5} scale factor, this is exactly the difference of the nth powers of the golden ratio \phi = (1+\sqrt{5})/2 , and 1 – \phi = (1-\sqrt{5})/2 . That is:
\begin{equation}\label{eqn:fibonacci:60} F_n = \frac{\phi^n – (1 -\phi)^n}{\sqrt{5}}. \end{equation}

How on Earth would somebody figure this out? According to Tattersal [2], this relationship was discovered by Kepler.

Understanding this from the ground up looks like it’s a pretty deep rabbit hole to dive into. Let’s save that game for another day, but try the more pedestrian task of proving that this formula works.

Start proof:

\begin{equation}\label{eqn:fibonacci:80} \begin{aligned} \sqrt{5} F_n &= \sqrt{5} \lr{ F_{n-2} + F_{n-1} } \\ &= \phi^{n-2} – \lr{ 1 – \phi}^{n-2} + \phi^{n-1} – \lr{ 1 – \phi}^{n-1} \\ &= \phi^{n-2} \lr{ 1 + \phi } -\lr{1 – \phi}^{n-2} \lr{ 1 + 1 – \phi } \\ &= \phi^{n-2} \frac{ 3 + \sqrt{5} }{2} -\lr{1 – \phi}^{n-2} \frac{ 3 – \sqrt{5} }{2}. \end{aligned} \end{equation}
However,
\begin{equation}\label{eqn:fibonacci:100} \begin{aligned} \phi^2 &= \lr{ \frac{ 1 + \sqrt{5} }{2} }^2 \\ &= \frac{ 1 + 2 \sqrt{5} + 5 }{4} \\ &= \frac{ 3 + \sqrt{5} }{2}, \end{aligned} \end{equation}
and
\begin{equation}\label{eqn:fibonacci:120} \begin{aligned} (1-\phi)^2 &= \lr{ \frac{ 1 – \sqrt{5} }{2} }^2 \\ &= \frac{ 1 – 2 \sqrt{5} + 5 }{4} \\ &= \frac{ 3 – \sqrt{5} }{2}, \end{aligned} \end{equation}
so
\begin{equation}\label{eqn:fibonacci:140} \sqrt{5} F_n = \phi^n – (1-\phi)^n. \end{equation}

End proof.

References

[1] Steven Strogatz and Don Joffray. The calculus of friendship: What a teacher and a student learned about life while corresponding about math. Princeton University Press, 2009.

[2] James J Tattersall. Elementary number theory in nine chapters. Cambridge University Press, 2005.

Building my new “garage”

November 12, 2020 Home renos , , , , , , , ,

I managed to sneak in a day off of work (split over two days), and built a space for all the tools that I used to keep in my double car garage. We’ve been in the new downtown house now for a year, and had most of the old house cleared out except for the garage. You can accumulate a lot of stuff in 20 years of home ownership, and moving from a house with a double car garage to a no-garage house, was quite a challenge. After many panic-demic induced delays, we eventually finished the renos on the old house, and sold it.  I’m really enjoying the new neighbourhood, where I can walk to just about everything I need, but there’s a few things that I miss from the old house:

  1. The garage!
  2. Parking spaces (6 not including the garage — I won’t miss shovelling that driveway!)
  3. The pool.
  4. The hottub.

However, number 1 — the garage, has been the most challenging.  We’ve had stuff from the garage all over the house, in the sheds in the back yard, and a whole lot of it on the back deck under a tarp.  We replaced our washer and dryer with a stacking unit to maximize the space, and I’ve now built some heavy duty shelves next to it for all the tools and toolboxes:

I’ve drilled three rows of holes, each 2″ apart, so that I can adjust the height of the shelves.  I’ve fixed the middle and the top shelf for stability.  I also tacked in the shelf on the bottom with a couple screws and should put some sort of fixed back brace, or a bottom piece so that the side supports cannot spread.  That will have to be later, since I’m out of wood (I had to scrounge a bit and my top most adjustable shelf is not big enough — so that one is temporary too.)

We may redo the plumbing on the other side of the washer dryer too. We have some long multiple hose runs, one of which leaked at one point, because of a degraded washer.   It would be better to put one of those tidy washer/dryer plumbing boxes right in the wall near the washer dryer instead of the current leak ready to happen system.  That would allow for eliminating all the too-long hoses, and give us a chance to fully optimize the long laundry closet for storage.  That and the opposite storage unit is the closest that we will get to a “garage” in the new house.

In the 2o year accumulation of stuff, I have a whole lot of tools that actually need to go.  Some of these were dad’s, and I didn’t have the heart to toss them, but it would be better to find them homes with people that will actively use them.  At the bare minimum, some of these excess tools should go to people who actually have storage space to be hoarders, something that we can no longer do.  Now that I have things arrayed in an accessible fashion, it’s time for the big sort, and then the purge after the sort.

A new computer for me this time.

November 5, 2020 Incoherent ramblings , , , , , , , , , ,

It’s been a long long time, since I bought myself a computer.  My old laptop is a DELL XPS, was purchased around 2009:

Since purchasing the XPS lapcrusher, I think that I’ve bought my wife and all the kids a couple machines each, but I’ve always had a work computer that was new enough that I was able to let my personal machine slide.

Old system specs

Specs on the old lapcrusher:

  • 19″ screen
  • stands over 2″ tall at the back
  • Intel Core I3, 64-bit, 4 cores
  • 6G Ram
  • 500G hard drive, no SSD.

My current work machine is a 4yr old mac (16Mb RAM) and works great, especially since I mainly use it for email and as a dumb terminal to access my Linux NUC consoles using ssh.  I have some personal software on the mac that I’d like to uninstall, leaving the work machine for work, and the other for play (Mathematica, LaTex, Julia, …).

I’ll still install the vpn software for work on the new personal machine so that I can use it as a back up system just in case.  Last time I needed a backup system (when the mac was in the shop for battery replacement), I used my wife’s computer.  Since Sofia is now mostly working from home (soon to be always working from home), that wouldn’t be an option. Here’s the new system:

New system specs

This splurge is a pretty nicely configured, not top of the line, but it should do nicely for quite a while:

  • Display: 15.6″ Full HD IPS | 144HZ | 16:9 | Operating System: Win 10
  • Processor: Intel Core i7-9750H Processor (6 core)
  • RAM Memory: XPG 32GB 2666MHz DDR4 SO-DIMM (64GB Max)
  • Storage: XPG SX8200 1TB NVMe SSD
  • Graphics: NVIDIA GeForce GTX 1660Ti 6GB
  • USB3.2 Gen 2 x 1 | USB3.2 Gen 2 x 2 | Thunderbolt 3.0 x 1 (REAR)| HDMI x 1 (REAR)
  • 4.08lbs

The new machine has a smaller screen size than my old laptop, but the 19″ screen on the old machine was really too big, and with modern screens going so close to the edge, this new one is pretty nice (and has much higher resolution.)  If I want a bigger screen, then I’ll hook it up to an external monitor.

On lots of RAM

It doesn’t seem that long ago when I’d just started porting DB2 LUW to 64bit, and most of the “big iron” machines that we got for the testing work barely had more than 4G of ram each.  The Solaris kernel guys we worked with at the time told me about the NUMA contortions that they had to use to build machines with large amounts of RAM, because they couldn’t get it close enough together because of heat dissipation issues.  Now you can get a personal machine for $1800 CAD with 32G of ram, and 6G of video ram to boot, all tossed into a tiny little form factor!  This new machine, not even counting the video ram, has 524288x the memory of my first computer, my old lowly C64 (I’m not counting the little Radio Shack computer that was really my first, as I don’t know how much memory it had — although I am sure it was a whole lot less than 64K.)

C64 Nostalgia.

Incidentally, does anybody else still have their 6402 assembly programming references?  I’ve kept mine all these years, moving them around house to house, and taking a peek in them every few years, but I really ought to toss them!  I’m sure I couldn’t even give them away.

Remember the zero page addressing of the C64?  It was faster to access because it only needed single byte addressing, whereas memory in any other “page” (256 bytes) required two whole bytes to address.  That was actually a system where little-endian addressing made a whole lot of sense.  If you wanted to change assembler code that did zero page access to “high memory”, then you just added the second byte of additional addressing and could leave your page layout as is.

Windows vs. MacOS

It’s been 4 years since I’ve actively used a Windows machine, and will have to relearn enough to get comfortable with it again (after suffering with the transition to MacOS and finally getting comfortable with it).  However, there are some new developments that I’m gung-ho to try, in particular, the new:

With WSL, I wonder if cygwin is even still a must have?  With windows terminal, I’m guessing that putty is a thing of the past (good riddance to cmd, that piece of crap.)

More satisfying editing of classical mechanics notes.

November 3, 2020 math and physics play , , , , ,

I’ve purged about 30 pages of material related to field Lagrangian densities and Maxwell’s equation, replacing it with about 8 pages of new less incoherent material.

As before, I’ve physically ripped out all the pages that have been replaced, which is satisfying, and makes it easier to see what is left to review.

The new version is now reduced to 333 pages, close to a 100 page reduction from the original mess.  I may print myself a new physical copy, as I’ve moved things around so much that I have to search the latex to figure out where to make changes.

Gauge transformation in the Lorentz force Lagrangian.

November 2, 2020 Uncategorized , , ,

[Click here for a PDF of this post with nicer formatting]

Problem: Lorentz force gauge transformation.

Show that the gauge transformation A \rightarrow A + \grad \psi applied to the Lorentz force Lagrangian
\begin{equation}\label{eqn:gaugeLorentzSTA:20} L = \inv{2} m v^2 + q A \cdot v/c, \end{equation}
does not change the equations of motion.

Answer

The gauge transformed Lagrangian is
\begin{equation}\label{eqn:gaugeLorentzSTA:40} L = \inv{2} m v^2 + q A \cdot v/c + \frac{q v}{c} \cdot \grad \phi. \end{equation}
We know that the Lorentz force equations are obtained from the first two terms, so need only consider the effects of the new \phi dependent term on the action. First observe that
\begin{equation}\label{eqn:gaugeLorentzSTA:60} v \cdot \grad \phi = \frac{dx^\mu}{d\tau} \PD{x^\mu}{\phi} = \frac{d \phi}{d\tau}. \end{equation}
This means that the action is transformed to
\begin{equation}\label{eqn:gaugeLorentzSTA:80} S \rightarrow S + \frac{q}{c} \int d\tau \frac{d\phi}{d\tau} = S + \frac{q}{c} \evalbar{\phi}{\Delta \tau}. \end{equation}
As the action is evaluated over a fixed interval, the gauge transformation only changes the action by a constant, so the equations of motion are unchanged.

References