Exploring an Inequality
Introduction
I have attempted to give a mathematical proof of the following inequality,
$$ \frac{a}{1+b}+\frac{b}{1+c}+\frac{c}{1+d}+\frac{d}{1+a}\le 2, $$
where $a,\ b,\ c$ and $d$ are all in the range $[0,\ 1]$, but no success. So in this note I explore the above inequality using the power of computation.Exploring
Define function
$$ f(a,\ b,\ c,\ d) = \frac{a}{1+b}+\frac{b}{1+c}+\frac{c}{1+d}+\frac{d}{1+a}, $$
where $a,\ b,\ c$ and $d$ are all in the range $[0,\ 1]$.Method 1
Calculate values of the above function for some given values of $a$, $b$, $c$ and $d$, and then give a summary.
R code:
library(dplyr)
f <- function(a, b, c, d)
{a/(1+b) + b/(1+c) + c/(1+d) + d/(1+a)
}
n <- 10
df <-
expand.grid(a = seq(0, 1, length.out = n),
b = seq(0, 1, length.out = n),
c = seq(0, 1, length.out = n),
d = seq(0, 1, length.out = n)) %>%
mutate(the_f_value = f(a, b, c, d))
(summary(df$the_f_value))
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 0.000 1.212 1.442 1.399 1.632 2.000
NB: To save running time, I set $n=10$; in practice $n$ should be large, say $n=100$.
Method 2
Use base::optim
to find the maximum of the function $f(\cdot)$.
g <- function(x)
{x[1]/(1 + x[2]) + x[2]/(1 + x[3]) + x[3]/(1 + x[4]) + x[4]/(1 + x[1])
}
(re <- optim(par = c(0, 0, 0, 0), fn = g, method = "L-BFGS-B",
lower = rep(0, 4), upper = rep(1, 4),
control = list(fnscale = -1)))
## $par
## [1] 1 1 1 1
##
## $value
## [1] 2
##
## $counts
## function gradient
## 2 2
##
## $convergence
## [1] 0
##
## $message
## [1] "CONVERGENCE: NORM OF PROJECTED GRADIENT <= PGTOL"
NB:
- To use
base::optim
, we must define $f$ in the way likeg
in the above. - In the
par
, we set an initial value. control = list(fnscale = -1)
is used because we want to find the maximum rather than the minimum.