• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

An Antic Disposition

  • Home
  • About
  • Archives
  • Writings
  • Links
You are here: Home / Archives for Add new tag

Add new tag

The Duel: A curious mathematical puzzle

2010/01/20 By Rob 9 Comments

Captain Galaxy and Commander Glarcon are locked in mortal combat.   Each mans a battle tank armed with N photonic missiles which move at the speed of light.   They move toward each other at constant velocity=v on a 1-dimensional track, unable to stop or reverse direction.  Assume v << c.  The probability of scoring a kill with a missile is described by a function f(d) which monotonically increases from 0 to 1 as the distance between the tanks decreases from infinity to 0.  If the distance closes to 0 and no missiles are fired, both tanks are destroyed in the collision.    Assume each combatant attempts to maximize their own probability of survival.

Note that this is not strictly a zero-sum game, since it is possible for neither player to survive.  But it is impossible for both to survive.

The state of the game is thus described by three variables:

  • d=distance between the players
  • N1= number of own missiles remaining
  • N2= number of opponent’s missiles remaining

A strategy S(d,N1,N2) would describe a combatant’ actions (shoot or don’t shoot) for all possible states.

  1. If each player has exactly one missile what is the optimal strategy?  Clearly, if the first player shoots and misses, the 2nd will win by waiting for d to approach 0 and then make a last minute shot.
  2. What if each player has exactly two missiles?
  3. What if each player has N missiles?

It may simplify the problem to assume f(d) is proportionate to 1/d or 1/d^2 and then solve the general case.

Filed Under: Puzzles Tagged With: Add new tag, Game Theory, Math, Probability

Lost in Translation

2006/07/14 By Rob 3 Comments

In the last installment I looked at the way the ODF Add-in for Word 2007 integrates into the Word UI. Now let’s drill down into an actual conversion and see what fidelity we get.

I downloaded the code from SourceForce and installed on a machine running the Office 2007 beta 2. The Add-in pre-reqs the .NET 2.0 runtime, an additional 22MB download. The current version only supports reading ODF documents, not writing, and only handles the word processor ODF format.

Now for fidelity. Since you may not all have Office 2007 beta 2 installed, I’m going to show you the fidelity via PDF exports. In all cases I manually verified that the PDF output was identical to what I saw on the screen, every error is real, nothing introduced by the PDF export process.

First up is a document I call “the sampler”. It has a little bit of all the basic word processor formatting, fonts, alignment, nested tables, graphics, other character sets, headers/footers, images, captions, etc. It is not intended to be a particularly hard test of document conversion, but a basic test of core functionality.

So, here is the sampler, in the original ODF format, as well as the PDF rendering of it in OpenOffice 2.0.3, where it was originally created.

I then exported that file from OpenOffice to Word format. This demonstrates the quality of conversion users already get when running OpenOffice. Here is is in DOC and PDF exported after loaded the DOC file in Word 2007 beta 2.

Good, but not perfect. Some differences:

  • the bullet point size larger in Word than in OpenOffice
  • the nested table collapsed into main table in Word
  • the above table problem causes the table to take up more vertical space, pushing the graphic onto a second page

Again, that is the OpenOffice –> Word conversion we all have available for free today in open source code. Since DOC is a proprietary binary format with inadequate publicly-available documentation, this level of fidelity is impressive. So moving from ISO ODF to Draft Office Open XML should be that much easier, especially since the target format is voluminously documented (4,000 pages and growing), and the writers of the translator are receiving technical assistance from Microsoft.

Let’s take a look. From within Word 2007 (beta 2) I use the ODF Add-in to load the sampler ODF file, and get something that looks like this PDF.

I won’t characterize it but to say it fared less well than I expected. Problems include:

  • headers/footers dropped (data loss)
  • bullet list indentation ignored
  • number list indentation ignored
  • table dimensions messed up
  • caption for the graphics sized and positioned incorrectly

Whether these are all bugs or merely functional limitations is an interesting question. There is a Functional Specification document available on SourceForge for the Add-in which lists these requirement:

2.1.1.1. Basic Formatting

Here is the list of formatting items that the Add-in and command line translator would keep intact. The first 10 in the list are must haves and the last 4 (number 11 to 14) are good to have items of formatting.

  1. Bold
  2. Italics
  3. Underline
  4. Bulleting
  5. Numbering
  6. Indentation
  7. Alignment (Left, Center, Right)
  8. Font size
  9. Font face
  10. Tabs
  11. Tables
  12. Font color
  13. Highlights
  14. Background colors

Tables are “nice to have”? I’d hope so! This does not give me the impression that full fidelity is in their plans. Forget about scripts and macros. They are not even planning on tables or font colors. I hope I am wrong or misinterpreting their plans here, but that is the requirements document they have posted.

Filed Under: Microsoft, ODF Tagged With: Add new tag, Word 2007

Primary Sidebar

Copyright © 2006-2026 Rob Weir · Site Policies