Facebook Applications and Privacy

February 16th, 2010

Facebook applications violate your privacy. This is not a surprise to many of you who have been around the block a time or two, and I know several people who refuse to enable any Facebook applications because of this concern. However, there is a point which I do not think has been made enough, and that is the following:

You do not have to install a Facebook application for it to learn about you. In fact, it is a virtual certainty that all of the large applications on Facebook, such as Farmville or Mafia Wars, can almost access anything about you that your friends can access, such as photos, your phone number, your birthday, and your interests. This is in spite of the fact that you might have restricted all access to items in your profile to friends or friends of friends. Think about it: If any of your friends has installed a nefarious application (like Farmville Gifts), that application can access your information by default.

Why does this happen? Facebook’s security model distinguishes between access by real people and access by applications. It is obviously handy for Facebook to allow applications to know who a person’s friends are — this way, you can easily invite friends to enable the application from within the application itself. However, by default, a lot of your information is accessible at any time to any application that any of your friends use. This includes

  • Personal info (activities, interests, etc.)
  • Status updates
  • Online presence
  • Website
  • Education and work
  • My videos
  • My links
  • My notes
  • My photos
  • Photos and videos of me
  • About me
  • My birthday
  • My hometown

Consider it: Anybody (including somebody who knows who you are) can create a fake application and convince ANY of your friends to install it, and your information is available to them. The recent privacy hoopla about Google Buzz seems minor in comparison.

I encourage you to disable applications’ access to your information through your friends.


admin Uncategorized

Earth Song

February 5th, 2010

I know it’s old news, but I thought I’d put something on here that wasn’t about math or LaTeX. Not long after Michael Jackson died, I made the following cover of Earth Song.

I also have an mp3 and TuxGuitar tab available.

admin Uncategorized

The exam class

August 29th, 2009

Another pointer to a LaTeX class which which I ran across, called simply “exam”. As you might guess, its entire purpose is to help you typeset exams. Rather than exhaustively go through all of the features, I would like to point out a few items:

  1. The magic seems to come with the questions environment, similar to the enumerate environment.  Instead of \item, you would use \question.
  2. There is an optional item to \question, which is the point value for the particular question.  There are several options for typesetting point values.
  3. Questions can have parts, which individually can have subparts, which can have subsubparts.  In particular, see the \parts environment and the \parts macro.
  4. There is a solution environment.  If you express the desire (either by using the answers option in the documentclass declaration or by using the \printanswers macro in your preamble) your answers will be typeset with the questions.  Otherwise they are hidden.  The solution environment also takes an option, which is the blank space to be left for students to write their answers when answers are not printed.
  5. There is a coverpages environment, which allows you to typeset material before page 1 of the exam.
  6. There is a gradetable macro.  If you put point values on your questions (and use the \addpoints macro in your preamble), a table is placed in your document which allows you to hand-write the points earned on each question in an appropriate blank, adding up the result in the end to get a score.

All-in-all, a pretty basic class.  There are many options which I have not gone over, but the included documentation is well-done.  Of course, there are always a couple of things that I would like to see included in the next version.

  1. I would like the option to typeset a solution within the space allowed for the student.  In a perfect world, the “correct” solution would fit in the space allotted to the student; also, it would be easier to compare the key with the original exam if the two were paginated the same.
  2. A little customization for the short-answer solutions would be nice.  In this class, the short-answer blanks come right after the corresponding question part.  What if it were delayed to when the question itself were finished?

I’m sure there are other ideas people might have for improvements to this class.  I will also mention that the exam class is not the only game in town; there is also the examdesign class and the exams class.

Here is an example LaTeX file using the exam class, and the compiled output.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
\documentclass[12pt]{exam}
\usepackage{amsmath}
\usepackage{color}

%% exam options
\boxedpoints
\addpoints
\printanswers
\setlength\answerlinelength{3in}
\cfoot{Page \thepage\ of \numpages}

\begin{document}
\begin{coverpages}
  \begin{center} {\Huge \bf MAT305 Exam 1}
\vskip 0.2in
\fbox{\fbox{\parbox{5.5in}{\centering Answer the questions in the
      spaces provided on the question sheets. If you run out of room
      for an answer, continue on the back of the page.

      This exam has \numquestions\ questions for a total of
      \numpoints\ points.
}}}
\end{center}
\vspace{0.1in} \hbox to \textwidth{Name and
  section:\enspace\hrulefill
} \vspace{0.2in} \hbox to
\textwidth{Instructor's name:\enspace\hrulefill}
\begin{center}
  \gradetable[h]
\end{center}
\end{coverpages}
\begin{questions}
  \question[10] Solve the separable differential equation \[ y' +
  t^3y^2= t^3.\
]
  \begin{solution}
    We begin by manipulating:
    \begin{align*}
      y' &= t^3(1-y^2)\\
      \intertext{There are the constant solutions $y = \pm 1$.
        Discarding the possibility that $1-y^2 = 0$ (on the strength
        of the uniqueness theorem for linear DEs), we have
}
      \frac{y'}{1-y^2} &= t^3\\
      \left(\frac{1}{1-y} + \frac{1}{1+y}\right) y' &= 2t^3\\
      \frac{d}{dt}(\ln|1+y| - \ln|1-y|) &= 2t^3\\
      \ln \left|\frac{1+y}{1-y}\right| &= \frac{t^4}2+C & (C\text{ arbitrary})\\
      \frac{1+y}{1-y} &= ce^{t^4/2} & (c\text{ arbitrary})\\
      y &= \frac{ce^{t^4/2}-1}{ce^{t^4/2}+1}
    \end{align*}
  \end{solution}
  \vfill \hskip 3in Answer: \hrulefill
  \pagebreak
  \question Solve the differential equation
  \[ y' + 14y = t\] using an integration factor, using the following
  procedure.
  \begin{parts}
    \part[5] What is the integrating factor $\mu(t)$?\answerline
    \part[5] What function is $\mu(t)y' + 14\mu(t)y$ the derivative
    of?\answerline
    \part[5] Find the general antiderivative of both sides of
    $\mu(t)(y'+14y) = \mu(t) t$ and solve for $y$.
  \end{parts}
  \begin{solution}
    The integrating factor $\mu(t)$ should satisfy $\mu'(t) = 14
    \mu(t)$
, so we choose
    \[\mu(t) = e^{14t}.\]
    This makes the left side the derivative of the expression
    \[ e^{14t}y \] according to the product rule.  Therefore, by
    taking the general antiderivative of the indicated expression, we
    have

    \begin{align*}
      e^{14t}y &= \int te^{14t} \, dt\\
      &= \frac{1}{14}te^{14t} - \frac{1}{196} e^{14t} + C &(C\text{ arbitrary})\\
      y &= \frac t {14} - \frac{1}{196} + Ce^{-14t}.
    \end{align*}
  \end{solution}
\end{questions}

\end{document}

admin Uncategorized

Drawing Poincaré Geodesics in the Unit Disk

April 24th, 2009

I find myself reinventing the wheel pretty often when it comes to this, so I thought I would set it down here for the teeming masses of the future.

Sometimes I want a picture comprised of chords in the unit disk.  One can draw them as straight line segments, but this has the disadvantage that short chords are almost indistinguishable from arcs of the circle.  Hence, it makes more sense to draw Poincaré geodesics joining two points.  As an example, below are two images depicting the same set of chords, once with Euclidean geodesics (straight lines) and once with Poincaré geodesics (arcs of circles). Notice how much more detailed (and, dare I say, pretty) the second picture appears.

The Poincaré geodesic joining two points a and b on the boundary of the unit circle is the unique circular arc that strikes the unit circle perpendicularly at a and b.  It is not difficult to calculate what this geodesic is: the circle C that it lies on has a particular center and radius, and it subtends a particular set of angles from the center of C.  I will not bother showing these calculations, but I will explain why this is not a good solution for the problem.

As the size of the geodesic gets smaller and smaller (i.e., as the points it connects gets closer and closer), the radius of the circle tends to zero, and such things are easy to draw.  However, as the two points it’s connecting get further apart, the geodesic tends to a straight line, meaning that the circle’s radius gets large and the angles of intersection with the unit circle get really close together.  This means that, when you ask your computer to draw them, you are not likely to get accurate pictures. Even worse, it will dump core all over you if you try to draw antipodal points. This course of action is highly recommended if you want strange errors from your postscript files.

The reasonable among you may ask, “Well, why don’t you stop drawing arcs of circles when the angle gets too big? Eventually they look like straight lines, so draw those, doofus.” Well, I’m not satisfied by that solution. I want to try something more complicated: Bézier curves!

To be more specific: a Bézier curve is a parametric curve which, in each coordinate, is a cubic polynomial. It has a knack for approximating smooth curves. In fact, it is relatively common to approximate a circle by four splines (see this page for more info), which is accurate to better than a tenth of a percent. My hope was that splines are better conditioned for drawing Poincaré geodesics than arcs of circles are.

The happy truth is that they are. Though I lack the time to go into the details, suppose you wish to draw a Poincaré geodesic between points a and b on the unit circle. According to the formulas on this page, there is a homeomorphism of the unit disk in the complex plane, given by

\phi(z) = \frac{z}{1+\sqrt{1-|z|^2}},

which sends Euclidean geodesics to Poincaré geodesics. In particular, the image of the straight line \overline{ab} under \phi is the Poincaré geodesic joining a and b. All you must do is find a spline P(t) such that

  1. P(0)=a and P(1)=b
  2. P'(0) and P'(1) point toward the origin (i.e., are proportional to a and b, respectively),
  3. the spline passes through the image of the midpoint of \overline{ab} under \phi, and
  4. the spline is symmetric with respect to the perpendicular bisector of \overline{ab}.

These conditions give you that the endpoints of the spline are a and b, and the control points are \kappa a and \kappa b, where \kappa is a function only of M = \left|\frac{a+b}{2}\right|. Specifically,

\kappa = \frac43\left(\frac{1}{1+\sqrt{1-M^2}}-\frac 1 4\right)

which, miracle of miracles, gracefully approaches \frac 1 3 as a and b approach antipodal points.

This is now my go-to formula in any setting where Bézier curves are supplied for drawing Poincaré geodesics. I have not had the occasion to extend this to the approximation of a spline joining points a and b not on the unit circle, but it seems this would be straightforward.

As an example, here’s a short asymptote program which draws the chords specified in a text file in the unit disk.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* chords-from-file.asy
 * Author: Clinton Curry
 * Date: April 24, 2009
 *
 * Draw the chords whose angles (in full revolutions) are given
 * in the input file.
 */

size(400,400);
draw(unitcircle);

// Read in a filename and open
file fin=input(stdin);

// Draw chords in file
real a,b;
while( !eof(fin) ) {
  a = fin;
  b = fin;
  pair z1 = (cos(2*pi*a), sin(2*pi*a));
  pair z2 = (cos(2*pi*b), sin(2*pi*b));
  real M = length(1/2 * (z1+z2));
  real kappa = 4/3* ( 1/(1+sqrt(1-M*M)) - 1/4);
  draw(z1..controls kappa*z1 and kappa*z2..z2);
}

admin Uncategorized , ,

Todonotes

March 20th, 2009

Allow me to draw your attention to the todonotes package.

admin Uncategorized