Drawing Blanks

Premature Optimization is a Prerequisite for Success

Archive for March 2010

OLE DB Services

leave a comment »

Here are all possible values of the “OLE DB Services” connection string parameter. They are very poorly documented and were not easy to find.

All services (default) “OLE DB Services = -1;”
All services except pooling “OLE DB Services = -2;”
All services except pooling and transaction auto-enlistment “OLE DB Services = -4;”
All services except client cursor “OLE DB Services = -5;”
All services except client cursor and pooling “OLE DB Services = -6;”
No services “OLE DB Services = 0;”

Written by bbzippo

03/31/2010 at 4:24 pm

Posted in programming

7 TeV collisions: why not antiprotons?

leave a comment »

First 7 TeV events: http://atlas.web.cern.ch/Atlas/public/EVTDISPLAY/events.html

I’ve been wondering for a while why the LHC is designed for proton-proton collisions, and not proton-antiproton like the Tevatron. The Tevatron uses the same set of magnets to circulate both beams, and the LHC needs two sets.

First of all, apparently, it’s very difficult to produce antiprotons at a high enough rate to sustain the rate of collisions needed for the LHC detectors to see rare events.

There are also very interesting considerations that make proton-antiproton collisions a better choice for the lower energy accelerator. The momentum of a moving proton is not equal to the sum of momenta of the three quarks. Some small fraction of the momentum is carried by the “strong field” – gluons and virtual quarks.

At the Tevatron, the virtual particle collisions do not contribute to interesting events (like W boson production) because they don’t have enough energy. Only the 3 valence quarks count. So if some of the valence quarks are antiquarks, the electric attraction dramatically increases the probability of collision.

And at the LHC energies the virtual quarks (and antiquarks) and even gluons carry enough momentum to be involved into production of heavy particles. That is why the 7-fold increase in energy is expected to give a 120-fold increase in rate of production of heavy particles. Introducing 3 antiquarks would not make any difference.

Written by bbzippo

03/30/2010 at 5:50 pm

Posted in Uncategorized

Pie cutting problem: the proof

leave a comment »

Let me first restate the problem: You are expecting guests and you know their number is going to be either n or m. You want to cut a pie so that the pieces can be equally distributed among the guests in either case. What is the minimal number of pieces?

And let me remind you that the pieces don’t have to be equal. For m=2, n= 3 we don‘t need to cut into 6 equal pieces. It is sufficient to cut into 4:


In the picture I cut a line segment instead of a pie. And I used a very straightforward algorithm: first I cut into 2 equal pieces (the blue cut), and then into 3 (the red cuts). Obviuosly, if m and n are relatively prime, this method will result in m+n-1 pieces. And if they are not, some cuts will coincide. Here is the cutting for m=6, n=9:


The two magenta cuts are those that coincided. In the general case, the number of coincident cuts will be equal to the greatest common divisor of m and n minus 1. I’m not going to prove this, this is trivial.

So our simple and straightforward cutting method will always yield m+n-GCD(m,n) pieces. I claim that this number is the minimum, i.e. the conditions of the problem cannot be satisfied with a smaller number of pieces.


First, one simple fact about graphs:

In any connected graph, the number of edges is not less than the number vertices minus 1. (In a tree it equals to the the number vertices minus 1).

In any graph, the number of edges is not less than the number of vertices minus the number of connected components.

What do graphs have to do with this problem? I’m going to use graphs to represent the distribution of the pieces of the pie among the guests. The n guests will be represented by n blue dots, the m guests – by m red dots. The lines will represent the pieces. A line originating from a dot represents the fact that this particular guest gets this particular piece. Each line will connect a red dot to a blue dot showing which guest gets this piece in the case when the blue guests show up and in the case when the red guests show up.

Confused? Yeah, this is some heavy abstraction. Here is the picture for m=2, n=3 and the cutting into 6 equal pieces:


See, each red guy gets 2 pieces, each blue guy gets 3. And for the cutting {1/3, 1/6, 1/6, 1/3} the distribution will be:


And if m=2, n=4, and we cut into 4 equal pieces, the graph will have 2 connected components:


Now we have all clues that we need in order to conduct the proof

Read the rest of this entry »

Written by bbzippo

03/12/2010 at 6:12 am

Posted in math

The State of Scholarly Publishing

with one comment

We’ve all heard about this http://en.wikipedia.org/wiki/Sokal_Affair and this http://en.wikipedia.org/wiki/Bogdanov_Affair , and that some papers generated by this http://pdos.csail.mit.edu/scigen/ have been accepted for publication … amusing stuff, isn’t it?

Today I ran across an article that was The Most Cited publication in Mathematics in 2008 and the author was named a Rising Star.



Today this paper is #2 top cited in Math, according to http://info.scopus.com/topcited/

In my very humble unprofessional opinion, this paper isn’t more valueable than those generated by SciGen. And I know I’m not the only one who thinks so.



Written by bbzippo

03/05/2010 at 6:03 am

Posted in Uncategorized

Pie Cutting problem

with one comment

You are expecting guests and you know their number is going to be either n or m. You want to cut a pie so that the pieces can be equally divided among guests in either case. What is the minimal number of pieces?

Note that the pieces don’t have to be equal. E.g. for n=2, m=3 you don’t have to cut the pie into 6 pieces. You can cut into 4: 1/3, 1/3, 1/6, 1/6.

For n=4, m=7 you can cut into 16 pieces: 4 * 1/7 + 12 * 1/28. But you can do better and use only 10 pieces: 4*1/7 + 2*1/14 + 2*1/28 + 2*3/28

There is a very simple and straightforward algorithm that results in a small number of pieces. But it wasn’t easy for me to prove that there is no better algorithm. It took me almost a week to find a proof, but I’m happy because it’s very beautiful.

In this post I’m only going to give the answer and an algorithm. I will publish the proof of optimality later.

Read the rest of this entry »

Written by bbzippo

03/04/2010 at 3:18 am

Posted in math

Some important theorems from combinatorics

leave a comment »

In relation to the problems that I recently presented here – the crocodile dinner problem, the crossing lines  problem and its “schoolgirl” formulation – I’d like to reference a few important and beautiful theorems. Unfortunately, combinatorics is one of those branches of mathematics that I have never been exposed to.

Dilworth’s theorem http://en.wikipedia.org/wiki/Dilworth%27s_theorem

König’s theorem http://en.wikipedia.org/wiki/K%C3%B6nig%27s_theorem_(graph_theory)

(you gotta love wikipedia: “Note that, although Kőnig’s name is properly spelled with a double acute accent, the theorem named after him is customarily spelled with an umlaut”)

Marriage theorem http://en.wikipedia.org/wiki/Marriage_theorem , http://www.cut-the-knot.org/arithmetic/marriage.shtml , http://www.cut-the-knot.org/arithmetic/elegant.shtml 

Apparently, all these theorems are equivalent.

And “combinatorics” has lots of irrelevant anagrams 🙂

Written by bbzippo

03/01/2010 at 5:49 am

Posted in math