Archive for March, 2009

The Biggest Box Fedex Will Take

My friend Megan Goering asks what is the largest volume box you can send through Fedex given that length + twice the width + twice the height must be less than 165 inches. It might seem odd to care about only the volume instead of the dimensions, but it makes sense if you’re shipping walnuts, balloons or bows for Christmas presents. Anything pourable, that is.

Here’s my solution. Say that the dimensions are $x$, $y$ and $z$. Then we can write the problem as

\begin{eqnarray*}\textrm{max } & & xyz \\\textrm{subject to} & &x + 2y + 2z \le 165 \\& & x,y,z \ge 0 \\\end{eqnarray*}

First, observe that if $x + 2y + 2z < 165$, then the product $xyz$ can be increased by increasing any one of the dimensions. Therefore, the maximum will occur when $x + 2y + 2z = 165$. Thus, we can eliminate $z$ because

$\displaystyle z$ $\textstyle =$ $\displaystyle \frac{165 - 2y -x}{2}$ (1)

Here is the problem

\begin{eqnarray*}\textrm{max } & & xy\left(\frac{165 - 2y -x}{2} \right)\\\textrm{subject to} & &x + 2y \le 165 \\& & x,y \ge 0 \\\end{eqnarray*}

The constraints impose that the maximum be achieved in a triangular area with one vertex at the origin and the other two each on one of the $x$ and $y$ axes. Notice that if we use a point $(x,y)$ on the border of this triangular region, the product $xyz$ will be equal to 0, so this is clearly not the maximum. Therefore, the maximum occurs on the inside of the triangle. This is important, because it means that the maximum is some sort of “bump” which means the problem can be solved directly with calculus.

We want to maximize $xy\left(\frac{165 - 2y -x}{2} \right)$. The choice of $x$ and $y$ that achieves the maximum is unaffected by multiplying that product by a positive constant, so use this opportunity to get rid of the $\frac{1}{2}$. Let $f = xy(165 - 2y -x)$. Then

\begin{eqnarray*}f & = & 165xy - 2xy^{2} -x^{2}y \\\frac{\partial f}{\partial...... -2xy \\\frac{\partial f}{\partial y} & = & 165x - 4xy -x^{2}\end{eqnarray*}

Thus, in order for the maximum to be achieved, we need both derivatives to be equal to 0. Thus, we need

\begin{eqnarray*}165y - 2y^{2} -2xy & = & 0 \\165x - 4xy -x^{2} & = & 0\end{eqnarray*}

Which is, conveniently enough, two equations in two variables, so we can probably solve this. First simplify as

\begin{eqnarray*}165 - 2y -2x & = & 0 \\165 - 4y -x & = & 0\end{eqnarray*}

Then as

\begin{eqnarray*}2y + 2x & = & 165 \\4y + x & = & 165\end{eqnarray*}

And finally

\begin{eqnarray*}x & = & 55 \\y & = & \frac{55}{2}\end{eqnarray*}

and we get

\begin{eqnarray*}z & = & \frac{55}{2}\end{eqnarray*}

from Equation (1).

Thus the maximum volume you can send using this Fedex rule is $55 \times \frac{55}{2} \times \frac{55}{2} = \frac{166375}{4}$ cubic inches, or about 24 cubic feet. This many walnuts weighs over 300 kg, so presumably the problem was motivated by something lighter.


Comments (1)

Why Web Comics are Better

A friend of mine, Brian Lewis, recently asked on Facebook why Web comics are better than printed comics.  My guess is that it’s a combination of factors:

Selection Bias.  Webcomics allow a reader to be much choosier.  You only keep up with the ones you like the most out of thousands (and you forget about the rest).  In the paper, the selection is smaller and you are still constantly reminded of the bad ones.

Audience Focus.  This is related to the above point.  To stay in paper, a comic needs to appeal to at least a few percent of the papers’ readers, probably at least 10%.  Thus, you don’t have niche comics about specific games, jobs or hobbies.  However it’s just these comics that develop the most devoted fans.  You heard about ones that are appeal to you from members of your peer group and you came to love them.  Your favorite comics are ones that other people wouldn’t like.  To be fair, you would probably dislike their favorites just as much.

Fearlessness.  Webcomics can take risks and offend people.  Print comics will get ejected from the paper.

Comments (1)

First Steps on Your Business’ Online Presence

A friend of mine asked me how to get started with the website for his business idea.  I thought that because I took the time to write this down, I’d share it here too.  I can’t say anything specific about this business, but it relies on some sophisticated, social-network-related algorithms to rank candidates.  Here’s what I told him:

The best way to fiddle around with the algorithms for ranking is in a spreadsheet.  Excel or Google spreadsheets are both fine.  Translating the formulas into website code will be easy.  Finding the right formulas is hard and spreadsheets make it so you can experiment agilely.

The best way to make mockups and design the pages and website structure is honestly on a piece of paper.  Lots of people, including experienced designers, try to write the pages in code too early and get locked into it.  This won’t take very long and will let you start coding it up soon to show people soon.

To learn HTML, you should have some sort of sandbox environment.  I imagine that your firm or program must give you some sort of webspace.  If so, talk to the IT department about how you can upload files to it.  If you don’t have space there, you can create files on your laptop and look at them locally in your browser, or use Google’s Pages application.

To write the HTML files, you can use a text editor (not Word it has to be like notepad) or a WYSIWYG editor like Mozilla Composer.  Mozilla Composer is free and pretty good: .  WYSIWYG is an acronym for “What You See Is What You Get” which basically means you aren’t writing in code.   Rather, you’re formatting the webpage the way you would a Word document with the underlying code hidden from view.   However, you can choose to view the code which is a learning-experience.

To get to your actual question: how to learn HTML, I would say that any book on amazon that has a lot of stars is as good as any book I can tell you about.  I would just say that before you get the book, give a try to a couple of online HTML tutorials.  Whatever comes out on top of a google search and gives you the right vibe is fine.  If those don’t work for you, get a book, but if they do work, they’ll save more than money.  I’ve often found that web-based tutorials were easier to use, more up-to-date, had cooler and more interactive examples and had better self-referencing structure.

Use the comments to tell me what I missed.

Comments (1)