Discrete math question... Finding largest area Can anyone help explain to me how to go about solving this question ?:
Of all the rectangles with perimeter 4, prove that the square has the largest area.
I know how to solve this algebraically, although how would one go about solving it in context of discrete mathematics 
 A: Let $n \in \mathbb{N}$. Imagine a complete bipartite graph with a total of $2n$ vertices. Let $p + q = 2n$ be the number of vertices on left and right sides of the graph.
This graph has $p\cdot q$ vertices. Imagine a transformation, where you take one vertex from left side and move it to the right side, i.e. $p' = p-1$ and $q' = q+1$. Observe, that this operation removes $q$ edges (we take a vertex from the left) and adds $p-1$ edges (we add vertex to the right). Of course, it is also possible to calculate $(p-1)\cdot(q+1) - p\cdot q = p-q-1$. This tells us, that as long as $p > q+1$ we could transform the graph in to one with more edges.
Finally we arrive, that $p > q+1 \implies |E|<|E'|$ and by symmetry when $q > p+1 \implies |E|>|E'|$. Given that $p+q = 2n$ we conclude that $|E|$ is maximal for $p = q = n$.
I hope it is what you were asking for (put $n = 4$).   
A: Let $x,y$ be the sides of the rectangle and the perimeter be $2s$ 
So, $2(x+y)=2s$
Using algebra,
The area is $xy=x(s-x)=\frac{s^2}4-(x-\frac s2)^2$
As  $(x-\frac s2)^2\ge0,xy\le\frac{s^2}4$
So,the  maximum will be $\frac{s^2}4$ if $x-\frac s2=0\implies x=\frac s2\implies y=s-x=\frac s2=x$

Alternatively using calculus, the ares is $A=xy=x(s-x)=sx-x^2$
So, $\frac{dA}{dx}=s-2x$
For the extreme values of $A,\frac{dA}{dx}=0\implies x=\frac s2$
$\frac{d^2A}{dx^2}=-2<0$
So, $x=\frac s2$ will give us the maximum value of the area $A$.
A: Note that $xy = \frac{1}{4}((x+y)^2-(x-y)^2)$, and since $x+y=2$, we have $xy = 1-\frac{1}{4}(x-y)^2$. Hence $xy \leq 1$, and $x=1, y=1$ results in $xy = 1$. Hence the square has the largest area (and any other lengths have $xy < 1$).
