
4 Cal.3d 932 (1971)
485 P.2d 261
95 Cal. Rptr. 197
JOHN F. KEANE, Plaintiff and Respondent,
v.
GORDONI. SMITH, Defendant and Appellant.
Docket No. Sac. 7889.
Supreme Court of California. In Bank.
May 25, 1971.
*934 COUNSEL
White, Harber, Fort & Schei and Lawrence A. Schei for Defendant and Appellant.
Alan H. Thieler, McDonough, Holland, Schwartz, Allen & Wahrhaftig and Joseph E. Coomes, Jr., for Plaintiff and Respondent.
OPINION
THE COURT.
In this election contest involving the office of Judge of the Superior Court in and for the County of Sierra, defendant Gordon I. Smith appeals from a judgment declaring that at the primary election held on June 2, 1970, he and plaintiff John F. Keane each received 621 votes for such office and ordering that (1) the declaration of election made in favor of, and the certificate of election issued to defendant, be annulled and (2) the names of plaintiff and defendant appear as candidates for such judicial office on the November 1970 general election ballot. As we explain infra, we have concluded that the trial court correctly determined the election contest. We affirm the judgment.
Plaintiff Keane, the incumbent judge, and defendant Smith, the incumbent district attorney-public administrator, were the only candidates for the office of superior court judge in Sierra County listed on the ballot in the primary election held in that county on June 2, 1970. The office of district attorney and public administrator, vacated by Smith, was also to be filled at the same primary, but there were no declared candidates and no names were listed on the ballot for that office.
The official canvass of all precincts in the county pursuant to section 18460 et seq. of the Elections Code[1] and of all the absentee ballots pursuant to section 18200 et seq. resulted in a tabulation of 632 votes for defendant Smith and 618 votes for plaintiff Keane. The latter filed the instant contest pursuant to section 20000 et seq. and the votes were recounted. The trial *935 court announced the official results of the recount as 630 votes for Smith and 622 votes for Keane; however, it reserved its final decision as to 10 of the votes included in that tally until the parties had time to brief the issues presented. Of the 10 challenged votes, 9 were for Smith and 1 was for Keane.
After considering the arguments raised by the parties, the trial court concluded that all 10 votes were improperly counted. It found that the one vote for Keane should not have been counted because it "was not marked by the rubber stamp required by Section 14415 of the Elections Code...." Each of the other nine challenged ballots, originally counted for Smith, contained an "X" opposite his name, printed on the ballot as a candidate for judge. In addition, on each of these ballots, the voter had written in Smith's name as a candidate for district attorney-public administrator. Finding that by reason of these acts, as to each of the nine ballots, it was impossible to determine the voter's choice for the office of superior court judge, the trial court concluded that the nine ballots could not properly be counted for Smith. (§ 17072, subd. (c).[2]) It, therefore, declared that each candidate had received a total of 621 votes, that neither had been elected, and that both should stand for election in November.
Both parties appealed. However, the parties stipulated in writing that the appeals should not stay the court's order placing their names as candidates for the office on the ballot for the November 1970 general election without waiver of any of their rights. At the general election Keane received a substantial majority of the votes, and thereafter dismissed his appeal without prejudice. Thus, we are concerned solely with the appeal of defendant Smith, who contends that the nine votes for him which the trial court rejected were properly cast and should have been counted.
We must first consider Keane's contention that the judgment is not appealable. Under the provisions of the Elections Code, any judgment in an election contest is appealable, except one in a primary election contest involving a simple recount. (§ 20374.)[3] Thus, the instant appeal is properly before us unless it is shown that for the purposes of this appeal (a) the June election was a primary election, and (b) the election contest involved only a simple recount. Keane has not demonstrated either of these propositions.
We first consider whether Smith has appealed a primary election contest. *936 In Immel v. Langley (1959) 52 Cal.2d 104 [338 P.2d 385] we held that section 2 3/4 of article II of the California Constitution[4] "is self-executing, and its effect, when applicable, is to transmute the primary election into a general election as to the nonpartisan offices to which it relates. [Citations.] In order for a primary election to have the effect of a general election, however, the constitutional provision quoted above requires that a candidate for a nonpartisan office shall receive votes on a majority of all the ballots cast, and where, as here, there is a tie vote, the section does not operate to change the primary election into a general election." (Id. at p. 106.) We also held that since the trial court found a tie vote, it should have ordered that the names of both candidates be listed on the ballot at the general election.
The determination in the instant case as to whether or not the June primary election was "transmuted" into a general election is complicated by the fact that there were two tabulations of the vote at the primary. The first count, the official canvass, revealed that one candidate (Smith) had a majority of the votes. The recount before the court showed a tie vote. Consequently, the character of the election  whether primary or final  depends upon which count is seen as controlling.
Faced with a similar factual situation, we held in Immel that the results of the official canvass are determinative. Thus, we stated: "This proceeding was properly brought under section 8511 of the Elections Code [now § 20021],[[5]] which enumerates the grounds for the contest of a general election, since it then appeared from the canvass of votes that Langley had been elected at the primary. The character of the suit did not change when the recount showed that neither of the candidates had received a majority vote, and the contestors were entitled to appeal under section 8575 of the Elections Code [now § 20115],[[6]] which provides that a party aggrieved in a contest based on section 8511 may appeal from the judgment." (Italics added.) (52 Cal.2d at p. 107.)
*937 (1) Applying this reasoning to the present case, we conclude that since the official canvass indicated that Smith had received a majority of the votes cast, for purposes of appeal the primary election was "transmuted" into a general election as to the office of superior court judge and the contest should be treated as a contest of a general election. We hold that the judgment is appealable under section 20115.
In addition, we observe that even were we to assume arguendo that the election remained for all purposes a primary election, the judgment would still be appealable. As we stated above, only judgments in simple recount contests are not appealable (§ 20374; see fn. 3, ante); under section 20339 judgments in all other primary elections are subject to review. Upon the above assumption, we think it is clear that the contest before us involves more than a simple recount. Section 20360[7] defines simple recount contests as "contests on the ground that due to mistake, error, or misconduct the votes in any precinct were so incorrectly counted as to change the result." By contrast, other primary election contests are defined by section 20330, subdivision (c), to include contests based on the ground that "[a] sufficient number of votes were illegal, fraudulent, forged, or otherwise improper, and that had such votes not been counted the defendant would not have received as many votes as the contestant."[8]
*938 The central issue in this case is not the accuracy of the recount as a matter of mathematics; rather the question is whether it is impossible to determine from the nine challenged ballots those voters' choice for judge. (§ 17072, subd. (c).) The resolution of this problem requires more than the mechanical act of tabulating votes; it involves the determination of questions of law. Where the issue is merely one of counting ballots, an appeal serves little purpose beyond having yet another body operate the adding machine. However, where, as here, substantial questions of law are raised, an appeal is appropriate. For these reasons we conclude that, even assuming the election is a primary election, the instant case falls within section 20330, subdivision (c), as a contest involving other than a simple recount. As such, the case would be appealable under section 20339.
By allowing this appeal, we are not, as plaintiff asserts, disfranchising the voters of Sierra County. In the first place, we note that the voters have expressed their views on two separate occasions. Whether or not we allow the appeal, we run the risk of disregarding their will as expressed at one of the two elections.
Furthermore, as we have already said, the November election for the office of superior court judge proceeded as the result of a stipulation between the parties in this case. (2) The stipulation clearly reveals the parties' intention to appeal and their agreement that the November election would have no effect except if the judgment were upheld on appeal. Having entered into such a stipulation, plaintiff cannot be heard to argue that the November election mooted the appeal.
Finally, to contend that the November election is the final expression of the voters' will is to assume the very question in this case. Unless the trial court was correct in holding that the June election resulted in a tie vote, that election is the final election. (Cal. Const., art. II, § 2 3/4; Immel v. Langley, supra, 52 Cal.2d 104, 106.)[9]
*939 Proceeding to the merits, we must at the outset determine the scope of our review. More specifically, we must decide whether, on the record presented to us, we should adhere to the usual substantial evidence rule or are called upon to make an independent review of the record. In this case, the ballots themselves were the only evidence before the trial court; no extrinsic evidence of any kind was presented by either of the parties, either to show the intent of the voters or to aid in the interpretation of their ballots. The trial court, confining its examination to the face of the nine challenged ballots for Smith, ruled that it was impossible to ascertain the intent of the voters.
(3) We think that the interpretation of ballots should be governed by the same rules applied to the construction of all other written instruments. Summarizing those rules in Parsons v. Bristol Development Co. (1965) 62 Cal.2d 861, 865-866 [44 Cal. Rptr. 767, 402 P.2d 839], we said that it is "solely a judicial function to interpret a written instrument unless the interpretation turns upon the credibility of extrinsic evidence. Accordingly, `An appellate court is not bound by a construction of the contract based solely upon the terms of the written instrument without the aid of evidence [citations], where there is no conflict in the evidence [citations], or a determination has been made upon incompetent evidence [citation].' (Estate of Platt, 21 Cal.2d 343, 352 [131 P.2d 825].)" (Id. at p. 865.) Where no contradictory extrinsic evidence has been introduced, the appellate court has before it all the evidence presented to the trial court. There is no reason to defer to the trial judge where events at trial and demeanor of the witnesses play no part in the decision.
Keane asserts that the rule announced in Parsons should not apply to the interpretation of ballots and cites as authority Garrison v. Rourke (1948) 32 Cal.2d 430, 439 [196 P.2d 884], which in turn rests upon People v. Town of Sausalito (1895) 106 Cal. 500 [39 P. 937]. While these decisions contain language which would appear to support plaintiff's argument, they do not give the point extended consideration. In Patterson v. Hanley (1902) 136 Cal. 265, 271 [68 P. 821, 975], where the problem was more fully treated, the court reached a result consistent with Parsons. We think Patterson adopts the preferable rule. Accordingly, to the extent that Garrison and Town of Sausalito are inconsistent with Parsons, they are overruled. We conclude that where no conflicting extrinsic evidence has been introduced at the trial, an appellate court must independently interpret ballots or other written instruments on the basis of the uncontradicted evidence in the record.
As we have previously noted (see fn. 2, ante) section 17072, subdivision (c), directs that "if for any reason it is impossible to determine [a voter's] *940 choice for any office, his ballot shall not be counted for that office...." Our task then is to determine from the record before us whether it is possible to ascertain the intention of the nine voters whose ballots have been challenged.
An examination of each of the nine ballots discloses the following. In the box under the heading "Judge of the Superior Court" (which is in turn under the caption "Judicial") are listed the printed names of John F. Keane and Gordon I. Smith in that order, and in each instance an "X" appears opposite Smith's name. Further down the same column of the ballot, in the box under the heading "District Attorney, Public Administrator" (which is in turn under the caption "County") the name Gordon I. Smith has been written in the single available space (there being no printed names of any candidate) and, except in one instance,[10] an "X" appears opposite Smith's name.[11] We attach hereto as an appendix a reproduction of one of the nine ballots.
By thus marking his ballot, the voter might have intended to vote for Smith for both offices. If such were his intent, the ballot must be disregarded since it is clear that Smith could not hold both offices at once. (Cal. Const., art. III.) Alternatively, the voter might have intended to vote for Smith for only one of the two offices and have merely marked his name twice by mistake. It is also possible that the voter intended that Smith be elected to one of the offices, but that if Smith failed to obtain a majority vote for the favored office, he should be elected to the other. Finally, the voter may have intended that Smith be elected to either of the two offices Smith chose to fill. Since there is nothing to indicate which of these several intentions the voter actually entertained, we find that it is impossible to ascertain the voter's choice.[12]
*941 Nor can we say with assurance that whatever the voter's intention, he certainly chose Smith over Keane for the office of superior court judge. The voter may have intended to vote for Smith only for district attorney-public administrator. On the ballot, the square provided for votes for the latter office followed the boxes for votes for the judgeship. The voter may, at first, have voted for Smith for judge. Then, upon finding no candidate for district attorney-public administrator, the voter may have changed his mind, voted for Smith for that office and neglected to correct his earlier vote for superior court judge.[13]
Defendant contends that in determining, pursuant to section 17072, subdivision (c), whether it is impossible to ascertain the voter's choice, votes for each office should be considered separately. Thus, it is argued that in our examination of the nine ballots we should consider only the votes marked for the office of the superior court judge and ignore entirely the write-in votes for the office of district attorney-public administrator. In support of this contention, defendant cites Rutledge v. Crawford (1891) 91 Cal. 526, 531-532 [27 P. 779]. We reject this contention as lacking in merit.
(4) While our sole concern in the case at bench, is to ascertain the voter's choice for judge, in making that determination, we must consider all the relevant evidence. Since, as we have shown above, the write-in votes for Smith for district attorney-public administrator cast doubt upon the voter's choice for judge, the write-in votes are obviously relevant to our inquiry and must be taken into account.[14]
*942 Rutledge v. Crawford, supra, 91 Cal. 526, provides no assistance to defendant. There the parties were opposing candidates for superior court judge. On the ballot in question (which then consisted of a printed party ticket) the names of Rutledge, Oates (another candidate for superior court judge) and Howe, a candidate for state senator, appeared on successive lines. On the challenged ballot the voter erased the name of Howe printed on the line for state senator and wrote in Crawford's name either opposite it or in line with it. This court held that the ticket could not be read as a vote for Crawford for judge saying: "Voting for a person to fill an office for which he is not a candidate may be the result of mistake, or it may be merely the frivolous exercise of the right of suffrage; but no matter whether such action be attributed to folly or mistake, the ballot is the only expression of the voter's will, and it must be counted according to its legal effect. The intention of the voter, as it appears upon the face of this ballot, was to vote for [Crawford] for state senator, and not for judge of the superior court, and it should be so counted." (Rutledge v. Crawford, supra, 91 Cal. at p. 532.)
Since the court in Rutledge was not concerned with a ballot which showed votes for the same candidate for two inconsistent offices, that case is of no assistance here.
Nor are we persuaded by Misch v. Russell (1891) 136 Ill. 22, 30-32 [26 N.E. 528] which defendant also cites. There, 10 ballots contained votes for Misch for president of the school board and also for school board member. Finding "no rule of law which prohibits a man's becoming a candidate or being voted for at the same election for two incompatible offices," the Illinois court saw "no reason why a particular voter, if he chooses so to do, may not vote for [a candidate] for both offices at the same time." (Id. at p. 31.) The court therefore held that the voters had chosen Misch for both offices and that their votes should have been counted in his favor for president of the school board.
The reasoning of Misch is inapplicable to the present case because of the fundamentally different election law which prevails in this state. (5) Under section 6491 a candidate is required to declare that he will accept nomination, not withdraw, and if nominated, qualify for any office for which he is a candidate. Obviously, a candidate could not file such a declaration for two incompatible offices. Thus, in California one is effectively prohibited from being a candidate for two incompatible offices at the same election. Since the conclusion of the Misch court was based upon a contrary rule in Illinois, it is inapposite to the present case. Furthermore, for the reasons stated above, we find unconvincing the *943 Illinois court's conclusion that the voters intended that the candidate be elected to both offices.
(6) We, therefore, conclude, as indeed we think the trial court properly concluded, that, upon an examination of each of the nine challenged ballots, it is impossible to determine the respective voter's choice for the office of superior court judge of Sierra County. We find that the trial court correctly refused to count these votes for Smith.
When the nine challenged votes are disregarded each candidate received 621 votes. Since neither candidate received a majority, the election retained its character as a primary election (Cal. Const., art. II, § 2 3/4; Immel v. Langley, supra, 52 Cal.2d 104) and judgment was appropriately entered directing that both candidates' names appear on the ballot at the November election.
The judgment is affirmed.
Appellant's petition for a rehearing was denied June 23, 1971, and the opinion was modified to read as printed above.
*944 
NOTES
[1]  Hereafter, unless otherwise indicated, all section references are to the Elections Code.
[2]  Section 17072 provides in relevant part: "if for any reason it is impossible to determine his choice for any office, his ballot shall not be counted for that office, but the rest of his ballot, if properly marked, shall be counted."
[3]  Section 20374 found in article 3 of division 11 which article is entitled "Procedure on Contests Involving a Simple Recount" provides: "The judgment of the court is final in every respect. No party may appeal."
[4]  Article II, section 2 3/4 provides in relevant part: "Any candidate for a judicial school, county, township, or other nonpartisan office who at a primary election shall receive votes on a majority of all the ballots cast for candidates for the office for which such candidate seeks nomination, shall be elected to such office."
[5]  Section 20021 found in chapter 2 of division 11 which chapter covers "Contests at General Elections" provides in relevant part: "Any elector of a county, city, or of any political subdivision of either may contest any election held therein, for any of the following causes: ... (e) That the precinct board in conducting the election or in canvassing the returns, made errors sufficient to change the result of the election as to any person who has been declared elected."
[6]  Section 20115, also found in chapter 2 dealing with contests at general elections provides in relevant part: "Any party aggrieved by the judgment of the court may appeal therefrom to the court of appeal, as in other cases of appeal thereto from the superior court."
[7]  As previously noted chapter 2 of division 11 deals with contests of general elections. Chapter 3 deals with contests of primary elections. Section 20360 is found in article 3 of chapter 3 which article is entitled "Procedure on Contests Involving a Simple Recount."
[8]  Keane contends that the legislative history of sections 20360 (contests involving a simple recount) and 20330, subdivision (c) (contests not involving a simple recount), shows that the instant case must be a simple recount contest under the former section. Section 20360 derives from language added in 1911 to section 28 of the Direct Primary Law. As enacted in 1909 (Stats. 1909, ch. 405, § 28), section 28 stated that a candidate could initiate a contest of a primary election by filing an affidavit. In the 1909 version, section 28 did not specify what facts the affidavit should allege.

This deficiency was remedied in 1911 by the addition of the following language: "Such affidavit must specify separately each precinct in which a recount is demanded, and the nature of the mistake, error, misconduct, or other cause why it is claimed that the returns from such precinct do not correctly state the vote...." (Stats. 1911, ch. 398, § 28.) The 1911 enactment also provided that no appeal would lie from a judgment in such a contest. (Id.) These features are retained under the present sections dealing with primary contests involving simple recounts.
Section 20330, on the other hand, is derived from section 28a of the Direct Primary Law which was added in 1933. (Stats. 1933, ch. 960.) This section allowed primary contests on the grounds that (1) the defendant was ineligible for nomination, (2) the defendant committed any offense against the elective franchise, or (3) "illegal, fraudulent, forged, or otherwise improper votes" were counted. Section 28a permitted appeals in contests brought within its provisions.
Keane contends that section 28a was enacted in response to our decision in Puccinelli v. Superior Court (1920) 183 Cal. 775 [192 P. 707], and consequently was never intended to cover contests such as the present one. In Puccinelli this court held that section 28 did not permit a contest on the basis of fraud and misconduct of election officials and on the basis of the reception of illegal votes.
While it may be conceded that section 28a was enacted, in part, in response to Puccinelli, its provisions are not limited solely to the situation involved in that case. It permits a contest where it is claimed that the defendant is ineligible or has committed crimes against the elective franchise. Similarly, we think that the term "improper votes" was intended to cover cases such as the present one. Since an appeal serves an important function in such cases, we would require a far clearer demonstration of legislative intent before we could conclude that no appeal would lie in such case.
[9]  Defendant contends that he would be denied equal protection of the laws if he were not permitted an appeal in this case. Since we have concluded that he is entitled to an appeal under appropriate sections of the Elections Code, we need not reach his constitutional argument.
[10]  Section 18600 provides that, unless prohibited by section 18603, a write-in vote shall be counted "whether or not a cross (+) is stamped or made with pen or pencil in the voting square after the name so written."
[11]  Smith, of course, could not have been elected district attorney at the June election, nor could write-in votes for him have been counted for that office, because he had not filed a write-in candidate's declaration pursuant to sections 18601 and 18602, nor paid the requisite fee under section 6555. (§ 18603.) However, there is no evidence to indicate that the voters knew this. Indeed, Smith had been elected district attorney by write-in votes on two prior occasions. The fact that the voters went to the extra effort of writing in his name tends to show that they thought he could again be elected to that office by write-in votes. In considering the intention of the voters, we must disregard facts which were not within their knowledge at the time they voted.
[12]  As the learned trial judge stated in his memorandum of intended decision: "Any attempt to analyze the nine ballots in question with a view to determining the choice of each voter leaves the Court in doubt as to what such choice was. Either the voter intended to vote for SMITH for Judge and for District Attorney or his intention was to vote for SMITH for Judge or for District Attorney. SMITH obviously could not have served as both Judge and District Attorney (Article III, California Constitution). If the voter's intention was to vote for SMITH either for Judge or for District Attorney, his intention as to either office obviously cannot be ascertained. There is something fundamentally inconsistent in the act by a voter of taking the time and effort necessary to write in the name of a person as a candidate for one office when he has already cast a vote for the same person for an entirely different office. Under such circumstances, one can only speculate as to what the voter's intention really is."
[13]  A voter may change his vote by returning his ballot to the ballot clerk as spoiled and obtaining another. (§ 14427; People v. Campbell (1902) 138 Cal. 11, 20-21 [70 P. 918].)
[14]  Defendant argues that the write-in votes are not identifying marks which would invalidate the entire ballot under section 17074. (Turner v. Wilson (1915) 171 Cal. 600 [154 P. 2]; Muir v. Steinberg (1961) 197 Cal. App.2d 264 [17 Cal. Rptr. 431].) He also contends that even though the write-in votes could not be counted in his favor for district attorney-public administrator (see fn. 11, ante) their invalidity does not infect the entire ballot. (Sweetser v. Pacheco (1916) 172 Cal. 137, 142 [155 P. 639]; Patterson v. Hanley, supra, 136 Cal. 265, 272; Day v. Dunning (1899) 127 Cal. 55, 57 [59 P. 196].) However, the critical issue here is not the invalidity of the votes for district attorney-public administrator but the possibility of ascertaining the intent of those voters who voted for the same person for both judge and district attorney.
