I am looking for mathematical notation (not computer code) for the following simple scenario:
I have three numbers: 6, 7 and 2. I wish to find the weighted median where the weights are say, 20, 10, 30, respectively.
In R, I would calculate this using something along the lines of:
median( c(rep(6,20), rep(7,10), rep(2,30) )
However, I am seeking a mathematical depiction of this without writing out 6, 20 times; 7, 10 times, etc.
I don't know that there is a single notation for this, but what you want is the median of a list where there are repeated data based on weight. You may have to define a notation or describe this instead of writing it as a single expression, e.g., the median is given by $$ \widetilde{\mathbf{x}} $$ where $\mathbf{x}$ is the list $$ \mathbf{x} = \{\{a\}_{w_1}, \{b\}_{w_2}, \{c\}_{w_3} \} $$ for weights $w_1$, $w_2$, etc., where each weight is the cardinality of a repeated list, .i.e., $$ | \{ a,a,a,... \}_{w_k} | = w_k $$