opinion: Mr. Justice Powell
  delivered the opinion of the Court.
  The question before us concerns the constitutionality of § 230 (3) of the New York Correction Law, which denied appellee state prisoners “good time” credit for their presentence incarceration in county jails. Appellees claim that disallowing such credit to them while permitting credit up to the full period of ultimate incarceration for state prisoners who were released on bail prior to sentencing deprived them of equal protection of the laws. The three-judge District Court, one judge dissenting, upheld their claim, 332 F. Supp. 973 (1971). The Commissioner of Correction and other officials (hereafter Commissioner) have appealed and we noted probable jurisdiction, 405 U. S. 986 (1972).
  The challenged New York sentencing system is a complex one, and some basic definitions are required at the outset. Jail time denotes that time an individual passes in a county jail prior to trial and sentencing. Good time is awarded for good behavior and efficient performance of duties during incarceration. Both good time and jail time figure variously in the calculations of a series of release dates that each prisoner receives upon his arrival at state prison. Each inmate has both a minimum parole date, which is the earliest date on which he may be paroled at the discretion of the Parole Board, and a statutory release date which is the earliest date he must be paroled by the Parole Board. The minimum parole date is calculated under §§ 230 (2) and 230 (3) by subtracting the greatest amount of good time that can be earned (10 days per month) from the minimum sentence of an indeterminate term. The statutory release date is calculated under § 230 (4) by subtracting the greatest amount of good time that can be earned (5 days per month) from the maximum sentence of an indeterminate term.
  Although appellees did receive jail-time credit for the period of their presentence incarceration in county jail, § 230 (3) explicitly forbids, in calculating the minimum parole date, any good-time credit for the period of county jail detention served prior to transfer to state prison. Appellee Royster, being unable to post bail, served 404 days’ jail time in the Nassau County Jail prior to his transfer to state prison to serve consecutive 5-to-10-year terms for burglary in the third degree and grand larceny in the first degree. Appellee Rutherford also failed to make bail and spent 242 days’ jail time in Nassau County Jail prior to his trial, sentencing, and transfer to state prison for concurrent terms of 10 to 20 years for robbery in the first degree and two and one-half to five years for grand larceny in the second degree. It is undisputed that, were appellees Royster and Rutherford to receive good-time credit for their presentence confinement in county jail, they would be entitled to appear before the Parole Board approximately four and three months earlier, respectively, than under the computation required by § 230 (3).
  Two additional points merit mention. While New York does deny good-time credit for jail time in computing the minimum parole date under §§ 230 (2) and (3), it allows such credit in calculating the statutory release date under § 230 (4). Finally, §230 (3) itself provides that good-time credit for jail time shall be awarded to those prisoners confined after sentence in county penitentiaries, as opposed to those convicted of felonies, such as appellees, who are transferred after sentence to state prison.
  I
  Section 230 (3) of the New York Correction Law does, as appellees note, draw a distinction “between the treatment of state prisoners incarcerated prior to sentencing and those who were not similarly incarcerated.” Appellees contend that “denying state prisoners good-time credit for the period of their pre-sentence incarceration in a County Jail whereas those fortunate enough to obtain bail prior to sentence [receive] a full allowance of good time credit for the entire period which they ultimately spend in custody” violates the equal protection of the laws and discriminates against those state prisoners unable to afford or otherwise qualify for bail prior to trial.
  We first note that any relative disadvantage the distinction works on appellees is lessened by the fact that New York on September 1, 1967, replaced § 230 of its Correction Law with §§ 803 and 805, which apply to all convictions for offenses after that date. Under the new scheme, “good time earned on the minimum sentence is abolished. A prisoner meets with the Parole Board at the expiration o.f his minimum term, regardless of how much good time he has earned or of how much time he spent in jail prior to arriving at state prison.” New York has given appellees — and all those sentenced for offenses committed prior to September 1, 1967 — a chance to elect the new procedure, but appellees declined to do so. Appellees thus enjoy at least as favorable a position as all state prisoners convicted for offenses committed subsequent to September 1, 1967, including those released on bail prior to sentence. Appellees thus are disadvantaged in the computation of time only in comparison with those who were convicted of offenses committed prior to September 1, 1967, and made bail prior to trial. Even the adverse impact of this difference is lessened, though not eliminated, by the fact that New York did not deprive appellees of credit for the full amount of actual time spent in jail prior to trial and sentencing but only of the potential additional 10 days per month of good time ordinarily available under § 230 (2) to inmates for good conduct and efficient performance of duty.
  We note, further, that the distinction of which appel-lees complain arose in the course of the State’s sensitive and difficult effort to encourage for its prisoners constructive future citizenship while avoiding the danger of releasing them prematurely upon society. The determination of an optimal time for parole eligibility elicited multiple legislative classifications and groupings, which the court below rightly concluded require only some rational basis to sustain them. James v. Strange, 407 U. S. 128, 140 (1972); Lindsey v. Normet, 405 U. S. 56, 73-74 (1972); Schilb v. Kuebel, 404 U. S. 357 (1971); Dandridge v. Williams, 397 U. S. 471, 487 (1970). Appellees themselves recognize this to be the appropriate standard. For this Court has observed that “[t]he problems of government are practical ones and may justify, if they do not require, rough accommodations — illogical, it may be, and unscientific.” Metropolis Theatre Co. v. City of Chicago, 228 U. S. 61, 69-70 (1913). We do not wish to inhibit state experimental classifications in a practical and troublesome area, but inquire only whether the challenged distinction rationally furthers some legitimate, articulated state purpose. We conclude that it does.
  II
  The Commissioner defends the distinction by noting that “state prisons differ from county jails with respect to purpose, usage and availability of facilities.” State prisons are “intended to have rehabilitation as a prime purpose and the facilities at these institutions are built and equipped to serve this purpose.” The Commissioner cites the presence at state prisons of “educational and vocational services such as schools, factories, job-training programs and related activities.” At argument, the Commissioner noted: “We have barber shops. We teach trades. We manufacture a lot of goods. . . . Green-haven State Prison has a textile factory.”
  We pass no judgment on the success or merits of the State’s efforts, but note only that at state prisons a serious rehabilitative program exists. County jails, on the other hand, serve primarily as detention centers. The Commissioner asserts they are “neither equipped nor intended to do anything more than detain people awaiting trial and maintain no schools, run no factories and require no work from these inmates.” While appellees do point to the existence of some rehabilitative or recreational facilities within some county jails, it is clear that nothing comparable to the State’s rehabilitative effort exists.
  These significant differences afford the basis for a different treatment within a constitutional framework. We note that the granting of good-time credit toward parole eligibility takes into account a prisoner’s rehabilitative performance. Section 230 (2) of the New York Correction Law authorizes such credit toward the minimum parole date “for good conduct and efficient and willing performance of duties assigned [emphasis added].” The regulations of the New York Department of Correction, 7 N. Y. C. R. R. § 260.1 (a), state that: “[T]he opportunity to earn good behavior allowances offers inmates a tangible reward for positive efforts made during incarceration [emphasis added].” As the statute and reg-illations contemplate state evaluation of an inmate’s progress toward rehabilitation, in awarding good time, it is reasonable not to award such time for pretrial detention in a county jail where no systematic rehabilitative programs exist and where the prisoner’s conduct and performance are not even observed and evaluated by the responsible state prison officials. Further, it would hardly be appropriate for the State to undertake in the pretrial detention period programs to rehabilitate a man still clothed with a presumption of innocence. In short, an inmate in county jail is neither under the supervision of the State Correction Department nor participating in the State’s rehabilitative programs. Where there is no evaluation by state officials and little or no rehabilitative participation for anyone to evaluate, there is a rational justification for declining to give good-time credit.
  Ill
  We do not agree with the court below that the integrity of appellants’ assertions as to rehabilitation is undermined by the fact that the State does grant under § 230 (3) good-time credit for presentence jail time to county penitentiary inmates and under § 230 (4) to state prisoners for the purpose of calculating their statutory release dates. The legislature could have concluded rationally that county penitentiary inmates, who are nonfelons with less than one-year sentences, required quantitatively and qualitatively less rehabilitation- — -with fewer risks of misevaluation — than inmates confined to state prison for more serious crimes. And the legislature could rationally have distinguished between the minimum parole date and the statutory release date on the ground that an acceleration of the minimum parole date posed a greater danger that an inmate would be released without adequate exposure to rehabilitative programs and without adequate evaluation by prison officials. Thus, New York's decision to deny good-time credit for presentence jail time solely with respect to a state prisoner’s minimum parole date is rationally justified on the ground that the risk of prematurely releasing unrehabilitated or dangerous criminals may well be greatest when the parole decision is made prior to expiration of the minimum sentence.
  IY
  Neither appellees nor the court below contended that increased opportunity for state evaluation of an inmate’s behavior and rehabilitative progress was not a purpose of the challenged provision of § 230 (3). Appellees state only that the rehabilitative purpose was not the “overriding” one, and the District Court noted that “the legislature’s primary aim in enacting the good time statute was to foster and insure the maintenance of prison discipline.” 332 F. Supp., at 978 (emphasis added). We do not dispute these statements: the disciplinary-purpose is certainly an important and possibly the “primary” aim of the legislation! Yet, our decisions do not authorize courts to pick and choose among legitimate legislative aims to determine which is primary and which subordinate. Rather, legislative solutions must be respected if the “distinctions drawn have some basis in practical experience,” South Carolina v. Katzenbach, 383 U. S. 301, 331 (1966), or if some legitimate state interest is advanced, Dandridge v. Williams, 397 U. S., at 486. So long as the state purpose upholding a statutory class is legitimate and nonillusory, its lack of primacy is not disqualifying.
  When classifications do not call for strict judicial scrutiny, this is the only approach consistent with proper judicial regard for the judgments of the Legislative Branch. The search for legislative purpose is often elusive enough, Palmer v. Thompson, 403 U. S. 217 (1971), without a requirement that primacy be ascertained. Legislation is frequently multipurposed: the removal of even a “subordinate” purpose may shift altogether the consensus of legislative judgment supporting the statute. Permitting nullification of statutory classifications based rationally on a nonprimary legislative purpose would allow courts to peruse legislative proceedings for subtle emphases supporting subjective impressions and preferences. The Equal Protection Clause does not countenance such speculative probing into the purposes of a coordinate branch. We have supplied no imaginary basis or purpose for this statutory scheme, but we likewise refuse to discard a clear and legitimate purpose because the court below perceived another to be primary.
  V
  As the challenged classification here rationally promotes the legitimate desire of the state legislature to afford state prison officials an adequate opportunity to evaluate both an inmate’s conduct and his rehabilitative progress before he is eligible for parole, the decision of the District Court is
  Reversed.
  Section 230 (3):
  “In the case of a definite sentence prisoner, said reduction shall be computed upon the term of the sentence as imposed by the court, less jail time allowance, and in the case of an indeterminate sentence prisoner said reduction shall be computed upon the minimum term of such sentence, less jail time allowance. No prisoner, however, shall be released under the provisions hereof from a state prison until he shall have served at least one year. In the case of a prisoner confined in a penitentiary, said reduction shall be computed upon the term of the sentence as imposed by the court, including jail time allowance. Subject to the rules of the commissioner of correction, the maximum reduction of ten days in each month may, in the discretion of the board hereinafter provided for, be in whole or in part withheld, forfeited or cancelled, in accordance with the rules of the commissioner of correction for bad conduct, violation of prison rules or failure to perform properly duties assigned.”
  Other relevant sections read as set forth below.
  Section 230 (2):
  “Every prisoner confined in a state prison or penitentiary, except a prisoner sentenced for an indeterminate term having a minimum of one day and a maximum of his natural life, may receive, for good conduct and efficient and willing performance of duties assigned, a reduction of his sentence not to exceed ten days for each month of the minimum term in the case of an indeterminate sentence, or of the term as imposed by the court in the case of a definite sentence. The maximum reduction allowable under this provision shall be four months per year, but nothing herein contained shall be construed to confer any right whatsoever upon any prisoner to demand or require the whole or any part of such reduction.”
  Section 230 (4):
  “Every prisoner confined in an institution under the jurisdiction of the state department of correction for an indeterminate term, except a prisoner sentenced for a term having a maximum of natural life, may receive, for good conduct and efficient and willing performance of duties assigned, a reduction of his sentence not to exceed two days for each month of the maximum term. For meritorious progress and achievement in a treatment program to which he has been assigned, following appropriate testing and classification, such prisoner may also receive a reduction of his sentence not to exceed three additional days for each month of the maximum term. In no event, however, shall the maximum reduction allowable under this subdivision exceed two months for each year of the maximum sentence, nor shall any such reduction be calculated under this subdivision to reduce the time actually served to a term less than the minimum sentence imposed by the court. . . .”
  The Commissioner claims in his brief that the court below should have treated the instant case, not as a class action, Fed. Rule Civ. Proc. 23, but as a petition for habeas corpus with the attendant requirement that appellees exhaust their state remedies. Brief for Appellants 2. Appellants did not, however, raise this question in their jurisdictional statement, and did not argue it before the Court. In light of this, it becomes unnecessary to comment further on any possible exhaustion question.
  He also has a maximum expiration date which is the date of the maximum sentence to which an inmate can be held if he receives no good-time credit at all. This date, unlike the other two, bears no direct relevance to the instant case.
  Both prisoners here were sentenced to indeterminate terms. See §230 (1):
  “. . . A sentence to imprisonment in a state prison having minimum and maximum limits fixed by the court or the governor is an indeterminate sentence.”
  As the court below noted:
  “There is no doubt that by its express wording Section 230 mandates the denial of good time credit for the time plaintiffs served in county jail awaiting trial and sentencing. Subsection 2 thereof provides that a state prisoner may receive, ‘for good conduct and efficient and willing performance of duties assigned, a reduction of his sentence not to exceed ten days for each month of the minimum term in the case of an indeterminate sentence . . . ,’ and subsection 3 states that ‘in the case of an indeterminate sentence prisoner said reduction shall be computed upon the minimum term of such sentence, less jail time allowance.’ (Emphasis added.)” 332 F. Supp. 973, 974-975.
  See People v. Deegan, 56 Misc. 2d 567, 289 N. Y. S. 2d 285 (1968); Paul v. Warden, N. Y. L. J., May 21, 1969, p. 18, col. 6.
  “In the case of a prisoner confined in a penitentiary, said reduction shall be computed upon the term of the sentence as imposed by the court, including jail time allowance." (Emphasis added.)
  Brief for Appellees 5.
  Id., at 5-6.
  The court below correctly noted:
  “[The] statutory scheme of §230, which is the subject of this lawsuit, is no longer the law in New York. On September 1, 1967, § 230 was replaced by §§ 803 and 805 of the Correction Law and §§ 70.30 and 70.40 of the new Penal Law, which sections apply to all convictions for offenses committed on or after that date (but not to convictions — as of plaintiffs herein — for offenses committed prior to the effective date). Thus, the scope of this case (and of the proposed class) is necessarily limited, for the challenged statute, § 230 (3) of the Correction Law, now applies only to those prisoners who were convicted for offenses committed before September 1, 1967, whose minimum terms have not yet expired, who have not yet met with the Parole Board, and who have not yet elected the ‘conditional release’ program offered by the new law and made available to old law prisoners by § 230-a of the Correction Law. Of these prisoners, a smaller class yet — comprised of those inmates who served time in county jail prior to sentence to state prison — actually feel the effect of §230 (3) ’s proscription against good time credit for jail time. Nevertheless, the briefs in this case attest to the continuing effect of that mandate on a substantial number of individuals.” 332 F. Supp., at 975 n. 4.
  Brief for Appellants 12.
  As noted above, this would make a difference of three and four months, respectively, in the time appellees Rutherford and Royster were eligible to appear before the Parole Board.
  Tr. of Oral Arg. 30.
  Brief for Appellants 14.
  Tr. of Oral. Arg. 13.
  Brief for Appellants 15.
  Brief for Appellees 17. But the State notes that “some counties have absolutely nothing. Some have a little something.” Tr. of Oral Arg. 6.
  See n. 1, supra.
  Appellants further note that:
  “Section 260.3 sets forth the criteria for awarding allowances and states:
  “'(b) In evaluating the amount of allowance to be granted, the statutory criteria (i. e. good behavior, efficient and willing performance of duties assigned, progress and achievement in an assigned treatment program) shall be viewed in the light of the following factors:
  “'(1) The attitude of the inmate;
  “'(2) The capacity of the inmate; and
  “'(3) The efforts made by the inmate within the limits of his capacity.’
  “These factors are evaluated by a time allowance committee, whose purpose is to make recommendations to the superintendent as to the amount of good behavior allowance to be granted to inmates who are eligible to be considered for such allowance. 7 N. Y. C. R. R. 261.2. The time allowance committee awards good time on the following criteria [7 N. Y. C. R. R. 261.3]:
  '"(d) The committee shall consider the entire file of the inmate and shall interview the inmate and then shall decide upon a recommendation as to the amount of good behavior allowance to be granted, applying the principles set forth in sections 260.3 and 260.4 of this Part.
  '"(e) The committee shall not recommend the granting of the total allowance authorized by law or the withholding of any part of the allowance in accordance with any automatic rule, but shall appraise the entire institutional experience of the inmate and make its own determination.’ (Emphasis added.)” Reply Brief for Appellants 2-3.
  See also the affidavit of the Deputy Commissioner of the Department of Correction, John R. Cain, who stated that:
  “The actual allowance of 'good time’ is discretionary and is awarded as an incentive for good conduct. It is a means for encouraging participation in programs, efficient work and discipline.
  “The state correctional system seeks to encourage rehabilitation by work participation by inmates, job training programs and education programs. An inmate can be evaluated in his work and participation in the facility’s programs and 'good time’ granted as an incentive. Prior to being received in the facility, however, an inmate who is in jail is not under the supervision of the State Correction Department and is not involved in the facility program. Since the inmate is not participating in the state programs while in jail there is no opportunity to evaluate him nor need to encourage his participation.” App. 19a.
  Appellants further correctly note:
  “In fact, until recently changed by federal policy, the federal prison system itself did not require the awarding of good time for pre-trial incarceration under 18 U. S. C. § 4161, which awards good time solely for good behavior. Section 4161 states that good time begins to run ‘with the day on which the sentence commences to run’, and the sentence does not start to run until the prisoner is received in a federal penitentiary. See Blackshear v. United States, 434 F. 2d 68 (5th Cir.1970). The federal courts have uniformly upheld the denial of the opportunity to earn good time on this jail time. Bandy v. Willingham, 398 F. 2d 333 (10th Cir.1968), cert. den. 393 U. S. 1006; Aderhold v. Ellis, 84 F. 2d 543 (5th Cir.1936), cert. den. 299 U. S. 587; Swope v. Lawton, 83 F. 2d 814 (9th Cir.1936).” Brief for Appellants 20-21.
  See supra, at 268, and nn. 7 and 8. The court below stated:
  “Whatever the merit in defendants’ attempted distinction, the fact remains that state prisoners can be, and, under certain circumstances, are, granted good time credit for jail time for reasons other than as a reward for participation in the various rehabilitative programs of the state prison system. The awarding of good time for jail time to these two classes of prisoners only reinforces the belief that the legislature’s primary aim in enacting the good time statute was to foster and insure the maintenance of prison discipline.” 332 F Supp., at 978.
  At oral argument the following instructive colloquy occurred:
  “Q. Then it is your position that the only purpose at all, sir, by the statute, exclusively, the only single purpose, is the disciplinary one?
  “MR. SORGE: Your Honor, it is extremely difficult to say whether the only purpose is just for the discipline. I believe that the court has-
  “Q. If a purpose is the rehabilitation one, then are you not in some trouble?
  “MR. SORGE: If the main purpose is?
  “Q. If a purpose, not the main purpose, a purpose.
  “MR. SORGE: I do not believe so, Your Honor, because, as the district court stated, the overriding consideration in this case is disciplinary.
  “Q. You go further then than the district court, I take it, because I read the district court’s opinion the same way Mr. Justice Brennan does, as saying that rehabilitation is a subordinate function and that its opinion is based on that. You say that it really is no function at all?
  “MR. SORGE: I believe that if you take the state prisoners themselves, Mr. Justice, there might be a subordinate position. However, I would repeat that the overriding consideration is the disciplinary aspect of it.” Tr. of Oral Arg. 28-30.
  See also the court’s statement that:
  “Defendants contend that good time is granted as an incentive to the inmates to participate in these prison rehabilitation programs and that, since county jails are not equipped to provide such services, there is no basis for granting good time for time served therein. If it were clear that the awarding of good time was based solely and exclusively on an evaluation of an inmate’s performance in such programs so endemic to the state prison system, the denial of good time for jail time might be understandable; however, this does not appear to be the case. Rather, it seems that the overriding consideration in the granting of good time reductions is the maintenance of prison discipline.” 332 F. Supp., at 977.
  The court below noted that the disciplinary purpose of the statute is demonstrated by the fact that “a prisoner is immediately and automatically credited with a maximum allowance of good time credit for future good behavior at the time his minimum parole date is initially fixed upon his arrival in state prison. In effect, then, a prisoner does not 'earn’ good time credit as time goes on for exemplary performance in assorted prison programs but rather simply avoids being penalized for bad behavior.” The court then cited § 235 of New York Correction Law providing that good time may be withheld as “ 'punishment for offenses against the discipline of the prison or penitentiary’ (emphasis added) . . . .” 332 F. Supp., at 977-978.
  The statements above do demonstrate a disciplinary purpose for the statute, but do not negate the rehabilitative one. There is nothing to show that good-time credit may not be revoked for failure of the inmate to participate acceptably in the State’s rehabilitative program as well as for disciplinary violations. Indeed, § 230 (3) requires loss of good time for “bad conduct, violation of prison rules or failure to perform properly duties assigned." (Emphasis added.)
choices: Alabama Alaska American Samoa Arizona Arkansas California Colorado Connecticut Delaware District of Columbia Federated States of Micronesia Florida Georgia Guam Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Marshall Islands Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Northern Mariana Islands Ohio Oklahoma Oregon Palau Pennsylvania Puerto Rico Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virgin Islands Virginia Washington West Virginia Wisconsin Wyoming United States Interstate Compact Philippines Indian Dakota