The median voter theorem asserts that in a voting system where the majority determines the winner, then the outcome is determined by the median voter. The main assumption underlying the theorem is that voters put the candidates in a one-dimensional spectrum and that there are two main parties in the election. The United States has the Republican and Democratic Party as the two main political parties in competition; hence the median voter theorem is applicable in this case. Using this strategy, a candidate tries to identify the median voter in their area and appeal to them so that they can get the maximum number of votes and consequently win.
When moving from a primary to a general election, candidates can sometimes change their position as they try to appeal to more voters. The reason for this is that the general election has more voters from diverse backgrounds and with different beliefs. In a primary election, it is easier to determine if the median voter is liberal or conservative, although people usually have varied opinions depending on the issue at hand. However, at the general election level, they have to appeal to more people hence they can change their position or express it differently. Bernie Sanders was one of the presidential candidates in the 2016 election. Most of his policies resonate with the median voter; hence I would say that he followed the median voter. Bernie behaved both ethically and strategically. The middle class makes up the majority of voters and by appealing to them, he appealed to the median voter. Ethically, he addressed many of the issues facing the majority of voters which he has always championed for since his early years.