text:
## On Order-Generic Queries

### Authors: Oleg V. Belegradek, Alexei P. Stolboushkin, and Michael A. Taitslin

ABSTRACT

We consider relational databases organized over an ordered domain with some additional relations---a typical example is the ordered domain of rational numbers together with the ternary relation $+$ of addition. In the focus of our study are the first order queries that are invariant under order-preserving permutations''---such queries are called order-generic. In fact, we consider two formalizations of this notion: generic'', and locally generic'', queries. For several domains order-generic queries fail to express more than pure order queries, for example, every order-generic query over rational numbers with $+$ can be rewritten without $+$. Our goal is to find general conditions on the domain that allow for such a simplification of order-generic queries.

An important difference of this paper from a recent series of related papers (see, for example,~\cite{PBG95,BDLW95}) is that we generalize all notions to the case of finitely representable database states---as opposed to finite states---and develop a general lifting technique that, essentially, allows us to extend any result of the kind we are interested in, from finite to finitely-representable states, and thus all the results in this paper are proved for the general case of {\em constraint databases.}

On the simplification of order-generic queries, we offer two types of results. The results of the first type address {\em equivalence\/} of order-generic queries that use the additional predicates (extended queries) to pure order queries. Here we establish the necessary and sufficient condition for an extended query to be equivalent to a pure order query, in terms of behavior of this extended query over the ultra-product of this domain by a non-principal ultra-filter over $\omega$. This characterization relies upon the Continuum Hypothesis, and is used as instrumental in establishing equivalence of generic, as well as locally generic, extended queries to pure order queries for several classes of domains, including in particular the so-called $o$-minimal domains, integers with $+$, and such. Although, by Shoenfield's Absoluteness Theorem, the Continuum Hypothesis can be eliminated from these latter results, the fact remains, no translation algorithm can be extracted from arguments of this type.

That is why we also offer {\em effective algorithms\/} of translating extended to pure order queries for divisible ordered Abelian groups. Such groups---including real or rational numbers with $+$---are all $o$-minimal.

Paper Available at: ftp://dimacs.rutgers.edu/pub/dimacs/TechnicalReports/TechReports/1996/96-01.ps.gz


text:
# Find area of triangle

Geometry Level 5

Triangle $$ABC$$ has an inradius of $$5$$ and a circumradius of $$16$$.

If $$2\cos B = \cos A + \cos C$$, then the area of triangle $$ABC$$ can be expressed as $$\dfrac{x\sqrt{y}}{z}$$, where $$x, y$$ and $$z$$ are positive integers such that $$x$$ and $$z$$ are relatively prime and $$y$$ is not divisible by the square of any prime.

Find $$x+y+z$$.

×

format: plain


text:
# anhilators of vector spaces.

• October 13th 2011, 04:58 PM
Jame
anhilators of vector spaces.
I am trying to prove that

$Ann(W_1+W_2)= Ann(W_1) \cap Ann (W_2)$

I have managed to prove one inclusion

$Ann(W_1) \cap Ann (W_2) \subset Ann(W_1+W_2)$

The fact that any function in these spaces is a linear transformation was really helpful however if doesn't seem to really help me on the reverse inclusion.

Let $f \in Ann(W_1+W_2)$

then $f(w_1+w_2) = 0 \; \forall w_1 \in W_1$ and $w_2 \in W_2$

since $f$ is a linear transformation: $f(w_1+w_2) = f(w_1)+f(w_2)$

thus $f(w_1)+f(w_2) = 0 \; \forall w_1 \in W_1$ and $w_2 \in W_2$

I dont think this helps me. I can't necessarily say $f(w_1) = 0 \; \forall w_1$and $f(w_2) = 0 \; \forall w_2$

What should I do from here? Is this the right path and I'm just not catching something?
• October 13th 2011, 05:01 PM
Drexel28
Re: anhilators of vector spaces.
Quote:

Originally Posted by Jame
I am trying to prove that

$Ann(W_1+W_2)= Ann(W_1) \cap Ann (W_2)$

I have managed to prove one inclusion

$Ann(W_1) \cap Ann (W_2) \subset Ann(W_1+W_2)$

The fact that any function in these spaces is a linear transformation was really helpful however if doesn't seem to really help me on the reverse inclusion.

Let $f \in Ann(W_1+W_2)$

then $f(w_1+w_2) = 0 \; \forall w_1 \in W_1$ and $w_2 \in W_2$

since $f$ is a linear transformation: $f(w_1+w_2) = f(w_1)+f(w_2)$

thus $f(w_1)+f(w_2) = 0 \; \forall w_1 \in W_1$ and $w_2 \in W_2$

I dont think this helps me. I can't necessarily say $f(w_1) = 0 \; \forall w_1$and $f(w_2) = 0 \; \forall w_2$

What should I do from here? Is this the right path and I'm just not catching something?

Ok, so let $\varphi\in\text{Ann}(W_1+W_2)$ then we know that $\varphi(v)=0$ for all $v\in W_1+W_2$, right? But, isn't $W_1,W_2\leqslant W_1+W_2$?
• October 13th 2011, 05:17 PM
Jame
Re: anhilators of vector spaces.
Oh i see

so

$f(w_1)+f(w_2) = 0 \; \forall w_1 \in W_1$ and $w_2 \in W_2$

Particularly when $w_2 = 0$, and since f is an L.T., $f(0) = 0$

therefore $f(w_1) = 0 \; \forall w_1 \in W_1$

implies $f \in Ann(W_1)$

similarly for $W_2$

so $f \in Ann(W_1 \cap W_2)$

Thanks a lot!
• October 13th 2011, 07:03 PM
Jame
Re: anhilators of vector spaces.
Sorry, I have another question having to do with this particular equality.

I've read you can use this to prove that

$Ann(W_1 \cap W_2) = Ann(W_1)+Ann(W_2)$

by asserting that they have the same dimension.

I have been playing around with this for the past hour or so. And haven't really gotten anywhere.

I've got

$dim(Ann(W_1 \cap W_2)) = dim V - dim(W_1 \cap W_2)$

but I have found no equalities that I could apply $Ann(W_1 + W_2) = Ann(W_1) \cap Ann(W_2)$ to.
• October 13th 2011, 07:08 PM
Drexel28
Re: anhilators of vector spaces.
Quote:

Originally Posted by Jame
Sorry, I have another question having to do with this particular equality.

I've read you can use this to prove that

$Ann(W_1 \cap W_2) = Ann(W_1)+Ann(W_2)$

by asserting that they have the same dimension.

I have been playing around with this for the past hour or so. And haven't really gotten anywhere.

I've got

$dim(Ann(W_1 \cap W_2)) = dim V - dim(W_1 \cap W_2)$

but I have found no equalities that I could apply $Ann(W_1 + W_2) = Ann(W_1) \cap Ann(W_2)$ to.

Which part are you trying to prove. I think you've proven the dimension formula and are trying to see how to use it. Well, as I mentioned earlier it's trivial to prove that $\mathsf{Ann}(W_1)+\mathsf{Ann}(W_2)\subseteq \mathsf{Ann}(W_1\cap W_2)$ but since they have the same dimension, they must be equal. Is that what you;re after?
• October 13th 2011, 07:14 PM
Jame
Re: anhilators of vector spaces.
Proving $Ann(W_1 \cap W_2) = Ann(W_1)+Ann(W_2)$

This is just an application if the equality in the very first post? How does this work?
• October 13th 2011, 07:36 PM
Drexel28
Re: anhilators of vector spaces.
Quote:

Originally Posted by Jame
Proving $Ann(W_1 \cap W_2) = Ann(W_1)+Ann(W_2)$

This is just an application if the equality in the very first post? How does this work?

Ok, so $\dim\mathsf{Ann}(W_1\cap W_2)=n-\dim (W_1\cap W_2)$ where $W_1,W_2\leqslant V$ with $\dim V=n$. Then,

\begin{aligned}\dim (\mathsf{Ann}(W_1)+\mathsf{Ann}(W_2))&=n-\dim(\mathsf{Ann}(\mathsf{Ann}(W_1)+\mathsf{Ann}(W _2)))\\ &=n-\dim(\mathsf{Ann}(\mathsf{Ann}(W_1))\cap\mathsf{An n}(\mathsf{Ann}(W_2))\\ &=n-\dim(W_1\cap W_2)\end{aligned}

where I have used a slightly non-obvious fact (where, and how do you prove it). So, $\mathsf{Ann}(W_1\cap W_2)\cong\mathsf{Ann}(W_1)+\mathsf{Ann}(W_2)$ and since $\mathsf{Ann}(W_1)+\mathsf{Ann}(W_2)\subseteq\maths f{Ann}(W_1\cap W_2)$ since if [tex]\varphi,\psi[/atex] are in the left hand side and $v\in W_1\cap W_2$ then $(\varphi+\psi)(v)=\varphi(v)+\psi(v)=0$ etc. But, since they are isomorphic, containment is equivalent to equality.
• October 13th 2011, 10:10 PM
Deveno
Re: anhilators of vector spaces.

how does $\dim(\mathsf{Ann}(\mathsf{Ann}(W_1) + \mathsf{Ann}(W_2))) = \dim(\mathsf{Ann}(\mathsf{Ann}(W_1)) \cap \mathsf{Ann}(\mathsf{Ann}(W_2)))$

without first showing what we are trying to prove, namely:

$\dim(\mathsf{Ann}(W_1+W_2)) = \dim(\mathsf{Ann}(W_1)) \cap \mathsf{Ann}(W_2))$ ?
• October 13th 2011, 10:25 PM
Drexel28
Re: anhilators of vector spaces.
Quote:

Originally Posted by Deveno

how does $\dim(\mathsf{Ann}(\mathsf{Ann}(W_1) + \mathsf{Ann}(W_2))) = \dim(\mathsf{Ann}(\mathsf{Ann}(W_1)) \cap \mathsf{Ann}(\mathsf{Ann}(W_2)))$

without first showing what we are trying to prove, namely:

$\dim(\mathsf{Ann}(W_1+W_2)) = \dim(\mathsf{Ann}(W_1)) \cap \mathsf{Ann}(W_2))$ ?

Perhaps I mixed up what we are trying to prove with what we're proving. But, we first proved (through the first three posts) that $\mathsf{Ann}(W_1+W_2)=\mathsf{Ann}(W_1)\cap\mathsf {Ann}(W_2)$ which is what I used. I'm tired and don't feel like making sure I didn't mix them up, which I did initially. So, if I did, which I don't think I did, feel free to do it up man.
• October 13th 2011, 10:38 PM
Deveno
Re: anhilators of vector spaces.
from the first 3 posts, we know that they are equal (the annihilator of the sum, and the intersection of the annihilators). so they have to have the same dimension.

(assuming, of course, that their dimension is finite).

i may be mistaken, but i am wondering if what the thread starter is asking is, can we show equality from a dimensional argument?

i think we can, but we're going to have to invoke a basis, at some point.

(was your "non-obvious" assertion $\mathsf{Ann}(\mathsf{Ann}(W)) = W$?)
• October 13th 2011, 10:40 PM
Drexel28
Re: anhilators of vector spaces.
Quote:

Originally Posted by Deveno
from the first 3 posts, we know that they are equal (the annihilator of the sum, and the intersection of the annihilators). so they have to have the same dimension.

(assuming, of course, that their dimension is finite).

i may be mistaken, but i am wondering if what the thread starter is asking is, can we show equality from a dimensional argument?

i think we can, but we're going to have to invoke a basis, at some point.

Ok, now I wonder if you realize that he asked to prove a DIFFERENT equality than the one initially asked...I originally proved "the annihilator of a sum is the interesction of annihilators" and the post that you thought I had circular reasoning on I was proving "the sum of annihilators is the annihilator of the intersection" for which I used "the annihilator of a sum is the interesction of annihilators"
• October 13th 2011, 10:49 PM
Deveno
Re: anhilators of vector spaces.
ok, i got it. yes, the similarity DID confuse me. and in the case we're talking about:

Ann(W1+W2) = Ann(W1)∩Ann(W2) DOES imply Ann(W1∩W2) = Ann(W1)+Ann(W2)

for a moment, there, we were talking about our conversation, and i got "meta-lost".


text:
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

We present a novel approach for measuring feature importance in k-means clustering, or variants thereof, to increase the interpretability of clustering results. In supervised machine learning, feature importance is a widely used tool to ensure interpretability of complex models. We adapt this idea to unsupervised learning via partitional clustering. Our approach is model agnostic in that it only requires a function that computes the cluster assignment for new data points.

Based on a simulation study below we show that the algorithm finds the variables which drive the cluster assignment and scores them according to their relevance. As a further application, this provides a new approach for hyperparameter tuning for data sets of mixed type when the metric is a linear combination of a numerical and a categorical distance measure – as in Gower’s distance, for example.

In combination with stability analyses, feature importance provides a means for feature selection, i.e. the identification of a lower dimensional subspace which offers a reasonable separation. Our package works with some popular clustering packages such as flexclust, clustMixType, base R’s kmeans function and the newly developed ClustImpute package.

## Installation

You can install the package as follows:

devtools::install_github("o1iv3r/FeatureImpCluster")

## Useage with flexclust

We’ll create some random data to illustrate the usage of FeatureImpCluster. It provides 4 clusters in a 2 dimensional subspace of a 6 dimensional space

library(FeatureImpCluster)

set.seed(7)
dat <- create_random_data(n=4000,nr_other_vars = 4)
summary(dat$data) #> V1 V2 V3 #> Min. :-3.531648 Min. :-3.578032 Min. :-3.924400 #> 1st Qu.:-0.670694 1st Qu.:-0.676281 1st Qu.:-0.662992 #> Median :-0.001917 Median :-0.001944 Median :-0.002742 #> Mean : 0.000000 Mean : 0.000000 Mean : 0.000000 #> 3rd Qu.: 0.654912 3rd Qu.: 0.658228 3rd Qu.: 0.678405 #> Max. : 3.501554 Max. : 3.717284 Max. : 3.065434 #> V4 x y #> Min. :-3.91009 Min. :-2.255326 Min. :-2.04657 #> 1st Qu.:-0.67427 1st Qu.:-0.934193 1st Qu.:-0.92633 #> Median : 0.01396 Median :-0.004383 Median : 0.04418 #> Mean : 0.00000 Mean : 0.000000 Mean : 0.00000 #> 3rd Qu.: 0.67657 3rd Qu.: 0.927500 3rd Qu.: 0.92785 #> Max. : 3.58167 Max. : 2.095888 Max. : 2.18437 library(ggplot2) true_clusters <- factor(dat$true_clusters)
ggplot(dat$data,aes(x=x,y=y,color=true_clusters)) + geom_point() If our clustering works well, x and y should determine the partition while the other variables V1,..,V4 should be irrelevant. Feature importance is a novel way to determine whether this is the case. We’ll use the flexclust package for this example. Its main function FeatureImpCluster computes the permutation missclassification rate for each variable of the data. The mean misclassification rate over all iterations is interpreted as variable importance. The permutation missclassification rate of a feature (column) is the number of wrong cluster assignments divided by the number of observations (rows) given a permutation of the feature. library(FeatureImpCluster) library(flexclust) #> Lade nötiges Paket: grid #> Lade nötiges Paket: lattice #> Lade nötiges Paket: modeltools #> Lade nötiges Paket: stats4 set.seed(10) res <- kcca(dat$data,k=4)
FeatureImp_res <- FeatureImpCluster(res,as.data.table(dat$data)) plot(FeatureImp_res) Indeed, y and x are most relevant. But also V2 has some impact on the cluster assignment. By looking at the cluster centers we see that, in particular, cluster 2 and 3 have a different center in the V2 dimension than the other clusters. barplot(res) # bwplot(res,dat$data), image(res,which=5:6) # alternative diagnostic plots of flexclust

If we had a lot more than 6 variables (and possibly more clusters), then the chart above might be hard to interpret. The feature importance plot instead provides an aggregate statistics per feature and is, as such, always easy to interpret, in particular since only the top x (say, 10 or 30) features can be considered to get a first impression.

## Feature selection

We know that the clustering is impacted by the random initialization. Thus it is usually recommended to run the clustering alogrithm several times with different seeds. As a by-product, the feature importance will provide us a feature selection mechanism: instead of iterating over permutation, we can iterate over the different cluster runs (or both). This way there is a good chance that any spurious importance is identified as an outlier.

For our example we repeat the clustering + feature importance calculation 5 times:

set.seed(12)
nr_seeds <- 5
seeds_vec <- sample(1:1000,nr_seeds)

savedImp <- data.frame(matrix(0,nr_seeds,dim(dat$data)[2])) count <- 1 for (s in seeds_vec) { set.seed(s) res <- kcca(dat$data,k=4)
FeatureImp_res <- FeatureImpCluster(res,as.data.table(dat$data),sub = 1,biter = 1) savedImp[count,] <- FeatureImp_res$featureImp[sort(names(FeatureImp_res$featureImp))] count <- count + 1 } names(savedImp) <- sort(names(FeatureImp_res$featureImp))

Now it becomes quite obvious that x and y are the only relevant features, and we could do our clustering only based on these features. This is importantant in practice since cluster centroids with a lower number of features are easier to interpret, and we can save time / money collecting and pre-processing unnecessary features.

boxplot(savedImp)

## Data sets of mixed type

Another application arises for data sets with numerical and categorical features. Since one cannot simply calculate an Euclidean distance for categorical variables, one often uses an L0-norm (1 for equality, 0 else) for the latter and combines both metrices linearly with an appropriate weight (often this choice is referred to as Gower’s distance in the literature). In the clustMixType package the parameter lambda defines the trade off between Euclidean distance of numeric variables and simple matching coefficient between categorical variables. Feature Importance can be used as an additional guide to tune this parameter.

First we add categorical variables to our data set

ds <- as.data.table(dat$data) n <- dim(ds)[1] p <- dim(ds)[2] set.seed(123) ds[,cat1:=factor(rbinom(n,size=1,prob=0.3),labels = c("yes","no"))] # irrelevant factor ds[,cat2:=factor(c(rep("yes",n/2),rep("no",n/2)))] # relevant factor Obviously x and cat2 are strongly correlated. cor(ds$x,as.numeric(ds$cat2),method="spearman") #> [1] 0.8655712 First we’ll apply the clustering with an automatic estimation of lambda library(clustMixType) res <- kproto(x=ds,k=4) #> # NAs in variables: #> V1 V2 V3 V4 x y cat1 cat2 #> 0 0 0 0 0 0 0 0 #> 0 observation(s) with NAs. #> #> Estimated lambda: 2.17156 res$lambda
#> [1] 2.17156

With color=“type” we can draw the attention to the importance by data type. While cat2 correctly has some importance, the one of cat1 is almost zero.

FeatureImp_res <- FeatureImpCluster(res,ds)
plot(FeatureImp_res,ds,color="type")

All in all the numeric variables are more important for the partitioning. If, for some reason, we wanted partitions that emphasize differences between the cateogrical features, we’d have to increase lambda. The feature importance directly shows us the effect of this action: the two categorical features now have an equally high importance only somewhat smaller than x. As above, repeated partitioning could be used to compute a more reasonable importance for the data set and not only an importance for a specific partition.

res2 <- kproto(x=ds,k=4,lambda=3)
#> # NAs in variables:
#>   V1   V2   V3   V4    x    y cat1 cat2
#>    0    0    0    0    0    0    0    0
#> 0 observation(s) with NAs.
plot(FeatureImpCluster(res2,ds),ds,color="type")

Of course, further criteria should be used to determine an “optimal” lamda for the use case at hand - but certainly featuer importance provides helpful guidance for data of mixed types.

## Other methods: kmeans(), pam() and ClustImpute()

FeatureImpCluster can be easily used with other packages. For example, stats::kmeans or cluster::pam can be used via flexclust:

cl_kcca <- flexclust::as.kcca(cl, dat$data) # cl is a kcca or pam object FeatureImpCluster(cl_kcca,as.data.table(dat$data))

ClustImpute, a package that efficiently imputes missing values while performing a k-means clustering can be used directly:

library(ClustImpute)
res_clustimpute <- ClustImpute(as.data.frame(dat$data),4) FeatureImpCluster(res_clustimpute,as.data.table(dat$data))

For other methods, a custom prediction function can be provided (cf. documentation for details)

FeatureImpCluster(clusterObj, as.data.table(dat\$data), predFUN = custom_prediction_function_for_clusterObj)

## Further options

There are further options not being explained in the examples above:

• For initialization, the prediction methodhas to be computed on the entire data set. This can be of high computational cost for large data sets. Alterntively one can provide the current partitioning via basePred.
• To further spead up a computation on large data sets, the permutation importance can be computed on random subsets of the data. This can be controlled via the sub parameter
• The number of iterations (default is 10) can be set via biter


text:
Select Page

## Existence and multiplicity for perturbations of an equation involving a Hardy inequality and the critical Sobolev exponent in the whole of $\Bbb R^N$

• Volume 9, 2004, pages 481-508

## Schrödinger group on Zhidkov spaces

• Volume 9, 2004, pages 509-538

## Existence of the nontopological condensate in self-dual Chern-Simons gauge theory

• Volume 9, 2004, pages 539-562

## On an evolution system describing self-gravitating Fermi-Dirac particles

• Volume 9, 2004, pages 563-586

## Global solutions of Navier-Stokes equations with large $L^2$ norms in a new function space

• Volume 9, 2004, pages 587-624

## Instantaneous shrinking of the support in degenerate parabolic equations with strong absorption

• Volume 9, 2004, pages 625-643

## Location and critical groups of critical points in Banach spaces with an application to nonlinear eigenvalue problems

• Volume 9, 2004, pages 645-676

## Local and global solutions for a nonlinear Dirac system

• Volume 9, 2004, pages 677-698

## On a variational characterization of a part of the Fučík spectrum and a superlinear equation for the Neumann $p$-Laplacian in dimension one

• Volume 9, 2004, pages 699-720

## Scattering states for the nonlinear wave equation with small data

• Volume 9, 2004, pages 721-744

## Second-best constant and extremal functions in Sobolev inequalities in the presence of symmetries

• Volume 9, 2004, pages 745-770

## Uniqueness and profile of solutions for a superlinear elliptic equation

• Volume 9, 2004, pages 771-796

## Bifurcation problems associated with generalized Laplacians

• Volume 9, 2004, pages 797-828

## Large-amplitude high-frequency waves for quasilinear hyperbolic systems

• Volume 9, 2004, pages 829-890

## On the minimizers of a Ginzburg-Landau-type energy when the boundary condition has zeros

• Volume 9, 2004, pages 891-960

## Existence and classification of critical points for nondifferentiable functions

• Volume 9, 2004, pages 961-978

## Stability and instability of generalized Kolmogorov flows on the two-dimensional sphere

• Volume 9, 2004, pages 979-1008

## Global solutions of higher-order semilinear parabolic equations in the supercritical range

• Volume 9, 2004, pages 1009-1038

## Some theoretical results concerning diphasic viscoelastic flows of the Oldroyd kind

• Volume 9, 2004, pages 1039-1078

## Regularity for Stokes and generalized Stokes systems under nonhomogeneous slip-type boundary conditions

• Volume 9, 2004, pages 1079-1114

## The short-wave limit for nonlinear, symmetric, hyperbolic systems

• Volume 9, 2004, pages 1-52

## Backward uniqueness of semigroups arising in coupled partial differential equations systems of structural acoustics

• Volume 9, 2004, pages 53-84

## Local and global well-posedness for a class of nonlinear dispersive equations

• Volume 9, 2004, pages 85-132

## Global existence conditions for a nonlocal problem arising in statistical mechanics

• Volume 9, 2004, pages 133-158

## On Schrödinger-Boussinesq equations

• Volume 9, 2004, pages 159-176

## Exponentially accurate balance dynamics

• Volume 9, 2004, pages 177-196

## Existence of multiple positive solutions for singular elliptic problems with concave and convex nonlinearities

• Volume 9, 2004, pages 197-220

## On the location of concentration points for singularly perturbed elliptic equations

• Volume 9, 2004, pages 221-239

## Conditional and unconditional well-posedness for nonlinear evolution equations

• Volume 9, 2004, pages 241-265

## Spectra of critical exponents in nonlinear heat equations with absorption

• Volume 9, 2004, pages 267-298

## Coupled surface and grain boundary motion: nonclassical traveling-wave solutions

• Volume 9, 2004, pages 299-327

## Local estimates and large solutions for some elliptic equations with absorption

• Volume 9, 2004, pages 329-351

## Local and global well-posedness results for flows of inhomogeneous viscous fluids

• Volume 9, 2004, pages 353-386

## The Miller scheme in semigroup theory

• Volume 9, 2004, pages 387-414

## On a variational problem involving critical Sobolev growth in dimension four

• Volume 9, 2004, pages 415-446

## $C^{1,β}$ regularity of viscosity solutions via a continuous-dependence result

• Volume 9, 2004, pages 447-480

## Exponential decay for a von Kármán system with memory

• Volume 9, 2004, pages 1115-1142

## Front propagation in bistable reaction-diffusion-advection equations

• Volume 9, 2004, pages 1143-1166

## Asymptotic stability of traveling waves for viscous conservation laws with dispersion

• Volume 9, 2004, pages 1167-1184

## Antimaximum principle for quasilinear problems

• Volume 9, 2004, pages 1185-1200

## On the solutions of quasilinear elliptic equations with a polynomial-type reaction term

• Volume 9, 2004, pages 1201-1234

## On a degenerate parabolic system for compressible, immiscible, two-phase flows in porous media

• Volume 9, 2004, pages 1235-1278

## Type-II blowup for a semilinear heat equation

• Volume 9, 2004, pages 1279-1316

## Analysis of a scalar conservation law with a flux function with discontinuous coefficients

• Volume 9, 2004, pages 1317-1338

## Existence results for some quasilinear elliptic equations involving critical Sobolev exponents

• Volume 9, 2004, pages 1339-1368

## Exact controllability for hyperbolic thermoelastic systems with large memory

• Volume 9, 2004, pages 1369-1394

## Stratified weak solutions of the 1-D Lagrangian Euler equations are viscosity solutions

• Volume 9, 2004, pages 1395-1436


text:
$\operatorname{card}(\bigcup\limits_{n \in \mathbb{N}} \underbrace{A\times…\times A}_{n})=k$ if $\operatorname{card}(A)=k$ infinite.

I was reading a proof of a theorem that goes like this:
Let $$A$$ be an infinite set of cardinality $$k$$ and $$A^{<\omega}$$ the set of finite sequences of elements of A. Then $$\operatorname{card}(A^{<\omega})=k$$.

In the proof, we note that $$A^{<\omega}=\bigcup\limits_{n \in \mathbb{N}} \underbrace{A\times...\times A}_{n}$$. So at some point, we have to show $$\operatorname{card}(A \times A)=k$$, and for this the author uses the fact that $$\operatorname{card}(A \times A)=\operatorname{card}(\operatorname{card}(A) \times \operatorname{card}(A))$$.
I am not super sure why this is the case. My thoughts: We have by definition a bijection $$A \leftrightarrow \operatorname{card}(A)$$. So we have a bijection $$A \times A \leftrightarrow \operatorname{card}(A) \times \operatorname{card}(A)$$. So in particular since these sets are bijective they have the same cardinal $$\operatorname{card}(A \times A)=\operatorname{card}(\operatorname{card}(A) \times \operatorname{card}(A))$$. Is that it?
So from this we can prove $$\operatorname{card}(\underbrace{A\times...\times A}_{n})=k$$ $$\forall n$$.

Then the author says $$k\le \operatorname{card}(\bigcup\limits_{n \in \mathbb{N}} \underbrace{A\times...\times A}_{n}) \le \operatorname{card}(A)\cdot\omega$$ where the $$\cdot$$ is the cardinal product. Why is that?

So far, so good. Next you need $$k^2=k$$ to prove by induction that each of the products has cardinality $$k$$. Then their union has at most size $$k\aleph_0\le k^2=k$$. But the proof there are at least $$k$$ sequences is trivial.
• In general, what bound do we have : $\operatorname{card}(\bigcup\limits_{i \in I} B_i) \le ?$ – roi_saumon Jan 23 at 23:56
• @rol_saumon We have lower bound $\max_i\operatorname{card}(B_i)$, upper bound $\sum_i\operatorname{card}(B_i,)$. – J.G. Jan 24 at 6:02


text:
## USDA Coronavirus Food Assistance Program (CFAP) for Specialty Crop Farmers

Calculating the Coronavirus Food Assistance Program (CFAP) payments for specialty crops can be relatively easy when using the US Department of Agriculture (USDA) Farm Services Agency (FSA) calculator, and when you know the basics of the program. Sign-up must be submitted in person (by appointment), by mail, e-mail, or facsimile to your county FSA office by August 28, 2020. We suggest you make your appointment with your FSA county office as soon as possible.

## Specialty Crops Feel the Effect of Coronavirus

The COVID-19 pandemic has severely impacted some specialty crops. Industry sources estimate that thousands of fruit and vegetable acres were not harvested because of the loss of the food services marketing channel. While some crops are meant for grocery stores, many farmers cater solely through the foodservice marketing chain. A survey performed early in the pandemic crisis indicated that COVID-19 was having an impact on 62% of specialty crop growers nationwide, with 24% of survey respondents stating that the impact was significant.1 Prices have dropped up to 69% in squash and 64% in tomatoes according to USDA Agricultural Marketing Service (AMS) data2, calculated as the difference between column(s) A and B of table 1 below.3 The average mid-January to mid-April price loss across all specialty crops listed in table 1 was 23.5 %.

## CFAP Program Relief

Through the use of the FSA released CFAP calculator that can be downloaded at www.farmers.gov/cfap, knowing the eligible crops (table 1) and some basic CFAP rules, an estimated CFAP payment can be determined. Crops that are not listed in table 1 may be considered in the future by FSA if additional information becomes available to show that there was a 5% or more reduction in crop value caused within the appropriate time period.

Table 1 will assist in determining a CFAP payment.

• Column A: Average price for specific crops according to USDA AMS data from January 13-17. The price is calculated as an average of all units shipped of domestic production, whether conventional or organic. The prices are designated from the shipping point (if available) or terminal market.
• Column B: Average price for specific crops from April 6-10, calculated the same way. Any transactions (or reports) that may have occurred on April 10, Good Friday the weekly AMS cash prices are used.
• Column C shows the difference between columns A and B, which is reflective of the price drop from mid-January to mid-April 2020. An empty or zero cell in this column signifies either a price increase, a price decrease under 5%, or a payment rate of zero after rounding to two decimal places.

Producers of eligible specialty crops may receive CFAP payments if they fall in one or more of three scenarios. A specialty crop producer may be able to receive payments based on each of the scenarios. Payments are calculated using payment rates from table 1 in the following columns:

Scenario 1: CARES Act Payment Rate on sales losses (80% of price change): Column D

Scenario 2: CARES Act Payment Rate on shipped but spoiled (30% of lost value): Column E

Scenario 3: Commodity Credit Corporation (CCC) Payment Rate on crops not leaving the farm (5.875% of crop value): Column F

### Scenario 1

This scenario includes producers of crops that realized a 5% or greater reduction in sales price between the average price for the week of January 13-17, 2020 and the average price for the week of April 6-10, 2020.

• Payments for this scenario will be the grower’s sales volume during that time frame, multiplied by the pre-specified payment rate, as shown in column D of table 1.
• The payment rates in table 1 were calculated as 80% of the given crop’s mid-January to mid-April price change according to AMS data.
• For example, a grower that sold 100 pounds of tomatoes during that period, would get a $64 payment, calculated as 100 lbs. x$ 0.64.

### Scenario 2

This scenario includes producers with crops that were shipped from the farm by April 15 but subsequently spoiled due to loss of marketing channels, and no payment was received.

• The payment for this scenario will be the volume of shipped, spoiled crops multiplied by the pre-specified payment rate, as shown in column E of table 1.
• The payment rates in table 1 were determined assuming the field value of the crop is 60% of a mid-January sales value as determined by AMS data, multiplied by a 50% coverage level.
• In this example, a grower that shipped 100 pounds of tomatoes during that period, would get a $38 payment, calculated as 100 lbs. x$ 0.38.

### Scenario 3

This scenario includes producers with unpriced shipments that did not leave the farm, or with mature crops that remained unharvested by April 15 due to loss of marketing channel, and which have not been and will not be sold.

• Payments for this scenario are covered using CCC funds. Producers may submit a loss claim for compensation to assist with the purchase of materials and facilities required in connection with the production and marketing of agricultural commodities, and with the development of new and additional markets, marketing facilities, and uses for such commodities.
• Payments are calculated as the sum of the quantity of harvested acres for eligible crops that did not leave the farm and mature crops that remained unharvested, multiplied by the pre-specified yield, as determined by AMS, and multiplied by the pre-specified payment rate as shown in column F of table 1.
• The payment rates in table 1 were calculated as the product of the average mid-January to mid-April price loss across all specialty crops (23.5%), a 25% coverage rate, and the mid- January price for the specific crop. In other words, the payment for this scenario may be up to 5.875% of the crop’s value estimated by AMS as of mid-January.
• For example, a farmer that could not harvest one-acre worth of tomatoes may receive a payment as high as $6,122.90, calculated as 1-acre x yield (using national average AMS yield per acre) x$ 0.07/lb.

## Calculation versus Actual Payment

Payments are based on program eligibility and may vary due to changes in commodity data, producer eligibility, producer or member payment share, payment rates, factors, and payment limitation. Please look for the most current information at www.farmers.gov/cfap.

USDA FSA will make an initial payment of only 80% of your calculated payment, and the rest will be distributed once a payment is issued to all applicants. Any CCC funds that remain available will be distributed and may be prorated.

Supporting documentation may be requested to verify the amounts specified on the application. Specialty crop producers must provide acceptable records that substantiate the reported amounts, such as production records, copies of receipts, ledgers of income, income statements of deposit slips, register tapes, invoices for custom harvesting, measurements, truck scale tickets, or accounting records. Applications may also be spot-checked prior to payment.

An overview of the CFAP program can be found at Clemson University’s Land-Grant Press repository, authored by Stan Moore and Adam Kantrovich. A Spanish version of the article is also available, with translation and review provided by Florencia Colella of Michigan State University Extension.

Additional resources and information on assistance programs related to COVID-19 can be found at

• Clemson Cooperative Extension, Agribusiness Program Team Resources for COVID-19 website
• Michigan State University Extension, Farm Management Agribusiness Resources for Novel Coronavirus website

Table 1. Total Estimated CFAP Payments for Specialty Crops, not including payment limitations (includes, but is not limited to, the listed commodities). Source: Adapted from USDA AMS; USDA AMS data.

 Commodity Average price, January 13-17 Average price, April 6-10 2 Mid-January to mid-April Price Decline CARES Payment Rate on Sales Losses (80% of price change) CARES Payment Rate on Shipped But Spoiled (30% of lost value) CCC Payment Rate on Crops Not Leaving the Farm (5.875% of crop value) Column Designation A B C D E F Quantity Measure ($/lb.) ($/lb.) ($/lb.) ($/lb.) ($/lb.) ($/lb.) Almonds $1.90$1.58 $0.32$0.26 $0.57$0.11 Apples — — $0.18$0.03 Artichokes $1.64$0.81 $0.83$0.66 $0.49$0.10 Asparagus — — — — $0.38$0.07 Avocados — — — — $0.14$0.03 Beans $0.55$0.33 $0.22$0.17 $0.16$0.03 Blueberries — — — — $0.62$0.12 Broccoli $1.62$0.84 $0.78$0.62 $0.49$0.10 Cabbage $0.22$0.16 $0.05$0.04 $0.07$0.01 Cantaloupe — — — — $0.10$0.02 Carrots $0.38$0.35 $0.03$0.02 $0.11$0.02 Cauliflower $1.02$0.89 $0.14$0.11 $0.31$0.06 Celery — — — — $0.07$0.01 Corn-sweet $0.43$0.31 $0.11$0.09 $0.13$0.03 Cucumbers $0.50$0.34 $0.16$0.13 $0.15$0.03 Eggplant $0.50$0.40 $0.09$0.07 $0.15$0.03 Garlic — — — — $0.85$0.17 Grapefruit — — — — $0.11$0.02 Kiwifruit — — — — $0.32$0.06 Lemons $0.70$0.61 $0.09$0.08 $0.21$0.04 Lettuce, iceberg $0.50$0.25 $0.25$0.20 $0.15$0.03
 Commodity Average Price, January 13-17 Average Price, April 6-10 Mid-January to mid-April Price Decline CARES Payment Rate on Sales Losses (80% of Price Change) CARES Payment Rate on Shipped but Spoiled (30% of lost value) CCC Payment Rate on Crops Not Leaving the Farm (5.875% of crop value) Column Designation A B C D E F Quantity Measure ($/lb.) ($/lb.) ($/lb.) ($/lb.) ($/lb.) ($/lb.) Lettuce, romaine $0.40$0.31 $0.08$0.07 $0.12$0.02 Mushrooms — — — — $0.59$0.11 Onions green — — — — $0.30$0.06 Onions, dry $0.18$0.16 $0.02$0.01 $0.05$0.01 Oranges — — — — $0.14$0.03 Papaya — — — — $0.32$0.06 Peaches $1.05$0.96 $0.09$0.08 $0.32$0.06 Pears $0.58$0.49 $0.10$0.08 $0.18$0.03 Pecans $3.10$2.76 $0.35$0.28 $0.93$0.18 Peppers, bell type $0.73$0.56 $0.18$0.14 $0.22$0.04 Peppers, other $0.73$0.55 $0.19$0.15 $0.22$0.04 Potatoes — — — — $0.04$0.01 Raspberries — — — — $1.45$0.28 Rhubarb $3.42$3.23 $0.18$0.15 $1.03$0.20 Spinach $1.22$0.77 $0.46$0.37 $0.37$0.07 Squash $1.30$0.40 $0.90$0.72 $0.39$0.08 Strawberries $2.40$1.35 $1.05$0.84 $0.72$0.14 Sweet potatoes — — — — $0.18$0.04 Tangerines — — — — $0.22$0.04 Taro — — — — $0.23$0.05 Tomatoes $1.26$0.46 $0.80$0.64 $0.38$0.07 Walnuts — — — — $0.45$0.09 Watermelons — — — — $0.02$0.00

## References

1. Nickle A. How the coronavirus is affecting the produce industry. The Packer. 2020 March 13.
https://www.thepacker.com/article/how-coronavirus-affecting-produce-industry.
2. Specialty Crops, Custom Reports. Washington (DC): US Department of Agriculture Agricultural Marketing Services Market News. https://www.ams.usda.gov/market-news/fruits-vegetables.
3. Coronavirus Food Assistance Program, Cost Benefit Analysis. Washington (DC): US Department of Agriculture, Farmers.gov. https://www.farmers.gov/sites/default/files/documents/CFAP%20CBA%205%2015%202020.pdf.
4. Coronavirus Food Assistance Program. Washington (DC): US Department of Agriculture, Farmers.gov. https://www.farmers.gov/cfap.

Moore S, Kantrovich AJ. The Long-Awaited Coronavirus Food Assistance Program (CFAP) for Farmers. Clemson (SC): Clemson Cooperative Extension, Land-Grant Press by Clemson Extension; 2020. LGP 1063. http://lgpress.clemson.edu/publication/the-long-awaited-coronavirus-food-assistance-program-cfap-for-farmers/.

Moore S, Kantrovich AJ, Colella Florencia. El tan esperado Programa de Asistencia Alimentaria frente al Coronavirus (CFAP) para Agricultores. Clemson (SC): Clemson Cooperative Extension, Land-Grant Press by Clemson Extension; 2020. LGP 1064. http://lgpress.clemson.edu/publication/el-tan-esperado-programa-de-asistencia-alimentaria-frente-al-coronavirus-cfap-para-agricultores/.


text:
## CryptoDB

### Paper: Identity-Based Broadcast Encryption with Efficient Revocation

Authors: Aijun Ge Puwen Wei DOI: 10.1007/978-3-030-17253-4_14 Search ePrint Search Google PKC 2019 Identity-based broadcast encryption (IBBE) is an effective method to protect the data security and privacy in multi-receiver scenarios, which can make broadcast encryption more practical. This paper further expands the study of scalable revocation methodology in the setting of IBBE, where a key authority releases a key update material periodically in such a way that only non-revoked users can update their decryption keys. Following the binary tree data structure approach, a concrete instantiation of revocable IBBE scheme is proposed using asymmetric pairings of prime order bilinear groups. Moreover, this scheme can withstand decryption key exposure, which is proven to be semi-adaptively secure under chosen plaintext attacks in the standard model by reduction to static complexity assumptions. In particular, the proposed scheme is very efficient both in terms of computation costs and communication bandwidth, as the ciphertext size is constant, regardless of the number of recipients. To demonstrate the practicality, it is further implemented in Charm, a framework for rapid prototyping of cryptographic primitives.
##### BibTeX
@inproceedings{pkc-2019-29288,
title={Identity-Based Broadcast Encryption with Efficient Revocation},
booktitle={Public-Key Cryptography – PKC 2019},
series={Lecture Notes in Computer Science},
publisher={Springer},
volume={11442},
pages={405-435},
doi={10.1007/978-3-030-17253-4_14},
author={Aijun Ge and Puwen Wei},
year=2019
}


text:
# All Questions

2,055 questions
Filter by
Sorted by
Tagged with
76 views

### Moderation: Handling flags and deleting answers

Since we have a full moderation team now and the load isn't all on one person, some of you may have noticed that flags are being handled a lot faster now. However, this has resulted in the problem ...
65 views

### Accepting my first answer, things to consider beyond byte count with a tie on “shortest code wins” question?

My first ever question Find all integer pairs that produce a given Loeschian number was a straightforward code-golf tagged problem. I copied the format from an earlier related question, including the ...
42 views

### Declined flag on a comment that was fully implemented in an answer

Recently I flagged this comment as no longer needed, since it was fully implemented in an my answer. Furthermore, I thanked the user helped my shortening my answer. After reading this post, I was ...
104 views

For a while now, most bounties on our site are rewards for existing answers. As a consequence, it's pretty hard to spot any bounty that would fall into the 'Draw attention' or 'Bonus / Side challenge' ...
86 views

### Feed Filter: A TNB Userscript

Inspired by a conversation about annoying quirks with the chat feeds (such as New Main Posts), Feed Filter is a simple userscript I made to introduce a few features/fixes to the feeds in The ...
615 views

### Language of the month for October 2020: Husk

In accordance with our meta agreement, since one candidate received more votes than the others, we have a new featured language! Throughout October 2020, our Language of the Month, nominated by myself,...
266 views

### 2020 Community Moderator Election Results

Code Golf's third moderator election has come to a close, the votes have been tallied and the three new moderators are: They'll be joining the existing crew shortly—please thank them for ...
95 views

### Should I upvote an answer based on how much it was improved?

Should I hold how much an answer's score increased/decreased (depending on the winning criterion) as an indicator of how good it is and whether or not I should upvote it? I used to see answers golfed ...
105 views

### Newer users can't view vote counts, therefore cannot view current site consensus

So recently I've been reading through some policy recently, and besides there being a whole lot of them, I've noticed a problem. As I have less than 1k rep on the main community, I'm not an ...
268 views

### 2020 Community Moderator Election

The 2020 Community Moderator Election is now underway! Community moderator elections have three phases: Nomination phase Primary phase Election phase Most elections take between two and three weeks, ...
594 views

### 2020 Moderator Election Q&A - Questionnaire

In connection with the moderator elections, we are holding a Q&A thread for the candidates. Questions collected from an earlier thread have been compiled into this one, which shall now serve as ...
330 views

### Discussion on the upcoming moderator elections (Sep 2020)

We are scheduled for a moderator election on Sep 14, 2020. A Community Interest Check by SE last November gauged interest in holding and running for January elections for the spots of the two (now ...
158 views

### Users with 1 rep aren't able to post answers on Meta

Despite our help page claiming you only need 1 reputation to participate in Meta, multiple users have reported being unable to post answers on Meta, despite being supposed to be (screenshot of a ...
399 views

### 2020 Moderator Election Q&A - Question Collection

The purpose of this thread was to collect questions for the questionnaire. The questionnaire is now live, and you may find it here. Code Golf is scheduled for an election next week, September 14th ...
106 views

### Scoring Desmos equations

The Desmos graphing calculator, commonly referred to as just Desmos1, has been used for a number of answers, by me as well as others. However, scoring (as well as I/O, but that's for another post) ...
42 views

### \[ in code triggers LateX in preview

When the code contains the characters \[, the preview shows everything else as LateX even though it is inside the  section. This is how the preview looks like: ...
361 views

### Language of the Month for September 2020: R

In accordance with our meta agreement to restart the Language of the Month with the top-voted nomination from the old nominations list, we have a new featured language! Throughout September 2020, our ...
56 views

### Answering a tip for golfing in a specific version of a language

Phrased generally, my question is: Given a language "The Summer" and an experimental branch of it "The Fall", should I answer a "Tips for golfing in The Summer" question ...
58 views

### Can we do some tag spring cleaning?

Looking at the last 3 pages of tags (sorted by popular), we can see a whole bunch of tags which are used on 5 questions or less. All of the questions with 0 questions (page 9 and some on page 8) are ...
127 views

### Does U+007F contribute to a byte count?

U+007F, though it is not a C0 control character, Unicode still considers it as a control character. It is the deleted character. If one mis-punched a character into a punched tape, one would turn it ...
509 views

### Nominations for Language of the Month, 2020 edition

We've decided to revive the Language of the Month event. We've also decided to start a new post for nominations. (You can see the old nominations post here.) So let's get to nominating! Procedure A ...
218 views

### Reviving Language of the Month: Pick up where we left off, or start over?

Language of the Month was fun. Then it died. Now there's interest in bringing it back! I had assumed that we would just go back to the original nominations thread and pick the top-voted answer as LotM ...
257 views

### We decided to post a new factorial challenge. Should we close the old one as dupe?

The existing factorial challenge has some restrictions on the domain, performance, and banning built-ins. I opened a meta question about it a week ago, and as per the meta consensus, we decided to ...
85 views

### Can we do anything with the showcase?

The showcase is intended to, and was, a place to show and see new languages. In fact, it motivated me to learn ><>. But now, it's pretty much dead AFAIK. New languages keep coming in, but ...
144 views

### How can I retroactively deal with rules that turned out to make a challenge uninteresting?

I created a couple challenges recently which I was hoping would be pretty interesting, but turned into something significantly less interesting due to an oversight or regrettable rule. In De-...
195 views

### How do I let others use my custom golfing language?

I'm currently working on my own golfing language which is based on Python 3. Once this language is finished, what would be the best way to let other people use it? I know TIO is very widespread here, ...
319 views

### Should we remove unnecessary restrictions on the factorial challenge?

The Factorial challenge is one of the canonical challenges on our site. Just like "Hello World", "Add two numbers", "Primality test", and "Fibonacci", it ...
162 views

### Default policy for ouput in decision problems

Challenges tagged as decision-problem involve "deciding whether the input meets certain criteria". Although some challenges with this tag involve more than two categories, most involve only ...
142 views

### How can I improve my post?

Just recently I posted this king-of-the-hill question. It was a rock paper scissors contest, but opponents had access to each other's source codes. It wasn't very well received - it had some downvotes ...
88 views

### Unable to Delete and Unable to Close Vote

I've got a question that I really don't like (does not meet my standards, has repetitive answers because I did not realize how many languages had built-in functions for transpositions, etc). I would ...
192 views

### What counts as “output” in SQL? [duplicate]

Some of the site's questions rule that something must (or must not) be printed to the output. My question is, in the case of SQL, what really is the output? The ...
96 views

### Why languages encode their SBCS into UTF-8 and vice versa?

I saw that in many golfing programming languages with a SBCS other than UTF-8 there is a converter (encoding and decoding) that converts the code/file from the SBCS defined characters to UTF-8 and ...
139 views

### How to get reputation to post on the meta?

I'm sorry for posting here instead of on the meta but I'm not allowed to post on the meta. I need 5 reputation here to post in the sandbox. How am I supposed to get that if I am supposed to post in ...
56 views

### Do you gain reputation from upvotes from the meta site [closed]

I just have a simple question: Do you gain any reputation from the upvotes from the meta-site?
56 views

### Feedback for closed questions

I just posted a question available here: Print out a valid pokemon team! , which got closed due to lack of details. I do understand that at first, my question was somewhat unclear, as mentioned by ...
87 views

### Code Golf Contest(Idea)

Welcome to the idea of the Code Golf Contest, where many code golfers pit their skills against eachother in a Battle For Dream Island-esque competition! The prize? 300 reputation! The challenges will ...
183 views

### What's so great about code-golf. We're in the 2020s and memory isn't an issue. How about code-FormulaOne instead?

The challenging nature of aggressively optimizing for program size has itself long been recognized Wikipedia In the old days, memory was very limited The larger 360 models could have up to 8 MB of ...
337 views

### Goodbye PPCG, everybody stay healthy!

I just wanted to say goodbye, I have very little time for code golf lately and I'm losing interest, I don't know if I'll come back soon (if at all). What follows is just my random thoughts in no ...
387 views

### Why are some users so quick to jump on a bandwagon?

I've been lurking on this site long before I made my account, and I've seen many cases where people are downvoted simply because they post an answer in the same language as someone else and it happens ...
210 views

### Is “A solution wins if there's no strictly better solution in multiple measures” a valid winning criterion?

To cite a recently sandboxed challenge by l4m2: Solution win if there's no strictly better solution, aka. no solution that take less or same amount of items in mapping table, less or same amount of ...
278 views

### Omitting trailing closing parentheses in Excel

When golfing in Excel, it is often possible to omit closing parentheses at the end of an expression. Excel will detect this, add the missing closing parentheses and ask if this is what was meant. ...
284 views

### Duplicate between the main site and a Sandbox entry

The community has encouraged users to post a proposed challenge to the Sandbox for a few days before posting to the main site, to get feedback in the interest of improving the question and and to iron ...
110 views

### Where do good questions go? [closed]

It seems now few questions show enough serious sense, and lots are just random requirements. Where do good ones go, are they dilutioned, deleted or just posted less?
105 views

### How to ask for a parser

Refer to this challenge in Sandbox. My major language is Haskell. In Haskell, a parser (type ReadS) is a function that inputs a ...
107 views

### How can hash be allowed in a input-testing challenge?

Immagine to have a group of elements $G$, and a challenge that requires to output truthy if the input is in $G$. I suppose that in traditional programming ...
123 views

### Lack of obviousness about how to use this site

The problem is hardly unique to this SE site, but for people new to the site there is fundamental knowledge that isn't obvious. For instance, the "tour" page doesn't mention that questions must be ...
67 views

### Is this REST API question way too practical for the site?

I recently had one of the senior developers on my team code up a simple REST API server and client, using SSL, basic authentication, and .NET Core. I was a little shocked to see how much code it took ...
59 views

### How do I count C64 BASIC score? [duplicate]

So I recently posted 2 answers on C64 BASIC. I first counted it in characters, but after reading more about how the Commodore 64 works, I decided to start counting it in bytes. But there were ...


text:
In 1706 mathematician William Jones, born in the small village of Llanfihangel Tre'r Beirdd on Anglesey, became the first person to use the 16th letter of the Greek alphabet to represent the ratio of the circumference of a circle to its diameter. Previously the ratio was known as the Ludolphian number, after Ludolph van Ceulen, a German mathematician.
We all know that $\pi$ can be approximated as 22/7, but did you know that a better approximation is $\frac{355}{113}$ ? That's better than one part in 10 million, which seems unreasonably good.

Questions:

• Where does that come from?
• Can every number be approximated?
• Yes
• Why are some numbers better approximated than others?
• Because some are "closer" to rationals.
• Are there any with especially bad approximations?


text:
# What is a chemical combination of two or more different elements joined?

May 22, 2018

A synthesis reaction would be the easiest chemical reaction to understand.

A+ B →AB

#### Explanation:

Examples:

The synthesis of water

2 H_2(g) + O_2(g)→ 2 H_2O(g)

The synthesis of potassium chloride

2 K(s) + Cl_2(g) → 2 KCl(s)

Note: You take two elements react them together on the reactant side (left side), and you produce one compound on the product side (right side).


text:
MathSciNet bibliographic data MR1270620 (95d:65092) 65N15 (65N30) Han, Weimin; Jensen, Søren On the sharpness of \$L\sp 2\$$L\sp 2$-error estimates of \$H\sp 1\sb 0\$$H\sp 1\sb 0$-projections onto subspaces of piecewise, high-order polynomials. Math. Comp. 64 (1995), no. 209, 51–70. Article

For users without a MathSciNet license , Relay Station allows linking from MR numbers in online mathematical literature directly to electronic journals and original articles. Subscribers receive the added value of full MathSciNet reviews.


text:
# Math Help - Optimization: Max Capacity of Cone-Shaped Cup

1. ## Optimization: Max Capacity of Cone-Shaped Cup

A cone shaped drinking cup is made from a circular piece of paper of radius R by cutting out a sector and joining the edges CA and CB. Find the maximum capacity of such a cup.

2. ## Re: Optimization: Max Capacity of Cone-Shaped Cup

$R$ = sector radius (a given constant)

$r$ = cone radius

$h$ = cone height

$R^2 = r^2 + h^2$

$r^2 = R^2 - h^2$

$V = \frac{\pi}{3} r^2 h$

$V = \frac{\pi}{3} (R^2 - h^2)h$

$V = \frac{\pi}{3} (R^2 h - h^3)$

$\frac{dV}{dh} = \frac{\pi}{3} (R^2 - 3h^2)$

$\frac{dV}{dh} = 0$ and is a maximum when $h = \frac{R}{\sqrt{3}}$ since $\frac{d^2V}{dh^2} < 0$ for all $h$

$V_{max} = \frac{\pi}{3} \left(R^2 - \frac{R^2}{3}\right) \frac{R}{\sqrt{3}}$

$V_{max} = \frac{2 \pi R^3}{9\sqrt{3}}$


text:
• Potential impacts of climate change on groundwater resources: A multi-regional modelling assessment

• Fulltext

Permanent link:
https://www.ias.ac.in/article/fulltext/jess/128/05/0131

• Keywords

Climate change; groundwater; hydrogeology; semi-arid region; uncertainty; Iran; nonparametric probability density function

• Abstract

The complexity of understanding the groundwater resources in relation to climate change is caused by direct and indirect effects of climate change on hydrological processes. The study herein aims at implementing a physically based groundwater model to investigate the effects of climate change on groundwater system under 15 general circulation models (GCMs) in a semi-arid region from 2020 to 2044. A non-parametric probability density function estimator was used to quantify the level of uncertainties in the simulations. The method was applied to an area of 2073 km$^{2}$ in southwest Iran, consisting of five plains: western Dez, eastern Dez, Sabili, Deymche and Lor. The results indicate that there is a decline in the recharge in April, May, June and October. The range of changes in the recharge was determined to be between $-$10% and +13% in the Sabili plain, $-$6% and +10% in the Deymche plain, $-$4% and +10% in the western-Dez plain, $-$6% and +26% in the eastern-Dez plain, and $-$40% and +100% in the Lor plain. The most significant decline in the groundwater level occurred in the Sabili plain in September. The largest uncertainty in the simulation of recharge under GCM scenarios was determined to be in August, September and December. This study highlights that climate change can have a significant effect on groundwater resources in the region that reinforces the need for groundwater management plans and a long-term perspective.

• Author Affiliations

1. Department of Hydrology, Shahid Chamran University of Ahvaz, Ahvaz, Khuzestan, Iran.
2. Department of Civil Engineering, Jundi-Shapur University of Technology, Dezful, Khuzestan, Iran.
3. Department of Geomatics Engineering, University of Calgary, Calgary, AB, Canada.

• Journal of Earth System Science

Volume 129, 2020
All articles
Continuous Article Publishing mode

• Editorial Note on Continuous Article Publication

Posted on July 25, 2019

Click here for Editorial Note on CAP Mode

© 2017-2019 Indian Academy of Sciences, Bengaluru.


text:
# The angle sum rule¶

The angle sum rule is:

\begin{align}\begin{aligned}\sin(\alpha \pm \beta) = \sin \alpha \cos \beta \pm \cos \alpha \sin \beta\\\cos(\alpha \pm \beta) = \cos \alpha \cos \beta \mp \sin \alpha \sin \beta\end{aligned}\end{align}

## Proof¶

Let’s say we have a vector $$(x_1, y_1)$$ resulting from the anticlockwise rotation of a length 1 vector $$(1, 0)$$ by $$\alpha$$ degrees around the origin.

We rotate this vector another $$\beta$$ degrees anticlockwise around the origin to give length 1 vector $$(x_2, y_2)$$.

We can see from the picture that:

\begin{align}\begin{aligned}\cos(\alpha + \beta) = x_2 = r - u\\\sin(\alpha + \beta) = y_2 = t + s\end{aligned}\end{align}

We are going to use some basic trigonometry to get the lengths of $$r, u, t, s$$.

Because the angles in a triangle sum to 180 degrees, $$\phi$$ on the picture is $$90 - \alpha$$ and therefore the angle between lines $$q, t$$ is also $$\alpha$$.

Remembering the definitions of $$\cos$$ and $$\sin$$:

\begin{align}\begin{aligned}\cos\theta = \frac{A}{H} \implies A = (\cos \theta) H\\\sin\theta = \frac{O}{H} \implies O = (\sin \theta) H\end{aligned}\end{align}

Thus:

\begin{align}\begin{aligned}p = \cos \beta\\q = \sin \beta\\r = (\cos \alpha) p = \cos \alpha \cos \beta\\s = (\sin \alpha) q = \sin \alpha \cos \beta\\t = (\cos \alpha) q = \cos \alpha \sin \beta\\u = (\sin \alpha) q = \sin \alpha \sin \beta\end{aligned}\end{align}

So:

\begin{align}\begin{aligned}\cos(\alpha + \beta) = x_2 = r - u = \cos \alpha \cos \beta - \sin \alpha \sin \beta\\\sin(\alpha + \beta) = y_2 = t + s = \sin \alpha \cos \beta + \cos \alpha \sin \beta\end{aligned}\end{align}


text:
# zbMATH — the first resource for mathematics

The well-posedness of solutions for a generalized shallow water wave equation. (English) Zbl 1242.35191
Summary: A nonlinear partial differential equation containing the famous Camassa-Holm and Degasperis-Procesi equations as special cases is investigated. The Kato theorem for abstract differential equations is applied to establish the local well-posedness of solutions for the equation in the Sobolev space $$H^s(\mathbb{R})$$ with $$s > 3/2$$. Although the $$H^1$$-norm of the solutions to the nonlinear model does not remain constant, the existence of its weak solutions in the lower-order Sobolev space $$H^s$$ with $$1 \leq s \leq 3/2$$ is proved under the assumptions $$u_0 \in H^s$$ and $$||u_{0x}||_{L^\infty} < \infty$$.

##### MSC:
 35Q35 PDEs in connection with fluid mechanics
Full Text:
##### References:
 [1] A. Constantin and D. Lannes, “The hydrodynamical relevance of the Camassa-Holm and Degasperis-Procesi equations,” Archive for Rational Mechanics and Analysis, vol. 192, no. 1, pp. 165-186, 2009. · Zbl 1169.76010 · doi:10.1007/s00205-008-0128-2 [2] R. Camassa and D. D. Holm, “An integrable shallow water equation with peaked solitons,” Physical Review Letters, vol. 71, no. 11, pp. 1661-1664, 1993. · Zbl 0972.35521 · doi:10.1103/PhysRevLett.71.1661 [3] A. Degasperis and M. Procesi, “Asymptotic integrability,” in Symmetry and Perturbation Theory, vol. 7, pp. 23-37, World Scientific, Singapore, 1999. · Zbl 0963.35167 [4] R. S. Johnson, “Camassa-Holm, Korteweg-de Vries and related models for water waves,” Journal of Fluid Mechanics, vol. 455, pp. 63-82, 2002. · Zbl 1037.76006 · doi:10.1017/S0022112001007224 [5] A. Constantin, “The trajectories of particles in Stokes waves,” Inventiones Mathematicae, vol. 166, no. 3, pp. 523-535, 2006. · Zbl 1108.76013 · doi:10.1007/s00222-006-0002-5 [6] A. Constantin and J. Escher, “Particle trajectories in solitary water waves,” Bulletin of American Mathematical Society, vol. 44, no. 3, pp. 423-431, 2007. · Zbl 1126.76012 · doi:10.1090/S0273-0979-07-01159-7 [7] A. Bressan and A. Constantin, “Global conservative solutions of the Camassa-Holm equation,” Archive for Rational Mechanics and Analysis, vol. 183, no. 2, pp. 215-239, 2007. · Zbl 1105.76013 · doi:10.1007/s00205-006-0010-z [8] G. M. Coclite, H. Holden, and K. H. Karlsen, “Global weak solutions to a generalized hyperelastic-rod wave equation,” SIAM Journal on Mathematical Analysis, vol. 37, no. 4, pp. 1044-1069, 2005. · Zbl 1100.35106 · doi:10.1137/040616711 [9] A. Constantin and J. Escher, “Wave breaking for nonlinear nonlocal shallow water equations,” Acta Mathematica, vol. 181, no. 2, pp. 229-243, 1998. · Zbl 0923.76025 · doi:10.1007/BF02392586 [10] A. Constantin, V. S. Gerdjikov, and R. I. Ivanov, “Inverse scattering transform for the Camassa-Holm equation,” Inverse Problems, vol. 22, no. 6, pp. 2197-2207, 2006. · Zbl 1105.37044 · doi:10.1088/0266-5611/22/6/017 [11] A. Constantin and W. A. Strauss, “Stability of peakons,” Communications on Pure and Applied Mathematics, vol. 53, no. 5, pp. 603-610, 2000. · Zbl 1049.35149 · doi:10.1002/(SICI)1097-0312(200005)53:5<603::AID-CPA3>3.0.CO;2-L [12] A. Constantin and J. Escher, “Well-posedness, global existence, and blowup phenomena for a periodic quasi-linear hyperbolic equation,” Communications on Pure and Applied Mathematics, vol. 51, no. 5, pp. 475-504, 1998. · Zbl 0934.35153 · doi:10.1002/(SICI)1097-0312(199805)51:5<475::AID-CPA2>3.0.CO;2-5 [13] A. Constantin and R. S. Johnson, “Propagation of very long water waves, with vorticity, over variable depth, with applications to tsunamis,” Fluid Dynamics Research, vol. 40, no. 3, pp. 175-211, 2008. · Zbl 1135.76007 · doi:10.1016/j.fluiddyn.2007.06.004 [14] A. A. Himonas, G. Misiołek, G. Ponce, and Y. Zhou, “Persistence properties and unique continuation of solutions of the Camassa-Holm equation,” Communications in Mathematical Physics, vol. 271, no. 2, pp. 511-522, 2007. · Zbl 1142.35078 · doi:10.1007/s00220-006-0172-4 [15] H. Holden and X. Raynaud, “Dissipative solutions for the Camassa-Holm equation,” Discrete and Continuous Dynamical Systems. Series A, vol. 24, no. 4, pp. 1047-1112, 2009. · Zbl 1178.65099 · doi:10.3934/dcds.2009.24.1047 [16] Y. A. Li and P. J. Olver, “Well-posedness and blow-up solutions for an integrable nonlinearly dispersive model wave equation,” Journal of Differential Equations, vol. 162, no. 1, pp. 27-63, 2000. · Zbl 0958.35119 · doi:10.1006/jdeq.1999.3683 [17] Z. Xin and P. Zhang, “On the weak solutions to a shallow water equation,” Communications on Pure and Applied Mathematics, vol. 53, no. 11, pp. 1411-1433, 2000. · Zbl 1048.35092 · doi:10.1002/1097-0312(200011)53:11<1411::AID-CPA4>3.0.CO;2-5 [18] Y. Liu and Z. Yin, “Global existence and blow-up phenomena for the Degasperis-Procesi equation,” Communications in Mathematical Physics, vol. 267, no. 3, pp. 801-820, 2006. · Zbl 1131.35074 · doi:10.1007/s00220-006-0082-5 [19] Y. Zhou, “Blow-up of solutions to the DGH equation,” Journal of Functional Analysis, vol. 250, no. 1, pp. 227-248, 2007. · Zbl 1124.35079 · doi:10.1016/j.jfa.2007.04.019 [20] Z. Guo and Y. Zhou, “Wave breaking and persistence properties for the dispersive rod equation,” SIAM Journal on Mathematical Analysis, vol. 40, no. 6, pp. 2567-2580, 2009. · Zbl 1177.30024 · doi:10.1137/080734704 [21] S. Lai and Y. Wu, “Global solutions and blow-up phenomena to a shallow water equation,” Journal of Differential Equations, vol. 249, no. 3, pp. 693-706, 2010. · Zbl 1198.35041 · doi:10.1016/j.jde.2010.03.008 [22] S. Lai and Y. Wu, “A model containing both the Camassa-Holm and Degasperis-Procesi equations,” Journal of Mathematical Analysis and Applications, vol. 374, no. 2, pp. 458-469, 2011. · Zbl 1202.35231 · doi:10.1016/j.jmaa.2010.09.012 [23] T. Kato, “Quasi-linear equations of evolution, with applications to partial differential equations,” in Spectral Theory and Differential Equations, Lecture Notes in Mathematics, pp. 25-70, Springer, Berlin, Germany, 1975. · Zbl 0315.35077 [24] G. Rodríguez-Blanco, “On the Cauchy problem for the Camassa-Holm equation,” Nonlinear Analysis, vol. 46, no. 3, pp. 309-327, 2001. · Zbl 0980.35150 · doi:10.1016/S0362-546X(01)00791-X [25] Z. Y. Yin, “On the Cauchy problem for an integrable equation with peakon solutions,” Illinois Journal of Mathematics, vol. 47, no. 3, pp. 649-666, 2003. · Zbl 1061.35142 · www.math.uiuc.edu [26] T. Kato and G. Ponce, “Commutator estimates and the Euler and Navier-Stokes equations,” Communications on Pure and Applied Mathematics, vol. 41, no. 7, pp. 891-907, 1988. · Zbl 0671.35066 · doi:10.1002/cpa.3160410704 [27] W. Walter, Differential and Integral Inequalities, Springer, New York, NY, USA, 1970. · Zbl 0252.35005
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. It attempts to reflect the references listed in the original paper as accurately as possible without claiming the completeness or perfect precision of the matching.


text:
# Dew Point

Written by Jerry Ratzlaff. Posted in Properties

Due point is the exact temperature at which moisture begins to form.

Abbreviated as $$DP$$


text:
# Mini-Contest 2: Multi-Agent Adversarial Pacman

Version 1.001. Last Updated: 09/17/2019.

Due: Monday 10/25 at 11:59 pm

Enough of defense,
Onto enemy terrain.
Capture all their food!

## Overview

This mini-contest involves a multi-player capture-the-flag variant of Pacman, where agents control both Pacman and ghosts in coordinated team-based strategies. Your team will try to eat the food on the far side of the map, while defending the food on your home side. The contest code is available as a zip archive (minicontest2.zip).

You may choose to work alone or with one partner. There is room to bring your own unique ideas, and there is no single set solution. Much looking forward to seeing what you come up with!

## Extra Credit

Extra credit points are earned on top of the 25 points available in P2. E.g. if you earn 1 point of EC through the mini-contest and had a 25/25 on P2, then you’ll have 26/25 on P2.

Your agent will be tested on Gradescope against the baseline and a few staff agents on several selected maps in layouts/.

• 0.5 points for over 51% winning rate against the provided baseline agent in baselineTeam.py.
• 0.5 points for over 51% winning rate against “Staff Agent 1”.
• 0.5 points for over 51% winning rate against “Staff Agent 2”.
• 0.5 points for over 51% winning rate against “Staff Agent 3”.

Students that perform well in the final leaderboard, ranked by “final score” metric, will receive the following:

• 1st place: 2 points
• 2nd and 3rd place: 1.5 points
• 4th to 10th place: 1 point

## Introduction

The primary change between the first and second mini-contests is that mini-contest 2 is an adversarial game, involving two teams competing against each other. Your team will try to eat the food on the far side of the map, while defending the food on your home side.

Your agents are in the form of ghosts on your home side and Pacmen on your opponent’s side. Also, you are now able to eat your opponent when you are a ghost. If a Pacman is eaten by a ghost before reaching his own side of the board, he will explode into a cloud of food dots that will be deposited back onto the board.

Note that the mini-contest framework, provided in minicontest2.zip, has changed slightly from Mini-Contest 1. The functions and interfaces are nearly the same, but maps now include power capsules and you can eat your opponents.

 Files you'll edit: myTeam.py What will be submitted to Gradescope. Contains all of the code needed for your agent. Files you might want to look at: baselineTeam.py Example code that defines two very basic reflex agents, to help you get started. capture.py The main file that runs games locally. This file also describes the new capture the flag GameState type and rules. captureAgents.py Specification and helper methods for capture agents. Supporting files you can ignore (do not modify): captureGraphicsDisplay.py Graphics specific to capture-the-flag variant of Pacman. distanceCalculator.py Computes shortest paths between all maze positions. game.py The logic behind how the Pacman world works. This file describes several supporting types like AgentState, Agent, Direction, and Grid. graphicsDisplay.py Graphics for Pacman. graphicsUtils.py Support for Pacman graphics. keyboardAgents.py Keyboard interfaces to control Pacman. layout.py Code for reading layout files and storing their contents. mazeGenerator.py Code for generating Pacman maze layouts. textDisplay.py ASCII graphics for Pacman. util.py Useful data structures for implementing search algorithms.

Files to Edit and Submit: You will fill and submit myTeam.py. Please do not change the other files in this distribution or submit any of our original files other than this file.

External libraries: In this contest, you are allowed to use numpy as a dependency.

Academic Dishonesty: We will be checking your code against other submissions in the class for logical redundancy. If you copy someone else’s code and submit it with minor changes, we will know. These cheat detectors are quite hard to fool, so please don’t try. We trust you all to submit your own work only; please don’t let us down. If you do, we will pursue the strongest consequences available to us.

Getting Help: You are not alone! If you find yourself stuck on something, contact the course staff for help. Office hours, section, and the discussion forum are there for your support; please use them. If you can’t make our office hours, let us know and we will schedule more. We want these contests to be rewarding and instructional, not frustrating and demoralizing. But, we don’t know when or how to help unless you ask.

Discussion: Please be careful not to post spoilers.

## Rules

### Layout

The Pacman map is now divided into two halves: blue (right) and red (left). Red agents (which all have even indices) must defend the red food while trying to eat the blue food. When on the red side, a red agent is a ghost. When crossing into enemy territory, the agent becomes a Pacman.

There are a variety of layouts in the layouts directory.

### Scoring

As a Pacman eats food dots, those food dots are stored up inside of that Pacman and removed from the board. When a Pacman returns to his side of the board, he “deposits” the food dots he is carrying, earning one point per food pellet delivered. Red team scores are positive, while Blue team scores are negative.

If Pacman gets eaten by a ghost before reaching his own side of the board, he will explode into a cloud of food dots that will be deposited back onto the board.

### Power Capsules

If Pacman eats a power capsule, agents on the opposing team become “scared” for the next 40 moves, or until they are eaten and respawn, whichever comes sooner. Agents that are “scared” are susceptible while in the form of ghosts (i.e. while on their own team’s side) to being eaten by Pacman. Specifically, if Pacman collides with a “scared” ghost, Pacman is unaffected and the ghost respawns at its starting position (no longer in the “scared” state).

### Observations

Each agent can see the entire state of the game, such as food pellet locations, all Pacman locations, all ghost locations, etc. See the GameState section for more details.

### Winning

In this adversarial game, a team wins when they return all but two of the opponents’ dots. Games are also limited to 1200 agent moves (moves can be unequally shared depending on different speeds - faster agents get more moves). If this move limit is reached, whichever team has returned the most food wins.

If the score is zero (i.e., tied), the game is recorded as a tie.

### Computation Time

Each agent has 1 second to return each action. Each move which does not return within one second will incur a warning. After three warnings, or any single move taking more than 3 seconds, the game is forfeited. There will be an initial start-up allowance of 15 seconds (use the registerInitialState function).

## Designing Agents

An agent now has the more complex job of trading off offense versus defense and effectively functioning as both a ghost and a Pacman in a team setting. The added time limit of computation introduces new challenges.

### Baseline Team

To kickstart your agent design, we have provided you with a team of two baseline agents, defined in baselineTeam.py. They are quite bad. The OffensiveReflexAgent simply moves toward the closest food on the opposing side. The DefensiveReflexAgent wanders around on its own side and tries to chase down invaders it happens to see.

### File Format

You should include your agents in a file of the same format as myTeam.py. Your agents must be completely contained in this one file.

### Interface

The GameState in capture.py should look familiar, but contains new methods like getRedFood, which gets a grid of food on the red side (note that the grid is the size of the board, but is only true for cells on the red side with food). Also, note that you can list a team’s indices with getRedTeamIndices, or test membership with isOnRedTeam.

### Distance Calculation

To facilitate agent development, we provide code in distanceCalculator.py to supply shortest path maze distances.

### CaptureAgent Methods

To get started designing your own agent, we recommend subclassing the CaptureAgent class. This provides access to several convenience methods. Some useful methods are:

getFood(self, gameState)

Returns the food you’re meant to eat. This is in the form of a matrix where m[x][y]=True if there is food you can eat (based on your team) in that square.

getFoodYouAreDefending(self, gameState)

Returns the food you’re meant to protect (i.e., that your opponent is supposed to eat). This is in the form of a matrix where m[x][y]=True if there is food at (x,y) that your opponent can eat.

getOpponents(self, gameState)

Returns agent indices of your opponents. This is the list of the numbers of the agents (e.g., red might be [1,3]).

getTeam(self, gameState)

Returns agent indices of your team. This is the list of the numbers of the agents (e.g., blue might be [1,3]).

getScore(self, gameState)

Returns how much you are beating the other team by in the form of a number that is the difference between your score and the opponents score. This number is negative if you’re losing.

getMazeDistance(self, pos1, pos2)

Returns the distance between two points; These are calculated using the provided distancer object. If distancer.getMazeDistances() has been called, then maze distances are available. Otherwise, this just returns Manhattan distance.

getPreviousObservation(self)

Returns the GameState object corresponding to the last state this agent saw (the observed state of the game last time this agent moved).

getCurrentObservation(self)

Returns the GameState object corresponding this agent’s current observation (the observed state of the game).

debugDraw(self, cells, color, clear=False)

Draws a colored box on each of the cells you specify. If clear is True, this function will clear all old drawings before drawing on the specified cells. This is useful for debugging the locations that your code works with. color is a list of RGB values between 0 and 1 (i.e. [1,0,0] for red), cells is a list of game positions to draw on (i.e. [(20,5), (3,22)])

## Restrictions

You are free to design any agent you want. However, you will need to respect the provided APIs if you want to participate in the contest. Agents which compute during the opponent’s turn will be disqualified. In particular, any form of multi-threading is disallowed, because we have found it very hard to ensure that no computation takes place on the opponent’s turn.

Please respect the APIs and keep all of your implementation within myTeam.py.

## Getting Started

By default, you can run a game with the simple baselineTeam that the staff has provided:

python capture.py

A wealth of options are available to you:

python capture.py --help

There are four slots for agents, where agents 0 and 2 are always on the red team, and 1 and 3 are on the blue team. Agents are created by agent factories (one for Red, one for Blue). See the section on designing agents for a description of the agents invoked above. The only team that we provide is the baselineTeam. It is chosen by default as both the red and blue team, but command line options allow you to choose teams:

python capture.py -r baselineTeam -b baselineTeam

In this case, we specify that the red team -r and the blue team -b are both created from baselineTeam.py. To control one of the four agents with the keyboard, pass the appropriate option:

python capture.py --keys0

The arrow keys control your character, which will change from ghost to Pacman when crossing the center line.

### Layouts

By default, all games are run on the defaultcapture layout. To test your agent on other layouts, use the -l option. In particular, you can generate random layouts by specifying RANDOM[seed]. For example, -l RANDOM13 will use a map randomly generated with seed 13.

### Recordings

You can record local games using the --record option, which will write the game history to a file named by the time the game was played. You can replay these histories using the --replay option and specifying the file to replay.

## Submission

Please submit your myTeam.py file in the Mini-Contest 2 assignment on Gradescope.

You may choose to work alone or with one partner. If you do choose to work with a partner, whoever submits has to appropriately tag their partner at submission time.


text:
• 13
• 12
• 9
• 10
• 13

# Terrain Strips

This topic is 3641 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Is it possible to draw an entire Terrain using a single triangle strip? I can't find a way. I'm currently drawing a triangle strip for every row in the map. Thanks in advance.

##### Share on other sites
Yes, using degenerate triangles. But you might be better off using an indexed triangle list, the speed will be almost identical, and they're much easier to deal with.

If you have the following vertices:
0---------1---------2---------3|         |         |         ||         |         |         ||         |         |         |4---------5---------6---------7|         |         |         ||         |         |         ||         |         |         |8---------9--------10--------11

You can have an index buffer containing something like:
4, 0, 5, 1, 6, 2, 7, 3, 3, 8, 8, 4, 9, 5, 10, 6, 11, 7
Effectively, you put two backfacing triangles in the buffer so you can get to a new strip.

Actually, the more I look at that, the more I think I screwed it up, maybe someone else can confirm [smile]

##### Share on other sites
Ingenious!

It Works.

:)

I'm ashamed to say I used to be doing one draw call per quad and using set texture, until I found that it was the slowest thing in my rendering loop, despite being low-poly. Now the entire thing in one!


text:
# zbMATH — the first resource for mathematics

Leere konvexe Vielecke in ebenen Punktmengen. (Empty convex polygons in planar point sets). (German) Zbl 0629.52016
Naturwissenschaftliche Fakultät der Technischen Universität Carolo- Wilhelmina Braunschweig. 46 S. (1987).
For any planar n-point set M with no three points collinear, let $$h_ k(M)$$ be the number of empty convex k-gons in M (“empty” means that the convex k-gon has no point of M in its interior). Set $$h_ k(n)=\min \{h_ k(M):| M| =n\}$$. The author shows that $$h_ 3(n)\geq n^ 2-5n+7$$ and $$h_ 4(n)\geq \left( \begin{matrix} n-3\\ 2\end{matrix} \right)$$ and that equalities hold for $$3\leq n\leq 9$$. Moreover, he also shows that $$h_ 3(10)=58$$, $$h_ 4(10)=23$$, $$h_ 5(10)=1$$, $$h_ 3(11)=75$$, $$h_ 4(11)=32$$, $$h_ 5(11)=2$$, $$94\leq h_ 3(12)\leq 95$$, $$42\leq h_ 4(12)\leq 44$$, $$3\leq h_ 5(12)\leq 4$$ and, for all $$n\geq 13$$, $$h_ 3(n)\geq n^ 2- 5n+10,\quad h_ 4(n)\geq \left( \begin{matrix} n-3\\ 2\end{matrix} \right)+6$$ and $$h_ 5(n)\geq 3[n/12]$$.
Reviewer: J.Daneś

##### MSC:
 52A40 Inequalities and extremum problems involving convexity in convex geometry 52A37 Other problems of combinatorial convexity 52A10 Convex sets in $$2$$ dimensions (including convex curves) 52Bxx Polytopes and polyhedra
##### Keywords:
empty convex planar polygon


text:
## Roots in Mathematica

0

Example:

x = (-8)^(1/3)

Return:

2 (-1)^(1/3)

How simplifying?

I need an answer as x = -2

Thanks!

Question was closed 2015-11-04T05:13:28.847

$-1$ has three roots; Mathematica's choice (the "principal branch") happens to be complex. You'll want to use Surd[] for real-valued odd roots of negative numbers. See the linked thread for more details. – J. M.'s ennui – 2015-11-04T05:15:05.993

Excuse me! I read properly but not fluent in English to explain properly... – Dennis La Cotera – 2015-11-04T05:33:54.360