Standard deviation of a dichotomous variable Suppose, I have a dichotomous variable - gender:
Male coded as 0 Female coded as 1
Frequency of male - 30 Frequency of female - 20
The mean of a dichotomous variable is just the proportion which has been coded as 1. So, in this case, I believe it is 30/50.
The confusing part is while solving for standard deviation. How can I do that? Also, is the answer a meaningful one?
 A: If you code males as 0 and females as 1, the mean will be $\frac{20}{50}$, not $\frac{30}{50}$.
For the SD, just use the standard formula with your coding, $x_i\in\{0,1\}$ and the mean $\frac{20}{50}$ you calculated above.
No, I don't think this answer is meaningful. In reporting the mean and SD, we summarize a distribution in two numbers. If we have a binary distribution, we have a much easier and more intuitive way of summarizing it in two numbers: just report the numbers of males and females.
A: In this instance, using either the mean or the standard deviation would not be appropriate/meaningful. Both of these measures typically assume a 'normally distributed' variable (as in a bell curve shape). The mean tells you 'central tendency' - where the highest point on that curve is. The SD tells you the typical amount of deviation or spread around that mean. What both these numbers are assuming is that you have a scale variable. From the mean and SD, you can say what percentage of people are included within a particular deviation from the mean, and that gives valuable information about the distribution of your variable, which can also help with comparisons between groups.
In the case of a dichotomous variable, none of these assumptions hold. I believe you should simply just report the ratio of males to females to give an indication of what is going on in your sample. You could also (though it would be obvious if you report the ratio) note for example, 'therefore, most participants are male'.
If you want to use means and SDs to make comparisons between groups in how a dichotomous variables is split across different conditions, you should consider instead using something such as the chi square test of independence.
