In humans, sex is determined at fertilization. The embryo receives either an X or a Y chromosome. Many other organisms have their sex determined in a manner similar to this as well. The case with plants is not so rigid. Many plants produce both male and female parts on the same flower, others have flowers that are either male or female, while some can change their sex throughout their lifetime. The latter is quite interesting and offers an insight into the differences in maleness and femaleness.
The green dragon (Arisaema dracontium) is an arum related to jack-in-the-pulpit. It is wide spread throughout the east but declining in much of its northern range. This species produces a single inflorescence that can be purely male, both male and female, or, in some rare cases, entirely female. The mechanism for this has been a subject of interest for many botanists as it does not seem to be dictated solely by genetics. It has been discovered that any given plant may switch up its flowering strategy from year to year.
What researchers have found is that male flowers are most often produced in younger plants as well as plants that are stressed. In years where environmental conditions are not as conducive to survival or if the plants have not had enough time to build up energy reserves, it is not uncommon to find only male plants. This is advantageous since male flowers and pollen are a lot less costly to produce than ovaries. Also, the plant does not have to allocate resources into developing seeds. In good years and also in older, larger plants, inflorescence are produced that are both male and female. If the plants are less stressed and large enough, more energy can be allocated to seed production. In some rare cases, very large plants have been known to produce only female flowers. This seems to be a strategy that is adopted only under the best of conditions.
It should be noted that whereas there seems to be a threshold for environmental conditions as well as plant size in determining what kinds of flowers will be produced, each green dragon population seems to vary. In essence there is some genetic determination for how the plant will respond in any given year but this is where teasing the gene environment out of the actual environment gets tricky. Studying these plants is giving us more insight into the advantages and disadvantages of each sex as well as helping to inform how sensitive species like the green dragon will respond in a changing climate.
Further Reading:
http://plants.usda.gov/core/profile?symbol=ardr3
http://www.jstor.org/stable/2656980
http://www.jstor.org/stable/2445597?seq=1