  In this paper, we investigate several extremal combinatorics problems that
ask for the maximum number of copies of a fixed subgraph given the number of
edges. We call problems of this type Kruskal--Katona-type problems. Most of the
problems that will be discussed in this paper are related to the joints
problem. There are two main results in this paper. First, we prove that, in a
$3$-edge-colored graph with $R$ red, $G$ green, $B$ blue edges, the number of
rainbow triangles is at most $\sqrt{2RGB}$, which is sharp. Second, we give a
generalization of the Kruskal--Katona theorem that implies many other previous
generalizations. Both arguments use the entropy method, and the main innovation
lies in a more clever argument that improves bounds given by Shearer's
inequality.
