# Counting a bipartite graph in two ways

I've got a bipartite graph where the left side corresponds to points $X = \{x_1,\ldots,x_n\}$ and the right side corresponds to subsets $\mathcal F = \{A_1,\ldots,A_m\}$ of $X$. There's an edge between the left and right side if a point is a member of a subset. $d(x)$ is the out-degree of a vertex on the left side of the graph, and indicates the number of members of $\mathcal F$ that contain $x$.

While it's easy to count the bipartite graph in two ways and show:

$$\sum_{A\in \mathcal F}^m\big| A \big| = \sum_{x\in X}d(x)$$

I'm trying to show that:

$$\sum_{i,j=1}^m\big| A_i\cap A_j \big| = \sum_{x\in X}d(x)^2$$

This seems intuitive, but where do I start to get a more rigorous proof?

-

## 2 Answers

For the first equation (and title), you're not double counting a graph. You are counting, in two different ways, the number of pairs $(x,A)$ with $x\in X$ and $A\in\mathcal P$ satisfying $x\in A$.

For the second equation, count in two different ways the number of triples $(x,A,B)$ with $x\in X$ and $A,B\in\mathcal P$ satisfying $x\in A\cap B$.

-
i thought "double counting" and "counting in two ways" referred to the same technique -- would it be better to update the title and question with "count in two ways"? – aaronstacy Jan 29 at 15:02

1
"Double counting" means "counting in two ways". But "double counting graphs" does not mean "double counting pairs $(x,A)$ with $x\in A$". – Colin McQuillan Jan 29 at 15:43
ah, i see. i'll update the question's wording. – aaronstacy Jan 29 at 17:27

We can view double counting as counting pairs $(x_i,A_j)$ where $x_i\in A_j$. For your proposed extension, I'd count triples $(x_i,A_j,A_k)$ where $x_i\in A_k$ and $x_i\in A_k$.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 21, "mathjax_display_tex": 2, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9262731671333313, "perplexity_flag": "head"}