Sufficient conditions for $ \frac{\sum_{k=1}^N {p_k}G(x+e_k)}{G(x)} $ increases/decreases where $\sum_{k=1}^N p_k e_k = 0 $ and $\sum_{k=1}^N p_k = 1$

Suppose that $ 0 \leq G(x) \leq 1$ , $ G'(x)<0$ , $ G $ is smooth enough and $ x \in \mathbb{R}$ .

I want to find some neat sufficient conditions for $ H(x) = \frac{\sum_{k=1}^N {p_k}G(x+e_k)}{G(x)} $ is increasing (decreasing) in $ x$ , where $ \sum_{k=1}^N p_k e_k = 0$ and $ \sum_{k=1}^N p_k = 1$ , $ \forall N \in \mathbb N $ , for all posible combinations of $ p_k >0$ and $ e_k$ .

An obvious sufficient condition for $ H(x)$ to be increasing is $ G”'(x)>0$ . However, the symmetric version ($ G”'(x)<0$ ) does not guarantee a decreasing $ H(x)$ .

(1) Are there any sufficient conditions that are “symmetric” for increasing $ H(x)$ and decreasing $ H(x)$ ?

(2) Are there tighter sufficient conditions, or sufficient and necessary conditions?

Sum a finite, discrete exponential series $\sum_{k=1}^{n} b^{k}$

How can I sum a discrete exponential series to a known finite exponent?

I need to write a computer program with a function to compute this sum: $ $ \sum_{k=1}^{n} b^{k} $ $

The function will already have known values for $ b$ and $ n$ . It knows $ n$ is always an integer >= 1. The function needs to compute the sum of discrete values $ b^k$ for $ k=[1..n]$ . What is that function?

The article Exponential sum looks interesting and relevant, but my maths is not strong enough to apply those formulas to my case. (The article talks about summing a series for $ ar^{k-1}$ which is different from mine, I can’t see the correct way to alter that to be equivalent to my case.)

An answer showing the pseudocode for a correct program expression will be appreciated as I’m not confident I could translate a complex formula to code.