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.