text:
### Fake data, part 3: Bypassing the central limit theorem

May 2017: This is from my other blog that's no longer online. The original comments are no longer available, but you are welcome to add more.

Now that I have my black swan distribution, and I verified that it fits market returns remarkably well while being mathematically tractable, I want to use it to generate artificial market data.

Generating a series of closing prices is easy.

1. Select a starting price, take the logarithm
2. Select a mean μ and standard deviation σ of log returns ln(P0/P1) where P0 is the most recent price and P1 is the previous price.
3. Generate a uniformly-distributed random probability p between 0 and 1. Plug it into the inverse black swan distribution (using a=1.6):
$$B^{-1}(p;\mu,s) = \mu - 2 s \, \sinh \left[\frac {\tanh^{-1}(1-2p)} {a} \right]$$
4. Add the result to a running total.
5. Go to step 3. Repeat as often as desired.
Then simply calculate the antilog or exponential of the values in the running total to get prices.

This works fine. But what if we want to generate more than just single prices? How do I get a series of daily price bars, with high, low, and closing values for my fake market? The way to mimic real market behavior is to generate a series of n values for each "day" and record the highest, lowest, and final price for high, low, and close of the day. That is, define Sd as a daily step and Si as an intraday step:

$$S_d = \sum_{i=1}^n S_i$$ where $$S_i = B^{-1}(p,\mu_i,s_i) = \mu_i - 2 s_i \, \sinh \left[\frac {\tanh^{-1}(1-2p)} {a} \right]$$ $$\mu_i = \frac{\mu_d}{n}, \quad s_i = \frac {s_d}{\sqrt n}$$

The scaling of the intraday mean μi and standard deviation σi (corresponding to the shape parameter si) is necessary to preserve the desired mean μd and standard deviation σd for daily values. As described in the previous part, the approximation for the distribution shape parameter s is:

$$s \approx \frac{\sqrt{6}\,\sigma} {\pi \tanh^{-1} \left(\frac{1}{a}\right) \sqrt{\tanh^{-1} \left(\frac{1}{a}\right)^2+2}}$$ ...using a=1.6. But look at what happened! A disaster. The figure shows the resulting distributions for 1, 10, and 100 intraday steps. Look at the big rounded top made up of green dots representing n=100. As the number of intraday steps n grows, the resulting distribution of daily values approaches a normal distribution.

I'm back where I started! The whole point was to find something better than a normal distribution to model the markets. I don't want to end up with a normal distribution, I want to end up with my black swan distribution.

So what happened? The central limit theorem, evidently the "sovereign law" of probability theory, came in and took over. It says that the sum of many random variables with a finite mean and variance will be normally distributed, regardless of the underlying distribution we start with.

Although the black swan distribution has infinite kurtosis, it does have a finite mean and variance. This means, if we generate a bunch of tiny black swan steps to build large "daily" steps in a random walk, the large steps will approximate a normal distribution.

How can I break this law?

After much experimentation, I found a way to get past the central limit theorem. If we perturb μd to vary black-swanly with each daily step (not each intraday step), we get values that still appear distributed according to black swan, and so are the sums! $$\large \varepsilon = \begin {cases} \frac{ B^{-1}(p,0,s_d)}{\sqrt{n}\sqrt{n+1}} = \frac{\mu_d - 2 s_d \, \sinh \left[\frac {\tanh^{-1}(1-2p)}{a} \right]}{\sqrt{n}\sqrt{n+1}} & n>1 \\ 0 & n=1 \end {cases}$$ Re-generate ε once per day, and use that value for all intraday steps (if you generate a new ε for each intraday step, you end up with a normal distribution again). For each intraday step Si, use these values of μi and si: $$\mu_i = \frac{\mu_d}{n}+\varepsilon, \quad s_i = \frac {s_d}{n}$$ For large n, the adjustment to μd basically perturbs the mean each day by a small black swan distribution having a standard deviation of σ/n. For n>50 or so, one can simply use n by itself in the denominator of the expression for ε. Again, p is a random probability between 0 and 1.

Here's how it worked out:

That seems to work. I can now generate an artificial series of high-low-close prices that have similar statistical properties to actual markets. Now I must investigate whether any dependencies exist between successive values in the series.

I want to mention that the plots in this article use the Rnd() function in Excel's Visual Basic. The Visual Basic random number generator is fairly crude by modern standards, which may explain the noisy tails of the distributions shown (using 16,000 samples) versus the relatively cleaner tails of the distributions measured from actual market data (using less samples). I can't know for sure unless I try a better random number generator, but I'm not inclined to do so now — I'm satisfied with these results.


text:
Next: 2-d problem with Neumann Up: The diffusion equation Previous: An improved 1-d solution

## 2-d problem with Dirichlet boundary conditions

Let us consider the solution of the diffusion equation in two dimensions. Suppose that
 (214)

for , and . Suppose that satisfies mixed boundary conditions in the -direction:
 (215)

at , and
 (216)

at . Here, , , etc., are known functions of , whereas , are known functions of and . Furthermore, suppose that satisfies the following simple Dirichlet boundary conditions in the -direction:
 (217)

As before, we discretize in time on the uniform grid , for . Furthermore, in the -direction, we discretize on the uniform grid , for , where . Finally, in the -direction, we discretize on the uniform grid , for , where . Adopting the Crank-Nicholson temporal differencing scheme discussed in Sect. 6.6, and the second-order spatial differencing scheme outlined in Sect. 5.2, Eq. (214) yields

 (218)

where . The discretized boundary conditions take the form
 (219) (220)

plus
 (221)

Here, , etc., and , etc.

Adopting the Fourier method introduced in Sect. 5.7, we write the in terms of their Fourier-sine harmonics:

 (222)

which automatically satisfies the boundary conditions (221). The above expression can be inverted to give (see Sect. 5.9)
 (223)

When Eq. (218) is written in terms of the , it reduces to
 (224)

for , and . Here, , and . Moreover, the boundary conditions (219) and (220) yield
 (225) (226)

where
 (227)

etc. Equations (224)--(226) constitute a set of uncoupled tridiagonal matrix equations for the , with one equation for each separate value of .

In order to advance our solution by one time-step, we first Fourier transform the and the boundary conditions, according to Eqs. (223) and (227). Next, we invert the tridiagonal equations (224)--(226) to obtain the . Finally, we reconstruct the via Eq. (222).

Next: 2-d problem with Neumann Up: The diffusion equation Previous: An improved 1-d solution
Richard Fitzpatrick 2006-03-29

format: plain


text:
# What is the smallest cardinality of a maximal ultrafamily of infinite subsets of $\omega$?

A family $$\mathcal U$$ of infinite subsets of $$\omega$$ is called an ultrafamily if for any sets $$U,V\in\mathcal U$$ one of the sets $$U\setminus V$$, $$U\cap V$$ or $$V\setminus U$$ is finite.

By the Kuratowski-Zorn Lemma, each ultrafamily $$\mathcal U\subseteq [\omega]^\omega$$ can be enlarged to a maximal ultrafamily.

Let $$\mathfrak{uf}$$ be the smallest cardinality of a maximal ultrafamily. It can be shown that $$\max\{\mathfrak s,\mathfrak a\}\le\mathfrak {uf}\le\mathfrak c,$$ where $$\mathfrak a$$ is the smallest cardinality of a maximal infinite almost disjoint family of infinite sets in $$\omega$$ and $$\mathfrak s$$ is the smallest cardinality of a family $$\mathcal S\subseteq[\omega]^\omega$$ such that for every $$X\in[\omega]^\omega$$ there exists $$S\in\mathcal S$$ such that the sets $$X\cap S$$ and $$X\setminus S$$ are infinite.

Problem 1. Find non-trivial upper (and lower) bounds for the cardinal $$\mathfrak{uf}$$.

Problem 2. Is $$\mathfrak{uf}$$ equal to any known cardinal characteristic of the continuum?

Problem 3. Is $$\mathfrak{uf}<\mathfrak c$$ consistent?

Added in Edit. The diagrams of known small uncountable cardinals in the surveys of Blass and Vaughan do not show up any cardinal characteristic between $$\max\{\mathfrak s,\mathfrak a\}$$ and $$\mathfrak c$$. So the answer to Problem 2 is rather no'' unless $$\mathfrak{uf}=\mathfrak c$$ (which would be a bit surprising).

• A piece of heuristics: this statement has a very similar flavour to Booth's lemma (that is equivalent to Martin's axiom), so very likely $uf = c$ under MA and probably it is consistent that there is a strict inequality. – Tomasz Kania Apr 15 '20 at 15:38
• @TomekKania That $\mathfrak{uf}=\mathfrak{c}$ under MA follows from the inequalities in the question plus the fact that MA implies $\mathfrak{s}=\mathfrak{c}$. – Andreas Blass Apr 15 '20 at 16:54

To my surprise, I found that this my new'' cardinal $$\mathfrak{uf}$$ is equal to $$\mathfrak c$$.

Theorem. $$\mathfrak{uf}=\mathfrak{c}$$.

Proof. Fix any maximal ultrafamily $$\mathcal U\subseteq[\omega]^{\omega}$$. For two sets $$A,B$$ we write $$A\subset^* B$$ if $$A\setminus B$$ is finite but $$B\setminus A$$ is infinite.

A subfamily $$\mathcal L$$ will be called

$$\bullet$$ linearly ordered if for any distinct sets $$A,B\in\mathcal L$$ we have either $$A\subset^* B$$ or $$B\subset^* A$$;

$$\bullet$$ densely linearly ordered if for any distinct sets $$A,B\in\mathcal L$$ with $$A\subset^* B$$ there exists a set $$C\in\mathcal L$$ such that $$A\subset^* C\subset^* B$$.

Claim 1. If $$\mathcal U$$ contains a set $$U\in\mathcal U$$ such that the family $${\downarrow}U=\{V\in\mathcal U:V\subset^* U\}$$ is linearly ordered, then $${\downarrow}U$$ is densely linearly ordered.

Proof. Assuming that $${\downarrow}U$$ is not densely linearly ordered, we can find two sets $$A,B\in{\downarrow}U$$ such that $$A\subset^* B$$ and the set $$\{C\in\mathcal U:A\subset^* C\subset^* B\}$$ is empty. Taking into account that $$B\setminus A\subset^* U$$ and the family $${\downarrow}U$$ is linearly ordered, we conclude that $$B\setminus A\notin\mathcal U$$. By the maximality of $$\mathcal U$$, there exists a set $$W\in\mathcal U$$ such that the sets $$(B\setminus A)\cap W$$, $$(B\setminus A)\setminus W$$, $$W\setminus(B\setminus A)$$ are infinite. Then also the sets $$B\cap W$$, $$B\setminus W$$ are infinite. Taking into account that $$\mathcal U$$ is an ultrafamily, we conclude that $$W\subseteq^* B\subset^* U$$ and hence $$W\in{\downarrow}U$$. Now the choice of the sets $$A,B$$ guarantees that $$W\subseteq^*A$$ and then $$(B\setminus A)\cap W$$ is finite, which is a desired contradiction. $$\quad\square$$

Claim 2. If $$\mathcal U$$ contains a set $$U\in\mathcal U$$ such that the family $${\downarrow}U=\{V\in\mathcal U:V\subset^* U\}$$ is linearly ordered, then $$|\mathcal U|=|{\downarrow}U|=\mathfrak c$$.

Proof. By Claim 1, the family $${\downarrow}U$$ is densely linearly ordered. Consider the countable set $$\mathbb Q_2=\{\frac{k}{2^n}:n\in\omega,\;0\le k\le 2^n\}$$ of binary rational numbers in the unit interval $$[0,1]$$. Using the density of the linear order on $$\mathcal L$$, we can inductively construct a subfamily $$\{L_q\}_{q\in\mathbb Q_2}\subseteq\mathcal L$$ such that for any rational numbers $$r in $$\mathbb Q_2$$ we have $$L_r\subset^* L_q$$.

To see that $$|{\downarrow}U|=\mathfrak c$$, it remains to prove the following

Claim 3. For every $$r\in[0,1]\setminus \mathbb Q_2$$ there exists a set $$L_r\in\mathcal U$$ such that $$L_p\subset^* L_r\subset^* L_q$$ for every rational numbers $$p,q\in\mathbb Q_2$$ with $$p.

Proof. To derive a contradiction, assume that the maximal ultrafamily $$\mathcal U$$ does not contain such set $$L_r$$.

Since the poset $$\mathcal P(\omega)/\mathrm{Fin}$$ contains no $$(\omega,\omega)$$-gaps, there exists a set $$\tilde L_r\subseteq \omega$$ such that $$L_p\subset^* \tilde L_r\subset^* L_q$$ for any $$p,q\in\mathbb Q_2$$ with $$p. By our assumption, $$\tilde L_r\notin\mathcal U$$.

By the maximality of $$\mathcal U$$ we can find a set $$L_r\in\mathcal U$$ such that the sets $$\tilde L_r\cap L_r$$, $$\tilde L_r\setminus L_r$$ and $$L_r\setminus \tilde L_r$$ are infinite. The infiniteness of the intersections $$\tilde L_r\cap L_r$$ and $$\tilde L_r\setminus L_r$$ implies that for any $$q\in\mathbb Q_2$$ with $$r the intersections $$L_q\cap L_r$$ and $$L_q\setminus L_r$$ are infinite. Taking that $$\mathcal U$$ is an ultrafamily, we conclude that $$L_r\subseteq^* L_q\subset^* U$$ and hence $$L_r\in{\downarrow}U$$. For every $$p\in\mathbb Q_2$$ with $$p the infiniteness of the set $$L_r\setminus \tilde L_r$$ and the almost inclusion $$L_p\subset^* \tilde L_r$$ implies the infiniteness of the set $$L_r\setminus L_p$$. Since the family $${\downarrow}U$$ is linearly ordered, we conclude that $$L_p\subseteq^* L_r$$. Therefore, we proved that $$L_p\subset^* L_r\subseteq^* L_q$$ for any rational numbers $$p,q\in\mathbb Q_2$$ with $$p. But the existence of the set $$L_r$$ contradicts our assumption. $$\quad\square$$

So, Claims 3 and 2 have been proved. $$\quad\square$$

Claim 2 reduced the proof of the theorem to the case when for every $$U\in\mathcal U$$ the family $${\downarrow}U$$ is not linearly ordered and hence contains two sets $$U_0,U_1$$ such that $$U_0\cap U_1$$ is finite. In this case we can inductively construct a family of sets $$\{U_s\}_{s\in 2^{<\omega}}\subseteq\mathcal U$$ indexed by the elements of the binary tree $$2^{<\omega}=\bigcup_{n\in\omega}2^n$$ such that $$\mbox{U_{s\hat{\;}0}\cup U_{s\hat{\;}1}\subseteq^* U_s and U_{s\hat{\;}0}\cap U_{s\hat{\;}1}=^*\emptyset for any binary sequence s\in 2^{<\omega}}.$$

Claim 4. For every $$s\in 2^\omega$$ there exists a set $$U_s\in\mathcal U$$ such that $$U_s\subseteq^* U_{s{\restriction}n}$$ for every $$n\in\omega$$.

Proof. To derive a contradicion, assume that for some $$s\in 2^\omega$$ the sequence $$(U_{s{\restriction}n})_{n\in\omega}$$ has no pseudointersection in $$\mathcal U$$. Choose any infinite pseudointersection $$\tilde U_s$$ of the sequence $$(U_{s{\restriction}n})_{n\in\omega}$$. By our assumption, $$\tilde U_s\notin\mathcal U$$ and by the maximality of the ultrafamily $$\mathcal U$$, there exists a set $$U_s\in\mathcal U$$ such that the sets $$U_s\cap\tilde U_s$$, $$U_s\setminus\tilde U_s$$ and $$\tilde U_s\setminus U_s$$ are infinite. Then for every $$n\in\omega$$ the sets $$U_{s{\restriction}n}\cap\tilde U_s$$ and $$U_{s{\restriction}n}\setminus U_s$$ are infinite. Taking into account that $$\mathcal U$$ is an ultrafamily, we conclude that $$U_s\subseteq^* U_{s{\restriction}n}$$ for every $$n\in\omega$$, which contradicts our assumption. $$\quad\square$$

It is easy to see that the family $$(U_s)_{s\in 2^\omega}$$ given by Claim 4 is almost disjoint and hence $$|\mathcal U|\ge|\{U_s\}_{s\in 2^\omega}|=|2^\omega|=\mathfrak c$$. $$\quad\square$$.


text:
### Help Support The Rocketry Forum:

#### AKPilot

##### Well-Known Member
I went to our local Michaels today, with the 40% off coupon from Sunday's paper . . . and got, what I feel, was a great deal.

Rocketry isn't too big up here, so Michaels selection is kinda lean, but I managed to pick up a Big Daddy for $7.20 and a Guardian for$3.00!!!

It's not always, but you know sometimes it just pays to be away from the main stream . . .
Hey, welcome to TRF! I lived in Alaska from '98-'01 (USAF/Elmendorf). At the time I wasn't quite back into model rocketry yet, but I recall that the 2 House of Hobbies had quite a selection of out-of-production rockets. Mind you, this was a few years ago now so I don't think they'll (either the shops or rockets) still be there, but check out Anchorage House of Hobbies and see if they still have any good finds. I know the one on Ingra St. had an NCR Archer in the window display. The other location had an Optima on the shelf. I recall it was $29.99. 2812 Spenard Rd Anchorage, AK 99503 Phone: (907) 277-7778 585 Ingra St Anchorage, AK 99501 Phone: (907) 272-5651 So where are you flying rockets? I drove around for quite sometime everywhere from Anchorage to Eagle River and beyond (where the state fair is held) and could never seem to find any open fields. Living in the dorms I don't think I would have had the chance to grow any type of collection. Besides, I imagine they would have considered rocket motors as some type of contraband or "firework" on base or in the dorms. Post pictures if you can. I kinda miss Alaska! (Now living in Florida!) Nice find in the Michael's. You'll see people post quite often regarding sales at different retail outlets. Just do a search in the forum and you'll see. Once again, welcome to TRF! #### jflis ##### Well-Known Member My mom and sister Bev live in Anchorage with a place in Soldatna on the Kenia river. I've been up 3 times and would move in a heartbeat I just love it! #### wwattles ##### Well-Known Member Originally posted by jflis My mom and sister Bev live in Anchorage with a place in Soldatna on the Kenia river. I've been up 3 times and would move in a heartbeat I just love it! Is that where you got that King Salmon, Jim? I've been up to Soldotna twice for fishing trips, and loved both of them. Frankly, it spoiled me for fishing just about anywhere else! I hooked into a nice big King once, but it was 2 weeks after the end of the season on the Kenai, so I had to throw it back People think of AK and think snow, but during the summer it's absolutely beautiful and warm... WW #### AKPilot ##### Well-Known Member I'm also stationed at Elmendorf, but this is my last assignment as I have my retirement orders in hand. It's been great up here! To answer your question, I launch from a local park right here in the city. It's about four acres in size and for the most part, clear of any obstacles. It's been great so far for C-engines. As far as hobby shops, we have two: House of Hobbies, and Hobbycraft. The one on Ingram closed. The selection in the two is decent . . . and yes, you're right you can find some OOP models. Anchorage is a great city too! Where else can you fish on a river, in the middle of the city, and catch Kings. This year's city derby saw a 52-pounder; down on the Kenai someone got a 60+ this year. Our family watches them make the run for the hatchery where they're so thick you can literally walk across the river on them. Our family is more into trout, artic char, greyling, etc. Some may snuff at this, but where else can you catch Rainbows 2'-3' long, coming in from 5-10lbs? The first time I caught one, in my canoe about 50' off shore, I freaked! Noone down in the lower 48 believes it until I show them the picture. Another benefit is the moose. We live in the city towards the east side, about two miles from the base of the mountains and I can't tell you how many times this week we've encountered bull and cow moose walking down our street. It's, honestly, more frequent than Northern Exposure. We were in the car wash this week and saw a bull and cow, ambling down the sidewalk in the middle of the day on a main road. This morning we saw two laying in the grass. And then was the time where our daughter opened up the front door and almost got a mouth full of moose rear-end fur. It was standing on our door step. Gotta love it . . . #### eugenefl ##### Well-Known Member Originally posted by akpilot I'm also stationed at Elmendorf, but this is my last assignment as I have my retirement orders in hand. It's been great up here! To answer your question, I launch from a local park right here in the city. It's about four acres in size and for the most part, clear of any obstacles. It's been great so far for C-engines. As far as hobby shops, we have two: House of Hobbies, and Hobbycraft. The one on Ingram closed. The selection in the two is decent . . . and yes, you're right you can find some OOP models. I know exactly which park you are flying in! There is a rec area there with tennis courts and a softball field or something to that effect and a church nearby. It's off of the main drag towards Elmendorf if I'm not mistaken. Are there several large buildings on the outset? If so, I flew an Astrocam there twice. On the second flight it landed in a side street and I had enough. You're right though, it's great for smaller birds and larger ones on Cs. A few of my favorite restaurants are in Anchorage - Romanos, Simon and Siefords, and Taco King! Favorite day trip was taking the AK Railroad up to Denali. I used to snowboard at Hillberg nightly and did many runs at Alyeska. Ah man...I need to go back there some day. I exited the AF as a SrA. I worked in the networking shop (3CS) at the NCC. Good times. Well, best of luck with your rocketry adventures. There is a member on the Forums that goes by AKVance. I'm not too sure if he's active still, but you could drop him a line. I don't think he's too far from you. #### MetMan ##### Well-Known Member Cool thread! I was stationed at Fort Rich and Elmendorf from 89-92. Lived off base the first year and have a picture of our dog nose to nose with a moose across a chain link fence. (The moose's pack was bigger with two other cows laying in the snow so Chamois was very well behaved!) I also almost ran into the side of a big cow after getting a haircut on Elmendorf one winter morning at 0715 (it was dark, of course). I'm not sure who was more suprised. Best part was the aurbo (aurora borealis--northern lights). I'd been stationed in Maine prior to this and saw the 89 event that took out the Quebec power grid (wow!), but the variety and frequency in AK is beyond belief. Only problem was that the best aurbo occurred during the coldest weather! Also did a project to support the Geophysical Institute with some DMSP data and got a tour of the Poker Flat Research Range. Unfortunately, I wasn't into rockets at the time and didn't retain all that much... MetMan #### North Star ##### Well-Known Member Alaska is one of those 'must see' places that I haven't managed to get to yet. There is a specialist tour group for aviation enthusiasts that I sometimes travel with and they have a preliminary listing for september 2005 which includes Alaska and is aimed at those interested in propliners and older aircraft . Looks like I'd better get my booking in #### GL-P ##### Well-Known Member I live in Canada but I'd love to travel further North to the Yukon and maybe crossover to Alaska for a bit. I'd get to experience the real small town feeling up North. I bet I'd love it!!! (cuz I live in the boonies already!!! ) #### jflis ##### Well-Known Member I want to plan a trip where i fly into Anchorage and rent a truck with a small camper. Head north east into Tok, then the Yukon and south into Washington. That would be SUCH an awesome trip! #### AKPilot ##### Well-Known Member You guys won't be disappointed in coming up here! As my callsign applies, I'm also a civil pilot. One of my favorite flights, to take relatives and friends on, involves taking off, from here in Anchorage - flying down the coast - then into Prince William Sound - and back up through a few glacier fields. On clear days we see Denali (Mt McKinley), spot moose, bear, dall sheep, whales, etc. Total flight time is 1.5 hours. The only close experience I had was at altitude with a bald eagle. Seems as if those guys don't take crap from anyone - they're the only bird that doesn't believe in diving away from an approaching aircraft - they kind of take it as a personal challenge to their airspace. Also, talk about becoming a rocket geek . . . my family and I just got back from a general aviation conference up in Fairbanks. My wife was great! We stayed in the hotel, where the conference was at, so I was able to attend as I wanted. And then hit every hobby store in Fairbanks. When I asked if it was okay to buy some of the more hard to find rockets, she asked how much I wanted to spend. When I said, jokingly,$400 - she said "fine"! Talk about a green light?! While I didn't spend no where near that amount - it was truly a blessing to have her support.

Oh, by the way, don't tell the kids, but Santa wasn't home at his house in the North Pole . . . must be in Hawaii or something.

#### sandman

##### Well-Known Member
Oh, by the way, don't tell the kids, but Santa wasn't home at his house in the North Pole . . . must be in Hawaii or something.
Well, DUH!!!

Shows what you know!

Did you try his work number?

He does have a deadline you know!

#### AKPilot

##### Well-Known Member
Nope, I don't have his work number . . . I'll give his cell a go though.

The kids say it's okay, because he's coming to Anchorage city center the day after Thanksgiving - in his sled, pulled by 13 reindeer. Kinda of our Macy's Thanksgiving day parade up here. It's pretty cool because we have enough ice and/or snow that the reindeer can actually pull a real sleigh.

Funny though, a couple years ago we went as a family to see this and Rudolph (was first, and wearing a tag around his neck) was kicking up a fuss. He wanted out of the harness and out of the crowd pretty bad. Anyhow he was jumping around and the handlers were trying to hold him down (reindeer only weigh about 140lbs or so) and kids started shouting "he's trying to fly, he's trying to fly"!!!

Needless to say, the handler didn't seem as impressed as the kids . . . she needed to get a sense of humor.


text:
# Chapter 6 - Section 6.4 - Some Constructions and Inequalities for the Circle - Exercises - Page 302: 18a

m$\angle$1$\gt$m$\angle$2

#### Work Step by Step

When there are two unequal central angles, the larger angle corresponds to the larger intercepted arc. Arc RS is larger than arc TV so angle 1 is larger than angle 2.

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.


text:
I wrote:

> So, here's what we've shown:

> If \$$f : A \to B\$$ has a right adjoint \$$g : B \to A\$$ and \$$A\$$ is a poset, this right adjoint is unique and we have a formula for it:

$g(b) = \bigvee \\{a \in A : \; f(a) \le_B b \\} .$

> And we can copy our whole line of reasoning and show this:

> If \$$g : B \to A\$$ has a left adjoint \$$f : A \to B\$$ and \$$B\$$ is a poset, this left adjoint is unique and we have a formula for it:

$f(a) = \bigwedge \\{b \in B : \; a \le_A g(b) \\} .$

Jonathan wrote:

> My take is that the formula tells us what values the [...] adjoint must take if it exists.

That's true, and that's what I said in my lecture: I derived each of these formulas assuming the adjoint in question exists.

But I think the situation is much better than this. I believe that if the formulas give well-defined functions, these are necessarily the desired adjoints! It would be fun to try to show this, straight from the definitions. My hunch is that it's easy.


text:
# zbMATH — the first resource for mathematics

Aull-paracompactness and strong star-normality of subspaces in topological spaces. (English) Zbl 1099.54023
The main result is the following theorem: Let $$X$$ be a $$T_1$$-space and $$Y$$ be a subspace of $$X$$. Then the following assertions are equivalent: (1) $$Y$$ is strongly star-normal in $$X$$; (2) $$Y$$ is strictly Aull-paracompact in $$X$$ and $$Y$$ is Hausdorff in $$X$$; (3) $$Y$$ is Aull-paracompact in $$X$$ and $$Y$$ is Hausdorff in $$X$$; (4) $$X_Y$$ (the space made from $$X$$ by making all points of $$X\setminus Y$$ isolated) is Hausdorff and paracompact.
##### MSC:
 54D20 Noncompact covering properties (paracompact, Lindelöf, etc.) 54B05 Subspaces in general topology
Full Text:


text:
Logarithmic integral li(x) (chart) Calculator

Calculates a table of the logarithmic integral li(x) and draws the chart.

 $li(x)={\large\int_{\small 0}^{\hspace{25}\small x}\frac{1}{ln(t)}}dt$
 initial value x [ increment repetition ]
 $\normal Logarithmic\ integral\ li(x)\\[10](1)\ li(x)={\large\int_{\small 0}^{\hspace{25}\small x}\frac{1}{ln(t)}}dt\\(2)\ li(x)=E_i(ln(x))\\[10](3)\ li(0)=0,\hspace{20}li(1)=-\infty\\$

Sending completion

To improve this 'Logarithmic integral li(x) (chart) Calculator', please fill in questionnaire.
Male or Female ?
Male Female
Age
Under 20 years old 20 years old level 30 years old level
40 years old level 50 years old level 60 years old level or over
Occupation
Elementary school/ Junior high-school student
High-school/ University/ Grad student A homemaker An office worker / A public employee
Self-employed people An engineer A teacher / A researcher
A retired people Others
Useful?
Very Useful A little Not at All
Purpose of use?


text:
# Form the equation of a plane, given 2 points and a parallel straight line

I am given 2 points: $B(3; 4; -2)$ and $C(1; 5; 3)$. I am also given a straight line which is parallel to the plane: $$\frac{x+6}{-3}=\frac{y-7}{7}=z$$

The task is to form an equation of a plane with the given information.

I know how to solve it, the problem is that I don't know how to describe it. So what I did, was write out that the normal vector of the plane is perpendicular to the vector BC, and is also perpendicular to the vector $(-3, 7, 1)$, which I got from the divisors of the straight line. Don't know how they're called in English. From that point forward, I found the cross product of vectors BC and s (s being the divisors of the straight line), which gave me the normal vector and allowed me to form the plane equation.

Could someone describe, why it is done like this so I'd understand it more clearly for future assignments as well. Thank you.

You are on the right track.

Note that those divisors will give you a vector parallel to the line. Once, you've computed a vector normal to the plane, you take a general point on the plane, say $P \equiv (x,y,z)$. This point lies on the plane. Note that the vector parallel to $PB$ will be perpendicular to the vector normal to the plane (Can you visualize it?)

Therefore, $\vec{PB}.\vec{n} = 0 \Rightarrow (x-3,y-4,z+2).\vec{n} = 0$, where $\vec{n}$ is the normal vector.

This will give you equation of the plane.

• Yes, you're right. But that's not the problem I'm having. I know how to form the plane equation from the point where I am using the same formula you gave me. The question was that why the normal vector is the cross product of the 2 vectors, about which I'm also writing an answer now because a little bit of googling actually helped me. :) – Janno Nov 23 '16 at 10:22
• I'm sorry. That was not clear to me by your question. – Dhruv Kohli - expiTTp1z0 Nov 23 '16 at 10:24
• To see if $a \times b$ gives you a vector normal to $a$ and $b$, try computing $a.(a \times b)$ and $b.(a \times b)$ using the definition of $a \times b$, both will come out to be zero, implying that $a \times b$ is perpendicular to $a$ and $b$. – Dhruv Kohli - expiTTp1z0 Nov 23 '16 at 10:46

It seems that your problem is to understand where comes from the vector $(-3,7,1)^T$.

If it is so, note that the equation of the line is: $$\frac{x+6}{-3}=\frac{y-7}{7}=z=t$$ write this equation as: $$\begin{pmatrix} \frac{x+6}{-3}\\ \frac{y-7}{7}\\ z \end{pmatrix} =t\begin{pmatrix} 1\\ 1\\ 1 \end{pmatrix}$$ that is $$\begin{pmatrix} x+6\\ y-7\\ z \end{pmatrix} =t\begin{pmatrix} -3\\ 7\\ 1 \end{pmatrix}$$ so the equation of the line is: $$\begin{pmatrix} x\\ y\\ z \end{pmatrix} =t\begin{pmatrix} -3\\ 7\\ 1 \end{pmatrix} +\begin{pmatrix} -6\\ 7\\ 0 \end{pmatrix}$$

and $\vec r=(-3,7,1)^T$ is the vector that gives the orientation of the line.

And, as you have noted, the orthogonal vector to the plane $\vec u$ must be orthogonal to this vector and to the vector $BC=(2,-1,-5)^T=\vec v$, so we can find it as the cross product: $\vec u=\vec r \times \vec v$

A little bit of googling about cross product could've help me before making this question.

Wikipedia: Given two linearly independent vectors a and b, the cross product, a × b, is a vector that is perpendicular to both a and b and therefore normal to the plane containing them.

As I got the vector from the line and the vector $BC$, the cross product will be perpendicular with both of them, means it will be the normal vector of the plane as well.


text:
# Getting started

Here is how to start a project with Pijul: first run the following command:

pijul init

In the project's directory. This creates a directory called ".pijul", and initialises a few things.

Then, add a few files to track. For a Rust project, this could be for instance:

pijul add Cargo.toml src/lib.rs

Finally, create a patch by recording your changes:

pijul record

Let's see what happened under the hood in this simple example:

## Definitions

Pijul works in four different places of your hard drive: a working copy, where you can edit files, a set of patches, a tree, which is the set of files currently tracked by Pijul, and a pristine, which is a representation of the current recorded version of the repository.

The changes between the pristine and the working copy are used to produce patches, which can be then applied to the pristine. Patches encode edits made to files of the repository (line insertions and deletions), as well as file additions, deletions and name changes.

At any time, the pristine can be output into the working copy, for instance after receiving new patches, or to cancel changes and reset the working copy to its recorded state.

So, the first command of the above example, pijul init, initialised an empty pristine. pijul add then updated the tree, to tell Pijul to start tracking files "Cargo.toml" and "src/lib.rs". Finally, pijul record compared the (currently empty) repository with the working copy, producing a patch as a result, and applied this patch to the pristine.

## Next steps

In the next chapter, we will see how to exchange patches with others.

Collaboration with Pijul doesn't have to be centralised, and is not even made easier by centralisation, as patches allow for a completely distributed workflow, which can happen even by email exclusively.

However, the authors of Pijul provide a free web service called the Nest, as one way to share patches with collaborators.


text:
# Software Tools in Haskell: overstrike

## interpret backspaces on stdin

Posted on 2016-02-20 by nbloomf

This page is part of a series on Software Tools in Haskell.

This post is literate Haskell; you can load the source into GHCi and play along.

As usual, we start with some imports.

-- sth-overstrike: interpret backspaces using line printer control codes
module Main where

import System.Exit (exitSuccess)
import Control.Arrow ((>>>))
import Data.List (unfoldr, intercalate, sortBy)

At first I was going to skip this program, because I cannot imagine myself having a use for it. But I started thinking about the problem and before I knew it the program was written, so I might as well write about it. :)

In ASCII (and unicode) there is a backspace control character. This character is only kind of related to the backspace key on a modern keyboard. On a typewriter, the backspace key physically moves the carriage “back” one “space”, without erasing any characters that might already be printed there. This allowed the typist to physically print one character on top of another, called overstriking. Doing so allowed for things like underlining words (overstrike with underscore), striking out words (overstrike with hyphen), creating new characters (overstrike hyphen and colon to get a division sign, maybe), and elaborate typewriter art (a precursor of ASCII art). For example, the literal sequence of key strokes

Hello world!\b\b\b\b\b\b\b\b\b\b\b\b____________

would appear on the page as underlined text.

According to Kernighan and Plauger, line printers (I’ve unfortunately never used one, so I’ll take their word for it) can achieve overstriking by not advancing the paper between lines. On some machines this was done by prepending each line to be printed with a control code: either a space or a plus sign. For instance, the lines

 Hello world!
+____________

would be printed one on top of the other, effectively underlining “Hello world!”. A space at the beginning of the line means “advance the paper to the next line”, and a plus sign means “don’t”.

The overstrike program turns a sequence of typewriter-style keystrokes into a sequence of line printer-style print commands. Our strategy is this: every character to be printed has an associated column index; this is the column where that character belongs. For instance, in the line

abcde

The character a has column index 1, b has column index 2, and so on. (That’s right, I think of strings as 1-indexed. What’s it to ya?) Anyway, normally the next character in the string has column index one more than the one before it. Except for those pesky backspace characters! They decrement (by two, really) the column index of everything that comes after them (unless the index is 1, since we cannot print to the left of the left edge of a line). So in the line

abcde\b\b\bfg

the character a has index 1, b is 2, c is 3, d is 4, e is 5, f is 3, and g is 4.

The trick is this: we can march down a string and determine the column index of every non-backspace character. This results in a big list of char-int pairs. Now in principle each one of these can be turned into an overstrike line. For instance, the last example could be expressed as

 a
+ b
+  c
+   d
+    e
+  f
+   g

But there is a problem here: while correct, having only one printed character per line is extremely inefficient! If two lines do not “overlap”, they can be merged. So a more efficient way to achieve the same effect is with

 abcde
+  fg

In fact this is a most efficient set of overstrike lines for this example, since 2 is the minimal number of lines required. It isn’t too hard to see that if a given line has at most $$k$$ characters with the same column index, then $$k$$ is the minimum number of overstrike lines required to render that line (and there is always a set of $$k$$ overstrike lines that works). Why? We can think of this as a graph coloring problem. The char-int pairs are vertices (ignoring those where the character is a blank), and two vertices are adjacent if they have the same column index. Colorings of this graph correspond to valid sets of overstrike lines. But this graph is a disjoint union of complete graphs, with one component for each column index. The minimum number of colors required is the size of the largest component.

To identify a coloring of the char-int graph, we (1) drop all the blanks, (2) sort the list by column index, and (3) split the list into maximal subsequences by column index. (What?) Finally, (4) thinking of these char-int pairs as sparse lists, convert to real actual lists, using space characters for any missing indices.

We will use an internal representation, CCLine, for lines formatted using a simplified version of the ASA carriage control scheme; a CCLine is a list of overstrike lines. Rendering a CCLine gives its unicode representation. (Note that the constructors of CCLine are internal to a single library module; programs can only create and manipulate CCLines via the functions provided by this module. This provides a very basic kind of future-proofing.)

data CCLine
= CCLine [String]
deriving (Show)

fromCCLine :: CCLine -> [String]
fromCCLine (CCLine xs) = xs

renderCCLine :: CCLine -> String
renderCCLine (CCLine xs)
= intercalate "\n" $zipWith (:) (' ' : (repeat '+')) xs Now toCCLine reads a CCLine from a string. toCCLine :: String -> CCLine toCCLine "" = CCLine [""] toCCLine xs = (columnIndices >>> filter (\(c,_) -> c /= ' ') -- try omitting >>> sortBy (\(_,a) (_,b) -> compare a b) -- these lines >>> maxMonoSubseqsBy p >>> map (fromSparseList ' ') >>> CCLine) xs where p u v = if snd u < snd v then True else False -- Assign a column index columnIndices :: String -> [(Char,Int)] columnIndices = accum [] 1 where accum zs _ "" = reverse zs accum zs k (c:cs) = case c of '\b' -> accum zs (max 1 (k-1)) cs otherwise -> accum ((c,k):zs) (k+1) cs maxMonoSubseqsBy :: (a -> a -> Bool) -> [a] -> [[a]] maxMonoSubseqsBy p = unfoldr maxMonoSubseq where maxMonoSubseq [] = Nothing maxMonoSubseq xs = accum [] [] xs accum as bs [] = Just (reverse as, reverse bs) accum [] bs (z:zs) = accum [z] bs zs accum (a:as) bs (z:zs) = if p a z then accum (z:a:as) bs zs else accum (a:as) (z:bs) zs fromSparseList :: a -> [(a,Int)] -> [a] fromSparseList x [] = [] fromSparseList x ys = accum 1 [] ys where accum _ as [] = reverse as accum t as ((z,h):zs) = case compare t h of EQ -> accum (t+1) (z:as) zs LT -> accum (t+1) (x:as) ((z,h):zs) GT -> accum (t+1) as zs As an aside: I pulled out maxMonoSubseqsBy and fromSparseList as abstractly as possible. When writing Haskell (this is probably true in other languages as well) writing code with the most general possible type usually makes it easier to write. Working with a less specific type means there are fewer meaningful things to say, and when there are fewer paths to choose from the correct one is easier to find. This code, for instance, was nearly written in one pass with no substantial editing needed. Not because I am particularly good but because there’s essentially only one way to do it. Pick a type signature and a recursion pattern (here, either unfoldr or accumulating parameter) and the rest practically writes itself. After all that, the main program is pretty straightforward. main :: IO () main = do lineFilter (renderCCLine . toCCLine) exitSuccess ## Old stuff -- apply a map to all lines on stdin lineFilter :: (String -> String) -> IO () lineFilter f = do xs <- fmap getLines getContents sequence_$ map (putStrLn . f) xs

-- split on \n
getLines :: String -> [String]
getLines = unfoldr firstLine
where
firstLine :: String -> Maybe (String, String)
firstLine xs = case break (== '\n') xs of
("","")   -> Nothing
(as,"")   -> Just (as,"")
(as,b:bs) -> Just (as,bs)


text:
# Phosphorous acid vs phosphonic acid?

I want to know the difference b/w phosphonic acid and phosphorous acid.

The formula for both is H3PO3.

Websites give me conflicting answers. Which one of them is dibasic and which one is tribasic?

The difference is that phosphonic acid ($\ce{HPO(OH)2}$) is an existing, shelf-stable compound while phosphorous acid ($\ce{P(OH)3}$) is extremely short-lived if at all and immediately tautomerises to phosphonic acid.

All the -ous acids are theoretically produced in the same manner: take the -ic acid and remove one unprotonated oxygen, leaving an additional electron pair with the central atom which reduces its oxidation state by two. So while sulphuric acid is $\ce{SO2(OH)2}$, sulphurous acid is $\ce{SO(OH)2}$.

Likewise, you can always theoretically generate the -onic acids by tautomerisation from the ‘parent’ -ous acid; one proton that previously was attached to an oxygen bonds to the central atom‘s newly-formed (when coming from the -ic acid) lone pair. Thus, sulphonic acid is $\ce{HSO2(OH)}$.

In case of sulphur, while both acids have been observed and crystal structures of both have been determined to the best of my knowledge,[citation needed] the two can still tautomerise. In the case of phosphorus, only the phosphonic acid is shelf-stable and all isolated salts have been determined to be phosphonate salts.[citation needed]

In both cases, however, organic esters have been generated in both ways. Thus, you can have e.g. triethyl phosphite $\ce{P(OEt)3}$ or diethyl ethylphosphonate $\ce{EtPO(OEt)2}$.

As already mentioned by Jan, phosphonic acid actually the stable, existing compound while phosphorous acid is unstable, short-lived and quickly tautomerizes to phosphonic acid. Wikipedia supports this fact:

$\ce{H3PO3}$ is more clearly described with the structural formula $\ce{HPO(OH)2}$. In the solid state, $\ce{HPO(OH)2}$ is tetrahedral with one shorter $\ce{P=O}$ bond of 148 pm and two longer $\ce{P–O(H)}$ bonds of 154 pm. This species exists in equilibrium with an extremely minor tautomer $\ce{P(OH)3}$. IUPAC recommends that the latter be called phosphorous acid, whereas the dihydroxy form is called phosphonic acid. Only the reduced phosphorus compounds are spelled with an "ous" ending.

$\ce{H3PO3}$ is described by the name of phosphorous acid but the name is actually quite misleading. As mentioned in Wikipedia, $\ce{H3PO3}$ actually has the structural formula $\ce{HPO(OH)2}$(dihydroxy form) which is actually called phosphonic acid and for which the acid is diprotic and not triprotic as might suggested by the formula. The tautomer of this acid is $\ce{P(OH)3}$ which is called phosphorous acid. This is unstable and quickly converts to its dihydroxy form.

Sometimes things may look very obvious but if you look for the story behind it, you may find that 'it was not that I thought of'.


text:
TLC moder checker 相关文档阅读笔记，专注于相关概念内容，省略 IDE 界面介绍部分。

The TLA+ Toolbox uses the TLC model checker to model check the current spec. More precisely, TLC checks a model of the specification.

## Models

• What the behavior spec is ?
• What TLC should check ?
• What values to substitute for constant parameters ?

### What the behavior spec is ?

In TLA+, the term specification (or spec) is used to mean one of two things, We take the word specification by itself to have the first meaning. We use the term behavior specification when we mean the second.

• Specification: The collection of modules consisting of the root module and and all modules that are imported by the root module, either directly or indirectly, with EXTENDS or INSTANCE statements.

In the context of the Toolbox, we exclude from this collection the standard TLA+ modules such as the Naturals module. All the specification’s module files must be in the same directory as the root module file.

• Behavior Specification: The TLA formula that specifies the set of allowed behaviors of the system or algorithm being specified.

There are two ways to write the behavior spec:

• Init and Next: A pair of formulas that specify the initial state and the next-state relation, respectively.
• Single formula: A single temporal formula of the form $Init \land \Box [Next]_{vars} \land F$.
• $Init$ is the initial predicate
• $Next$ is the next-state relation
• $vars$ is the tuple of variables
• $F$ is an optional fairness formula

### What TLC should check ?

There are three kinds of properties of the behavior spec that TLC can check:

• A deadlock is said to occur in a state for which the next-state relation allows no successor states.
• Termination is deadlock that is not considered an error. If you want the behavior spec to allow termination, then you should uncheck the deadlock option.

Invariants

• An invariant is a state predicate that is true of all reachable states–that is, states that can occur in a behavior allowed by the behavior spec.
• You can include a list of invariants. The checking of each invariant can be enabled or disabled by checking or unchecking its box.

Properties

• TLC can check if the behavior spec satisfies (implies) a temporal property, which is expressed as a temporal-logic formula.
• You can specify a list of such properties, each with a check-box for enabling or disabling its checking.

### What values to substitute for constant parameters ?

The most basic part of a model is an assignment of values to declared constants. A model must specify the values of all declared constants. There are three wasy to assign a value to a constant:

Ordinary assignment

• You can set the value of the constant to any constant TLA+ expression that contains only symbols defined in the spec.
• The expression can even include declared constants, as long as the value assigned to a constant does not depend on that constant.

Model value

• Ordinary Model Values

• A model value is an unspecified value that TLC considers to be unequal to any value that youcan express in TLA+.

• Since TLC cannot evaluate the unbounded $CHOOSE$ expression, to allow TLC to handle the follow spec, you need to substitute a model value for $NotANat$. $$NotANat = CHOOSE \enspace n : n \notin Nat$$

这条要注意！！！

• Typed Model Values

• TLC considers a typed model value to be unequal to any other model value of the same type.
• It produces an error when evaluating an expression requires it to determine if a typed model value is equal to any value other than a model value of the same type or an oridinary model value

普通的 model value 和其他值做比较时，只会返回 FALSE，但有可能比较行为本身就是错误的。为了发现这类错误，可以使用 typed model value，其只允许相同类型的 model value 之间的比较行为。

• A model-value type consists of a single letter, so there are $52$ different types because a and A are different types.
• A model value has type T if and only if its name begins with the two characters T_.

Set of model values

An important resson for substituting a set of model value for constants is to len TLC take advantage of symmetry. A set is a symmetry set meaning that permuting the elements in the set of values does not change whether or not a behavior satisfies that behavior spec. TLC can take advantage of this to speed up its check.

• You can declare more than one set of model values to be a symmetry set. However, the union of all the symmetry sets cannot contain two typed model values with different types.
• TLC does not check if a set you declare to be a symmetry set really is one.
• The only TLA+ operator that can produce a non-symmetric expression when applied to a symmetric expression is $CHOOSE$.

Symmetry sets should not be used when checking liveness properties. Doing so can make TLC fail to find errors, or to report nonexistent errors.

## Options

### Spec Options

• 不想在 Spec 内部定义的 operators 可以置于此处
• State Constraint

• Spec 的状态空间大多是无限延伸的，可于此处限制遍历的状态空间范围
• A state constraint is a state predicate, which is a Boolean-valued expression that contains unprimed variables.
• Action Constraint

• An action constraint is much like a state constraint, except that the constraint formula may also include primed variables.
• Model Values

• Definition Override

• 类似于 C 的 define 语句
• If the operator whose definition you are overriding has arguments, you will be presented with a form for writing the new definition in the obvious way.
• If it has no arguments, you have two options. With the Ordinary assignment option, you just write the new definition.

### TLC Options

Configuration

• not set it to be greater than the number of separate processors
• Fraction of physical memory allocated to TLC

• Setting the this parameter too large may produce a Could not create the Java virtual machine error.
• Log base 2 of number of disk storage files

Checking Mode

• Model-checking mode

• This is the normal method of running TLC, in which it essentially tries to check all possible behaviors allowed by the behavior spec.
• Simulation Mode

• It checks an unending series of behaviors, each of which it constructs by starting from a randomly choosen initial state and repeatedly making a random choice of a possible next state.
• When run in simulation mode, the only statistics TLC reports are for States Found.

Features

• Checkpoint Recovery

• TLC takes regular checkpoints, from which it can be restarted if it is stopped for any reason.
• Profiling

• TLC supports detailed profiling at the action as well as the expression level.
• Profiling negatively impacts model checking performance and should thus be off when checking large models.
• Visualize state graph after completion

• Can reasonably display only state graphs with at most around a hundred states.

Parameters

• Verrify temporal properties upon termination only

• check temporal properties(liveness) only after the complete state space has been checked for invariant(safety) violations
• Fingerprint seed index

• TLC saves only 64-bit fingerprints (hashes) of the reachable states that it finds, not the complete states.
• If two different reachable states have the same fingerprint, a situation called a collision, TLC may not find all reachable states.
• The fingerprint seed index specifies which of 64 fingerprint functions TLC should use.
• Cardinality of largest enumerable set

• If TLC tries to enumerate the elements of a set, it will report an error if the set contains more than this number of elements.
• JVM arguments

• TLC command line parameters

• There are options given to TLC when it is run on the model.
• A complete list of TLC options can be found in TLC.java

## Model Checking

### How TLC is Run

The Toolbox runs TLC on a module named MC that it constructs from the model. It writes the module file MC.tla and the TLC configuration file MC.cfg when validating the model.

### Statistics

State space progress

This show a history of TLC’s reachable state space computation.

• Diameter: The diameter of the reachable-state graph. It is the length of the longest behavior found so far.
• States Found: The total number of states TLC has examined so far.
• Distinct States: The number of distinct states among the states found.
• Queue Size: The number of (distinct) states found whose successor states TLC has not yet determined.

Sub-Actions of next-state

• A common error in writing a behavior spec is for an action not to be enabled when it should be, so the spec cannot reach states that represent reachable states of the actual system being specified.
• This kind of error leads to a violation of desired liveness properties, but does not cause any violation of safety.
• Sub-Actions of next-state shows the number of states generated by each sub-action of the next-state relation.
• The action statistics give you a way of catching such an error even if you’re not checking liveness.


text:
Is there any geometry where the triangle inquality fails? - MathOverflow most recent 30 from http://mathoverflow.net 2013-06-19T21:52:45Z http://mathoverflow.net/feeds/question/23113 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/23113/is-there-any-geometry-where-the-triangle-inquality-fails Is there any geometry where the triangle inquality fails? To be cont'd 2010-04-30T14:37:24Z 2012-05-19T09:44:28Z
We know from elementary school that the triangle inequality holds in Euclidean geometry. Some where in High School or in Univ., we come across non-Euclidean geometries (hyperbolic and Riemannian) and Absolute geometry where in both the inequality holds.

I am curious whether the triangle inequality is made to hold in any geometry( from the beginning) or is a consequence of some axioms. Presumably, the denial of the inequality would create havoc in that conceivable geometry.

Thanks.
 http://mathoverflow.net/questions/23113/is-there-any-geometry-where-the-triangle-inquality-fails/23116#23116 Answer by Tom Smith for Is there any geometry where the triangle inquality fails? Tom Smith 2010-04-30T14:56:04Z 2010-04-30T14:56:04Z
What do you mean by "denial"? There is the hoary old story of the researcher who wrote an entire thesis on the properties of antimetric spaces, ie spaces where $d(a,b) \ge d(a,c) + d(b,c)$ for all $a,b$ and $c$... without realising that any such space must consist of at most a single point!
 http://mathoverflow.net/questions/23113/is-there-any-geometry-where-the-triangle-inquality-fails/23121#23121 Answer by gowers for Is there any geometry where the triangle inquality fails? gowers 2010-04-30T15:36:05Z 2010-04-30T15:36:05Z
There are people who seriously study quasi-normed spaces. The most natural examples are $\ell_p$ spaces for p strictly between 0 and 1 (the "norm" given by the usual formula and the distance given by the norm of the difference). Although these spaces do not satisfy the triangle inequality, you get an inequality of the form $\|x+y\|\leq C(\|x\|+\|y\|)$.
 http://mathoverflow.net/questions/23113/is-there-any-geometry-where-the-triangle-inquality-fails/23122#23122 Answer by Joseph Malkevitch for Is there any geometry where the triangle inquality fails? Joseph Malkevitch 2010-04-30T15:39:30Z 2010-04-30T15:39:30Z
In the Euclidean plane when equality holds in the triangle inequality the points lie along a line of the geometry (degenerate triangle). However, for the triangle inequality in the Taxicab Plane (distance given by sums of absolute values of the differences in the coordinates) points which do not lie along a line of the geometry can have the sum of two sides of a triangle with equal length to the third.
 http://mathoverflow.net/questions/23113/is-there-any-geometry-where-the-triangle-inquality-fails/23130#23130 Answer by S. Carnahan for Is there any geometry where the triangle inquality fails? S. Carnahan 2010-04-30T17:40:08Z 2010-04-30T17:40:08Z
Any geometry modelled on non-positive definite spaces will yield an example. As Sergei Ivanov mentioned in the comments, an $n$-dimensional Lorentz geometry is modelled on the indefinite space $\mathbb{R}^{1,n-1}$, and there are tangent vectors of negative norm, hence paths of negative length squared. These appear a lot in special and general relativity, where one direction is time, and the rest are space.

Another example is the root space of an affine Kac-Moody Lie algebra, which has a singular metric (i.e., there is a line that is perpendicular to everything). It embeds as the codimension 1 subspace of a Lorentz space that is perpendicular to a lightlike (i.e., nonzero norm 0) vector. Its geometry comes into play when considering the affine Weyl group, which acts on this space by reflections. For reasons of sanity, one typically studies the action by using the Lorentz embedding to extend it to a group of hyperbolic reflections that fix a boundary point, and considering the induced action on a horocycle (which has Euclidean geometry).
 http://mathoverflow.net/questions/23113/is-there-any-geometry-where-the-triangle-inquality-fails/23140#23140 Answer by marc for Is there any geometry where the triangle inquality fails? marc 2010-04-30T19:56:29Z 2010-04-30T19:56:29Z
In Information Geometry, the Kullback-Liebler divergence is commonly used in the manner of a metric, but it does not satisfy the triangle inequality. It localizes to the Fisher Information Metric on the probability simplex, the interior of which is diffeomorphic to the geometry of the sphere with the inherited metric from Euclidean space under the map $x \mapsto 2\sqrt{x}.$ This geometry is used in evolutionary game theory to study natural selection.

There are many other information divergences that are not symmetric and do not satisfy the triangle inequality. You can form a divergence that does satisfy the triangle inequality.
 http://mathoverflow.net/questions/23113/is-there-any-geometry-where-the-triangle-inquality-fails/23174#23174 Answer by Eric O. Korman for Is there any geometry where the triangle inquality fails? Eric O. Korman 2010-05-01T12:30:41Z 2010-05-01T12:30:41Z
I just wanted to add that in the Lorentzian case, the triangle inequality gets reversed for a certain class of vectors (those with positive time component). Since the norm of a vector corresponds to the elapsed time measured by a clock moving along the vector, a physical consequence of this is the twin's paradox: by flying out in a spaceship from earth and then returning, you age less than if you had just stayed still.
 http://mathoverflow.net/questions/23113/is-there-any-geometry-where-the-triangle-inquality-fails/23187#23187 Answer by Peter Luthy for Is there any geometry where the triangle inquality fails? Peter Luthy 2010-05-01T15:38:54Z 2010-05-01T18:49:23Z
The weak $L^p$ spaces, often denoted $L^{p,\infty}$, provide another class of commonly occurring function spaces for which the triangle inequality fails to hold. The most common of these is weak $L^1$ which is the set of all functions so that $\sup_{\alpha>0}\alpha\textrm{ }\mu(x:|f(x)|>\alpha)$ is finite. This quantity is called the weak-$L^1$ "norm" of $f$, though it is not a true norm because it does not satisfy the triangle inequality. The term "weak" is appropriate as every $L^1$ function is automatically in weak $L^1$ by Chebyshev's inequality; the function $1/x$ is in weak $L^1$, however.

These spaces arise when studying, for example, maximal operators, e.g. Hardy-Littlewood, and singular integral operators, e.g. the Hilbert transform. Both the Hardy-Littlewood maximal operator and the Hilbert transform are bounded from $L^p$ to $L^p$ for $p\in(1,\infty)$ but are not bounded $L^1$ to $L^1$. They are, however, bounded from $L^1$ to weak $L^1$. The weak Lebesgue spaces are very useful substitutes for the usual Lebesgue spaces because some interpolation theorems, e.g. the Marcinkiewicz interpolation theorem, allow one to interpolate between two weak estimates to produce strong estimates in between. So the fact that the Hardy-Littlewood maximal operator is bounded from $L^1$ to weak $L^1$ and $L^\infty$ to $L^\infty$ is enough to prove that it is bounded from $L^p$ to $L^p$ for $p\in(1,\infty)$.
 http://mathoverflow.net/questions/23113/is-there-any-geometry-where-the-triangle-inquality-fails/23196#23196 Answer by Tom LaGatta for Is there any geometry where the triangle inquality fails? Tom LaGatta 2010-05-01T20:25:09Z 2010-05-01T20:25:09Z
Last-passage percolation is a model of random geometry on the lattice which satisfies a superadditive inequality (a reverse triangle inequality). On the lattice $\mathbb Z^2$, define a passage time $t_b \ge 0$ for each bond $b$ of the lattice. These are typically chosen to be i.i.d. random variables, but they don't have to be.

Define the up-right ordering $\le$ on $\mathbb Z^2$ by $z \le z'$ if $z_1 \le z_1'$ and $z_2 \le z_2'$. Then the last-passage time between two points $z \le z'$ on $\mathbb Z^2$ is $$\tau(z,z') = \max_{\gamma} \sum_{b \in \gamma} t_b,$$ where the maximum is taken over all directed up-right paths between $z$ and $z'$. The last-passage time satisfies a reverse triangle inequality: $$\tau(z,z') \ge \tau(z,w) + \tau(w,z')$$ if $z \le w \le z'$.
 http://mathoverflow.net/questions/23113/is-there-any-geometry-where-the-triangle-inquality-fails/23198#23198 Answer by David Sprehn for Is there any geometry where the triangle inquality fails? David Sprehn 2010-05-01T20:30:36Z 2010-05-01T20:30:36Z
There are a number of good answers from differential geometry, analysis, etc. But I suspect the questioner had axiomatic geometries in mind. So here's another take from that perspective.

There are two statements of the triangle inequality in plane geometry. (1) If A,B,C are noncollinear points, then $AC\lt AB+BC$; (2) If A,B,C are any three points, then $AC\leq AB+BC$.

In any system which includes a Ruler Postulate, (1) is stronger than (2). In neutral geometry (which includes all of the axioms of Euclidean geometry except the parallel postulate), statement (1) can be proven pretty directly from the SAS congruence postulate. (Does anyone know if they're equivalent in the presence of the other neutral geometry axioms?) Statement (2), on the other hand, is the one needed to show that the plane is a metric space, and is strictly weaker, as shown by the "taxicab geometry" mentioned above, which satisfies all of the postulates for neutral geometry except for SAS, and has property (2) but not property (1).

So, to summarize, the triangle inequality is true in neutral geometry, so any model of it (including the Euclidean and hyperbolic planes, etc.) will satisfy the triangle inequality. But of course we can consider weaker axiom systems in which models do not satisfy it (like taxicab).
 http://mathoverflow.net/questions/23113/is-there-any-geometry-where-the-triangle-inquality-fails/24716#24716 Answer by Gil Kalai for Is there any geometry where the triangle inquality fails? Gil Kalai 2010-05-15T09:38:46Z 2010-05-15T09:38:46Z
A famous example of a geometry which violates the triangle inequality is $\ell_2^2$, namely the distance between two points is defined as the square of their Euclidean distance. There is also much interesrt in metric spaces that do satisfy the triangle inequality which are subsets of $\ell_2^2$. Those are called "metric spaces of negative types". (Indeed, sumetimes the notation $\ell_2^2$ refer to a metric space which is a subset of $\ell_2^2$ as defined above.) There was a conjecture by Goemens and by Linial asserting that every metric space in $\ell_2^2$ can be embedded with constant distortion into $\ell_1$. This was disproved in a spectacular paper by Khot and Vishnoi.
 http://mathoverflow.net/questions/23113/is-there-any-geometry-where-the-triangle-inquality-fails/97383#97383 Answer by Ivan Meir for Is there any geometry where the triangle inquality fails? Ivan Meir 2012-05-19T09:44:28Z 2012-05-19T09:44:28Z
The reverse triangle inequality|x+y|>|x|+|y| holds in the Minkowski Space of Special Relativity for two timelike vectors in the same direction. So geometries that deny the triangle inequality in some signficant way can be very important I guess.


text:
A Lighter Perspective to Density Functional Theory

The diverse properties of materials upon which material science researchers possess enormous enthusiasm are categorized into magnetic, transport, optical and superconducting properties. As we know, materials are made up of atoms comprised of electrons and nuclei and all these material properties originate from the interactions among electrons and atomic nuclei. Classical mechanics can describe the interaction among nuclei as it is massive compared to that of electron, keeping Hydrogen and Helium as exception. However, classical mechanics cannot govern the behavior of electrons and so it calls for quantum mechanics to describe the system. The electron structure theory in quantum mechanics describes the behavior of electron in materials. The distribution of electron in real space and in main energy levels is attributed to electron structure that determines cohesive energy of the material. The cohesive energy originated from electron structure in turn controls the structure of the material and thereby electronic structure plays a vital role in the aforementioned diverse material properties. Density functional theory (DFT) is a computational modeling method to achieve electronic structure calculations which is a precursor to novel material properties.

Why “density” and what is “functional” in DFT?

In DFT, the physical quantity of interest is electron density. You can see the definition of functional in google search as function of a function is functional! But in DFT, the meaning is slightly different, i.e., the functional in density functional theory means there exist one to one mapping between two fields which means there should be one to one correspondence between the function and the functional. If we have an easily solvable function and complex functional, solving the function will help you to understand the functional because of this one-to-one correspondence among them. In DFT, we use electron density as a functional to understand all ground-state properties of a material system.

Basic theorems (Hohenberg-Kohn theorems) in DFT

1. The ground state energy extract from time independent Schrodinger equation is a unique function of the electron density.
2. The electron density that minimizes the energy of overall functional is the true electron density corresponds to the complete solution of Schrodinger equation.

The Problem

A material’s ground state energy consists of n nuclei at positions $(x_1,x_2,..,x_n)$, which can be expressed as $E(x_1, x_2,..,x_n)$ and that defines the adiabatic potential energy surface representing the ground state energy. We need to understand how this energy changes when the atoms are set into motion. The electron density of any system determines the ground state energy of that system. In such a case, the total ground state energy of a many-electron system is a function of electron density. So, if we know the electron density functional, we can extract the system’s total energy.

Let’s have a look at the Schrodinger equation of a many electrons system,

Where $\dfrac{\hbar^2}{2m} \sum_{i=1}^{N}{\nabla_i}^2$ is the Kinetic energy term, $\sum_{i=1}^{N} V(r_i)$ describes the interaction energy between each electron and the atomic nuclei, and $\sum_{i=1}^{N} \sum_{j<i} U(r_i,r_j)$ represents the quantum mechanical interaction energy between different electrons .

In reality, we need to deal with n ($n$= 1 to$\infty$ ) dimensions in order to understand the interaction energy term of material systems with huge number of electrons. However, there are some points to make the problem a little simpler such as,

1. If we know the ground state energy of the system, we can crack the problem as the Schrodinger equation is time-independent at the ground state and thereby overcome the mathematical complexity associated with time-dependent equations.
2. We can approximate the wavefunction as the Hartree product which expresses the resultant wavefunction of a material system as a product of individual electron wavefunctions.
3. The physical property of density in terms of the probability that ${\psi_i}^*(r)\psi_i(r)$ in our focus in DFT instead of electron position which helps to avoid the complexity of indistinguishability associated with the identical nature of electrons.

i.e. , $n(r) \approx \sum_{i=1} {\psi_i}^*(r)\psi_i(r)$

However, the complexity of DFT lies with accomplishing the one-to-one correspondence of this functional with easily solvable functions of a quantum mechanical system and the construction of this functional by selecting an appropriate set of wave functions. We can rewrite the total energy of this quantum mechanical system as,

$E(\psi_i)= E_{known}(\psi_i)+E_{X-C}(\psi_i)$

Here the known part of the energy consists of the kinetic energy of electrons, Coulomb interaction between the electron and nuclei, Coulomb interaction between pairs of nuclei, and the coulomb interaction between the pairs of electrons. The second part is called exchange-correlation functional representing all unknown quantum mechanical effects contributing to the total energy of the system. While doing DFT calculations, we have to choose the type of exchange-correlation functional based on the property of your interest. For instance, the local density approximation takes density as functional whereas the generalized gradient approximation (GGA) uses grad of electron density and meta GGA uses a second-order derivative of density and so on. We can decide on the suitable approximation among these by calculating the ground state energy given by each of these approximations. Whichever approximation gives minimum ground state energy, would be a more accurate approximation for your system. To perform DFT calculation, you have to use DFT packages and input atomic positions. The atomic positions can be extracted from molecule editing software such as Avagadro, VESTA, etc. So, identify a suitable package and go ahead to unravel the science encapsulated in electron density functional.


text:
# Lab 2: Dot to Dot Generator

## Learning Outcomes

• Implement algorithms using both ArrayLists and LinkedLists.

## Overview

This week you will implement an algorithm to reduce the number of dots in the picture so that more reasonable dot to dot challenges can be created.

## Assignment

• Incorporate feedback from your instructor from lab 1.
• Indicate the total number of dots in the selected file.
• Add a menu item called Number of Dots that will allow the user to enter a desired number of dots.
• Display the picture produced by removing all but the user-specified number of dots.
• Save a picture to a .dot file.

Note: If the user loads a picture with 2,000 dots, and enters 100 for the desired number of dots, and subsequently enters 1,000 for the desired number of dots, your program must show a picture with 1,000 dots, not 100.

## Details

### Changes to Dot Class

You must add the following two methods to the Dot class:

• private static double distance(Dot a, Dot b) that returns the distance between the two dots.
• A public instance method criticalValue(Dot previous, Dot next) that returns the critical value of the dot as defined below.

### Changes to Picture Class

You must remove all constructors from the Picture class and implement the following constructors:

• Picture(List<Dot> emptyList) — Constructor that uses the list emptyList passed to it to store the dots for this picture.
• Picture(Picture original, List<Dot> emptyList) — Constructor that copies the dots from original into emptyList and uses it to store the dots for this picture.

These constructors provide flexibility in our Picture class because we can now specify the specific implementation of the List used (e.g., ArrayList, LinkedList, or even our own List implementation) by passing the appropriate list to the constructor. In fact, the Picture class is no longer dependent on any concrete list implementation.

You must also implement the following methods in the Picture class:

• void save(Path path) — saves the picture to .dot path that is compatible with the format described in lab 1.
• void removeDots(int numberDesired) — removes all but the numberDesired most critical dots.
• If the picture does not have more than numberDesired dots, the method returns without changing the picture.
• If numberDesired < 3, an IllegalArgumentException is thrown.

Your implementation of the removeDots() method must be consistent with this flowchart:

#### Calculating the Critical Value of a Dot

The critical value of a dot depends on the relative proximity of it and its immediate neighbors. Consider three dots, labeled 1, 2, and 3, on a straight line. If dot 2 is removed, the connect the dots version of the line from 1 to 3 will look exactly the same. Therefore, we can conclude that the dot is not critical. If dot 2 is significantly far from the line connecting dot 1 and 3, then error would be introduced if dot 2 is eliminated, as shown in Figure 3.

The critical value of dot 2 is calculated as the sum of the distances from dot 2 to dot 1 and from dot 2 to dot 3 minus the distance from dot 1 to dot 3, i.e., $$cv_2 = d_{12} + d_{23} - d_{13}$$

where $$cv_y$$ is the critical value for dot $$y$$ and $$d_{xz}$$ are the distances illustrated below.

Note that in the case of a straight line between dots 1 and 3, $$cv_2 = 0$$

Your program should assume that the first and the last dots are connected so they should be treated as neighbors when calculating their critical values.

## Exception Handling

There are a number of situations that could cause your program to throw an exception. For example, if the file is not found, cannot be opened, or contains incorrectly formatted data, it is likely that an exception will be thrown. In these cases, the program should display an useful message in an Alert.

## Just For Fun

Ambitious students may wish to:

• Try replacing lineTo() with quadraticCurveTo() or bezierCurveTo().
• Add number annotations next to each dot.
• Use shades of colors to indicate the order in which to connect the dots.
• Overlay the reduced-dot picture on top of the picture with all of the dots in the file. You may wish to display the original picture in a lighter color.
• Toggle between the original and reduced-dot pictures with a key press or mouse click.
• Use levels of gray to indicate the critical value of each dot.
• Create a print to PDF option.
• Create an animation that shows the progression of dots being removed from the picture.
• Add a third dimension (x, y, z) to each dot, develop an algorithm for calculating the critical value in 3D, and create a 3D viewer to allow viewing the object from different perspectives.

## Acknowledgment

This laboratory assignment, developed by Dr. Chris Taylor, is motivated by the eighth programming project in chapter 2 of our textbook which is based on the paper: L. J. Latecki and R. Lakamper, "Convexity Rule for Shape Decomposition Based on Discrete Contour Evolution," Computer Vision and Image Understanding (CVIU) 73(1999), pp. 441-454.

See your professor's instructions for details on submission guidelines and due dates.


text:
# Edge Equipment Co. manufactures and markets a number of rope products. Management is considering...

1. Edge Equipment Co. manufactures and markets a number of rope products. Management is considering the future of Product XT, a special rope for hang gliding, that has not been as profitable as planned. Since Product XT is manufactured and marketed independently of the other products, its total costs can be precisely measured. Next year’s plans call for a $400 selling price per 100 yards of XT rope. Its fixed costs for the year are expected to be$540,000, up to a maximum capacity of 700,000 yards. Forecasted variable costs are $280 per 100 yards of XT rope. Required: Estimate Product XT’s break-even point in terms of (a) sales units and (b) sales dollars. Document Preview: University of the District of Columbia Department of Accounting, Finance, and Economics Course: 2201-201-04 Principles of Accounting II Summer 2011 SHOW ALL CALCULATIONS: NO CREDIT WILL BE AWARDED OTHERWISE Edge Equipment Co. manufactures and markets a number of rope products. Management is considering the future of Product XT, a special rope for hang gliding, that has not been as profitable as planned. Since Product XT is manufactured and marketed independently of the other products, its total costs can be precisely measured. Next year’s plans call for a$400 selling price per 100 yards of XT rope. Its fixed costs for the year are expected to be $540,000, up to a maximum capacity of 700,000 yards. Forecasted variable costs are$280 per 100 yards of XT rope. Required: Estimate Product XT’s break-even point in terms of (a) sales units and (b) sales dollars. Tuna Company sets the following standard costs for the current quarter for the units produced: Direct materials (3,240,000 lbs. @ $2 per lb.)$6,480,000 Direct labor (135,000 hrs. @ $28 per hr.) 3,780,000 Actual costs incurred during the current quarter are: Direct materials (3,230,000 lbs. @$2.05 lb.) $6,621,500 Direct labor (132,500 hrs. @$27.5 per hr.) 3,643,750 Required: Compute the direct materials cost variance, including its price and quantity variances. Compute the direct labor cost variance, including its rate and efficiency variances. Beyer Company is considering the purchase of an asset for $200,000. It is expected to produce the following net cash flows. The cash flows occur evenly throughout each year. Compute the payback period for this investment. Year 1 Year 2 Year 3 Year 4 Year 5 Total Net Cash flows$60,000 40,000 70,000 120,000 38,000 328,000 A machine costs...

Attachments:


text:
# Question #eacef

Mar 4, 2017

$\approx 445.3 \setminus m {s}^{- 1}$

#### Explanation:

The most probable velocity follows from the Maxwell-Boltzman distribution and is:

$v = \setminus \sqrt{\frac{2 R T}{M}} \approx 445.3 \setminus m {s}^{- 1}$

With:

• gas constant $R = 8.314$

• molar mass $M = 109 g$

Rest of question is missing information.


text:
# USB - rechargeable batteries

Nice idea. Knowing that many of us carry a laptop everyday, it makes sense to use it for charging batteries!

UsbCell can be found here.

Brent said...

hi cati, wow, nice find. :)

Luciano Bove said...

Ciao! This is a real useful gadget.

Bob Johnson said...

Great Idea.

dt said...

Its interesting, but I was told that the USB power is not enough for recharging? Perhaps my source was wrong.

Joanne said...

Whoa, neat idea. I like the whole multi-tasking energy use!


text:
# The generator polynomial of cyclic code

Let $q$ be a power of prime number $p$ and let $F_{q^2}$ be a finite field of order $q^2$. Suppose that "-" be a conjugation operation that is defined as follow:

$-:F_{q^2} \longrightarrow F_{q^2}$

$x \longmapsto x^q$

Let $C$ be a cyclic code of length n over $F_{q^2}$ with the generator polynomial $g(x)$ and let $\bar{C}=\lbrace \bar{c} : c \in C \rbrace$ be the conjugate code of $C$.

It is obvious that $\bar{C}$ is also a cyclic code.

Is it possible to determine the generator polynomial of $\bar{C}$ from $g(x)$?

-
The obvious choice works. –  Felipe Voloch Dec 16 '11 at 18:33
The generator polynomial of $\bar{C}$ is $\overline{g(x)}$. Because the conjugation operation is distributive over summation and multiplication.


text:
C++ Program to Check if a Given Set of Three Points Lie on a Single Line or Not

This is a C++ program to check if a given set of three points lie on a single line or not. Three points lie on a single line if the area of the triangle formed by this points is equal to zero.

The area of the triangle is −

0.5 * (x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)).

Algorithms

Begin
Generate the points randomly.
Calculate the area by using above formula.
If area > 0
Then the points don't lie on the straight line.
else if area < 0
Then the points don't lie on the straight line.
else
The points lie on the straight line.
End

Example

#include <iostream>
#include <time.h>
#include <stdlib.h>
using namespace std;
static int L = 1;
static int U= 20;
int main(int argc, char **argv) {
int x3, y3, x1, x2, y1, y2;
time_t seconds;
time(&seconds);
srand((unsigned int) seconds);
//Generate the points randomly using rand().
x1 = rand() % ( U- L+ 1) + L;
y1 = rand() % (U - L+ 1) + L;
x2 = rand() % (U - L + 1) + L;
y2 = rand() % (U - L+ 1) + L;
x3 = rand() % (U - L+ 1) + L;
y3 = rand() % (U - L+ 1) + L;
cout << "The points are: (" << x1 << ", " << y1 << "), (" << x2 << ", " << y2 << "), & (" << x3 << ", " << y3 << ")\n";
//calculate area
float a = 0.5 *(x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2));
if (a < 0)
cout << "The points don't lie on the straight line";
else if (a > 0)
cout << "The points don't lie on the straight line ";
else
cout << "The points lie on the straight line";
}

Output

The points are: (20, 9), (6, 13), & (13, 11)
The points lie on the straight line

The points are: (9, 15), (4, 15), & (11, 16)
The points don't lie on the straight line


text:
# Differentiating (Gradient and Hessian) a Rn->R function

• Feb 6th 2009, 03:06 PM
@mir
Suppose that $g(z)=f(x)$, where $x=Sz+s$ for some $S\in R^{n\times n}$ and $s\in R^n$

Please Show that $\nabla g(z)=S^T\nabla f(x)$ and $\nabla^2g(z)=S^T\nabla^2 f(x) S$

where $\nabla$shows the gradient and $\nabla^2$ shows the Hessian.

Hessian of a vector is defined by:

Any help would be sincerely appreciated. (Crying)