We propose a molecular mechanism for the intra-cellular measurement of the ratio of the number of X chromosomes to the number of sets of autosomes, a process central to both sex determination and dosage compensation inDrosophila melanogaster. In addition to the two loci,da andSxl, which have been shown by Cline(Genetics, 90, 683, 1978)and others to be involved in these processes, we postulate two other loci, one autosomal (Ω) and the other, X-linked (π). The product of the autosomal locusda stimulates Ω and initiates synthesis of a limited quantity of repressor.Sxl and π ,both of which are X-linked, compete for this repressor as well as for RNA polymerase. It is assumed thatSxl has lower affinity than π for repressor as well as polymerase and that the binding of polymerase to one of these sites modulates the binding affinity of the other site for the enzyme. It can be shown that as a result of these postulated interactions transcription from theSxl site is proportional to the X/A ratio such that the levels ofSxl+ product are low in males, high in females and intermediate in the intersexes. If, as proposed by Cline, theSxl- product is an inhibitor of X chromosome activity, this would result in dosage compensation. The model leads to the conclusion that high levels ofSxl+ product promote a female phenotype and low levels, a male phenotype. One interesting consequence of the assumptions on which the model is based is that the level ofSxl+ product in the cell, when examined as a function of increasing repressor concentration, first goes up and then decreases, yielding a bell-shaped curve. This feature of the model provides an explanation for some of the remarkable interactions among mutants at theSxl, da andmle loci and leads to several predictions. The proposed mechanism may also have relevance to certain other problems, such as size regulation during development, which seem to involve measurement of ratios at the cellular level.