## Show that Riemann integrable function \$f\$ on \$[a,b]\$ must be a bounded function.

I see these two:

1. How to show that a Riemann integrable function is bounded

2. If a function $$f(x)$$ is Riemann integrable on $$[a,b]$$, is $$f(x)$$ bounded on $$[a,b]$$?

The first uses a very different definition of Riemann integrable functions. The second post offers casual intuition, not a formal proof.

The definitions I’m working with:

A Riemann Sum is defined for a partition $$mathcal{P}$$ of $$[a,b]$$ as:

begin{align*} mathcal{R}(f, mathcal{P}) &= sumlimits_{j=1}^k f(s_j) Delta_j \ end{align*}

The function is Riemann integrable if Riemann sums converge to a number $$ell$$ as the mesh sizes of the partitions approach zero. A function $$f$$ is Riemann integrable if for any $$epsilon > 0$$, there must exist some $$delta > 0$$ and some partition $$mathcal{P}$$ such that:

begin{align*} m(mathcal{P}) < delta &implies |mathcal{R}(f, mathcal{P}) - ell| < epsilon \ end{align*}

Intuitively, if $$f$$ is unbounded, it looks like that Riemann sum will not converge, but I can’t see how to formally demonstrate that.

## Function for Domain of Differential Equatiion

Domain of d.e y’=f(x,y) is Domain[f] Union Domain[1/f].
I want to make function in Mathematica which will give Domain of any d.e and plot it.

`````` DomainDJ[f_, vars_] :=
Union[FunctionDomain[f, vars], FunctionDomain[1/f, vars]];
``````

This function give us Domain of d.e , with region plot we can plot that `RegionPlot[DomainDJ, {x, -2, 2}, {y, -2, 2}]`

For example d.e y’=(y*Log[y])/x when we use that function, we will get good Plot but we cant see visual that from region point (0,1) is out .

I definited a new function

``````PlotDomainDJSP[f_, vars_, sp_] :=
Module[{pddj = {}}, spt = Transpose[sp];
amin = Min[spt[[1]]];
amax = Max[spt[[1]]];
bmin = Min[spt[[2]]];
bmax = Max[spt[[2]]];
aamin = Min[{0, amin}];
aamax = Max[{-aamin, amax}];
bbmin = Min[{0, bmin}];
bbmax = Max[{-bbmin, bmax}];
For[i = 1, i <= Dimensions[sp][[1]], i++,
pddj = Append[pddj,
ParametricPlot[{aamin - 1 + (spt[[1, i]] - aamin + 1)*t,
spt[[2, i]]}, {t, 0, 1}, PlotStyle -> {Red, Dashing[Tiny]}]];
pddj = Append[pddj,
ParametricPlot[{spt[[1, i]],
bbmin - 1 + (spt[[2, i]] - bbmin + 1)*t}, {t, 0, 1},
PlotStyle -> {Red, Dashing[Tiny]}]];
pddj = Append[pddj,
ParametricPlot[{((aamax - aamin + 2)/300) Cos[
t], ((aamax - aamin + 2)/300) Sin[t]} + sp[[i]], {t, 0,
2 Pi}, PlotStyle -> Red]]];
df = DomainDJ[f, vars];
rpdj =
RegionPlot[
df, {x, aamin - 1, aamax + 1}, {y, bbmin - 1, bbmax + 1}];
Show[{rpdj, pddj}]];
``````

which show us nice everything but first problem of that is you need manual get points which give 0/0 case. My first question is how to set in this program that we not manual get point in case 0/0 .

Then my next question is can i merge that 2x function for example when we do not have points in d.e which give case 0/0 program use first function else if we get point 0/0 program use second function and how would do it .

I want a compact program-function which will give us VISUAL domain of d.e so maybe with this my idea or something else , maybe it can be much simpler (but visual with points 0/0 also ! )

## Could not find function register_google in R

library(ggmap)
library(ggplot2)
library(sp)
library(devtools)
library(dplyr)
library(stringr)
library(maps)
library(mapdata)
devtools::install_github(“dkahle/ggmap”)
install.packages(“tidyverse”)
library(tidyverse)

I don’t know where goes wrong, but I want to use register_google function.

## Rock, Paper Scissors Function

I’m trying to finished a rock, paper, scissors game, but I need help with with calling the main functions. Here is what I have so far:

import random

def main():

``````get_playerMove()

randomNumber = get_computerMove

print(randomNumber)
``````

def get_computerMove(randomNumber):

``````randomNumber = random.randint(1, 3)

if randomNumber == 1:
return "Rock"

elif randomNumber == 2:
return "Paper"
``````

else:
return “Scissors”

def get_playerMove():

``````player = input("Please enter your choice: ")

if player ==1:
return "Rock"

elif player == 2:
return "Paper"

else:
return "Scissors"
``````

def calculateWinner(playerMove, computerMove):

``````if computerMove == 1 and PlayerMove == 3:
return "Rock Smashes Paper."

elif computerMove == 3 and PlayerMove == 2:
return "Scissors cuts paper."

elif computerMove == 2 and PlayerMove == 1:
return "Paper covers rock."
``````

else:
return “It is a tie.”

main()

## Is this a pseudorandom function?

Given that $$F$$ is a secure $$PRF$$, is the construction $$F'(k, F(k, 1)) = 1$$ also a pseudorandom function for a secret key $$k$$?

My first intuition was that it is not a $$PRF$$, but after some thinking, I changed my mind to the fact that it is. Since because $$F$$ is a pseudorandom function, then for a secret key $$k$$ cannot the output of $$F$$ can’t be distinguished from the output of a truly random function. Hence, even though the output of $$F’$$ for input $$F(k,1)$$ is fixed, it can appear with the same probability as in a truly random function. I am right, or did I miss something important?

## ArgMax giving error “The function value *** is not a number at **”, but the exact same expression works in…

I am trying to ArgMax the following function:

``````ArgMax[{0.5 ln[2 (1 - [Alpha])] + 0.5 ln[4. [Alpha]]}, [Alpha]]
``````

This expression works flawlessly in WolframAlpha (link), but it doesn’t work in Mathematica Desktop 11.3.0.0.

It seems like that Mathematica is trying to evaluate alpha in a domain that alpha is not suppose to be, so I also tried assuming.

Any thoughts?

## Variable function names

I am working on a plugin that will add messages to a WooCommerce product at set places on a single item/product page and run into an issue that to be honest I have never needed a requirement for in the past.

The issue is variable function names.

What I want to be able to do is add multiple messages at key places in a product page, while I am able to target the places I want from a custom post type via a select options box I dont know how many messages in the page someone might want to add and with only one function name this is going to cause errors such as already declared if multiple messages are added for one product.

Is there a way to generate or use ‘variable_function’ names in a PHP function? I have tried a few ways all have not worked and even the mighty Google has failed to help me with a work around or way to allow for this to be done.

Take the below for an example I can call this once.

``````add_action( 'woocommerce_before_single_product', 'variable_function', 15 );

function variable_function() {
echo 'this is the first message';
}
``````

But what if i wanted to call the below also to add a second message at a different location I will get the error already declared on line —,

``````add_action( 'woocommerce_before_add_to_cart_form', 'variable_function', 15 );

function variable_function() {
echo 'This is a second message';
}
``````

without adding a single option for all possible areas this leaves me only able to add one message per single product and to add single options means the plugin will be bloated and not versatile.

So is there way to random generate functions name such as

``````add_action( 'woocommerce_before_single_product', 'variable_function'.\$randomn_info, 15 );

function variable_function.\$randomn_info() {
echo 'this is the first message';
}
``````

Or am I missing something very obvious?

Thanks….

## Should the cost function be zero using TensorFlow’s sigmoid_cross_entropy_with_logits?

I’m building a CNN to make a binary classification (1 or zero). For this I’m using the cost function `sigmoid_cross_entropy_with_logits`.

But for some reason the cost using this function is never equal to zero. Even if the prediction is equal to the correct valuel.

I tried plotting the output using the formula on TensorFlow’s website:
https://www.tensorflow.org/api_docs/python/tf/nn/sigmoid_cross_entropy_with_logits

This formula:

``````max(x, 0) - x * z + log(1 + exp(-abs(x)))
``````

And by making this plot I realised that it really isn’t zero when the outputs are equal. For example if z = 0 and x = 0 the result of this function is ~0.693.

This isn’t really making sense to me. Can someone shed a light on why it isn’t zero when the prediction is correct?