
148 Cal.App.3d 906 (1983)
196 Cal. Rptr. 293
In re BERNARD SABBATH STRICK on Habeas Corpus.
Docket No. 16018.
Court of Appeals of California, Fourth District, Division Two.
November 9, 1983.
*909 COUNSEL
Bernard Sabbath Strick, in pro. per, for Petitioner.
John K. Van de Kamp, Attorney General, A. Wells Petersen and Frederick R. Millar, Jr., Deputy Attorneys General, for Respondent.
OPINION
McDANIEL, J.
The issue in this petition for a writ of habeas corpus is whether new legislation regarding application of work credits against prison sentences should be applied retroactively.

STATEMENT OF FACTS
Bernard Strick (petitioner) was convicted of voluntary manslaughter and assault with a deadly weapon, both offenses having occurred on December 10, 1978. He was sentenced to prison for a total of six years at the California Institution for Men in Chino, and began serving his sentence on June 3, 1980. He received 157 days of preprison credit against his sentence.
On July 15, 1980, petitioner was assigned to the institution's Permanent Work Crew (PWC) and was given a position as clerk for the prison's law library. He continued to work in that capacity throughout his incarceration.
Penal Code section 2931, subdivision (a), in effect at the time of Bernard's incarceration, provided that: "... the Department of Corrections shall have the authority to reduce the term prescribed under such section by one-third for good behavior and participation consistent with subdivision (d) of section 1170.2."
Petitioner's prison record qualified him under this section to have his sentence reduced by one-third, which would have resulted in fixing his earliest release date at January 26, 1984.
In 1982, the California Legislature passed Assembly Bill No. 2954, which amended sections 2930, 2931, 2932, and 4019 of the Penal Code, and added sections 2933, 2934, and 2935 to the code. This bill was filed with the Secretary of State in September of 1982, and went into effect on January 1, 1983.
New section 2933, subdivision (a) provides in part: "For every six months of full-time performance in a credit qualifying program, as designated *910 by the director, a prisoner shall be awarded worktime credit reductions from his term of confinement of six months."
In addition, new section 2934 provides that: "Under rules prescribed by the Director of Corrections, a prisoner subject to the provisions of Section 2931 may waive the right to receive time credits as provided in Section 2931 and be subject to the provisions of Section 2933." Strick is within this class of persons as he is a prisoner subject to the provisions of section 2931, i.e., having committed offenses between July 1, 1977 and January 1, 1983.
Section 2934 further provides that: "A prisoner exercising a waiver under this section shall retain only that portion of good behavior and participation credits, ... attributable to the portion of the sentence served by the prisoner prior to the effective date of the waiver. A waiver under this section shall, if accepted by the department, become effective at a time to be determined by the Director of the Department of Corrections."
The Director of Corrections promulgated rules pursuant to these sections which provided that section 2933 would not apply to any work done before January 1, 1983.
In December 1982, petitioner applied for a waiver under section 2934. His waiver was accepted with an effective date of January 1, 1983. This meant petitioner would receive "2933 credit" for acceptable work done after January 1, 1983, and retain his "2931 credit" accumulated before that date. Under this dual formula, petitioner's new earliest release date was set for October 21, 1983.[1]
Petitioner then sought from us a writ of habeas corpus, contending that the director's decision to apply 2933 credit only to work done on or after January 1, 1983, impermissibly denies him equal protection of the laws under the federal Constitution and California Constitution. He contends, had the 2933 credit program been applied retroactively, that his release date would have been March 18, 1983. He asks that this claimed entitlement to an additional 217-day credit be applied to his parole period.
Before addressing ourselves to the merits of the petition, we must first dispose of the Peoples' contention that this petition should be dismissed because petitioner has not exhausted his administrative remedies.


*911 DISCUSSION

I

EXHAUSTION OF ADMINISTRATIVE REMEDIES
(1a) It is well settled as a general proposition that a litigant will not be afforded relief in the courts unless and until he has exhausted available administrative remedies. (Abelleira v. District Court of Appeal (1941) 17 Cal.2d 280, 291-296 [109 P.2d 942, 132 A.L.R. 715]. (2) This general rule applies to applications for habeas corpus relief (In re Muszalski (1975) 52 Cal. App.3d 500 [125 Cal. Rptr. 286]) where the Department of Corrections "has provided inmates with viable, efficacious administrative remedies." (Id., at p. 508.)
(1b) However, the requirement of exhaustion of administrative remedies does not apply if the remedy is inadequate. (Glendale City Employees' Assn., Inc. v. City of Glendale (1975) 15 Cal.3d 328, 342[124 Cal. Rptr. 513, 540 P.2d 609].) "[T]he doctrine ... has not hardened into inflexible dogma. [Citation.] It contains its own exceptions, as when the subject matter of the controversy lies outside the administrative agency's jurisdiction [citation], when pursuit of an administrative remedy would result in irreparable harm [citations], when the administrative agency cannot grant an adequate remedy ... and when the aggrieved party can positively state what the administrative agency's decision in his particular case would be. [Citations.]" (Ogo Associates v. City of Torrance (1974) 37 Cal. App.3d 830, 834 [112 Cal. Rptr. 761].)
(3) Although petitioner did not pursue the hearing process offered by the department, we find that his case falls within the last-mentioned exception. Section 2934 provides that the Director of Corrections will determine if a waiver will be accepted and when it will be effective. Pursuant to this provision, the director determined that no 2933 credit would be applied to work done before January 1, 1983.
There is no flexibility in this rule, and so it would be futile for petitioner to go through the normal appeals procedure. Besides, when one of petitioner's fellow inmates appealed the same issue up to the director's level, the director responded by letter, stating: "The issues raised by your appeal are ones involving legal matter rather than policy matter. For this reason they cannot be resolved through the administrative process."
It is clear that the director's determination that section 2934 would not be applied retroactively from the date it went into effect foreclosed any viable *912 administrative remedy available to petitioner. He is not required to pursue a futile remedy.

II

APPLICATION OF THE NEW LEGISLATION
(4a) Petitioner contends, in the director's fixing the effective date of the section 2934 waiver at no earlier than January 1, 1983, that he has acted in an arbitrary and capricious manner and has denied petitioner and others in his position equal protection of the laws. Petitioner points out that the entire sentence of a prisoner who began serving time on January 1, 1983, or thereafter, may be reduced by one-half, while prisoners in the 2934 group who began serving their sentence before that date may only earn one-half reductions for the remainder of their sentence still to be served after January 1, 1983.
Petitioner argues that such a pattern of credits constitutes a denial of equal protection because a prisoner who committed the same crime on the same date, but who did not, through some serendipitous circumstance, begin serving his or her sentence till January 1, 1983, might end up serving a shorter sentence. At first glance this argument is beguiling because it appeals to a sense of "fairness." However, a closer examination reveals that it misconstrues the fundamental purpose of the equal protection clause; thus, the argument is without merit as well as specious.
(5) "The constitutional guaranty of equal protection of the laws has been judicially defined to mean that no person or class of persons shall be denied the same protection of the laws which is enjoyed by other persons or other classes in like circumstances in their lives, liberty and property and in their pursuit of happiness. [Citations.] The concept recognizes that persons similarly situated with respect to the legitimate purpose of the law receive like treatment, but it does not, however, require absolute equality. [Citations.] Accordingly, a state may provide for differences as long as the result does not amount to invidious discrimination. [Citations.]" (People v. Romo (1975) 14 Cal.3d 189, 196 [121 Cal. Rptr. 111, 534 P.2d 1015].)
As a threshold requirement, it must first be demonstrated that persons are similarly situated with respect to the legitimate purpose of a given law before one can logically proceed with an equal protection analysis. (4b) Here, petitioner argues that he is similarly situated to all persons who committed the same crimes as he did on the same date, and, inasmuch as some of them might end up serving a shorter sentence than he did, he is entitled to complain on equal protection grounds. This argument conveniently ignores *913 the part of the standard, however, which requires that persons be similarly situated with respect to the purpose of the law.
We are not persuaded, as petitioner contends, that the purpose of section 2933 was to enable all persons who committed voluntary manslaughter within a certain period of time be afforded the opportunity to reduce their sentences by one-half. The obvious purpose of the new section is to affect the behavior of inmates by providing them with incentives to engage in productive work and maintain good conduct while they are in prison. Under the new statutory scheme, a prisoner will no longer receive credit only for good behavior; he must work. The opportunity to opt under section 2931 is not open to anyone whose crime was committed on or after January 1, 1983. In any event, under the new section, the full six-month credit reduction will be awarded only after an inmate has worked six months in a qualifying program.
It is fair to observe that this incentive purpose has no meaning if an inmate is unaware of it. The very concept demands prospective application. "Reason dictates that it is impossible to influence behavior after it has occurred." (In re Stinnette (1979) 94 Cal. App.3d 800, 806 [155 Cal. Rptr. 912].)
Thus, inmates were only similarly situated with respect to the purpose of section 2933 on January 1, 1983, when they were all aware that it was in effect and could choose to modify their behavior accordingly. As of that date, the law applied to petitioner in exactly the same manner it applied to all the other prisoners. This is demonstrated by the fact that petitioner's release date was advanced by more than three months sooner under section 2933 than it would have been under section 2931. How he passed his time in prison before section 2933 became effective is not relevant to its application.
If, by its terms, section 2933 credit could only be earned by inmates incarcerated on or after January 1, 1983, petitioner would have a good reason to be aggrieved. As it is, however, under the facts here no basis for an equal protection argument has been presented. (6) In other words, an equal protection argument is applicable only when the challenged law or its application operates disparately among persons similarly situated. "[E]qual protection of the laws is a pledge to the protection of equal laws." (In re Kotta (1921) 187 Cal. 27, 31 [200 P. 957], citing Yick Wo v. Hopkins (1886) 118 U.S. 356, 369 [30 L.Ed. 220, 226, 6 S.Ct. 1064].) And a law that confers equal rights on all persons similarly situated with respect to such law, or subjects them to equal burdens, is an equal law. (See Sutter Basin Corp. v. Brown (1953) 40 Cal.2d 235, 247 [253 P.2d 649].) (7) The equal protection clause creates no new legal rights. It merely operates *914 on legal rights as it finds them established, and declares that, such as they are in each state, they shall be enjoyed by all persons alike according to the respective condition of each. (See People v. Hickman (1928) 204 Cal. 470, 480 [268 P. 909, 270 P. 1117].)
Petitioner cites numerous cases involving application of credit statutes which were subjected to an equal protection analysis. He argues that they hold, because "liberty" is a fundamental interest, that a strict scrutiny standard must be applied when analyzing application of sections 2933 and 2934. However, before the question of what standard is applicable can be reached, he must demonstrate that the law applies differently to persons in like circumstances. This he has not done.
The only case with a similar fact pattern cited by the parties is In re Stinnette (1979) 94 Cal. App.3d 800 [155 Cal. Rptr. 912]. Stinnette involved a challenge to the Determinate Sentencing Act (DSA) which became operative on July 1, 1977. That act contained provisions under which prisoners could receive credits for good behavior or participation in certain programs, and involved the same section Strick was qualified under before enactment of the new penal code sections. Credit was available for prisoners who were sentenced before the DSA went into effect only to reduce the remainder of their sentences after July 1, 1977. Stinnette, who had been incarcerated before July 1, 1977, claimed that he was denied equal protection because the entire sentence of a prisoner who began serving time on or after July 1, 1977, could be reduced by one-third, while prisoners who began serving their sentence before that date could only earn one-third reduction for that portion of their sentences remaining to be served after July 1, 1977. The Court of Appeal in that case reached the same decision that we do now. Although the court in Stinnette used an equal protection analysis based on a rational basis standard to reach its result, we do not think that such analysis is necessary or proper.

DISPOSITION
The petition for writ of habeas corpus is denied.
Morris, P.J., and Kaufman, J., concurred.
On December 5, 1983, the opinion was modified to read as printed above. Petitioner's application for a hearing by the Supreme Court was denied February 2, 1984.
NOTES
[1]  Apparently, petitioner was released October 21. However, this does not render this issue moot, because any credit he should have been given can be applied against his parole period.
