# An application of continued fractions to composite electrical resistor design

I was teaching Ohms laws law and introductory circuit calculations bout two days ago at a Swedish gymnasium, a subject  which I’m about as adept as now as I was when I myself took the class 7 or so years ago. There are basically only two formulas one has to learn in that course and those are the two effective resistance formulas for resistors in series and resistors in paralell

$R = R_1 + R_2 + ... + R_n, \qquad \cfrac{1}{R} = \cfrac{1}{R_1} + \cfrac{1}{R_2} + ... + \cfrac{1}{R_m}$

Not sufficient to describe circuits with more complicated  typologies such as bridges like the Wheatstone bridge but sufficient for at least engaging in some basic design.

The problem which came to mind as I was reviewing the material was how one would set out to build a circuit element with a specified resistance from a given set of elements. Usually it’s the other way around. You get the component and  you compute the resistance but the inverse problem of getting a specified resistance and then designing the circuit from some pieces if of course a lot more interesting and as we shall see in this special case surprisingly straightforward.

Let us study this particular problem: “Given a set of resistors with resistance $R$ how does one combine these to form an element with a specified fractional resistance $\cfrac{p}{q}R$“. If we want an integer multiple or integer fraction or a specific resistance then things are straightforward, just chain $p$ together to get a resistance $pR$ or put $q$ in parallell to $R/q$ and this is the smallest number of equal number of components you need.

For fractional resistances of a more general form however there are clearly very different ways you can go about designing the circuit and there are different benefits to them

Solution one: Construct $latex$q$chains with $p$ resistors each and put those chains in parallel mThe chains have resistance $p R$ and putting$latex $q$ of them in paralell reduces the total resistance by a $q$th to $p R / q$.

Solution two: Another is to first create $p$ blocks of $latex$ resistors in paralell and then put those in series.However both of these solution has the disadvantage that it requires  a total number of $pq$ resistors to complete it which for most fractions becomes very impractical.

My question was therefore if there was a simple way to get a component with this resistance but which wouldn’t require quite so many resistors. Let us just start off by making clear that it is possible. These two components you see below both have the same resistance $2R/3$

but the right one was built using only 3 resistors instead of 6 which is (if you count by means of manufacturing cost) is a more effective solution. And the process or computing the resistance of the latter composition betrays the coming idea

$\cfrac{2}{3} = \cfrac{1}{1 + \frac{1}{2}}$

(I will henceforth just set $R = 1$) Usually one would have used ^(-1)-notation for the parallell coupling but not doing that reveals the continued fraction expression associated with this construction.

The central idea can be laid out as follows inductively. If you want to design a component with resistance $p/q$ (where $p/q$ is a reduced fraction such that $p < q$) perform euclidean division and rearrange it according to

1

$\cfrac{p}{q} = \cfrac{p}{dp + r} = \cfrac{1}{d + \cfrac{r}{p}} = \cfrac{1}{\cfrac{1}{1/d} + \cfrac{1}{p/r}}$

We now recognize the right hand side as the expression for the resistance of two resistor with resistance $1/d$ and $p/r$ in parallel. The idea can diagrammaticaly be represented by

The $1/d$ resistor is constructed by putting $d$ resistors in parallel and the $p/r$ resistor is constructed by repeating the induction step.**

This can be streamlined by first computing the continued fraction of a fraction and then move backwards to form these construction steps . Take for example the continued fraction for $7/24$

$\cfrac{7}{24} = \cfrac{1}{3 + \cfrac{1}{2 + \cfrac{1}{3}}}= [0; 3,2,3]$

which now contains a recipe for designing the composite resistor

Where the top 3-parallell component corresponds to [0;3,2,3], the 2-series at the bottom to [0;3,2,3], and the 3 in series at the bottom to [0;3,2,3].

Not all continued fractions will however have so small numbers in the expansion and especially when the numerator and denominator are fibonnacci numbers we’ll still end up with having to use a very large number of resistors.

What is kind of nice though is that irrational numbers which have a quickly convergent continued fraction can be approximated pretty accurately. $\pi$ for example has a continued fraction [3;7,15,1,292,1,1,…] which means you can use the approximation $\pi \approx [3;7,15,1] = [3;7,16]$ which using only 26 resistors gives 6 digits of pi which is pretty neat. A

I’ve got half a mind to build this circuit to see if it checks out but unfortunately cheap hobby resistors only have about 1% accuracy to them so you’d only really end up with 3 digits tops.

EDIT: Many of the diagrams in the original publications had errors in them which made them not agree with the text and which were corrected around one hour later.