text:
Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
How to query more than one table
4. Join tables on a condition
Creating JOINs
Referencing columns
Let's practice

## Instruction

Surprised, huh? If there are 8 movies and 5 directors, most people will say that we'll get 5, 8 or 13 rows in the result. This is not true.

We've got 40 rows altogether because SQL takes every single movie and joins it with every possible director. So we now have 8 * 5 = 40 rows!

Why did this happen? SQL doesn't know what to do with the results from the two tables, so it gave you every possible connection. How can we change it? Take a look:

SELECT *
FROM person, car
WHERE person.id = car.owner_id;

We've set a new condition in the WHERE clause. We now see only those connections where id from person is the same as owner_id from car. Makes sense, right?

Take a closer look at how we provide the information about columns in the WHERE condition. If you have multiple tables, you should refer to specific columns by giving the name of the table and the column, separated by a dot (.). As a result, the column owner_id from the car table becomes car.owner_id and so on.

## Exercise

Select all columns from tables movie and director in such a way that a movie is shown together with its director.

### Stuck? Here's a hint!

Type:

SELECT *
FROM movie, director
WHERE director.id = movie.director_id;


text:
# Elementary chains of $\aleph_1$-saturated models

If $X$ and $Y$ are two sets linearily ordered by $<$, $X$ is called cofinal in $Y$ if $X \subseteq Y$ and and for every $y \in Y$, there is a $x \in X$ with $y < x$.

If $M$ is some model and $\varphi(x)$ is a formula in the corresponding language, possibly with parameters from $M$, then $\varphi(M)$ denotes the subset of $M$ defined by $\varphi(x)$.

Let $L$ be a language containing a binary relation symbol $<$. Let $T$ be a theory in $L$ containing axioms which express that $<$ is a discrete linear order without a greatest element. Let

$\phantom{asdsdsdsd}$ $M_0 \prec M_1 \prec M_2 \prec ...$

be a countable elementary chain of models of $T$ such that each $M_i$ satisfies the following properties:

i) $M_i$ is $\aleph_1$-saturated

ii) card$(M_i)$ $<$ card$(M_{i+1})$

iii) for every $L$-formula $\varphi(x)$, possibly with parameters from $M_i$, $\varphi(M_i)$ is cofinal in $\varphi(M_{i+1})$ (i.e. each definable subset of $M_i$ is cofinal in the "corresponding" definable subset of $M_{i+1}$)

Here is the question: Is the limit $\bigcup_{i\in \mathbb{N}} M_i$ $\aleph_1$-saturated?

## 1 Answer

The answer is not necessarily.

Let me describe how to make a counterexample.

First, notice that your requirement that $\varphi(M_i)$ is cofinal in $\varphi(M_{i+1})$ is equivalent merely to the assertion that $M_i$ is cofinal in $M_{i+1}$, which is a special case if one uses a trivial formula. The reason is that the theory of discrete endless orders admits an elimination of quantifiers argument by which every assertion is equivalent to a Boolean combination of various assertions about specific finite distances from the parameters. It follows that $\varphi(M_i)$ either has a largest element, in which case this will also be largest in $M_{i+1}$, or else $\varphi(M_i)$ consists of a final segment of $M_i$, in which case it also will in $M_{i+1}$. So your requirement (iii) is asserting merely that $M_i$ is cofinal in $M_{i+1}$.

The quantifier elimination argument also shows that whenever one discrete order is a substructure of another in such a way to preserve the successor operation, it will therefore preserve finite distances and thus be an elementary substructure.

So, let build the counterexample like this. Start with any $\aleph_1$-saturated $M_0$. Fix a point in $M_0$ that we will call $0$, and consider the points of $M_0$ that are finitely far from $0$. This is the $\mathbb{Z}$-block around $0$ in $M_0$. Let $M_0\prec M_1$ be an elementary $\aleph_1$-saturated cofinal extension of $M_0$, of strictly larger size, which has new $\mathbb{Z}$-blocks just above the $0$-block of $M_0$, but below any other $\mathbb{Z}$-blocks of $M_0$. This is easy enough to arrange, since we can easily find saturated elementary extensions with such new elements, and if our extension happend to not be cofinal, we can simply chop it off at the cut determined by $M_0$ and still have an elementary extension, using the elimination of quantifiers result and the fact that the cofinality of $M_0$ must be uncountable since it itself is saturated.

Continuing in this way, we may build $$M_0\prec M_1\prec M_2\prec\cdots$$ as desired, satisfying all your properties, but such that at each stage, we add a new $\mathbb{Z}$ chain of elements in $M_{i+1}$ just above the $0$-chain of $M_0$, and below all other $\mathbb{Z}$-chains above $0$ in $M_i$.

It follows that the union $\bigcup_i M_i$ is not $\aleph_1$-saturated, since the cut determined by the $0$-chain in this union will have cofinality $\omega$ in the space of $\mathbb{Z}$-chains. More specifically, we can pick $x_i\in M_{i+1}$ in one of the newly added $\mathbb{Z}$-chains of $M_i$, so that $\langle x_i\mid i\in\omega\rangle$ is descending, but the only elements in the union model that are below every $x_i$ and above $0$ are finitely close to $0$. Thus, the type corresponding to squeezing a new $\mathbb{Z}$-chain in between $0$ and the $x_i$'s is not realized, and so the union model is not $\aleph_1$-saturated.

Meanwhile, there are other examples where the union model is $\aleph_1$-saturated. To build such an example, start with $M_0$, again $\aleph_1$-saturated. Fix $\omega$ many cuts in $M_0$, in order, in between $\mathbb{Z}$-chains of $M_0$, such that the cut determined at the supremum of these cuts has uncountable descending cofinality. Now make $$M_0\prec M_1\prec M_2\prec \cdots$$ by systematically adding a huge number of new points just in the $i^{th}$ cut at stage $i$. That is, the model $M_{i+1}$ is formed by adding to $M_i$ a huge number of points in the $i^{th}$ cut, and only adding points in that cut. These extensions will be elementary, by the quantifier elimination argument. They will be cofinal extensions, since we're never adding points on top. They will be saturated, provided that what we start with is saturated and what we add is saturated (note that the cut should have uncountable cofinality from at least one direction, and this will help to prove that the filling that cut with the new structure will be saturated). Finally, I claim that the union model is saturated, simply because the new elements in the successive $M_i$ are in totally different cuts of $M_0$ and do not interact in any way that is useful for defining a type, using the fact that the upper bounds of these new elements has uncountable cofinality.

• The assertions in your second paragraph are not true in general. They only hold if the language contains nothing but the ordering (which is however fine for the counterexample). – Emil Jeřábek Jun 25 '14 at 22:21
• Yes, I had meant that part to refer only to models with the order relation, which is all my examples require. But still, doesn't this fully answer the question? In some instances, I show, the union is not $\aleph_1$ saturated, and in other instances, it is. – Joel David Hamkins Jun 26 '14 at 0:55
• Your counterexample completely answers my question. – russoo Jun 26 '14 at 13:46

format: plain


text:
# TIME_AVERAGE_OUTPUT

Specifies parameters to output time-averaged nodal fields.

AcuSolve Command

## Syntax

TIME_AVERAGE_OUTPUT {parameters}

## Qualifier

This command has no qualifier.

## Parameters

order (integer) >=1 <=2 [=2]
Order of output fields. If one, first-order data are output. If two, first and second-order data are output. Currently only two is supported.
output_frequency or out_freq (integer) >=0 [=0]
Time step frequency at which to output nodal solutions. If zero, this option is ignored.
output_time_interval or out_intv (real) >=0 [=0]
Time frequency at which to output nodal solutions. If zero, this option is ignored.
reset_frequency or reset_freq (integer) >=0 [=0]
Time step frequency at which to reset the averaging process. If zero, never reset.
num_saved_states or save (integer) >=0 (=0)
Number of nodal solutions to keep. If zero, all nodal solution files are kept.

## Description

This command specifies the frequency at which to output time-averaged nodal values into a results database. For example,
TIME_AVERAGE_OUTPUT {
order                = 2
output_frequency     = 10
output_time_interval = 0
reset_frequency      = 10
}

specifies that the time-averaged nodal values up to the second-order terms are to be output at every 10 time steps and at the last time step. The sums for averaging the data will be reset every 10 time steps.

Once the solution has been written to disk, it can then be translated to other formats using the AcuTrans program and other post-processing modules; see the AcuSolve Programs Reference Manual for details.

When order is set to one, then the averaged quantities of velocity, pressure, and stress are output. The velocity averaging is performed on the conservative set of solutions. When order is two, the averaged quantities are these plus the square of velocity and the square of pressure. Only order=2 is supported currently.

If either output_frequency or output_time_interval is non-zero, the solution will be output at the end of the run. If both are zero, no time averaging is performed and no data are output.

Run times may not coincide with output_time_interval. In this case, at every time step which passes through a multiple of output_time_interval, the solution is output.

The num_saved_states parameter indicates the number of nodal solution files to save. Once the (num_saved_states + 1)th file is written, the first one is removed. When running in parallel, once all files are written (in parallel), then the old ones are removed (in parallel).


text:
+0

# Assigning var

0
232
4
+4

Is there a way to define a variable to use an equation? E.x.: 3x^2-2x+5=y, and I want to assign x a value without changing it out. Is it possible?

CatBoy13  Dec 12, 2014

#3
+91479
+10

Welcome to web2.0calc forum Catboy13

Umm - Interesting question.

$$\begin{array}{rll} 3x^2-2x+5&=&y\\\\ 3x^2-2x&=&y-5\\\\ x^2-\frac{2}{3}x&=&\frac{y-5}{3}\\\\ x^2-\frac{2}{3}x+\left(\frac{2}{6}\right)^2&=&\frac{y-5}{3}+\left(\frac{2}{6}\right)^2\\\\ x^2-\frac{2}{3}x+\left(\frac{1}{3}\right)^2&=&\frac{y-5}{3}+\left(\frac{1}{3}\right)^2\\\\ x^2-\frac{2}{3}x+\left(\frac{1}{3}\right)^2&=&\frac{3(y-5)}{9}+\frac{1}{9}\\\\ \left(x-\frac{1}{3}\right)^2&=&\frac{3y-15+1}{9}\\\\ \left(x-\frac{1}{3}\right)^2&=&\frac{3y-14}{9}\\\\ x-\frac{1}{3}&=&\pm\sqrt{\frac{3y-14}{9}}\\\\ x&=&\frac{1}{3}\pm\sqrt{\frac{3y-14}{9}}\\\\ x&=&\frac{1\pm\sqrt{3y-14}}{3}}\\ \end{array}$$

Melody  Dec 13, 2014
Sort:

#1
+7188
0

I believe it is possible....but I might be wrong...

happy7  Dec 12, 2014
#2
0

If you first define a function f as

$${f}{\left({\mathtt{x}}\right)} = {\mathtt{3}}{\mathtt{\,\times\,}}{{\mathtt{x}}}^{{\mathtt{2}}}{\mathtt{\,-\,}}{\mathtt{2}}{\mathtt{\,\times\,}}{\mathtt{x}}{\mathtt{\,\small\textbf+\,}}{\mathtt{5}}$$

then for any particular x the function f(x) has a value and you can write things such as

f(2) + f(0) - 4 = 14

Guest Dec 12, 2014
#3
+91479
+10

Welcome to web2.0calc forum Catboy13

Umm - Interesting question.

$$\begin{array}{rll} 3x^2-2x+5&=&y\\\\ 3x^2-2x&=&y-5\\\\ x^2-\frac{2}{3}x&=&\frac{y-5}{3}\\\\ x^2-\frac{2}{3}x+\left(\frac{2}{6}\right)^2&=&\frac{y-5}{3}+\left(\frac{2}{6}\right)^2\\\\ x^2-\frac{2}{3}x+\left(\frac{1}{3}\right)^2&=&\frac{y-5}{3}+\left(\frac{1}{3}\right)^2\\\\ x^2-\frac{2}{3}x+\left(\frac{1}{3}\right)^2&=&\frac{3(y-5)}{9}+\frac{1}{9}\\\\ \left(x-\frac{1}{3}\right)^2&=&\frac{3y-15+1}{9}\\\\ \left(x-\frac{1}{3}\right)^2&=&\frac{3y-14}{9}\\\\ x-\frac{1}{3}&=&\pm\sqrt{\frac{3y-14}{9}}\\\\ x&=&\frac{1}{3}\pm\sqrt{\frac{3y-14}{9}}\\\\ x&=&\frac{1\pm\sqrt{3y-14}}{3}}\\ \end{array}$$

Melody  Dec 13, 2014
#4
+91479
0

I have added this to the Sticky Topic - "Great Answers to Learn From"

Melody  Dec 14, 2014

### 4 Online Users

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.  See details


text:
# Thread: [SOLVED] trig function cos^2

1. ## [SOLVED] trig function cos^2

Solve: $4 cos^2 x = 3$
for
0 < x < 2pi

I thought the way I did it was right but I get the wrong answer.

so I factored
cosx(4cosx)=3
so
cosx=3 and 4cosx=3
cosx cannot =3 so 4cosx=3 ....
cosx=3/4

so I sketch a little graph and find x=pi/6 and 15 pi/8? but this gets confusing. whats the right way to find this?
but that isnt right, could someone help me with this question?

thanks.

2. Originally Posted by brentwoodbc
Solve: $4 cos^2 x = 3$
for 0 < x < 2pi
No not quite.
$4 cos^2(x)=3$
$cos(x)=\pm \frac{\sqrt{3}}{2}$

3. Originally Posted by Plato
No not quite.
$4 cos^2(x)=3$
$cos(x)=\pm \frac{\sqrt{3}}{2}$
thanks I just realized that.
but my teacher said you could factor and solve like.
$cos^2x-1=0$
cos(x)=0 and cosx=1
x=0,pi/2,3pi/2,2pi ? is that wrong?

4. Originally Posted by brentwoodbc
my teacher said you could factor and solve like. $cos^2x-1=0$
cos(x)=0 and cosx=1
x=0,pi/2,3pi/2,2pi ? is that wrong?
Yes it is wrong.
$4cos^2(x)-3=0$
$cos^2(x)-\frac{3}{4}=0$
$(cos(x)-\frac{\sqrt3}{2})(cos(x)+\frac{\sqrt3}{2})=0$

5. sorry an example of the way I did it is
sin^2x-sinx=0
sinx = 0 and sinx-2=0

this is one of the ways he taught us, he said if its a quadratic to do this, isnt the first example I gave you a quadratic with the b term =0 so why doesnt it work?

6. Originally Posted by Plato
Yes it is wrong.
$4cos^2(x)-3=0$
$cos^2(x)-\frac{3}{4}=0$
$(cos(x)-\frac{\sqrt3}{2})(cos(x)+\frac{\sqrt3}{2})=0$
thanks that answers my last post.

Thank you.


text:
# Spacing and font in \frac

When I write text in frac, it looks bad no space... bad font. How can I change it

\documentclass{article}
\begin{document}
$\frac{Lorem Ipsum}{abc dfe}$
\end{document}

• In math mode, letters are spaced like a product of variables. Ifyou really want text, load amsmath and use frac{\text{Lorem Ipsum}}{\text{abc def}}. – Bernard Aug 2 '20 at 22:05
• it is unrelated to \frac spaces are ignored in math mode try $abc def$ – David Carlisle Aug 2 '20 at 22:06

You could make the space character active in math mode to insert a thick muskip in its place. For this you will have to modify the definition of \obeyspaces (which I should probably propose to the LaTeX core) to make the expansion of the obeyed space overrideable. Then you just have to append \obeyspaces to \everymath and \everydisplay and you are all set to produce the most horrible-looking documents.

\documentclass{article}

\makeatletter
\def\obeyedspace{\space}
\def\@obeyedspace{\obeyedspace}
{\obeyspaces\global\let \@obeyedspace}
\makeatother

\renewcommand\obeyedspace{\;}
\everydisplay={\obeyspaces}
\everymath={\obeyspaces}

\begin{document}

$\frac{Lorem Ipsum}{abc dfe}$

\end{document}


text:
# $1.25 PPP per day poverty threshold - What precisely does it mean? As Wikipedia states: In 2008, the World Bank came out with a revised figure of$1.25 at 2005 purchasing-power parity (PPP).

(Update: In 2015, this was updated to $\$1.90$at 2015 PPP.) Wikipedia cites Ravallion, Chen, & Sangraula. "Dollar a Day Revisited", 2009. Of course, there will always be difficulties with measurement. But conceptually, what precisely is this$\$1.25$ figure meant to capture?

Does it mean the equivalent of someone having to pay for absolutely everything (food, water, shelter, utilities, transport, education, etc.) with just $\$1.25$a day, in a place where prices are similar to those of the US average in 2005? Or something else? • Do I understand correctly that you know what "PPP at 2005" means but you wonder what is "covered" by the \$1.25 at PPP2005, and in particular if conceptually these \$1.25 are supposed to pay for non-durable goods only, or to if they are also meant to pay for non-durable goods? – Martin Van der Linden Nov 25 '14 at 19:27 • You do understand correctly that I know what "PPP at 2005" means but I wonder what is "covered" by the$1.25 at PPP2005. – Kenny LJ Nov 25 '14 at 22:49
• Thanks for clarifying this point. I would have been able to help you with PPP, but not with the "coverage" issue which I would love to hear about from someone else. – Martin Van der Linden Nov 25 '14 at 23:17
• Some interesting reading on this topic here: web.worldbank.org/WBSITE/EXTERNAL/TOPICS/EXTPOVERTY/EXTPA/… – Ubiquitous Nov 26 '14 at 8:01

A partial answer : I m not sure what measurement the World Bank would recommend, but I suspect that in practice, the expenses that are taken into account to measure whether one is below or above the 1.25$threshold vary from one study to another. For instance in their famous The Economic Lives of the Poor, Banerjee and Duflo write "From each of these surveys we identified the extremely poor as those living in households where the consumption per capita is less than \$1.08 per person per day, as well as the merely “poor” defined as those who live under \$2.16 a day using the PPP in year 1993 as benchmark.3 The use of consumption, rather than income, is motivated by the better quality of the consumption data in these surveys (Deaton, 2004)." The use of "consumption per capita" suggest that capital income, such as the benefits one get from owning her own house, would not be taken into account. Because data quality considerations seem to enter the picture, it opens the door to much variation from one study to the other. The above quote however suggests that at equal data quality, income data would be preferred. The FAQ in the World Bank website provides detailed information about it. Some excerpts below (emphasis mine): We start with national poverty lines, which usually reflect the line below which a person’s minimum nutritional, clothing, and shelter needs cannot be met in that country. Not surprisingly, richer countries tend to have higher poverty lines, while poorer countries have lower poverty lines. So they usually reflect only food, clothing and housing costs. Do not include transport or education. However, it depends on how each country defines the national poverty line. Apparently the WB does not alter these lines. When we want to identify how many people in the world live in extreme poverty, however, we cannot simply add up the national poverty rates of each country, because this would mean using a different yardstick to identify who is poor in each and every country. We therefore need a poverty line that measures poverty in all countries by the same standard. Aggregating across these lines is not enough. You need to make them comparable. That is where the PPP comes in. In 1990, a group of independent researchers and the World Bank proposed to measure the world’s poor using the standards of the poorest countries in the World. They examined national poverty lines from some of the poorest countries in the world, and converted the lines to a common currency by using purchasing power parity (PPP) exchange rates. The PPP exchange rates are constructed to ensure that the same quantity of goods and services are priced equivalently across countries. So what is PPP? According to Chapter 1 in this website: A Purchasing Power Parity is a form of exchange rate based upon a comparison of prices between countries. The Big Mac Index compiled and published by the Economist is a widely known example of a PPP based on a single consumption item. The Big Mac Index is based on the comparison of its cost between countries compared to its cost in the US. A Big Mac in the Philippines, for example, cost 68 pesos in July 2004 compared to$2.90 in the US. In the Big Mac index, the ratio of the price in pesos divided by the US price is 23.5, and this figure is a basic example of a Purchasing Power Parity between the Philippines and the US. The ratio, 23.5, implies that 23.5 pesos have the same purchasing power as one US dollar. [...] In reality, Purchase Power Parities are prepared using relative prices for a very large number of comparable goods and services because the levels of price differences vary between different items and parts of the economy.


text:
# Non-integral toroidal Dehn surgeries

Date(s) : 08/07/2016   iCal
11 h 00 min - 12 h 00 min

Many years ago I constructed an infinite family of hyperbolic knots that admit a half integral toroidal Dehn surgery, that is, a surgery that produces a manifold containing an essential torus. The construction was made by means of tangles and double branched covers. Some years later, Gordon and Luecke proved that this family consists of all knots with a non-integral toroidal surgery.
Now I give an explicit construction of some of these knots, that is, a direct construction of the knots, without using double branched covers.

Catégories Pas de Catégories


text:
In this article we will explore binomial distribution and binomial test in Python.

## Introduction

To continue following this tutorial we will need the following Python libraries: scipy, numpy, and matplotlib.

If you don’t have it installed, please open “Command Prompt” (on Windows) and install it using the following code:

pip install scipy
pip install numpy
pip install matplotlib

## What is a binomial distribution

Binomial distribution is one of the most popular distributions in statistics, along with normal distribution. Binomial distribution is a discrete probability distribution of a number of successes ($$X$$) in a sequence of independent experiments ($$n$$). Each experiment has two possible outcomes: success and failure. Success outcome has a probability $$p$$, and failure has probability $$(1-p)$$.

Note: an individual experiment is also called a Bernoulli trial, an experiment with exactly two possible outcomes. And binomial distribution for one experiment ($$n=1$$) is also a Bernoulli distribution.

In other words, binomial distribution models the probability of observing either success or failure outcome in an independent experiment that is repeated multiple times.

Let’s say probability of success is equal to:

$$p$$

then probability of failure is equal to:

$$q=1-p$$

So the probability of achieving $$k$$ successes and $$n-k$$ failures is equal to:

$$p^k \times (1-p)^{n-k}$$

And the number of ways to achieve $$k$$ successes is calculated as:

$$\frac{n!}{(n-k)! \times k!}$$

Using the above notations we can solve for a probability mass function (total probability of achieving $$k$$ successes $$n$$ experiments):

$$f(k;n,p) = Pr(k;n,p) = Pr(X=k) = \frac{n!}{(n-k)! \times k!} p^k (1-p)^{n-k}$$

Note: probability mass function (pmf) – a function that gives the probability that a discrete random variable is exactly equal to some value.

And the formula for the binomial cumulative probability function is:

$$F(k;n,p) = \sum^{x}_{i=0} \frac{n!}{(n-i)! \times i!} p^i (1-p)^{n-i}$$

Example:

You are rolling a single 6-sided die 12 times, and you want to find out the probability of getting 3 as an outcome 5 times. Here, getting 3 is a success outcome, while getting anything else (1, 2, 4, 5, 6) is a failure outcome. Clearly, on each roll, your probability of getting 3 is $$\frac{1}{6}$$.
According to the data we have here, rolling a die 12 times, you should get 3 as an outcome 2 times ($$12 \times \frac{1}{6}$$).

Now, how do we actually calculate the probability of observing 3 as an outcome 5 times?

Using the above formula we can easily solve for it. We have an experiment that occurs 12 times ($$n$$ = 12), number of outcomes in question is 5 ($$k$$ = 5), and probability is $$\frac{1}{6}$$ or 0.17 rounded ($$p$$ = 0.17).

Plugging into the above equation we get:

$$Pr(5;12,0.17) = Pr(X=5) = \frac{12!}{(12-5)! \times 5!} 0.17^5 (1-0.17)^{12-5} = 0.03$$

and the binomial distribution for such experiment would look like this:

You can clearly see that observing 3 as an outcome has the highest probability at 2 times, and probability of observing it 5 times is less than 0.05.

## Create and plot binomial distribution in Python

Let’s now explore how to create the binomial distribution values and plot it using Python. In this section, we will work with three Python libraries: numpy, matplotlib, and scipy.

We will first import the required modules:

import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import binom

For the data, we will continue with the example from the previous section, where we roll a die 12 times ($$n$$ = 12) wherethe probability of observing any number from 1 to 6 is $$\frac{1}{6}$$ or 0.16 ($$p$$ = 0.17).

Now we will create values for them in Python:

n = 12
p = 0.17
x = np.arange(0, n+1)

where $$x$$ is an array of numbers from 0 to 12, representing the number of times any number can be observed.

n = 12
p = 0.17
x = np.arange(0, n+1)

Using this data we can now calculate the binomial probability mass function. Probability mass function (PMF) is a function that gives the probability that a binomial discrete random variable is exactly equal to some value.

In our example, it will show the number of times from 12 rolls you can observe any number that has probability of 0.17.

Construct PMF:

binomial_pmf = binom.pmf(x, n, p)

print(binomial_pmf)

And you should get an array with 13 values (which are the probabilities for our $$x$$ values):

[1.06890008e-01 2.62717609e-01 2.95952970e-01 2.02056244e-01
9.31162813e-02 3.05152151e-02 7.29178834e-03 1.28014184e-03
1.63873579e-04 1.49175414e-05 9.16620011e-07 3.41348087e-08
5.82622237e-10]

Now that we have the binomial probability mass function, we can easily visualize it:

plt.plot(x, binomial_pmf, color='blue')
plt.title(f"Binomial Distribution (n={n}, p={p})")
plt.show()

and you should get:

Now, how about trying to interpret what we see?

The graph shows that if we choose any number from 1 to 6 (die sides) and roll the die 12 times, the highest probability for any of those numbers to be observed is 2 times.

In other words, if I choose number 1 and roll the die 12 times, most likely 1 will show up 2 times.

If you ask, what is the probability that 1 will show up 6 times? By looking at the above graph you can see that it’s slightly more than 0.02 or 2%.

## What is a binomial test

Binomial test is a one-sample statistical test of determining whether a dichotomous score comes from a binomial probability distribution.

Using the example from the previous section, let’s reword the question in a way that we can do some hypothesis testing. The following is the situation:

You suspect that a die is biased towards number 3 (three dots) you decided to roll it 12 times ($$n$$ = 12) and observed a value of 3 (three dots) 5 times ($$k$$ = 5) . You want to understand whether the die is biased towards number 3 or not (recall that expected probability of observing 3 is $$\frac{1}{6}$$ or 0.17).

Formulating hypothesis we would have:

$$H_0: \pi \leq \frac{1}{6}$$

$$H_1: \pi > \frac{1}{6}$$

And now calculating the probability:

$$Pr(5;12,0.17) = Pr(X=5) = \frac{12!}{(12-5)! \times 5!} 0.17^5 (1-0.17)^{12-5} = 0.03$$

Here the probability is the $$p$$-value for the significance test. Since 0.03<0.05, we reject the null hypothesis and accept the alternative hypothesis that the die is biased towards number 3.

## Binomial test in Python (Example)

Let’s now use Python to do the binomial test for the above example.

It is a very simple few line implementation of .binomtest() function from the scipy library.

Step 1:

Import the function.

from scipy.stats import binomtest

Step 2:

Define the number of successes ($$k$$), define the number of trials ($$n$$), and define the expected probability success ($$p$$).

k=5
n=12
p=0.17

Step 3:

Perform the binomial test in Python.

res = binomtest(k, n, p)
print(res.pvalue)

and we should get:

0.03926688770369119

which is the $$p$$-value for the significance test (similar number to the one we got by solving the formula in the previous section).

Note: by default, the test computed is a two-tailed test. If you are working with one-tailed test situation, please refer to the scipy documentation of this function.

## Conclusion

In this article we explored binomial distribution and binomial test, as well as how to create and plot binomial distribution in Python, and perform a binomial test in Python.

Feel free to leave comments below if you have any questions or have suggestions for some edits and check out more of my Statistics articles.

The post Binomial Distribution and Binomial Test in Python appeared first on PyShark.


text:
threeStage {DRIP} R Documentation

## Denoising, deblurring and edge-preserving

### Description

Estimate surface using local smoothing and fitting principal component line. Bandwidth is specified by user.

### Usage

threeStage(image, bandwidth, edge1, edge2,
blur = FALSE, plot = FALSE)

### Arguments

 image A square matrix object of size n by n, no missing value allowed. bandwidth A positive integer that specifies the number of pixels used in the local smoothing. edge1 A matrix of 0 and 1 of the same size as image represents detected step edge pixels edge2 A matrix of 0 and 1 of the same size as image represents detected roof/valley edge pixels blur If blur = TRUE, besides a conventional 2-D kernel function, a univariate increasing kernel function is used in the local kernel smoothing to address the issue with blur. plot If plot = TRUE, the image of the fitted surface is plotted

### Details

At each pixel, if there are step edges detected in the local neighborhood, a principal component line is fitted through the detected edge pixels to approximate the step edge locally and then the regression surface is estimated by a local constant kernel smoothing procedure using only the pixels on one side of the principal component line. If there are no step edges but roof/valley edges detected in the local neighborhood, the same procedure is followed except that the principal component line to fitted through the detected roof/valley edge pixels. In cases when there is either no step edges or roof/valley edges detected in the neighborhood, the regression surface at the pixel is estimated by the conventional local linear kernel smoothing procedure.

### Value

Returns the restored image, which is represented by a matrix

### References

Qiu, P., and Kang, Y. "Blind Image Deblurring Using Jump Regression Analysis," Statistica Sinica, 25, 2015, 879-899.

JPLLK_surface, surfaceCluster
data(sar)


text:
1. Generating Function help

Hey there I need some help on what to do next for this problem.

In how many ways can you make change for a dollar using
pennies, nickels, dimes, quarters, and half-dollars?

so far I got
(1+x+x^2+x^3+...+x^100) <-- pennies
(1+x^5+x^10+x^15+....+x^100) <- nickels
(1+x^10+x^20+x^30+...+x^100) <- dimes
(1+x^25+x^50+x^75+x^100) <- quarters
(1+x^50+x^75+x^100) <- half dollars

and the generating function is
1/(1-x)(1-x^5)(1-x^10)(1-x^25)(1-x^50)

what do I do from here to get the answer I need?

2. Re: Generating Function help

Hey gfbrd.

What does this function refer to? Are you trying to solve a recurrence relation? Is this function meant to be equal to 0 where you need to find the roots?

3. Re: Generating Function help

sorry but i dont think i did anything wrong here, all i want to know is how do i get the coefficient for x^100 from the generating function

4. Re: Generating Function help

Ohh I see what you are trying to do.

Try expanding out (1-x^5)(1-x^10)(1-x^25)(1-x^50) and then look at the generating function for (1-x) when you get these terms multiplied by the expansion to give x^100 (there should be 16 terms to look for) then collect the coeffecients together.

5. Re: Generating Function help

what do you mean by expanding?
do I multiply this out?

(1+x+x^2+x^3+...+x^100)(1+x^5+x^10+x^15+....+x^100 )(1+x^10+x^20+x^30+...+x^100)(1+x^25+x^50+x^75+x^1 00)(1+x^50+x^75+x^100)
if so how do I multiply this out, it would take forever to do it by hand

6. Re: Generating Function help

No don't do that: multiply out (1-x^5)(1-x^10)(1-x^25)(1-x^50) and then look for when x^n * all the individual terms in the expanding polynomial give an x^100 term and collect those terms together.

Your generating function will be in terms of a_n*x^n so all you need to check are the terms where a_n*x^n * blah*x^k give a_n*blah*x^(n+k) where n+k = 100.

7. Re: Generating Function help

ok i expanded it and i got

1-x^5-x^10+x^15-x^25+x^30+x^35+x^40-x^50+x^55+x^60-x^65+x^75-x^80-x^85+x^90

i dont really see any x^100 terms here
im not sure what do i really do next sorry im a bit slow on this

8. Re: Generating Function help

Now you have to consider (1-x^5-x^10+x^15-x^25+x^30+x^35+x^40-x^50+x^55+x^60-x^65+x^75-x^80-x^85+x^90)*a_n*x^n where all these terms have a x^100 term in them.

For example 1*a_n*x^n has n = 100, while -x^5*a_n*x^n has n = 95 and so on.

9. Re: Generating Function help

going from left to right i get n=100,n=95,n=90,n=85,n=75,n=70,n=65,n=60,n=50,n=45 ,n=40,n=35,n=25,n=20,n=15,n=10
but what do i do with these terms though? sorry i need to take this slowly to understand

10. Re: Generating Function help

Now you need to consider what the a_n's are for those terms and then add them up.

Remember that these terms are the only time the whole series if were expanding out as a generating function gave a b_n*x^n where n = 100 where this is for the full expanding series.

Since you have all the possible terms where the n = 100 for the b_n, then the b_n for the expanding series will be the same of all the a_n's in your 1/(1-x) that correspond to those terms which means if you find all the a_n's and multiply them by the coffecients in the polynomial you just expanded then you will get the b_100 term which is the coffecient of the generating series for n = 100.

A few examples might clear things up:

1*a_100 for the first term
-a_5 for the second term
-a_10 for the third term

and so on

and then the final coffecient will be the sum of all these terms since all these terms have the common x^100 term if you looked at the completely expanding generator function with x^100*b_100 (you are trying to find b_100).

11. Re: Generating Function help

sorry i dont know if i understand this or not
1a_100-a_95-a_90+a_85-a_75+a_70+a_65+a_60-a_50+a_45+a_40-a_35+a_25-a_20-a_15+a_10

12. Re: Generating Function help

That's the right technique and that should give you the coeffecient for the 100th term if the polynomial and the calculation is correct.

13. Re: Generating Function help

so its a_120? if so then i think there might be a mistake, because i believe the answer should be 292 istead

14. Re: Generating Function help

No it's not that: you don't add up the indexes but the actual values.

a_100 is the value of the generating series of 1/(1-x) at the 100th position, a_75 is at the 75th position (i.e. n = 100. n = 75) and so on. You need to add these terms up, not the indices themselves.

15. Re: Generating Function help

Oh alright thanks for all your help


text:
# How to find the derivative of the flow of an autonomous differential equation with respect to $x$

Ok, may be this is a silly question but consider the following.

Let $\dot x=f(x)$ be an autonomous differential equation with $f$ having enough smoothness (Say $C^2$). Let $\xi:\mathbb R\to[0,\infty)$ with compact support $[-r,r]$ for some $r>0$. Let $\phi_t(x)$ denote the flow of the given differential equation. I wan to find the following derivative.

$$\frac{d}{dx}(\xi(\phi_t(x)) \tag{A}$$

Here is what I did. By chain rule we get \begin{align} \frac{d}{dx}(\xi(\phi_t(x)) &=\xi'(\phi_t(x)\frac{\partial}{\partial x}(\phi_t(x))) \quad \text{by chain rule}\\ &=\xi'(\phi_t(x)\frac{d}{dt}\left(\phi_t(x) \right)\cdot \frac{dt}{dx} \tag{*}\\ &=\xi'(\phi_t(x)(f(\phi_t(x)) \frac{1}{\dot x} \tag{**} \end{align}

Question? I am not convinced about the lines denoted as (* ) and (**) above. Can anybody please show me how this derivative can be found. May be I am missing some property of the flow of a differential equation. (I know that for a flow $\phi_t(x)$ of a differential equation that $\dot \phi_t =f(\phi_t)$)

Some context I eventually want to be able to compute the derivative of the following integral. $$\eta (x) =\int_0^\infty e^{at} \xi(\phi_t(x)) dt$$ for a given $f$. Since differentiation under the integral sign can be easily justified this shouldn't be a problem if I can somehow find the derivative in $(A)$

Addendum What if $f(x)=-ax+\xi(x)?$. Does that make any difference as far as $\partial \phi_t/\partial x$ not being able to be simplified?. If $f(x)$ is the given function then I know some properties of $\phi_t$. For example the origin is asymptotically stable and so $\phi_t(x) \to 0$ as $t\to \infty$. I can also assume $\xi(0)=\xi'(0)=0$ as well. By continuous dependance theorem I can also safely say that $\phi_t$ is sufficiently smooth.

• Note that $x$ is the initial condition of the system, and you want to compute the derivative of the solution at time $t$ with respect to this initial condition. Th computation of the derivative is a little more involved than the above. – copper.hat Aug 26 '14 at 4:20
• Yes, this is something that has always bothered me. Is $x$ fixed or not?. Why do they use the same letter $x$ in the differential equation and for the initial condition?. I am sure there is a good reason, but I am completely confused now. – minibuffer Aug 26 '14 at 4:34
• (*) is incorrect. Think of $\phi_t(x)=\phi(t,x)$ as a function of two variables. You want the partial derivative with respect to $x$. – user138530 Aug 26 '14 at 4:35
• @JackDawkins: It is a little confusing. I prefer to use a different letter to distinguish the initial condition from the solution at some time $t$ (clearly they are the same for $t=0$). – copper.hat Aug 26 '14 at 4:38
• $\partial \phi_t/\partial x$ can't really be simplified. You can characterize it as the solution of another ODE, which you obtain by differentiating the original equation. – user138530 Aug 26 '14 at 4:39

Remember that $\phi_t(x)$ is the solution at time $t$ to the system $\dot{y} = f(y)$ with initial condition $y(0) = x$.

The following skips a lot of details, but hopefully gives some idea of one approach to 'computing' the derivative you required.

To compute ${\partial \phi_t(x) \over \partial x}$, consider the system $L(z,x) = 0$, where $L(z,x)(t) = x+ \int_0^t f(z(\tau)) d \tau -z(t)$ and $L : C^n[0,t] \times \mathbb{R}^n \to C^n[0,t]$.

Some work shows that $({ \partial L(z,x) \over \partial z}h) (s) = \int_0^s { \partial f(z(\tau)) \over \partial y} h(\tau) d \tau-h(s)$ (with $s \in [0,1]$), some more work shows that the map $D h = { \partial L(z,x) \over \partial z}h$ is continuous, and that the equation $D h = b$ is invertible (with $b \in C^n[0,t]$), and so the operator ${ \partial L(z,x) \over \partial z}$ is invertible.

It is straightforward to see that $({ \partial L(z,x) \over \partial x}\delta)(s) = \delta$ (with $s \in [0,1]$), and applying the implicit function theorem (see Kantorovich & Akilov, "Functional analysis", for example) to $L(z,x) = 0$ gives the existence of some $\zeta$ such that $L(\zeta(a), a) = 0$ for $a$ in some neighbourhood of $x$. Furthermore, ${ \partial L(z,x) \over \partial z} { \partial \zeta(x) \over \partial x} = -{ \partial L(z,x) \over \partial x}$, and so, for any $\delta \in \mathbb{R}^n$, we have $({ \partial L(z,x) \over \partial z} ({ \partial \zeta(x) \over \partial x} \delta))(s) = -\delta$.

Unwinding this, and letting $\eta = { \partial \zeta(x) \over \partial x} \delta$, gives $\eta$ as the solution to the equation $\int_0^s { \partial f(z(\tau)) \over \partial y} \eta(\tau) d \tau-\eta(s) = -\delta$, or in other words, $\eta$ solves $\dot{\eta}(s) = { \partial f(z(s)) \over \partial y} \eta(s)$, with $\eta(0) = \delta$.

Suppose $\Phi(t_1,t_2)$ is the state transition matrix for $\dot{\eta}(s) = { \partial f(z(s)) \over \partial y} \eta(s)$, then we have ${ \partial \phi_t(x) \over \partial x} \delta = \eta(t) = \Phi(t,0) \delta$, the solution of the 'linearised' differential equation at time $t$.

• Thanks for the hints. What I wanted to show was $\eta(x)$ was $C^1$. May be there is an indirect way to show this without actually 'computing' the derivative under the integral sign. – minibuffer Aug 27 '14 at 0:51
• Well, $C^1$ will follow from the continuity of the partials of $L$. – copper.hat Aug 27 '14 at 4:11

Your confusion comes from the abuse of notation. The derivative is taken with respect to the initial value $x(0)$, rather than position $x(t)$. The integral is ought to be $$\eta(x(0))=\int_0^\infty e^{at}\xi(\phi_t(x(0)))dx$$ But it looks rather tedious and hence ignore the parenthesis. To make a clear statement, avoiding $x$ explicitly, let's assume $x(t)=\phi_t(p)$, with $x(0)=\phi_0(p)=p$, then we can write $$\frac{d}{dp}\xi(\phi_t(p))=\frac{d\xi(\phi_t)}{d\phi_t}\frac{d\phi_t}{dp}$$


text:
## anonymous one year ago rotation of a bounded area question i can't solve Write the integral in one variable to find the volume of the solid obtained by rotating the first-quadrant region bounded by y = 0.5x^2 and y = x about the line x = 5.

1. anonymous

my trouble is mainly with the fact that the rotation is done around x=5 and not the x axis

2. anonymous

im sure something changes but not sure what

3. anonymous

Do you prefer the washer or shell method?

4. anonymous

well i don't know the shell method so washer i suppose

5. anonymous

Observe that the dimensions of the washer that you'll be interested in (i.e. radius) will have to be written in terms of $$y$$. Let's draw the region first: |dw:1439519332453:dw|

6. anonymous

so does that mean we will have to integrate with sespect to y?

7. anonymous

Yes! Since $$y=\dfrac{1}{2}x^2$$, you have $$x=\sqrt{2y}$$ (taking the positive root since we're in the first quadrant). Here's a washer associated with an matching of points $$(x,y)=(\sqrt{2y},y)$$ and $$(x,y)=(y,y)$$ on the boundary of the region: |dw:1439519657597:dw|

8. anonymous

(As you'll no doubt learn soon enough, the shell method allows you to integrate with respect to $$x$$ instead.)

9. anonymous

Correction: the inner radius should be $$5-\color{red}{\sqrt{2y}}$$

10. anonymous

The volume of the solid is the infinite sum of the areas of these infinitely thin washers. The area of a washer is essentially the difference of the areas of circles. Take some circle with radius $$OR$$ and put some smaller circle with radius $$IR$$ at the larger one's center. The area of the large circle is $$\pi(OR)^2$$, and that of the smaller circle is $$\pi(IR)^2$$. Remove the smaller circle from the larger, and you're left with the washer shape, which has area $$\pi((OR)^2-(IR)^2)$$. So, to add up all these areas, you take the integral. It'll look something like this (I'll leave the details to you): $V=\int_a^b \pi((OR)^2-(IR)^2)\,dy$

11. anonymous

okay sorry lost internet connection , back now give me a second to read all that you posted

12. anonymous

okay so tell me if this is way off $V = \pi \int\limits_{0}^{2}(y^2)-({2y}) dy$

13. anonymous

It's off by little bit. Your setup would be right if you were revolving about the $$y$$-axis (the line $$x=0$$).

14. anonymous

okay so do i just add 5 to each expression or something?

15. anonymous

Sort of... if you take another look at that sketch, you'll notice that I lay out the lengths of a few distances. Let me remove some of that clutter: |dw:1439520860137:dw| Notice that the two smaller distances must add up to $$5$$. That is, $y+OR=5$ This means $$OR=5-y$$, not just $$y$$.

16. anonymous

Similarly, you can figure out what the inner radius would be by breaking down these distances: |dw:1439521024630:dw| You have $$\sqrt{2y}+IR=5$$, so $$IR=5-\sqrt{2y}$$.

17. anonymous

okay thats interesting let me give it another shot $V = \pi \int\limits_{0}^{2} (-x-5)^2 - (5-\sqrt{2y}) dy$

18. anonymous

woops forgot to square the last part

19. anonymous

I think you meant $$5-x$$, or $$-x+5$$ for the first term? Squared, of course.

20. anonymous

$$y$$, not $$x$$**

21. anonymous

22. anonymous

im getting 5.333 , does that look right to you?

23. anonymous

Yup

24. anonymous

times $$\pi$$, right?

25. anonymous

oh yea forgot :)

26. anonymous

It doesn't look like you actually had to do the computation, but maybe those instructions were just left out? Anyway, setting up these types of integrals is the hardest part.

27. anonymous

(usually)

28. anonymous

thanks for the help ! :D

29. anonymous

You're welcome!


text:
# Performance

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

## Recommended Posts

I appologize for a vague and hard-to-answer question, but I'ma give it a shot. I'm trying to make a first person game. All I have so far is a freely moving camera, and walls which consist of 5 quads ( no bottom ). I find that with as few as 10 walls, performance is slowing to really choppy. I figure I'll post as much code as I think is relevent, and if anyone sees anything that pops out at them, it'd be great. Otherwise, if some great soul could suggest other parts of my code that might be relevent, that'd also be great. I'd love to say more about where the problem might be, but I'm a bit of a neophyte. Oh, also: it mostly is pretty smooth. It seems like there are patches of very slowness, mostly around walls. I init like this:
gl.glShadeModel(GL.GL_SMOOTH);
gl.glEnable( GL.GL_DEPTH_TEST );
gl.glDepthFunc( GL.GL_LEQUAL );
gl.glHint( GL.GL_PERSPECTIVE_CORRECTION_HINT , GL.GL_NICEST );

gl.glEnable( GL.GL_COLOR_MATERIAL );

gl.glLightfv( GL.GL_LIGHT1 , GL.GL_AMBIENT  , ambient  );
gl.glLightfv( GL.GL_LIGHT1 , GL.GL_DIFFUSE  , diffuse  );
gl.glLightfv( GL.GL_LIGHT1 , GL.GL_POSITION , position );

gl.glEnable( GL.GL_LIGHTING );
gl.glEnable( GL.GL_LIGHT1 );

My light variables are
private float[] ambient =  { .6f , .6f , .6f , 1 };
private float[] diffuse =  { .2f , .2f , .2f , 1 };
private float[] position = { 0f , 0f , 0f , 1 };

I draw my walls like this:
gl.glPushMatrix();
gl.glColor3f( .7f , .7f , .7f );

gl.glTranslatef( x1 , y1 , 0 );
gl.glRotatef( theta * Util.TO_DEG , 0 , 0 , 1 );

gl.glEnd();
gl.glPopMatrix();

A thousand thanks for anyone who reads this. -Upton

##### Share on other sites
well, it sounds like you're not hardware accelerated. Most likely, the OpenGL wrapper you're using has no hardware support. You need to post what wrapper you are using and on what video card. drawing that should be fine unless you have no hardware acceleration at all.

##### Share on other sites
I'm using JoGL, on a NVidia GEFORCE FX 5200. How do I make it hardware accelerate?

##### Share on other sites
perhaps this is relevant:

my capabilities look like this:

GLCapabilities capabilities=new GLCapabilities();capabilities.setHardwareAccelerated(true);capabilities.setDoubleBuffered(true);

##### Share on other sites
How do the JOGL demos run?

If they run well then its something in your code that's wrong. If they run choppily as well try updating your version of JOGL and your video card drivers to the latest versions. There have been many fixes recently for the JSR231 version of JOGL which may help you.

One thing that could also be slowing your app down is if you aren't sorting your walls for depth before drawing. If, for example, your view contained all 10 walls and each wall covered 75% of the screen, that means you could be repainting the entire screen ~7 times each frame.

Cheers,
Brett

##### Share on other sites
Interesting. Is that a manual sort, or a gl.glEnable( SORT_ME_BLEEDIN_WALLS )?

Thanks.

##### Share on other sites
On what basis do I sort the walls? Distance to nearest endpoint? Farthest? Distance to line?

Thanks,
Upton

##### Share on other sites
wonder if I can bump this one more time...

##### Share on other sites
The simplest way is to just sort them (manually :) front to back within the view then render them in order. The z-culling should take care of the overdraw as long as you have depth testing enabled.

(btw sorry I disappeared, MUCH work to do)

Edit:
You might also want to ask this over at Javagaming where the people who actually work on JOGL answer questions.

Cheers,
Brett

##### Share on other sites
I really hate to sound dim, and I appreciate all your help, but on what basis sholud I sort my walls? If a wall is two vertecies, should I sort on distance to line? I'd like to avoid using something like a BSP tree.

Thanks

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633736
• Total Posts
3013598
×


text:
# Revision history [back]

### Thickness of points in plots

How can I change the thickness of points in a graph?

In case it is not clear what I mean, consider the following program, illustrating Chebyshev's bias:

var('N') N=[] l=0 k=7 for p in prime_range(10^k+1): if (p==2): N.append(0)
else: if (Mod(p,4)==1): N.append(N[l]-1) l=l+1 else: N.append(N[l]+1) l=l+1 list_plot(N).show()

(Sorry, I cannot yet upload graphs, but you may quickly run this example and see that:) The dots seem too thick to rally appreciate any fine features of the graph. Is there a way to make the dots smaller (thinner)?

 2 formatting Shashank 1887 ●26 ●47 ●81

### Thickness of points in plots

How can I change the thickness of points in a graph?

In case it is not clear what I mean, consider the following program, illustrating Chebyshev's bias:

var('N')
N=[]
l=0
k=7
for p in prime_range(10^k+1):
if (p==2):
N.append(0)
else:
if (Mod(p,4)==1):
N.append(N[l]-1)
l=l+1
else:
N.append(N[l]+1)
l=l+1
list_plot(N).show()list_plot(N).show()

(Sorry, I cannot yet upload graphs, but you may quickly run this example and see that:) The dots seem too thick to rally appreciate any fine features of the graph. Is there a way to make the dots smaller (thinner)?


text:
## 9.1.5 Mean Squared Error (MSE)

Suppose that we would like to estimate the value of an unobserved random variable $X$ given that we have observed $Y=y$. In general, our estimate $\hat{x}$ is a function of $y$: \begin{align} \hat{x}=g(y). \end{align} The error in our estimate is given by \begin{align} \tilde{X}&=X-\hat{x}\\ &=X-g(y). \end{align} Often, we are interested in the mean squared error (MSE) given by \begin{align} E[(X-\hat{x})^2 | Y=y]=E[(X-g(y))^2 | Y=y]. \end{align} One way of finding a point estimate $\hat{x}=g(y)$ is to find a function $g(Y)$ that minimizes the mean squared error (MSE). Here, we show that $g(y)=E[X|Y=y]$ has the lowest MSE among all possible estimators. That is why it is called the minimum mean squared error (MMSE) estimate.

For simplicity, let us first consider the case that we would like to estimate $X$ without observing anything. What would be our best estimate of $X$ in that case? Let $a$ be our estimate of $X$. Then, the MSE is given by

\begin{align} h(a)&=E[(X-a)^2]\\ &=EX^2-2aEX+a^2. \end{align} This is a quadratic function of $a$, and we can find the minimizing value of $a$ by differentiation: \begin{align} h'(a)=-2EX+2a. \end{align} Therefore, we conclude the minimizing value of $a$ is \begin{align} a=EX. \end{align} Now, if we have observed $Y=y$, we can repeat the above argument. The only difference is that everything is conditioned on $Y=y$. More specifically, the MSE is given by \begin{align} h(a)&=E[(X-a)^2|Y=y]\\ &=E[X^2|Y=y]-2aE[X|Y=y]+a^2. \end{align} Again, we obtain a quadratic function of $a$, and by differentiation we obtain the MMSE estimate of $X$ given $Y=y$ as \begin{align} \hat{x}_{M}=E[X|Y=y]. \end{align}

Suppose that we would like to estimate the value of an unobserved random variable $X$, by observing the value of a random variable $Y=y$. In general, our estimate $\hat{x}$ is a function of $y$, so we can write \begin{align} \hat{X}=g(Y). \end{align} Note that, since $Y$ is a random variable, the estimator $\hat{X}=g(Y)$ is also a random variable. The error in our estimate is given by \begin{align} \tilde{X}&=X-\hat{X}\\ &=X-g(Y), \end{align} which is also a random variable. We can then define the mean squared error (MSE) of this estimator by \begin{align} E[(X-\hat{X})^2]=E[(X-g(Y))^2]. \end{align} From our discussion above we can conclude that the conditional expectation $\hat{X}_M=E[X|Y]$ has the lowest MSE among all other estimators $g(Y)$.
Mean Squared Error (MSE) of an Estimator

Let $\hat{X}=g(Y)$ be an estimator of the random variable $X$, given that we have observed the random variable $Y$. The mean squared error (MSE) of this estimator is defined as \begin{align} E[(X-\hat{X})^2]=E[(X-g(Y))^2]. \end{align} The MMSE estimator of $X$, \begin{align} \hat{X}_{M}=E[X|Y], \end{align} has the lowest MSE among all possible estimators.

### Properties of the Estimation Error:

Here, we would like to study the MSE of the conditional expectation. First, note that \begin{align} E[\hat{X}_M]&=E[E[X|Y]]\\ &=E[X] \quad \textrm{(by the law of iterated expectations)}. \end{align} Therefore, $\hat{X}_M=E[X|Y]$ is an unbiased estimator of $X$. In other words, for $\hat{X}_M=E[X|Y]$, the estimation error, $\tilde{X}$, is a zero-mean random variable \begin{align} E[\tilde{X}]=EX-E[\hat{X}_M]=0. \end{align} Before going any further, let us state and prove a useful lemma.

Lemma
Define the random variable $W=E[\tilde{X}|Y]$. Let $\hat{X}_M=E[X|Y]$ be the MMSE estimator of $X$ given $Y$, and let $\tilde{X}=X-\hat{X}_M$ be the estimation error. Then, we have
1. $W=0$.
2. For any function $g(Y)$, we have $E[\tilde{X} \cdot g(Y)]=0$.
Proof:
1. We can write \begin{align} W&=E[\tilde{X}|Y]\\ &=E[X-\hat{X}_M|Y]\\ &=E[X|Y]-E[\hat{X}_M|Y]\\ &=\hat{X}_M-E[\hat{X}_M|Y]\\ &=\hat{X}_M-\hat{X}_M=0. \end{align} The last line resulted because $\hat{X}_M$ is a function of $Y$, so $E[\hat{X}_M|Y]=\hat{X}_M$.
2. First, note that \begin{align} E[\tilde{X} \cdot g(Y)|Y]&=g(Y) E[\tilde{X}|Y]\\ &=g(Y) \cdot W=0. \end{align} Next, by the law of iterated expectations, we have \begin{align} E[\tilde{X} \cdot g(Y)]=E\big[E[\tilde{X} \cdot g(Y)|Y]\big]=0. \end{align}

We are now ready to state a very interesting property of the estimation error for the MMSE estimator. Namely, we show that the estimation error, $\tilde{X}$, and $\hat{X}_M$ are uncorrelated. To see this, note that \begin{align} \textrm{Cov}(\tilde{X},\hat{X}_M)&=E[\tilde{X}\cdot \hat{X}_M]-E[\tilde{X}] E[\hat{X}_M]\\ &=E[\tilde{X} \cdot\hat{X}_M] \quad (\textrm{since $E[\tilde{X}]=0$})\\ &=E[\tilde{X} \cdot g(Y)] \quad (\textrm{since $\hat{X}_M$ is a function of }Y)\\ &=0 \quad (\textrm{by Lemma 9.1}). \end{align} Now, let us look at $\textrm{Var}(X)$. The estimation error is $\tilde{X}=X-\hat{X}_M$, so \begin{align} X=\tilde{X}+\hat{X}_M. \end{align} Since $\textrm{Cov}(\tilde{X},\hat{X}_M)=0$, we conclude \begin{align}\label{eq:var-MSE} \textrm{Var}(X)=\textrm{Var}(\hat{X}_M)+\textrm{Var}(\tilde{X}). \hspace{30pt} (9.3) \end{align} The above formula can be interpreted as follows. Part of the variance of $X$ is explained by the variance in $\hat{X}_M$. The remaining part is the variance in estimation error. In other words, if $\hat{X}_M$ captures most of the variation in $X$, then the error will be small. Note also that we can rewrite Equation 9.3 as \begin{align} E[X^2]-E[X]^2=E[\hat{X}^2_M]-E[\hat{X}_M]^2+E[\tilde{X}^2]-E[\tilde{X}]^2. \end{align} Note that \begin{align} E[\hat{X}_M]=E[X], \quad E[\tilde{X}]=0. \end{align} We conclude \begin{align} E[X^2]=E[\hat{X}^2_M]+E[\tilde{X}^2]. \end{align}
Some Additional Properties of the MMSE Estimator

- The MMSE estimator, $\hat{X}_{M}=E[X|Y]$, is an unbiased estimator of $X$, i.e., \begin{align} E[\hat{X}_{M}]=EX, \quad E[\tilde{X}]=0. \end{align}
- The estimation error, $\tilde{X}$, and $\hat{X}_{M}$ are uncorrelated \begin{align} \textrm{Cov}(\tilde{X},\hat{X}_M)=0. \end{align}
- We have \begin{align} \textrm{Var}(X)&=\textrm{Var}(\hat{X}_M)+\textrm{Var}(\tilde{X}),\\ E[X^2]&=E[\hat{X}^2_M]+E[\tilde{X}^2]. \end{align}
Let us look at an example to practice the above concepts. This is an example involving jointly normal random variables. Thus, before solving the example, it is useful to remember the properties of jointly normal random variables. Remember that two random variables $X$ and $Y$ are jointly normal if $aX+bY$ has a normal distribution for all $a,b \in \mathbb{R}$. As we have seen before, if $X$ and $Y$ are jointly normal random variables with parameters $\mu_X$, $\sigma^2_X$, $\mu_Y$, $\sigma^2_Y$, and $\rho$, then, given $Y=y$, $X$ is normally distributed with \begin{align}%\label{} \nonumber &E[X|Y=y]=\mu_X+ \rho \sigma_X \frac{y-\mu_Y}{\sigma_Y},\\ \nonumber &\textrm{Var}(X|Y=y)=(1-\rho^2)\sigma^2_X. \end{align}

Example
Let $X \sim N(0, 1)$ and \begin{align} Y=X+W, \end{align} where $W \sim N(0, 1)$ is independent of $X$.
1. Find the MMSE estimator of $X$ given $Y$, ($\hat{X}_M$).
2. Find the MSE of this estimator, using $MSE=E[(X-\hat{X_M})^2]$.
3. Check that $E[X^2]=E[\hat{X}^2_M]+E[\tilde{X}^2]$.
• Solution
• Since $X$ and $W$ are independent and normal, $Y$ is also normal. Moreover, $X$ and $Y$ are also jointly normal, since for all $a,b \in \mathbb{R}$, we have \begin{align} aX+bY=(a+b)X+bW, \end{align} which is also a normal random variable. Note also, \begin{align} \textrm{Cov}(X,Y)&=\textrm{Cov}(X,X+W)\\ &=\textrm{Cov}(X,X)+\textrm{Cov}(X,W)\\ &=\textrm{Var}(X)=1. \end{align} Therefore, \begin{align} \rho(X,Y)&=\frac{\textrm{Cov}(X,Y)}{\sigma_X \sigma_Y}\\ &=\frac{1}{1 \cdot \sqrt{2}}=\frac{1}{\sqrt{2}}. \end{align}
1. The MMSE estimator of $X$ given $Y$ is \begin{align} \hat{X}_M&=E[X|Y]\\ &=\mu_X+ \rho \sigma_X \frac{Y-\mu_Y}{\sigma_Y}\\ &=\frac{Y}{2}. \end{align}
2. The MSE of this estimator is given by \begin{align} E[(X-\hat{X_M})^2]&=E\left[\left(X-\frac{Y}{2}\right)^2\right]\\ &=E\left[X^2-XY+\frac{Y^2}{4}\right]\\ &=EX^2-E[X(X+W)]+\frac{EY^2}{4}\\ &=EX^2-EX^2-EXEW+\frac{EY^2}{4}\\ &=\frac{\textrm{Var}(Y)+(EY)^2}{4}\\ &=\frac{2+0}{4}=\frac{1}{2}. \end{align}
3. Note that $E[X^2]=1$. Also, \begin{align} E[\hat{X}^2_M]=\frac{EY^2}{4}=\frac{1}{2}. \end{align} In the above, we also found $MSE=E[\tilde{X}^2]=\frac{1}{2}$. Therefore, we have \begin{align} E[X^2]=E[\hat{X}^2_M]+E[\tilde{X}^2]. \end{align}

The print version of the book is available through Amazon here.


text:
scrolling led matrix

Status
Not open for further replies.

MrDEB

Well-Known Member
I have a clunky code that works BUT feel that this posted code may work better. My present clunky code has too mant spaces etc. In this posted code it uses a buffer to store the const arrays but it won't compile.
Any explanation as to how this posted code works as I have tried to understand what is going on but can't figure out how the const arrays are xfered from the Display_buffer to Data bus.(see draw data sub) the compile error is in this _ Data_Bus = Display_Out XOR $11111111 DIM Display_Out AS BYTE ' CONST array data DIM Display_Buffer(8) AS BYTE ' data to send to matrix DIM Data_Bus AS portb ' data that matrix displays DIM Colum_start AS WORD ' cathodes DIM Anode_Data AS PORTC ' Anodes DIM x AS BYTE DIM y AS BYTE DIM Speed AS BYTE //SUB ROUTINES SUB Load_Buffer() FOR x = 0 TO 96 ' 120 / 8 = 15 Display_Buffer(x) = Sentence_Data(x) NEXT END SUB SUB Draw_Data() FOR x = Colum_start TO (Colum_start+7) ' COLUMS ON PORT b counter Display_Out = Display_Buffer(x) ' const data Data_Bus = Display_Out XOR$11111111 ' inverts the CONST array data at the port
Display_Buffer(x) = Sentence_Data(x)
Data_Bus = Sentence_Data XOR %11111111 ' reverse the data bits
Data_Bus = 0 ' data bus
Data_Bus.bits(7 - (x- Colum_start)) = 1 ' cycle the anodes from 0 to 7
Data_Bus = 0
display_out = 1
DELAYMS(10)
display_out= 0

NEXT

END SUB

SUB Scroll_Text()
IF Speed <> 0 THEN
DEC(Speed)
ELSE
Speed = 6
Colum_start = Colum_start + 1
IF Colum_start + 8 = 96 THEN ' # of elements in CONST array Colum Start is Cathodes on portb
Colum_start = 0
END IF
END IF
END SUB

SetAllDigital // Make all Pins digital I/O's
TRISC = %00000000 // Make PORTD all outputs
TRISB = %00000000 // Make PORTB all outputs
y = 0
Speed = 50
Colum_start = 0
WHILE true

Draw_Data()
FOR y = 0 TO 20
Draw_Data()
NEXT
Scroll_Text()
WEND

MrDEB

Well-Known Member
Ah yes I corrected and now it compiles but the matrix is blank??

Dr_Doggy

Well-Known Member
Load_Buffer() is where the data imports to Display_Buffer(x) from Sentence_Data(x)

Sentence_Data(x) is likely where you put what you want to see on display(or aka the buffer that doesnt draw as you are editing)... i do not see it even declared yet

MrDEB

Well-Known Member
Thanks will look at that as well as I don't find where the anodes are enabled.

Dr_Doggy

Well-Known Member
EDIT: AH yes, Anode_Data is missing

also this snipit may need additional modification if hardware is different

what is your hardware like, do you follow the same, ie cathode on portB annode on portC?

Dr_Doggy

Well-Known Member
for debug purposes i would change this routine temporarially, then we can see the mismatch better in output:

FOR x = 0 TO 96 ' 120 / 8 = 15
Display_Buffer(x) = (x)
NEXT
END SUB

Dr_Doggy

Well-Known Member
notice this aswell in the SUB Draw_Data():
Data_Bus.bits(7 - (x- Colum_start)) = 1 ' cycle the anodes from 0 to 7

could it be another typo!?
maybe try:
Anode_Data.bits(7 - (x- Colum_start)) = 1 ' cycle the anodes from 0 to 7

MrDEB

Well-Known Member
I have a somewhat working display but I think I am running into a program memory issue as the display cycles once just fine then starts jumbling text then just freezes text. Am using 658 program bytes and 50 variables on a 24K20 pic.
two const arrays with 106 bytes each.
That's what I am thinking is wrong.

Dr_Doggy

Well-Known Member
I also wonder if display_buffer and sentence_data are declaired wrong,
note in the draw loop x goes up to 96 , but arrrays are declaired for only 8 bytes
try:
DIM Display_Buffer(96) AS BYTE ' data to send to matrix
DIM Display_Buffer(96) AS BYTE ' data to send to matrix

....actually how many columns are in your array?

.... to me sounds like a buffer alignment issue, but it could be memory, idk if swordfish would catch that error or not..

MrDEB

Well-Known Member
here is my new code that I got from a friend. it has 106 bytes per const array. looking at why is it retrieveing the const data every cycle. Tried doing it one time and it won't work. Am going to delete some of the array data.
DIM GreenBuffer(8) AS BYTE
DIM RedBuffer(8) AS BYTE
DIM x AS BYTE
DIM ScrollingTextOffset AS WORD
DIM ScrollingTextSpeed AS BYTE
DIM DefaultScrollingTextSpeed AS BYTE

IF ScrollingTextSpeed <> 0 THEN
DEC(ScrollingTextSpeed)
ELSE
ScrollingTextSpeed = DefaultScrollingTextSpeed
INC(ScrollingTextOffset)
IF ScrollingTextOffset > (BOUND(GreenData) - 8) THEN ' we need to check if we have reached the start of the last eight columns of data that's why we take away 8
ScrollingTextOffset = 0
ENDIF
ENDIF
END SUB

SUB SaveGraphics()
FOR x = 0 TO 7
GreenBuffer(x) = GreenData(x + ScrollingTextOffset)
RedBuffer(x) = RedData(x + ScrollingTextOffset)
NEXT
END SUB

SUB DisplayGraphics()
FOR x = 0 TO 7
GreenLEDs = GreenBuffer(x) XOR %11111111
RedLEDs = RedBuffer(x) XOR %11111111
Anodes.bits(7 - x) = 1
DELAYUS(520)
Anodes.bits(7 - x) = 0
NEXT
END SUB

SetAllDigital

TRISA = %00000000 ' PORTA outputs
TRISB = %00000000 ' PORTB outputs
TRISC = %00000000 ' PORTC outputs
'TRISD = %00000000 ' PORTC outputs
'TRISE = %00000001 ' PORTC outputs except pin 0

// Start Of Program
OSCCON = %01100000 ' Internal oscillator running at 8mHz
'OSCTUNE.bits(6) = 1 ' enable PLL so we can run this thing at 32Mhz

GreenLEDs = %00000000 ' we will be xor'ing the led data to make sure it sends logic 0's to turn on the LED
RedLEDs = %00000000 ' we will be xor'ing the led data to make sure it sends logic 0's to turn on the LED
Anodes = %00000000

ScrollingTextOffset = 0
DefaultScrollingTextSpeed = 45
ScrollingTextSpeed = DefaultScrollingTextSpeed

// Main Loop
WHILE True() // This creates an infinite loop
SaveGraphics
DisplayGraphics
WEND // Loop back to the while loop as long as we havent finished.

Dr_Doggy

Well-Known Member
i doubt it to be mem space error, please elaborate on hardware....
.... how many annodes/cathodes are in your array... how r they wired?

MrDEB

Well-Known Member
in hardware their are 8 anodes and 16 cathodes (8 red and 8 green) using a bi colored 8 x 8 led matrix
in the const arrays I am only addressing the cathodes. the anodes are scanning.
tried eliminating all the greenled references and it still locks up after one cycle.

Dr_Doggy

Well-Known Member
how are cathode arranged ... does it go portb = red, portc = green, or does it go red, green, red, green, red, green, across both ports?

MrDEB

Well-Known Member
PortA = green cathodes
PortB = Red cathodes
PortC = anodes

MrDEB

Well-Known Member
Well I ran same code but with a 18F25K20 (my final assembly has a smd 18F24K20 pic)
it looks like it is running out of memory comparing the two pics. The user ram is way different as is the user ram banks. So now I need to come up with a different code to use less memory.
18F25k20

#const _core = $0012 // processor core #const _ram_banks =$06 // 6 RAM bank(s) used

#variable _maxaccess = $60 // access ram is 96 bytes #variable _maxram =$0600 // 1536 bytes of user RAM

#variable _maxrom = $008000 // 32 KB of program ROM #const _eeprom =$0100 // 256 bytes of EEPROM

#const _eeprom_start = $F00000 // EEPROM start address #const _ports =$03 // 3 available ports

#const _ccp = $01 // 1 CCP module(s) available #const _eccp =$01 // 1 ECCP module(s) available

#const _mssp = $01 // 1 MSSP module(s) available #const _usart =$01 // 1 USART(s) available

#const _adc = $0A // 10 ADC channels available #const _adres =$0A // 10 bit ADC resolution

#const _comparator = $02 // 2 comparator(s) available #const _psp =$00 // Parallel Slave Port (PSP) is NOT supported

#const _can = $00 // onboard CAN is NOT supported #const _usb =$00 // USB is NOT supported

#const _ethernet = $00 // onboard Ethernet is NOT supported #const _flash_write =$01 // FLASH has write capability

18F24K20

#const _core = $0012 // processor core #const _ram_banks =$03 // 3 RAM bank(s) used

#variable _maxaccess = $60 // access ram is 96 bytes #variable _maxram =$0300 // 768 bytes of user RAM

#variable _maxrom = $004000 // 16 KB of program ROM #const _eeprom =$0100 // 256 bytes of EEPROM

#const _eeprom_start = $F00000 // EEPROM start address #const _ports =$03 // 3 available ports

#const _ccp = $01 // 1 CCP module(s) available #const _eccp =$01 // 1 ECCP module(s) available

#const _mssp = $01 // 1 MSSP module(s) available #const _usart =$01 // 1 USART(s) available

#const _adc = $0A // 10 ADC channels available #const _adres =$0A // 10 bit ADC resolution

#const _comparator = $02 // 2 comparator(s) available #const _psp =$00 // Parallel Slave Port (PSP) is NOT supported

#const _can = $00 // onboard CAN is NOT supported #const _usb =$00 // USB is NOT supported

#const _ethernet = $00 // onboard Ethernet is NOT supported #const _flash_write =$01 // FLASH has write capability

Dr_Doggy

Well-Known Member
Ill admit I still dont think its a mem prob, not that i researched it, but i was able to drive 5x5x5x3 matrix with lots of features from an 18f4620, which may or may not be smaller!!

going back to the first code , i like it better since its working better! for now lets ignore the green

Code:
' IF THIS FIRST LINE DOESNT WORK TRY THE SECOND, OR DELETE AND REPLACE ALL NAMES WITH VALUE
DIM Column_Length AS BYTE = 96 ' cathodes
DIM Column_Length = 96 AS BYTE  ' cathodes

DIM Colum_start AS BYTE ' cathodes
DIM Display_Out AS BYTE ' CONST array data
DIM Sentence_Data( Column_Length) AS BYTE ' SAFE PLACE TO WRITE data to send to matrix
DIM Display_Buffer( Column_Length) AS BYTE ' BACKBUFFER to matrix

DIM Anode_Data AS PORTC ' Anodes
DIM Data_Bus AS portb ' red cathodes

DIM x AS BYTE
DIM y AS BYTE
DIM Speed AS BYTE
DIM Speed_Counter AS BYTE

//SUB ROUTINES

' do you know how to read binary, the columns will output the count as such
FOR x = 0 TO Column_Length' 120 / 8 = 15
Display_Buffer(x) = (x)  'Sentence_Data(x)
NEXT
END SUB

SUB Draw_Data()
porta = 0 '     lets ignore the green
FOR x = Colum_start TO (Colum_start+7) ' COLUMS ON PORT b counter
Display_Out = Display_Buffer(x) ' const data
Data_Bus = Display_Out XOR \$11111111 ' inverts the CONST array data at the port  SETS UP PORTB

' WHAT ARE THESE 2 LINES ?? LOOKS LIKE A REPEAT OF THE LAST, MAY NEED DELETING
'Display_Buffer(x) = Sentence_Data(x)
'Data_Bus = Sentence_Data XOR %11111111 ' reverse the data bits

Anode_Data = 1
FOR Y = 1 TO 8 ' ROWS ON PORT A counter

' ONLY USE ONE OF THESE 3 LINES, NOT SURE WHICH WILL WORK FOR SF
'Anode_Data = 1 <<Y ' Anodes ' cycle the anodes from 0 to 7
'Anode_Data = 2^Y' Anodes ' cycle the anodes from 0 to 7
Anode_Data = Anode_Data * 2 ' Anodes ' cycle the anodes from 0 to 7

DELAYMS(50)       ' ADJUST THIS TO BALANCE BETWEEN BRIGHTNESS AND FLICKER
NEXT ' Y

NEXT 'X

END SUB

'SUB Scroll_Text()
'IF Speed <> 0 THEN
'DEC(Speed)
'ELSE
'Speed = 6
'Colum_start = Colum_start + 1
'IF Colum_start + 8 = Column_Length THEN ' # of elements in CONST array Colum Start is Cathodes on portb
'Colum_start = 0
'END IF
'END IF
'END SUB

SetAllDigital // Make all Pins digital I/O's
TRISC = %00000000 // Make PORTD all outputs
TRISB = %00000000 // Make PORTB all outputs
TRISA= %00000000 // Make PORTB all outputs
y = 0
Speed = 10
WHILE true

FOR Colum_start = 0 TO Column_Length - 8
FOR Speed_Counter = 0 TO Speed
Draw_Data()

NEXT   'Speed_Counter
NEXT    'Colum_start
WEND

MrDEB

Well-Known Member
Last night I loaded a compiled version of the first code and going to give it a whirl. Will look at your suggestion and try it as well
Thanks

Status
Not open for further replies.


text:
# finding Bondy and Chvatal closure

Given simple graph G(V,E) we have to make it hamiltonian. Bondy and Chvatal theorem states that : Given a graph G with n vertices, the closure cl(G) is uniquely constructed from G by successively adding for all nonadjacent pairs of vertices u and v with degree(v) + degree(u) ≥ n the new edge uv.(from wikipedia)

Now consider tree ( which is also simple graph ) n=6

1<->2
2<->3
3<->4
4<->5
5<->6

And now we realise that we can't get any two verticles(non adjacent) which sums of degrees is ≥ n.

Am i missing something? Seems like quite powerful theorem, but i don't get it.. fully.

Any help will be appreciated.

Chris

-
It would seem that the closure of your tree is itself. Is that a problem? – Gerry Myerson Oct 14 '11 at 21:58
Hmm, but it doesn't make hamiltonian cycle. Am i right? – Spinach Oct 15 '11 at 0:22

## 1 Answer

What the theorem you have in mind says is that: A graph has a hamiltonian circuit (HC) if and only if its "Bondy-Chvatal" closure is Hamiltonian. In the example you cite one cannot add any edges. The graph you start with has no HC and no edges get added so it remains without an HC. What sometimes happens is that one can not easily see if the graph one started with has an HC, but, say after computing the Bondy-Chvatal closure one gets a complete graph. Now the complete graph has an HC so the theorem above tells one that the original graph, where it was not clear if there was an HC or not, has to have an HC.

-
But do you know the method how to make any graph contain HC? I mean in minimum number of additions, because making graph always full is a little pointless. Or am i missing something? – Spinach Oct 15 '11 at 20:03
@Chris I think you are asking about the Hamiltonian completion problem. en.wikipedia.org/wiki/Hamiltonian_completion which is "hard" to solve. – Joseph Malkevitch Oct 16 '11 at 15:52


text:
# Is $\int_{t\in S^1} |t-\zeta|^{\alpha}p(z,t) |dt| \leq K|z-\zeta|^{\alpha}, 0< \alpha < 1$ for uniform $K$?

I asked the question before, but didn't get any reply, so I took the liberty to ask again.

Let $\zeta\in S^1$(unit circle in the complex plane) and $z\in \mathbb{D}$. Fix $0< \alpha < 1$. Then, is the following true ?

(Question 1) $\int_{t\in S^1} |t-\zeta|^{\alpha}p(z,t) |dt| \leq K|z-\zeta|^{\alpha}$ for some $K>0$ independent of $z\in \mathbb{D}, \zeta \in S^1$.

Actually, by using weak maximum principle on $|z-\zeta|^{\alpha} - H(z,\zeta)$, where $H(z,\zeta)= \int_{t\in S^1} |t-\zeta|^{\alpha}p(z,t) |dt|$ is the complex harmonic extension of $t\to |t-\zeta|^{\alpha}$ at $z$, I am getting $\int_{t\in S^1} |t-\zeta|^{\alpha}p(z,t) |dt| \geq |z-\zeta|^{\alpha}$, which is quite the contrary ! Any help or suggestions ? Thank you !

(Question 2)And also, as a seemingly related question can we say that if $f\in C^{0,\alpha}(S^1)$, then its complex harmonic extension $\int_{t\in S^1} f(t).p(z,t)|dt|$ is $C^{0,\alpha}(\mathbb{D}) ?$ Thanks.

-

It is true, you have to use Kellog-Warschowski's theorem (wikipidea, will give link soon),for $C^{0,\alpha}$ -maps on $S^1$, and note that $|t-\zeta|^{\alpha}$ is a $C^{0,\alpha}(S^1)$ map, with the Holder constant being independent of $\zeta \in S^1$.


text:
The Empirical Eigenvalue Distribution of a Gram Matrix: From Independence to Stationarity

#### W. Hachem, P. Loubaton, J. Najim

2005, v.11, №4, 629-648

ABSTRACT

Consider a $N\times n$ matrix $Z_n=(Z^n_{j_1 j_2})$ where the individual entries are a realization of a properly rescaled stationary Gaussian random field: $Z^n_{j_1 j_2} = \frac{1}{\sqrt{n}} \sum_{(k_1,k_2) \in \mathrm{Z}^2} h(k_1,k_2)\, U(j_1-k_1,j_2-k_2),$ where $h\in\ell^1(\math {Z}^2)$ is a deterministic complex summable sequence and $(U(j_1,j_2)$; $(j_1,j_2)\in \math {Z}^2)$ is a sequence of independent complex Gaussian random variables with mean zero and unit variance. The purpose of this article is to study the limiting empirical distribution of the eigenvalues of Gram random matrices $Z_n Z_n ^*$ and $(Z_n +A_n)(Z_n +A_n )^*$ where $A_n$ is a deterministic matrix with appropriate assumptions in the case where $n\rightarrow \infty$ and $N/n \rightarrow c \in (0,\infty)$. The proof relies on related results for matrices with independent but not identically distributed entries and substantially differs from related works in the literature [A. Boutet de Monvel, A. Khorunzhy and V. Vasilchuk, Limiting eigenvalue distribution of random matrices with correlated entries. Markov Processes Relat. Fields, 1996, v. 2, N4, 607-636. V.L. Girko, Theory of Stochastic Canonical Equations. Vol. I. Volume 535 of Mathematics and its Applications. Kluwer Academic Publishers, Dordrecht, 2001], etc.

Keywords: random matrix,empirical eigenvalue distribution,Stieltjestransform


text:
RF Electronic Devices and Systems

# Transmission line circuit for mismatched load and generator

Let’s consider the most general case of a circuit, where we have the arbitrary loads Z1, Zand an arbitrary generator.

The input impedance of the terminated transmission line is . The voltage on the line $V\left(z\right)={V}_{0}\left({e}^{–j\beta z}+{\Gamma }_{l}{e}^{–j\beta z}\right)$ . To receive the voltage of the generator we must take into consideration is the reflection coefficient of the generator. The standing wave ratio here is $SWR=\frac{1+|{\Gamma }_{L}|}{1–|{\Gamma }_{L}|}$ . So the power delivered to the load is: where ${Z}_{in}={R}_{in}+j{Z}_{in},{Z}_{2}={R}_{2}+j{Z}_{2}$.

1. When the load is matched to the line, ${Z}_{in}={Z}_{0},{Г}_{l}=0$ and .

2. When the load is matched to the line, ${Z}_{in}={Z}_{2}$ the load power is

3. Assuming that the generator impedance is fixed, the condition $\frac{dP}{d{Z}_{in}}\to 0$ leads to the maximum power delivered to the load.

The conjugate matching condition is . This condition is conjugate matching, that leads to the maximum power delivered to the load for a fixed generator impedance . Figure 1 depicts the general case of transmission line circuit for mismatched load and the generator.