I would like to define the letter \mathbb{E} as a summation symbol for averaged sum.
I've tried the following.
\newcommand{\E}{\mathbb{E}}
$$\E_{x\in X} f(x) = \frac{1}{|X|} \sum_{x\in X}f(x)$$
The problem with this is, that the symbol \mathbb{E} and \sum are not the same size. So then I tried these options (the code isn't pretty, I know that).
\newcommand{\E}{\mathbb{E}}
$$\underset{x \in X}{\scalebox{1.5}{$\E$}} f(x) = \frac{1}{|X|} \sum_{x \in X} f(x).$$
$$\mathop{\scalebox{1.5}{$\E$}}{x \in X} f(x) = \frac{1}{|X|} \sum{x\in X}f(x).$$
$$\scalebox{1.5}{$\E$}{x\in X} f(x) = \frac{1}{|X|} \sum{x\in X}f(x)$$
While here \mathbb{E} is larger, it is not aligned with summation symbol (at the bottom). Also f(x) is not in the middle of E, as is in for summation symbol.
I also tried the following.
\DeclareMathOperator*{\E}{E}
This would be a nice option but it does not accept mathfonts.
Any help would be appriciated, as I am struggling with this for some while now. These are just easy examples, I use average sum a lot in my thesis so I would like to have a nice looking symbol.



$$...$$for disaplyed math as explained here. – KersouMan Jun 30 '23 at 08:05\Bbbsum). You can use that as well if you desire. – Apoorv Potnis Jun 30 '23 at 09:52