A Multiple-Fraction Drawing Program for MATLAB

The following commands, when cut and pasted into MATLAB at the command prompt, will get MATLAB to draw an array of four pictures of different fractions, much like the image on the cover of the April issue of Math Magazine. It will only draw fractions of the form 1/d, but it will draw them in any base b. To draw different fractions from the ones above, follow the instructions for changing a single graph (see the comments after the MATLAB commands that generate a single graph) for each of the four panels.

I'm curious to know what people's tastes are in fractions. So if you find some fractions that you think are particularly beautiful, I'd like to know about them. Also, if you have any questions or comments, do not hesitate to contact me.  My email address is rafe@math.brown.edu.

Happy drawing!

d = 29
b = 10
r = 1
e = [1+i]

for j = 1:d
e = [e, r+r*i]
l = rem(b*r,d)
e = [e, r+l*i]
r = l
end

subplot(2,2,1)
plot(e)
axis([0 29 0 29])

title('\it{1/29 base 10}','FontSize',10)

hold on

q = [0 d+d*i]
plot(q)

hold off

d = 127
b = 42
r = 1
e = [1+i]

for j = 1:d
e = [e, r+r*i]
l = rem(b*r,d)
e = [e, r+l*i]
r = l
end

subplot(2,2,2)
plot(e)
axis([0 127 0 127])

title('\it{1/127 base 42}','FontSize',10)

hold on

q = [0 d+d*i]
plot(q)

hold off

d = 101
b = 50
r = 1
e = [1+i]

for j = 1:d
e = [e, r+r*i]
l = rem(b*r,d)
e = [e, r+l*i]
r = l
end

subplot(2,2,3)
plot(e)
axis([0 101 0 101])

title('\it{1/101 base 50}','FontSize',10)

hold on

q = [0 d+d*i]
plot(q)

hold off

d = 97
b = 13
r = 1
e = [1+i]

for j = 1:d
e = [e, r+r*i]
l = rem(b*r,d)
e = [e, r+l*i]
r = l
end

subplot(2,2,4)
plot(e)
axis([0 97 0 97])

title('\it{1/97 base 13}','FontSize',10)

hold on

q = [0 d+d*i]
plot(q)

hold off