text:
# Tikzscale fails for group plot with three elements, but works for two elements

For a custom figure I wanted to stack three figures on top of each other, to keep readability (multiple y axis) and comparability (all figures have the same x axis, the third figure is a combination of figure one and two). To be able to scale the figure properly I intended to use tikzscale. To test my code I wrote a small test sample, with main.tex:

\documentclass{article}
\usepackage{standalone}
\usepackage{tikz}
%\usetikzlibrary{external}
\usepackage{letltxmacro}
\usepackage{pgfplotstable}
\usepackage{pgfplots}
\usepackage{tikzscale}
\usepackage{siunitx}
\usepackage{subcaption}
%\tikzexternalize[prefix=tikz-cache/]
%\tikzset{external/force remake}
\usetikzlibrary{pgfplots.groupplots}
\pgfplotsset{compat=1.17}

\begin{document}
\begin{figure}[htpb]
\centering
\includegraphics[width=.8\linewidth, height=1.2\linewidth]{stacked_test_simple.tikz}
%\resizebox{.8\linewidth}{1.2\linewidth}{\input{stacked_test_simple.tikz}}
\caption{Image II}
\end{figure}
\end{document}

and stacked_test_simple.tikz:

\usepgfplotslibrary{groupplots}
\begin{tikzpicture}

\definecolor{color0}{rgb}{0.12156862745098,0.466666666666667,0.705882352941177}
\definecolor{color1}{rgb}{1,0.498039215686275,0.0549019607843137}

\begin{groupplot}[
group style={
% set how the plots should be organized
group size=1 by 3,
% only show ticklabels and axis labels on the bottom
x descriptions at=edge bottom,
% set the vertical sep' to zero
vertical sep=0pt,
},
]
% start the first plot
\nextgroupplot[
tick align=outside,
tick pos=left,
x grid style={white!69.0196078431373!black},
xmajorgrids,
xmin=1, xmax=5,
xtick style={color=black},
y grid style={white!69.0196078431373!black},
y label style={color=color0},
yticklabel style={color=color0},
xmajorticks=false,
ylabel={Plot 1},
ymajorgrids,
ymin=0, ymax = 26,
ytick style={color=black}
]
table {%
1 1
2 4
3 9
4 16
5 25
};
\nextgroupplot[
tick align=outside,
tick pos=left,
x grid style={white!69.0196078431373!black},
ytick style={color=color0},
xmajorgrids,
xmajorticks=false,
xmin=1, xmax=5,
xtick style={color=black},
y grid style={white!69.0196078431373!black},
y label style = {color=color0},
yticklabel style={color=color0},
ylabel={Plot 2},
ymajorgrids,
ymin = -6, ymax = 0,
ytick style={color=black}
]
\addplot [semithick, color0, mark=square*, mark size=2, mark options={solid}, only marks]
table {%
1 -1
2 -2
3 -3
4 -4
5 -5
};
\nextgroupplot[tick align=outside,
tick pos=left,
x grid style={white!69.0196078431373!black},
xlabel={X data},
xmajorgrids,
xmin=1, xmax=5,
xtick style={color=black},
y grid style={white!69.0196078431373!black},
ylabel style={color=color0},
ylabel={Plot 3},
ymajorgrids,
ymin = 0, ymax = 6,
ytick style={color=black},
yticklabel style={color=color0}
]
\addplot [semithick, color0, mark=square*, mark size=2, mark options={solid}, only marks]
table {%
1 1
2 2
3 3
4 4
5 5
};
\end{groupplot}
\end{tikzpicture}

but compilation fails for each \nextgroupplot with

Package pgfplots Error: Error: Plot height -316.93126pt' is too small. This
cannot be implemented while maintaining constant size for labels. Sorry, label

It works fine if I use \input and resizebox, i.e. without tikzscale, but that will damage my fonts. It also works fine if I reduce the amount of stacked plots to two and use tikzscale.
Why is tikzscale failing for my case, and what can I do to fix that issue (or what kind of different approach could I use)?

This answer is not indended to address all points in my question, but at least to point out a solution to my issues. Resizing the stacked plot worked by including the targeted size directly in the groupplot-definition:

\begin{groupplot}[
group style={
% set how the plots should be organized
group size=1 by 3,
% only show ticklabels and axis labels on the bottom
x descriptions at=edge bottom,
% set the vertical sep' to zero
vertical sep=0pt,
},
heigth=0.4\linewidth,
width=0.8\linewidth,
]

and including the figure with

\includegraphics[width=\linewidth]{stacked_test_simple.tikz}
`

This allows at least scaling, even though it requires a more indirect approach.


text:
# How to evaluate $\int_0^\frac{1}{\sqrt2}\frac{dx}{(1+x^2)\sqrt{1-x^2}}$

$$\int_0^\frac{1}{\sqrt2}\frac{dx}{(1+x^2)\sqrt{1-x^2}}$$

I tried using substitute, $$x=\sin\theta$$

But I ended up with $$\int_0^\frac{\pi}{4}\frac{d\theta}{1+\sin^2\theta}$$

Is my substitution correct? Please give me a hint to work this out! Thank you very much.

hint: $$\frac{1}{1+\sin^2 x}=\frac{\sec^2 x}{1+2\tan^2 x}$$

We see that $$\frac1{1+\sin(x)^2}=\frac{\sec(x)^2}{1+2\tan(x)^2}$$ as was hinted by @E.H.E. We then preform the sub $$u=\tan(x)$$ to get $$\int_0^1 \frac{du}{1+2u^2}$$ Then we may in fact compute the integral $$I(x;a,b,c)=\int\frac{ dx}{ax^2+bx+c}=\int\frac{dx}{a(x+\frac{b}{2a})^2+g}$$ Here $$g=c-\frac{b^2}{4a}$$. If we assume that $$4ac>b^2$$, then we may make the substitution $$x+\frac{b}{2a}=\sqrt{\frac{g}{a}}\tan u$$ which gives $$I(x;a,b,c)=\sqrt{\frac{g}{a}}\int\frac{\sec^2u\, du}{g\tan^2u+g}$$ $$I(x;a,b,c)=\frac{u}{\sqrt{ag}}$$ $$I(x;a,b,c)=\frac2{\sqrt{4ac-b^2}}\arctan\frac{2ax+b}{\sqrt{4ac-b^2}}+C$$ And by noting that your integral is given by $$I(1;2,0,1)-I(0;2,0,1)$$ we have your integral at the value $$\frac{\arctan\sqrt2}{\sqrt2}\approx 0.675510858856$$

• Why was the hint @EHE gave not enough? Why do the calculation for the OP? – JavaMan Apr 1 at 2:43
• @JavaMan Because it was an opportunity to demonstrate something more than the OP asked, namely $I(x;a,b,c)$. If I were a beginning calc. student I would find it very helpful, even interesting, to see such an answer. IMO, a good answer helps you in more ways than $1$, and helps you connect concepts/ideas (and in this case integrals). – clathratus Apr 1 at 3:31
• Of course I found it very useful. Using a second substitution is somewhat challenging task. Thank you for pointing it out! – emil Apr 1 at 15:26
• @emil You are very welcome :) – clathratus Apr 1 at 15:45

Hint

Divide numerator & denominator by $$\sin^2\theta$$

and set $$\cot\theta =u$$

Or divide numerator & denominator by $$\cos^2\theta$$

and set $$\tan\theta=v$$

format: plain


text:
Jigsaw Puzzle

GROUPS:
 Henrik Schachner 15 Votes Dear all, from the resemblance of a Voronoi mesh to a jigsaw puzzle I came to the idea for the following little program I want to share. The essential function is (* in: points p1, p2; out: BSplineCurve = jigsaw side if distance > minLength; *) jigsawSide[minLength_][pts : {p1_, p2_}] := Module[{m, u, o, vx, vy, n, dist, r, c, angle0, cPts}, dist = EuclideanDistance @@ pts; If[dist < minLength, Return[Line[pts]]]; (* avoid borders: *) If[Times @@ (p2 - p1) == 0, Return[Line[pts]]]; m = Mean[pts]; {u, o} = SortBy[pts, Last]; (* lower/upper point *) {vx, vy} = o - u; n = {vy, -vx}; (* normal vector *) r = .15 dist; (* radius *) c = m + n/4.; (* center *) angle0 = Sign[Last[n]] VectorAngle[{1, 0}, n]; (* points on circle: *) cPts = c + r {Cos[angle0 + #], Sin[angle0 + #]} & /@ (60 \[Degree] {-2, -1, 0, 1, 2}); Return[BSplineCurve[{u, m, Sequence @@ cPts, m, o}]] ] which connects two points with a BSplineCurve having the typical elementary shape of a jigsaw puzzle. If the distance is too short then the connection becomes a straight line. The same happens if the points share the same x- or y-coordinate to exclude the jigsaws borders. Here is a simple test of the function:Anything else is straightforward: start with "randomized" lattice points; from these a Voronoi mesh is created; extract its polygons; convert the polygon sides into the new (puzzle) shape; build new polygons out of these sides; apply a texture. The result is a bunch of jigsaw pieces one can play with:I was impressed by the consistent behavior of Texture. The whole (short) code is attached.Best regards -- Henrik Attachments:
7 months ago
9 Replies
 Vitaliy Kaurov 3 Votes @Henrik Schachner this is marvelous, thanks for sharing. Interestingly I had a similar idea visiting me a few years ago. Have you seen my blog post: Designing Jigsaw Puzzles with Mathematica ? For all details see the notebook attached at the end of the blogpost. The original idea came from my answer to this question. I bet the code design is different a bit, but I have not check this yet. A lot of things were added to Wolfram Language since 2012.
7 months ago
 Henrik Schachner 1 Vote Dear @Vitaliy Kaurov,thank you for this impressive hint! I particularly like the above animation! No, I did not know this, my little piece of code was just the result of a rainy weekend. I did not do any research whatsoever - maybe I should have done so ...Best Regards -- Henrik
7 months ago
 Dear Henrik,that is fantastic! I have been playing for a while now to try and write something that helps solving the jigsaw. I have tried two approaches: Machine learning For each piece of the jigsaw I have tried to determine all the adjacent ones. Then I have tried to learn how to find fitting parts. The aim is to only find all adjacent pieces not to actually solve the jigsaw. Similar sections of boundaries I have also tried to detect similar sections of the boundaries using ImageCorners. Neither of the approaches has worked. I hope to find some time tomorrow and come up with a new idea.Thank you for posting,Marco
7 months ago
 Henrik Schachner 2 Votes Dear Marco,I am glad you like my little post! As usual you are trying the most challenging task! Somewhat inspired by this picture img1 = Binarize@ColorNegate[Graphics[{EdgeForm[White], Black, jigsawPolygsRaw}, ImageSize -> Large]]; DistanceTransform[img1] // ImageAdjust I was thinking about it but could not come up with a better idea than the most obvious: Making a binary function out of each piece (defined by its polygon) polygToFunction[p_Polygon] := Module[{meanShift, region}, meanShift = Mean @@ p; region = DiscretizeGraphics@Graphics[Map[# - meanShift &, p, {2}]]; Return[Function[{pt}, Piecewise[{{1, pt \[Element] region}}]]] ] adding them all up with specific translations, minimizing its integral ... Well, definitely not a good idea! It is probably a NP problem, one probably needs an heuristic algorithm (simulated annealing, genetic algorithm, ...). I am very curious about your solution!Best regards -- Henrik
7 months ago
 Vitaliy Kaurov 2 Votes A relevant neat article: GEODE, MAZE, AND CUSTOM JIGSAW PUZZLES. Some beautiful puzzles are made algorithmically. A very neat way to make locking pieces, which they also start from a Voronoi diagram.
7 months ago
 Henrik Schachner 2 Votes Wow - very inspiring! Thank you Vitaliy one more for this link! I think I need one of these lasers! Even though - lasers are hot, the jigsaw might melt: img1 = Binarize@ColorNegate[Graphics[{EdgeForm[White], Black, jigsawPolygsRaw}, ImageSize -> Large]]; SkeletonTransform[img1] // Pruning[#, 40] & // InverseDistanceTransform


text:
# How to show $X=Spec(A)$ has maximal components $V(p)$?

This is from Atiyah Macdonald, Chapter 1, Execrise 20.

If $A$ is a ring and $X=Spec(A)$, then the irreducible components of $X$ are the closed sets $V(p)$, where $p$ is a minimal prime ideal of $A$.

It is not difficult to prove the closed sets $V(p)$ are irreducible. However it isn't clear to me how to prove the second part. It is clear that when closed sets of the form $V(q),q\in X$ then $V(p)$ did provide a maximal irreducible closed set. Neverthelss it is not clear to me why every closed set in $X$ must be of this form(they only provide a basis of closed sets). So theoretically there is the possiblity of some closed set $U$ that contains $V(p)$, and in particular contains some prime ideal $k$ such that $p\not\subset k$. Then what can we do to prove this cannot hold and $k$ must contain $p$?

One way to address this is to take the closure of $U\cap X_{p}=K$. Since the $V(q),q\in X$ form a basis there is some $V(l)\subset \overline K$. Then $V_{l}\cup V_{p}\subset U$, while $V_{l}\cup V_{p}=V_{l\cap p}$. But by definition $l\cap p=p$; so such $V_{l}$ could not exist, and $K$ must be empty.

I am wondering if this approach is long-winded, as I found almost every other proof used the fact every irreducible component of $X$ must be of the form $V_{r(p)}$, where $r(p)$ denotes the radical of $p$. Why this is true, and how it might help to simplify the above proof?

-

Let $I$ be an ideal of $A$. We denote by $rad(I)$ the set $= \{x \in A\colon x^n \in I$ for some integer $n > 0$, where $n$ depends on $x\}$. It is easy to see that $rad(I)$ is an ideal and $V(I) = V(rad(I))$.

Let $E$ be a subset of $X = Spec(A)$. We denote by $\mathfrak{I}(E)$ the ideal $\bigcap_{p \in E} p$.

Lemma 0 Let $I$ be an ideal of $A$. Then $\mathfrak{I}(V(I)) = rad(I)$.

Proof: This is an immediate consequence of proposition 1.8 of Atiyah-MacDonald(it states that $\mathfrak{I}(X) = rad(0)$.

Lemma 1 Let $E$ be a subset of $X$. Then $V(\mathfrak{I}(E))$ is the closure of $E$.

Proof: Let $\bar E$ be the closure of $E$. Since $E \subset V(\mathfrak{I}(E))$, $\bar E \subset V(\mathfrak{I}(E))$.

Conversely suppose $E \subset V(I)$ for some ideal $I$. Then $I \subset \mathfrak{I}(E)$. Hence $V(\mathfrak{I}(E)) \subset V(I)$. Hence $V(\mathfrak{I}(E)) \subset \bar E$. QED

Lemma 2 $X = Spec(A)$ is irreducible if and only if $A/rad(0)$ is an integral domain.

Proof: Since $X = Spec(A/rad(0))$, we can assume $rad(0) = 0$.

Suppose $X$ is reducible. There exist proper closed subsets $F_1, F_2$ of $X$ such that $X = F_1 \cup F_2$. Hence $0 = \mathfrak{I}(X) = \mathfrak{I}(F_1) \cap \mathfrak{I}(F_2)$. By Lemma 1, $V(\mathfrak{I}(F_1)) = F_1$. Since $F_1 \neq X$, $\mathfrak{I}(F_1) \neq 0$. Similarly $\mathfrak{I}(F_2) \neq 0$. Hence $A$ is not an integral domain.

Conversely suppose $A$ is not an integral domain. There exist elements $f, g$ of $A$ such that $f \neq 0, g \neq 0$, $fg = 0$. Then, by Lemma 0, $V(f) \neq X$, $V(g) \neq X$ and $X = V(f) \cup V(g)$. Hence $X$ is reducible. QED

Lemma 3 Let $I$ be an ideal of $A$. Then $V(I)$ is irreducible if and only if $rad(I)$ is a prime ideal.

Proof: This follows immediately from Lemma 2.

By Lemma 3, an irreducible closed subset of $X$ is of the form $V(q)$, where $q$ is a prime ideal of $A$. Hence $V(p)$ is a maximal irreducible closed subset of $X$, if $p$ is a minimal prime ideal of $A$.

-
Sorry for my low level, but the book did not define an irreducible closed subset must be of this form. You already used $V_{p}\cup V_{q}=V_{p\cap q}$? I see. –  Bombyx mori Sep 17 '12 at 2:01
@Makoto Your Lemma 1 is the full Nullstellensatz, which is not covered yet in chapter 1 in Atiyah - Macdonald. –  user38268 Sep 17 '12 at 3:20
@BenjaLim I added the proof of Lemma 1. –  Makoto Kato Sep 17 '12 at 3:33
@MakotoKato Sorry I was mistaken, it is not lemma 1 that is the full Nullstellensatz but the fact before that $I(V(J)) = \sqrt{J}$. By the way in that line you have two $I$'s which make it confusing. On one hand $I$ in the radical means an ideal, while $I$ on the left is the ideal of all functions vanishing on $V(J)$.... –  user38268 Sep 17 '12 at 3:35
@user32240 Since $\bar E$ is closed, it is of the form $V(I)$. –  Makoto Kato Sep 17 '12 at 5:44


text:
#### VT Markets APP

Trade CFDs on FX, Gold and more

### CPI dropped, market expects Fed to reduce rate hike in December

###### November 14, 2022

US stocks advanced higher on Friday, preserving their upside momentum and extending the rally amid a slowdown in inflation and the upbeat market mood on the last trading day of the week. The risk-on sentiment is mainly supported by the soft inflation data from the US and news of China easing the Covid-related restrictions, as the US Consumer Price Index (CPI) declined to 7.7% yearly in October.

The probability of a 50 basis points Fed rate hike in December jumped above 80% from 50% earlier in the week after the readings came in below market expectations. On top of that, China’s National Health Commission announced that they have decided to reduce the required quarantine times for travellers and people who had close contact with identified Covid cases, supporting the risk-positive market environment. On the Eurozone front, the hawkish stance from European Central Bank (ECB) policymakers acted as a tailwind for the Euro, as ECB member Robert Holtzman said he would vote for a 50 or 75 bps hike at the December meeting.

The benchmarks, S&P 500 and Dow Jones Industrial Average both advanced higher on Friday as the S&P 500 closed near session highs in the biggest weekly gain since June. The S&P 500 was up 0.9% daily and the Dow Jones Industrial Average also advanced slightly with a 0.1% gain for the day. Six out of eleven sectors in the S&P 500 stayed in positive territory as the Energy sector and the Communication Services sector are the best performing among all groups, rising 3.06% and 2.47%, respectively. The Nasdaq 100 meanwhile climbed the most with a 1.8% gain on Friday and the MSCI World index was up 1.9% for the day.

Main Pairs Movement

The US dollar tumbled sharply on Friday, extending its previous slide and dropped to a daily low below 106.5 in the late US trading session as the upbeat market mood continue to dominate financial markets. The expectations for a slowdown in the Federal Reserve (Fed) tightening cycle following the CPI release continued to exert bearish pressure on the greenback, which extended its losses to four consecutive weeks. Investors are beginning to price in a less hawkish Fed and a 50 bps rate hike in December.

GBP/USD advanced higher on Friday with a 0.97% gain after the cable appreciated to fresh multi-month highs above the 1.1850 mark amid upbeat UK data. On the UK front, the UK’s GDP contracted less than expected in Q3 and allowed the pair to extend its sharp two-day rally. Meanwhile, EUR/USD finished the week on a higher note and surged above the 1.0350 mark amid a weaker US dollar across the board. The pair was up almost 1.35% for the day.

Gold climbed higher with a 0.90% gain for the day after refreshing its two-month high and extended its rally towards the $1,770 mark during the late US session, as the release of a soft US Consumer Price Index in October weighed on the US Dollar and provided support for the precious metal. Meanwhile, WTI Oil advanced sharply with a 2.88% gain for the day following China’s easing Covid-19 restrictions. Technical Analysis EURUSD (4-Hour Chart) The EURUSD has extended its rally and climbed to its highest level in three months above 1.0320 as of writing following the impressive gains on Thursday. The safe-haven US Dollar remains in its post-CPI downtrend as risk flows continue to dominate the financial markets ahead of the weekend. After the data from the US showed on Thursday that the annual Consumer Price Index (CPI) declined to 7.7% in October from 8.2% in September, the USD suffered heavy losses against its major rivals. The US Dollar Index dropped 2.3% on Thursday, registering one of the largest one-day losses of 2022. Now, investors continued to scale back 75 basis points (bps) Federal Reserve (Fed) rate hike bets in December on soft inflation report and the benchmark 10-year US Treasury bond yield fell more than 10%. According to the CME FedWatch Tool, markets are currently pricing in an 80% chance of a smaller, 50 bps, rate hike at the last FOMC meeting of the year. From the technical perspective, the four-hour scale RSI indicator dramatically extended advanced to the overbought zone 75 figured as of writing, suggesting that the pair was surrounded by strong upside traction and investors need to be cautious about any possible pullback soon. As for the Bollinger Bands, the pair was surging along with the upper band and the size between upper and lower bands became larger, signalling the pair amid a strong bullish tendency. Resistance: 1.0615, 1.0774 Support: 1.0167, 0.9961, 0.9730 GBPUSD (4-Hour Chart) The GBPUSD has preserved its bullish momentum and advanced toward the 1.1800 level as of writing, with risk flows continuing to impact asset valuations, the pair looks to extend its rally despite having turned overbought in the short term. The data published by the US Bureau of Labor Statistics revealed on Thursday that the Consumer Price Index declined to 7.7% yearly in October from 8.2% in September. Moreover, the Core CPI, which excluded food and volatile energy price, edged lower to 6.3% from 6.6%, coming in below the market expectation of 6.5%. The safe-haven greenback tumbled by more than 2% on Thursday, as investors assessed the soft inflation data as an opportunity to unwind USD longs. Apart from this, the UK’s Office for National Statistics reported that the Gross Domestic Product (GDP) expanded at an annualized rate of 2.4% in the third quarter. This print came in better than the market forecast of 2.1% and helped the Pound Sterling, which has already been benefiting from the improving market mood, gather more strength. From the technical perspective, the four-hour scale RSI indicator dramatically extended and rallied to 70, the overbought area, figured as of writing. Is suggests that the pair was surrounded by a strong upside tilt and investors need to be careful about the expected pullback soon. As for the Bollinger Bands, the pair was moving upward along with the upper band and the size between the upper and lower bands became larger, signalling the pair amid strong upward momentum. Resistance: 1.1438, 1.1623 Support: 1.1634, 1.1334, 1.1123 XAUUSD (4-Hour Chart) Gold continues to push higher and traded above the$1760 mark for the first time in nearly three months on Friday, as investors cheer the soft US inflation report. The Consumer Price Index in the United States rose 7.7% YoY, down from 8.2% in September and clearly below the 8.0% consensus forecast. The CPI accelerated by only 0.4% on the month, down from 0.6% in September and core figures rose 0.3%, rather than the 0.5% expected. The highly anticipated economic release from the United States triggered a massive risk rally on increased expectations of a smaller rate hike by the US Federal Reserve (Fed) in December. Markets now price roughly an 81% probability of a 50 bps December Fed rate hike vs. odds of about 55% at the start of the week. Furthermore, the slump in the US Treasury bond yields and the dovish comments from the Federal Reserve policymakers on Thursday further exacerbated the pain in the greenback. The benchmark 10-year US Treasury bond yields plunged over 30 bps to 3.811%, falling below the psychological 4% level on the US CPI release. The sell-off in the US Treasury yields boded well for the non-interest-bearing Gold price.

From the technical perspective, the four-hour scale RSI indicator remained in the overbought zone of  78 figures as of writing, suggesting that the XAUUSD is amid crazily bullish momentum and investors need to notice any possible pullback. As for the Bollinger Bands, the gold was pricing along with the upper band, which is a signal that the yellow metal in the near-term would persist the positive traction.

Resistance: 1802, 1857

Support: 1748, 1702, 1660


text:
# College Math Teaching

## August 7, 2014

### Letting complex algebra make our calculus lives easier

Filed under: basic algebra, calculus, complex variables — Tags: , — collegemathteaching @ 1:37 am

If one wants to use complex arithmetic in elementary calculus, one should, of course, verify a few things first. One might talk about elementary complex arithmetic and about complex valued functions of a real variable at an elementary level; e. g. $f(x) + ig(x)$. Then one might discuss Euler’s formula: $e^{ix} = cos(x) + isin(x)$ and show that the usual laws of differentiation hold; i. e. show that $\frac{d}{dx} e^{ix} = ie^{ix}$ and one might show that $(e^{ix})^k = e^{ikx}$ for $k$ an integer. The latter involves some dreary trigonometry but, by doing this ONCE at the outset, one is spared of having to repeat it later.

This is what I mean: suppose we encounter $cos^n(x)$ where $n$ is an even integer. I use an even integer power because $\int cos^n(x) dx$ is more challenging to evaluate when $n$ is even.

Coming up with the general formula can be left as an exercise in using the binomial theorem. But I’ll demonstrate what is going on when, say, $n = 8$.

$cos^8(x) = (\frac{e^{ix} + e^{-ix}}{2})^8 =$

$\frac{1}{2^8} (e^{i8x} + 8 e^{i7x}e^{-ix} + 28 e^{i6x}e^{-i2x} + 56 e^{i5x}e^{-i3x} + 70e^{i4x}e^{-i4x} + 56 e^{i3x}e^{-i5x} + 28e^{i2x}e^{-i6x} + 8 e^{ix}e^{-i7x} + e^{-i8x})$

$= \frac{1}{2^8}((e^{i8x}+e^{-i8x}) + 8(e^{i6x}+e^{-i6x}) + 28(e^{i4x}+e^{-i4x})+ 56(e^{i2x}+e^{-i2x})+ 70) =$

$\frac{70}{2^8} + \frac{1}{2^7}(cos(8x) + 8cos(6x) + 28cos(4x) +56cos(2x))$

So it follows reasonably easily that, for $n$ even,

$cos^n(x) = \frac{1}{2^{n-1}}\Sigma^{\frac{n}{2}-1}_{k=0} (\binom{n}{k}cos((n-2k)x)+\frac{\binom{n}{\frac{n}{2}}}{2^n}$

So integration should be a breeze. Lets see about things like, say,

$cos(kx)sin(nx) = \frac{1}{(2)(2i)} (e^{ikx}+e^{-ikx})(e^{inx}-ie^{-inx}) =$

$\frac{1}{4i}((e^{i(k+n)x} - e^{-i(k+n)x}) + (e^{i(n-k)x}-e^{-i(n-k)x}) = \frac{1}{2}(sin((k+n)x) + sin((n-k)x)$

Of course these are known formulas, but their derivation is relatively simple when one uses complex expressions.

If you are wondering why your engineering students want to use $j = \sqrt{-1}$ is is because, in electrical engineering, $i$ usually stands for “current”.
Though many of you know this, this lesson also gives an excellent reason to use the complex form of the Fourier series; e. g. if $f$ is piece wise smooth and has period 1, write $f(x) = \Sigma^{k = \infty}_{k=-\infty}c_k e^{i 2k\pi x}$ (usual abuse of the equals sign) rather than writing it out in sines and cosines. of course, $\overline{c_{-k}} = c_k$ if $f$ is real valued.
How is this easier? Well, when you give a demonstration as to what the coefficients have to be (assuming that the series exists to begin with, the orthogonality condition is very easy to deal with. Calculate: $c_m= \int^1_0 e^{i 2k\pi t}e^{i 2m\pi x} dx$ for when $k \ne m$. There is nothing to it; easy integral. Of course, one has to demonstrate the validity of $e^{ix} = cos(x) + isin(x)$ and show that the usual differentiation rules work ahead of time, but you need to do that only once.


text:
# Aluminium vs Copper in power lines

1. Jun 7, 2016

### Monosandalus

Hi,

I have a question concerning the use of aluminium in power lines. I know that it's lighter than copper and thus cheaper, which is the main reason we prefer it above copper. But in fact alumunium has a lower conductivity than copper. Why is it then that one kg of aluminium can carry twice as much electricity as one kg of copper ? This seems to be contradictory to me.

Thank you :)

2. Jun 7, 2016

### collinsmark

Here's some information that should be useful in the process of considering the question objectively:

Resistivity, $\rho_e, \mathrm{(\Omega \cdot m)}$:
Copper: $1.68 \times 10^{-8}$
Aluminum: $2.86 \times 10^{-8}$

Conductivity, $\sigma, \mathrm{(S / m)}$:
Copper: $5.96 \times 10^{7}$
Aluminum: $3.50 \times 10^{7}$

Density $\rho_m, \mathrm{(g/cm^3)}$ [Edit: corrected copy-paste error and a typo.]
Copper: 8.96
Aluminum: 2.70
By the way, resistivity and conductivity are not independent. They are merely reciprocals. $\rho_e = 1/\sigma$. Both resisitivity and conductivity are given in terms of spacial dimensions, such as unit cross-sectional area and unit length.

If $A$ is the cross sectional area of the conductor, $\ell$ is the conductor's length, then

Resistance, $r = \frac{\rho_e \ell}{A}$

Conductance, $G = \frac{1}{r} = \frac{\sigma A}{\ell}$

Mass, $m = A \ell \rho_m$

Last edited: Jun 8, 2016
3. Jun 7, 2016

### rbelli1

You got those swapped. Copper is the higher density material.

BoB

4. Jun 7, 2016

### Nidum

Think about two wires of equal length . One made from 1 kg of Copper and the other from 1 kg of Aluminium .

5. Jun 7, 2016

### collinsmark

And the price of metals depends on many factors besides just their densities (their weights). Lead is not cheaper than silver because it is lighter (it isn't: lead is heavier than silver); it's cheaper because it is more abundant and easier to extract.

6. Jun 7, 2016

### collinsmark

Thanks. It was a copy-paste error. Correction made.


text:
# How to make sense of audio file's $\textrm{dBFS}$?

I'm trying to build a song visualizer using the FFT method. When I analyze the audio, I get the $\textrm{dBFS}$ value for each frequency range.

From my understanding,

• $\textrm{dBFS}$ is in the range $[-\infty, 0]$, where $0$ is the most loud.

• The formula for percentage loudness is $10^{\rm dBFS/20}$.

However, the $\textrm{dBFS}$ values I'm getting are consistently below $-20$, i.e., $10\%$ loudness, even at loud parts of the song. Why is this so? Am I calculating the loudness wrongly?

Also, how can I calculate the overall loudness at a point in time? Is it the sum of all the values, or the maximum?

• "Am I calculating the loudness wrongly?" How are you calculating it? – endolith Oct 20 '16 at 16:15
• @Code Try with an input audio file which is a single sinusoid normalized at 0 dBfs. The FFT should have one peak nearly at 0 dB IIRC. – Basj Oct 11 '18 at 20:25
• Might be linked to dsp.stackexchange.com/questions/32076/…. – Basj Oct 11 '18 at 20:33

However, the dbFS values I'm getting are consistently below -20, i.e., 10% loudness, even at loud parts of the song. Why is this so? Am I calculating the loudness wrongly?

Why should that be a problem? Human perception is roughly logarithmic. Sound that isn't "unbearably loud" shouldn't be much more than 10% of your "acoustic dynamic range".

By the way, with $\frac{}{20}$, this formula gives you amplitude, not power values, so this isn't truly loudness, just amplitude. But since that, in perception, is but a constant factor, these terms can be used interchangably.

Also, how can I calculate the overall loudness at a point in time? Is it the sum of all the values, or the maximum?

It's the sum, at least approximately: human perception has a different sensitivity for different frequencies, and also, frequencies can mask each other, so the energy in the signal is only proportional to the perceived loudness if we ignore these facts (see: psychoacoustic models).

• Wouldn't you say it's troublesome that he's not getting 0 dBFS at some point? There has to be a maximum somewhere. Or am I thinking about this wrong (in terms of his question)? – Envidia May 18 '17 at 20:54
• no, doesn't worry me at all. a) we don't know whether the DFT (FFT) OP uses scales, and if so, how, b) it's to be expected that not all energy in a recorded time-domain ends up in a single DFT element, and that's what I would scale to be 0dB, and c) you always want to stay clear of clipping. d) assuming AC-coupling, there's only one signal with max power, and that's an alternating +FS/2 and -FS/2. That signal is unlikely to be let through by the anti-aliasing filter. – Marcus Müller May 18 '17 at 21:08
• I didn't consider the DFT being used. I've been using the same FFT for so long that it's become de facto. I also didn't consider clipping. That would definitely deny you of any hopes of seeing 0 dB. – Envidia May 18 '17 at 21:12


text:
Continuous IUE Monitoring of HR 1099 Throughout Two \\ Complete Orbital Cycles (6 days) in December 1992
Session 46 -- Late Type Stars
Display presentation, Wednesday, 9:20-6:30, Heller Lounge Room

## [46.04] Continuous IUE Monitoring of HR 1099 Throughout Two \\ Complete Orbital Cycles (6 days) in December 1992

J.E.Neff (Penn State), T.Simon (Hawaii), I.Pagano, M.Rodon\`o (Catania), B.Foing (LPSP/IAS)

In order to map the spatial structure of a stellar atmosphere using Doppler imaging techniques, observations of a rapidly-rotating star must be obtained at all of its rotational phases. In order to discriminate temporaral variability (e.g. flares) from phase-locked variability (produced by magnetically-active regions on the stellar surface), observations must be obtained over at least two rotational cycles. Using the International Ultraviolet Explorer, we observed the bright RS~CVn-type system HR~1099 (V711~Tau) continuously for two contiguous orbital/rotational cycles (period\$\sim\$2.83~days) in December~1992.

These observations were coordinated with the 1992 campaign for Multi-Site Continuous Spectroscopy (MUSICOS). The purpose of this campaign was to coordinate a network of ground-based telescopes distributed around the Earth so that moderate and high-resolution spectroscopy could be obtained pseudo-continuously for several days. Supporting photometric and radio observations also were obtained simultaneously.

We are using the IUE high-dispersion spectra of the Mg~II~h and k lines to map the spatial structure of the stellar chromosphere and to study atmospheric dynamics during flares. In conjunction with the IUE low-dispersion spectra, we will be able to model the radial structure of the chromosphere. We present preliminary results showing the rotational modulation of the ultraviolet line fluxes and of the high-dispersion line profiles. At least 3 transition-region flares occurred within this 6-day interval, and our observations constrain both the rise and decay phases of these flares. The effect of a non-uniform atmospheric structure is subtle, but it is visible in the observed line profiles.


text:
Provided by: libperl-critic-pulp-perl_96-1_all

#### NAME

Perl::Critic::Policy::Documentation::ProhibitUnbalancedParens - don't leave an open
bracket or paren

#### DESCRIPTION

This policy is part of the "Perl::Critic::Pulp" add-on.  It reports unbalanced or
mismatched parentheses, brackets and braces in POD text paragraphs,

Blah blah (and something.    # bad

Blah blah ( [ ).             # bad

Blah blah brace }.           # bad

This is only cosmetic and normally only a minor irritant to readability so this policy is
low severity and under the "cosmetic" theme (see "POLICY THEMES" in Perl::Critic).

Text and command paragraphs are checked, but verbatim paragraphs can have anything.  There
are some exceptions to paren balancing.  The intention is to be forgiving of common or
reasonable constructs.  Currently this means,

·   Anything in "C<>" code markup is ignored

In code C<anything [ is allowed>.  # ok

Perhaps this will change, though there'd have to be extra exceptions in "C<>", such as
various backslashing.

Sometimes a prematurely ending "C<>" may look like an unbalanced paren, for example

This is bad because the "C<>" ends at the "=>", leaving "value)" unbalanced plain
text.  This is an easy mistake to make.  (The author's "perl-pod-gt.el" can show
warning face on this in Emacs.)

·   Quoted "(" is taken to be describing the char and is not an open or close.

Any of "(" or '[' or "[{]".   # ok

This only applies to quoted parens alone (one or more), not larger quoted text.

·   Item parens

a) the first thing, or b) the second thing   # ok

1) one, 2) two     # ok

Exactly how much is recognised as an "a)" etc is not quite settled.  In the current
code a "1.5)" is recognised at the start of a paragraph, but in the middle only "1)"
style.

·   Smiley faces are an "optional" close,

(Some thing :-).                # ok

Bare smiley :).                 # ok

(Or smile :-) and also close.)  # ok

·   Sad smiley faces are not an opening paren,

:( :-(.     # ok

·   Perl variables $( and$[ are not opening parens,

Default is group $( blah blah. # ok${ brace is still an open and expected to have a matching close, because it's likely
to be a deref or delimiter,

Deref with ${foo()} etc etc. Variables or expressions like this will often be in "C<>" markup and skipped for that reason instead, as described above. ·$) and $] are optional closes, since they might be Perl variables to skip, or might be "$" at the end of a parens,

blah blah (which in TeX is $1\cdot2$).

Perhaps the conditions for these will be restricted a bit, though again "C<>" markup
around sample code like this will be usual.

(POD document name and section) can have anything.

"=begin :foo" ... "=end :foo" sections with a format name ":foo" starting with a ":" are
POD markup and are processed accordingly.  Other "=begin" sections are skipped.

Unrecognised Forms
A mathematical half-open range like the following is not recognised.

Perhaps just numbers like this would be unambiguous, but if it's an expression then it's
hard to distinguish a parens typo from some mathematics.  The suggestion for now is an
"=for" per below to flag it as an exception.  Another way would be to write 1 <= X < 2,
which might be clearer to mathematically unsophisticated readers.

Parens spanning multiple paragraphs are not recognised,

Hopefully this is uncommon, and probably better style not to be parenthetical about
something so big that it runs to multiple paragraphs or has a verbatim block in the middle
etc.

Disabling
If an unbalanced paren is intended you can add an "=for" to tell
"ProhibitUnbalancedParens" to allow it.

=for ProhibitUnbalancedParens allow next

Something ( deliberately unclosed.

Or with a count of paragraphs to ignore,

=for ProhibitUnbalancedParens allow next 2

First deliberate [ unclosed.

Second (.

The usual no critic

## no critic (ProhibitUnbalancedParens)

works too as a whole-file disable, but the annotation must be before any "__END__" token,
and if the POD is after the "__END__" then "Perl::Critic" 1.112 up is required.
Individual "=for" has the advantage of being with an exception.

completely from your .perlcriticrc in the usual way (see "CONFIGURATION" in Perl::Critic),

[-Documentation::ProhibitUnbalancedParens]

#### SEEALSO

Perl::Critic::Pulp, Perl::Critic

<http://user42.tuxfamily.org/perl-pod-gt/index.html>

#### HOMEPAGE

http://user42.tuxfamily.org/perl-critic-pulp/index.html

Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017 Kevin Ryde

Perl-Critic-Pulp is free software; you can redistribute it and/or modify it under the


text:
## Topological Methods in Nonlinear Analysis

### Existence of solutions for $p(x)$-Laplacian problem on an unbounded domain

Fu Yongqiang

#### Abstract

In this paper we study the following $p(x)$-Laplacian problem: \begin{alignat}{2} -{\rm div}(a(x)|\nabla u|^{p(x)-2}\nabla u)+b(x)|u|^{p(x)-2}u&=f(x,u) &\quad& x\in \Omega,\\ u&=0 &\quad&\text{on }\partial\Omega, \end{alignat} where $1< p_{1}\le p(x)\le p_{2}< n$, $\Omega\subset {\mathbb R}^{n}$ is an exterior domain. Applying Mountain Pass Theorem we obtain the existence of solutions in $W_{0}^{1,p(x)}(\Omega)$ for the $p(x)$-Laplacian problem in the superlinear case.

#### Article information

Source
Topol. Methods Nonlinear Anal., Volume 30, Number 2 (2007), 235-249.

Dates
First available in Project Euclid: 13 May 2016

Permanent link to this document
https://projecteuclid.org/euclid.tmna/1463150092

Mathematical Reviews number (MathSciNet)
MR2387827

Zentralblatt MATH identifier
1159.35322

#### Citation

Yongqiang, Fu. Existence of solutions for $p(x)$-Laplacian problem on an unbounded domain. Topol. Methods Nonlinear Anal. 30 (2007), no. 2, 235--249. https://projecteuclid.org/euclid.tmna/1463150092

#### References

• \ref E. Acerbi and G. Mingione, Regularity results for a class of functionals with non-standard growth , Arch. Rational Mech. Anal., 156 (2001), 121–140
• \ref E. Acerbi and G. Mingione, Regularity results for stationary electro-rheological fluids , Arch. Rational Mech. Anal., 164 (2002), 213–259
• \ref Y. Alkhutov, The Harnack inequality and the Hölder property of solutions of nonlinear elliptic equations with a nonstandard growth conditions , Differential Equations, 33 (1997), 1653–1662
• \ref T. Bartsch and Z. Liu, On a superlinear elliptic $p$-Laplacian equation , J. Differential Equations, 198 (2004), 149–175
• \ref K. Chaib, Necessary and sufficient conditions of existence for a system involving the $p$-Laplacian $(1<p<N)$ , J. Differential Equations, 189 (2003), 513–525
• \ref V. Chiad Piat and A. Coscia, Hölder continuity of minimizers of functionals with variable growth exponent , Manuscripta Math., 93 (1997), 283–299
• \ref A. Coscia and G. Mingione, Hölder continuity of the gradient of $p(x)$–harmonic mappings , C.R. Acad. Sci. Paris Ser., 328 (1999), 363–368
• \ref D. Costa and O. Miyagaki, Nontrivial solutions for perturbations of the $p$-Laplacian on unbounded domain , J. Math. Anal. Appl., 193 (1995), 737–755
• \ref P. De Napoli and M. Mariani, Mountain pass solutions to equations of $p$-Laplacian type , Nonlinear Anal., 54 (2003), 1205–1219
• \ref G. Dinca, P. Jebelean and J. Mawhin, Variational and topological methods for Dirichlet problems with $p$-Laplacian , Portugal Math., 58 (2001), 339–378
• \ref D. Edmunds, J. Lang and A. Nekvinda, On $L^{p(x)}$ Norms , R. Soc. London Proc. Sec. A, 1981 (1999), 219–225
• \ref D. Edmunds and J. Rakosnik, Sobolev embending with variable exponent , Studia Math., 143 (2000), 267–293
• \ref D. Edmunds and J. Rakosnik, Sobolev embending with variable exponent \romII, Math. Nachr., 246–247 (2002), 53–67
• \ref H. Egnell, Existence and nonexistence results for $m$-Laplace equations involving critical Sobolev exponents , Arch. Rational Mech. Anal., 104 (1988), 57–77
• \ref X. Fan and X. Han, Existence and multiplicity of solutions for $p(x)$-Laplacian equations in ${\Bbb R}^{N}$ , Nonlinear Anal., 59 (2004), 173–188
• \ref X. Fan, J. Shen and D. Zhao, Sobolev Embedding Theorems for Spaces $W^{k,p(x)}(\Omega)$ , J. Math. Anal. Appl., 262 (2001), 749–760
• \ref X. Fan and Q. Zhang, Existence of solutions for $p(x)$-Laplacian Dirichlet problem , Nonlinear Anal., 52 (2003), 1843–1852
• \ref X. Fan and D. Zhao, The quasi-minimizer of integal functionals with $m(x)$ growth conditions , Nonlinear Anal., 39 (2000), 807–816
• \ref Y. Huang, Existence of positive solutions for a class of the $p$-Laplace equations , J. Austral. Math. Soc. Sec. B, 36 (1994), 249–264
• \ref O. Kovacik and J. Rakosnik, On spaces $L^{p(x)}$ and $W_{0}^{k,p(x)}$ , Czechoslovak Math. J., 41 (1991), 592–618
• \ref W. Ni and J. Serrin, Existence and nonexistence theorems for ground states of quasilinear partial differential equations. The anomalous case , Accad. Naz. Lincei, 77 (1986), 231–257
• \ref M. Ruzicka, Electro-Rheological Fluids: Modeling and Mathematical Theory, Springer–Verlag (2000)
• \ref S. Samko, Convolution and potential type operators in $L^{p(x)}(\Bbb{R}^{n})$ , Integral Transform. Spec. Funct., 7 (1998), 261–284
• \ref A. Wu, Existence of multiple nontrivial solutions for nonlinear $p$-Laplacian problems on $\Bbb{R}^{N}$ , Proc. Roy. Soc. Edinburgh Sec. A, 129 (1999), 855–883
• \ref L. Yu, Nonlinear $p$-Laplacian problems on unbounded domains , Proc. Amer. Math. Soc., 115 (1992), 1037–1045


text:
Any mathematical tools for analyzing mutable memory

Wondering if there are any documents, theories, or methodologies for dealing with mutable memory mathematically. Basically a formal algebraic model of how computers manipulate memory. Along the lines of, say I want to model an add operation at a low level, and it writes its output to a register. Then we can model the computer state as a memory, and:

$$add : a \times b \times m \to m'$$

the function $add$ transforms the memory into a different state, holding the final value. Then the second time we call add, the memory is different than it was before. So it's always changing:

$$m \neq m' \neq m'' \neq \dots \neq m^{(n)}$$

Wondering if there are any formalisms out there that deal with this. I would specifically like to see it applied to abstract algebra or category theory. Whereas in abstract algebra typically, everything is immutable and you never worry about "state". I would like to explore the state / mutable memory from a math framework.

• Any undergrad textbook on semantics should get you started. (Eike Best's 1996 Book comes to mind.) How complicated all that becomes depends on what language features you want to model. Category (or domain) theory enters the picture when higher order functions are to be modelled. – Kai May 24 '18 at 8:35


text:
LaTeX: how to change indentation of chapter and sections in report document class?

It seems like relative to the paragraph text, the chapter and section titles have a default indentation that I'd like to manually set. Is there a way to do this using

\setlength{\...}{}

? I'd rather not mess with \titlesec since I've got multiple files and using titlesec previously messed up with my formatting.

-
Welcome to TeX.sx! A tip: You can use backticks ` to mark your inline code as I did in my edit. Can you complete your code snippet to an minimal working example (MWE)? –  Kurt Nov 18 '12 at 20:26
Please don't cross-post on Stack Overflow and here, at least not without disclosure. Many *TeX question get migrated here from SO at any rate, as is the case with your question: tex.stackexchange.com/q/83250 –  doncherry Nov 18 '12 at 21:42

There isn't a predefined length for this in the standard classes but it is easy to copy the definitions from report.cls and add some leftskip:

\documentclass{report}

\begin{document}

\section{aaaaa}

aaaa

\makeatletter

\renewcommand\section{\@startsection {section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\leftskip1in \normalfont\Large\bfseries}}

\makeatother

\section{aaaaa}

aaaa

\end{document}

Note as shown in the section 0.1 example the default indentation is zero.

-


text:
# 10.3 The physics of springs  (Page 10/11)

 Page 10 / 11

## Spring constants

Next we look at the calculated spring constants. First, we look at them individually, drawing from Data Set A. We take experiments pairwise, one from each load, and calculate the spring constants. This gives us 16 samples in R of 52 points each. [link] plots the normality of each spring constant: all seem to be fairly normal. Because of this, we believe that the spring constants are normally distributed.

Next we look at the spring constants collectively, with one sample in R 16 . Because we believe that each individual spring constant is normally distributed, we expect the combined spring constants to be normally distributed. [link] is the plot from this sample, suggesting that the spring constants are indeed normally distributed.

When we look at our equation, ${A}^{T}diag\left(A,x\right)k=f$ , this makes sense. If A and f are fixed, then the relationship between x and k is simply linear, with no worries about the distributions of A and f . To be sure, A and f are not entirely accurate, but they are close enough to constant that we can expect k to come from the same kind of distribution as x .

Note that this criteria is fairly subjective. Plotting the random distribution helps us to get a feel for how much deviation from the reference line we can expect, but these in no way prove that the samples are from normal distributions. Rather, it suggests that, if they are not normally distributed, they can probably be reasonably approximated by a normal distribution.

## Rewriting the problem

In our original approach to use statistical inference to solve the inverse problem (see "Our Question" ) our problem reduced to the equation ${A}^{T}Ek=f$ , where $E\in {\mathbb{R}}^{16×16}$ has the elongation of each spring along the diagonal. If we consider the experimental error as well as the error in the model the equation becomes

$\left({A}^{T},+,\alpha \right)\left(E,+,ϵ\right)\left(k,+,\kappa \right)\approx f+\gamma ,$

where α , ϵ , κ , and γ are error due to either the measurements or the model. The error ϵ is the easiest error that we can describe with all our experimental data, specifically Data Set A (see "Notes: Our Data Sets, Measuring Spring Constants, and Error" ). The error of $\alpha ,$ $\gamma ,$ and κ we either have no description or very little description from our experimental data. The problem that we can then study using our observed error is

${A}^{T}\left(E,+,ϵ\right)k\approx f.$

Because ϵ is in the middle of the equation, it is very hard to deal with. We wish our problem to take the form

$y=Fz+ϵ,$

where z is the unknown variable, y is the observed variable with error ϵ , and $F\in {\mathbb{R}}^{m×n}$ .

To reach an equation of this form we begin by looking at our original problem ${A}^{T}KAx=f$ (see "An Inverse Problem" ). If A T is invertible, then our equation becomes $Ax={K}^{-1}{A}^{-T}f$ , where

${K}^{-1}=\left[\begin{array}{ccccc}{c}_{1}& 0& 0& \cdots & 0\\ 0& {c}_{2}& 0& \cdots & 0\\ 0& 0& {c}_{3}& \cdots & 0\\ ⋮& ⋮& ⋮& \ddots & ⋮\\ 0& 0& 0& \cdots & {c}_{n}\end{array}\right],\phantom{\rule{1.em}{0ex}}{c}_{i}=1/{k}_{i}.$

Because ${A}^{-T}f$ is a vector and ${K}^{-1}$ is a diagonal matrix, we see that our equation can be rewritten to

$e=Fc,$

where $e=Ax$ , $F=\mathrm{diag}\left({A}^{-T}f\right)$ , and c is the compliance, or the vector of inverses of spring constants. Now if we include error of the observed data, e , we obtain a model for the system of the form

#### Questions & Answers

what are the products of Nano chemistry?
Maira Reply
There are lots of products of nano chemistry... Like nano coatings.....carbon fiber.. And lots of others..
learn
Even nanotechnology is pretty much all about chemistry... Its the chemistry on quantum or atomic level
learn
Preparation and Applications of Nanomaterial for Drug Delivery
Hafiz Reply
Application of nanotechnology in medicine
what is variations in raman spectra for nanomaterials
Jyoti Reply
I only see partial conversation and what's the question here!
Crow Reply
what about nanotechnology for water purification
RAW Reply
please someone correct me if I'm wrong but I think one can use nanoparticles, specially silver nanoparticles for water treatment.
Damian
yes that's correct
Professor
I think
Professor
what is the stm
Brian Reply
is there industrial application of fullrenes. What is the method to prepare fullrene on large scale.?
Rafiq
industrial application...? mmm I think on the medical side as drug carrier, but you should go deeper on your research, I may be wrong
Damian
How we are making nano material?
LITNING Reply
what is a peer
LITNING Reply
What is meant by 'nano scale'?
LITNING Reply
What is STMs full form?
LITNING
scanning tunneling microscope
Sahil
how nano science is used for hydrophobicity
Santosh
Do u think that Graphene and Fullrene fiber can be used to make Air Plane body structure the lightest and strongest. Rafiq
Rafiq
what is differents between GO and RGO?
Mahi
what is simplest way to understand the applications of nano robots used to detect the cancer affected cell of human body.? How this robot is carried to required site of body cell.? what will be the carrier material and how can be detected that correct delivery of drug is done Rafiq
Rafiq
if virus is killing to make ARTIFICIAL DNA OF GRAPHENE FOR KILLED THE VIRUS .THIS IS OUR ASSUMPTION
Anam
analytical skills graphene is prepared to kill any type viruses .
Anam
Any one who tell me about Preparation and application of Nanomaterial for drug Delivery
Hafiz
what is Nano technology ?
Bob Reply
write examples of Nano molecule?
Bob
The nanotechnology is as new science, to scale nanometric
brayan
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Damian
Is there any normative that regulates the use of silver nanoparticles?
Damian Reply
what king of growth are you checking .?
Renato
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
Stoney Reply
why we need to study biomolecules, molecular biology in nanotechnology?
Adin Reply
?
Kyle
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
Adin
why?
Adin
what school?
Kyle
biomolecules are e building blocks of every organics and inorganic materials.
Joe
anyone know any internet site where one can find nanotechnology papers?
Damian Reply
research.net
kanaga
sciencedirect big data base
Ernesto
how did you get the value of 2000N.What calculations are needed to arrive at it
Smarajit Reply
Privacy Information Security Software Version 1.1a
Good
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

### Read also:

#### Get the best Algebra and trigonometry course in your pocket!

Source:  OpenStax, The art of the pfug. OpenStax CNX. Jun 05, 2013 Download for free at http://cnx.org/content/col10523/1.34
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'The art of the pfug' conversation and receive update notifications?

 By Michael Sag By John Gabrieli By Qqq Qqq By JavaChamp Team By Brooke Delaney By Mary Matera By Sandy Yamane By OpenStax By By David Bourgeois


text:
# Monoids of endomorphisms

Can one tell whether an (abstract) monoid $M$ is (isomorphic to) the monoid of endomorphisms of a structure $X$?

Or is there a representation theorem saying that for every monoid $M$ there is a structure $X$ such that $M$ is the monoid of endomorphisms of $X$? If not so: what is a simple counter-example?

How can the monoids which are monoids of endomorphisms be characterized?

-
Cayley's theorem for monoids asserts that $M$ is isomorphic to the monoid of endomorphisms of $M$ as a right $M$-set. This argument can be internalized to various categories; for example, a ring $R$ is isomorphic to the ring of endomorphisms of $R$ as a right $R$-module.


text:
Use the Statix Signature Generator¶

It is quite cumbersome to write Statix signatures. Thankfully, the sdf3.ext.statix project can generate these signatures for you.

Well-Formed SDF3 Requirements¶

For the generator to work correctly, your SDF3 must be well formed. In particular, you must:

• explicitly declare each sort exactly once in your project
• declare lexical sorts in a lexical sorts block
• declare context-free sorts in a context-free sorts block
• for every use of a sort: either have a local declaration of a sort, or an import of a file that declares the sort
• not declare sorts that are not used in any rules
• not use any implicitly declared sorts
• not use complex injections, such as Pair = Expr Expr. However, list injections without terminal syntax, such as List = Elem*, are allowed.
• not use sdf2table: c

The generator generates strategies and signatures for each explicit declaration of a sort in SDF3, which is why each sort must be declared exactly once. SDF3 does not generate Stratego signatures for placeholders for sorts that have no corresponding rules, causing errors in the generated Statix injection explication strategies. Complex injections are not supported across Spoofax. Optional sorts cannot be represented in Statix.

Applying the Generator in Spoofax 2¶

In your language project's metaborg.yaml file, change your compile dependencies to include org.metaborg:sdf3.ext.statix. For example:

   dependencies:
compile:
- org.metaborg:org.metaborg.meta.lang.esv:${metaborgVersion} - org.metaborg:org.metaborg.meta.lang.template:${metaborgVersion}
- org.metaborg:sdf3.ext.statix:\${metaborgVersion}

Clean the project and restart Eclipse when changing the metaborg.yaml file.

Once you clean your project, the extension automatically generates the following:

• Statix signatures declarations (in src-gen/statix/signatures/)
• Stratego strategies for explicating and removing injections (in src-gen/injections/)

Using the Generated Injection strategies¶

The generator generates strategies for explicating and removing injections. This is unfortunately needed since Statix does not support injections directly. To use these strategies, import injections/- and call the explicate-injections-MyLang-Start and implicate-injections-MyLang-Start strategies for the analysis pre-processing and post-processing respectively, where MyLang is the name of your language and Start is your language's start symbol (as specified in Syntax.esv). For example, in trans/analysis.str:

module analysis

imports

libspoofax/sdf/pp

statixruntime
statix/api

injections/-
libspoofax/term/origin

rules

editor-analyze = stx-editor-analyze(pre-analyze, post-analyze|"static-semantics", "programOk")
pre-analyze  = origin-track-forced(explicate-injections-MyLang-Start)
post-analyze = origin-track-forced(implicate-injections-MyLang-Start)

Using the Generated Signatures¶

Using the generated Statix signatures is quite simple: just import them into your Statix specification. Each SDF3 file gets an associated Statix file with the signatures. For example, if your syntax is defined across two files named MyLang.sdf3 and Common.sdf3, then in Statix you should add the following imports:

imports
signatures/MyLang-sig
signatures/Common-sig

Because Statix does not support injections, you have to use explicit constructor names for injections. For example, the following SDF3 syntax:

context-free sorts
Stmt VarName

lexical sorts
ID

context-free syntax
Stmt.VarDecl = <var <VarName>;>
VarName.Wildcard = <_>
VarName = ID

lexical syntax
ID = [a-zA-Z] [a-zA-Z0-9\_]*

lexical restrictions
ID -/- [a-zA-Z0-9\_]

would approximately produce the following signatures:

module signatures/Test-sig

imports

signature
sorts
Stmt
VarName
ID = string
constructors
Stmt-Plhdr : Stmt
VarName-Plhdr : VarName

signature
constructors
VarDecl : VarName -> Stmt
Wildcard : VarName
ID2VarName : ID -> VarName

Now, in Statix if you just want to capture the term of sort VarName in the VarDecl constructor, this would suffice:

VarDecl(x)

But if you want to match the term only if it has the sort ID, then you have to use the explicit injection constructor name ID2VarName:

VarDecl(ID2VarName(x))

In this example, ID is a lexical sort, so it is an alias for string in the Statix specification.

Troubleshooting¶

Calls non-existing¶

Build fails with errors such as this:

[ strj | error ] *** ("is-MyLang-MySort-or-inj",0,0) calls non-existing ("is-MyLang-ID-or-inj",0,0)
[ strj | error ] *** ("explicate-injections-MyLang-MySort",0,0) calls non-existing ("explicate-injections-MyLang-ID",0,0)
[ strj | error ] *** ("implicate-injections-MyLang-MySort",0,0) calls non-existing ("implicate-injections-MyLang-ID",0,0)
Executing strj failed: {}
Failing builder was required by "Generate sources".
BUILD FAILED

To solve this, ensure you have declared ID (in this example) as a lexical sort in your syntax, and make sure that the syntax file with rules for MySort that reference ID import the syntax file that declares ID.

Transformation failed unexpectedly¶

Clean or build fails with an error such as this:

ERROR: Optional sorts are not supported by Statix: Opt(Sort("MySort"))
Transformation failed unexpectedly for eclipse:///mylang/syntax/mysyntax.sdf3
org.metaborg.core.transform.TransformException: Invoking Stratego strategy generate-statix failed at term:
CfSignature("MySort", Some("MyCons"), [ Param(Opt(Sort("MySort")), "mySort") ])
Stratego trace:
generate_statix_0_0
generate_statix_abstract_0_0
geninj_generate_statix_0_0
geninj_module_to_sig_0_0
with_1_1
flatfilter_1_0
filter_1_0
with_1_1 <==
map_1_0
geninj_symbol_to_stxsig_0_0
Internal error: 'with' clause failed unexpectedly in 'geninj-sig-to-stxsig'

Note the first line with ERROR, it tells you that something is not supported. In this case, the use of optional sorts such as MySort? is not supported by Statix and the Statix signature generator.

To solve this, rewrite a syntax rule with an optional sort such as:

Stmt.VarDecl    = <<Type?> <ID> = <Exp>>

Into a rule with an explicit sort:

Stmt.VarDecl    = <<Type-OPT> <ID> = <Exp>>
Type-OPT.NoType = <>
Type-OPT        = Type

Note that the -OPT suffix has no special meaning. You can name the sort differently, such as OptionalType.

Constructor MySort-Plhdr/0 not declared¶

Build fails with an error such as this:

[ strj | error ] in rule explicate-injections-MyLang-MySort(0|0): constructor MySort-Plhdr/0 not declared
-     MySort-Plhdr()
Executing strj failed: {}
BUILD FAILED

You have declared a sort for which you don't have any syntax rules. Remove the sort from the context-free sorts or sorts block.

No pp entry found, cannot rewrite to box¶

Clean fails with an error such as this:

[ identity crisis | error ] No pp entry found for: (1,["declSortLex"])
- [ identity crisis | error ] Cannot rewrite to box:
-         declSortLex("MySort")

You are using the old sdf2table: c. Change this in metaborg.yaml into sdf2table: java.

SPT analysis tests calling Stratego strategies fail¶

An SPT test can run an arbitrary Stratego strategy on an analyzed AST and compare the results with the expected AST. If the origin of the is not tracked properly, the root constructor of the resulting analyzed AST will be missing and the comparison will fail.

To fix this, ensure the pre-analyze and post-analyze strategies in analysis.str call origin-track-forced:

imports libspoofax/term/origin

rules
pre-analyze  = origin-track-forced(explicate-injections-MyLang-Start)
post-analyze = origin-track-forced(implicate-injections-MyLang-Start)

Last update: 2021-11-15


text:
# American Institute of Mathematical Sciences

February  2009, 3(1): 87-122. doi: 10.3934/ipi.2009.3.87

## Discretization-invariant Bayesian inversion and Besov space priors

 1 Department of Mathematics and Statistics, University of Helsinki, P.O. Box 68 (Gustaf Hallstromin katu 2b) FI-00014, Finland, Finland 2 Tampere University of Technology,Institute of Mathematics,, P.O. Box 553, 33101 Tampere

Received  February 2008 Revised  November 2008 Published  February 2009

Bayesian solution of an inverse problem for indirect measurement $M = AU +$ε is considered, where $U$ is a function on a domain of $\R^d$. Here $A$ is a smoothing linear operator and ε is Gaussian white noise. The data is a realization $m_k$ of the random variable $M_k = P_kA U+P_k$ε , where $P_k$ is a linear, finite dimensional operator related to measurement device. To allow computerized inversion, the unknown is discretized as $U_n=T_nU$, where $T_n$ is a finite dimensional projection, leading to the computational measurement model $M_{kn}=P_k A U_n + P_k$ε . Bayes formula gives then the posterior distribution

$\pi_{kn}(u_n\|\m_{kn})$~ Π n $(u_n)\exp(-\frac{1}{2}$||$\m_{kn} - P_kA u_n$||$\_2^2)$

in $\R^d$, and the mean $\u_{kn}$:$=\int u_n \ \pi_{kn}(u_n\|\m_k)\ du_n$ is considered as the reconstruction of $U$. We discuss a systematic way of choosing prior distributions Π n for all $n\geq n_0>0$ by achieving them as projections of a distribution in a infinite-dimensional limit case. Such choice of prior distributions is discretization-invariant in the sense that Π n represent the same a priori information for all $n$ and that the mean $\u_{kn}$ converges to a limit estimate as $k,n$→$\infty$. Gaussian smoothness priors and wavelet-based Besov space priors are shown to be discretization invariant. In particular, Bayesian inversion in dimension two with $B^1_11$ prior is related to penalizing the $\l^1$ norm of the wavelet coefficients of $U$.

Citation: Matti Lassas, Eero Saksman, Samuli Siltanen. Discretization-invariant Bayesian inversion and Besov space priors. Inverse Problems & Imaging, 2009, 3 (1) : 87-122. doi: 10.3934/ipi.2009.3.87
 [1] Lassi Roininen, Janne M. J. Huttunen, Sari Lasanen. Whittle-Matérn priors for Bayesian statistical inversion with applications in electrical impedance tomography. Inverse Problems & Imaging, 2014, 8 (2) : 561-586. doi: 10.3934/ipi.2014.8.561 [2] Lassi Roininen, Mark Girolami, Sari Lasanen, Markku Markkanen. Hyperpriors for Matérn fields with applications in Bayesian inversion. Inverse Problems & Imaging, 2019, 13 (1) : 1-29. doi: 10.3934/ipi.2019001 [3] Masoumeh Dashti, Stephen Harris, Andrew Stuart. Besov priors for Bayesian inverse problems. Inverse Problems & Imaging, 2012, 6 (2) : 183-200. doi: 10.3934/ipi.2012.6.183 [4] Tan Bui-Thanh, Omar Ghattas. A scalable algorithm for MAP estimators in Bayesian inverse problems with Besov priors. Inverse Problems & Imaging, 2015, 9 (1) : 27-53. doi: 10.3934/ipi.2015.9.27 [5] Xiaomao Deng, Xiao-Chuan Cai, Jun Zou. A parallel space-time domain decomposition method for unsteady source inversion problems. Inverse Problems & Imaging, 2015, 9 (4) : 1069-1091. doi: 10.3934/ipi.2015.9.1069 [6] Tan Bui-Thanh, Quoc P. Nguyen. FEM-based discretization-invariant MCMC methods for PDE-constrained Bayesian inverse problems. Inverse Problems & Imaging, 2016, 10 (4) : 943-975. doi: 10.3934/ipi.2016028 [7] Linh V. Nguyen. A family of inversion formulas in thermoacoustic tomography. Inverse Problems & Imaging, 2009, 3 (4) : 649-675. doi: 10.3934/ipi.2009.3.649 [8] Igor E. Shparlinski. Close values of shifted modular inversions and the decisional modular inversion hidden number problem. Advances in Mathematics of Communications, 2015, 9 (2) : 169-176. doi: 10.3934/amc.2015.9.169 [9] Didi Lv, Qingping Zhou, Jae Kyu Choi, Jinglai Li, Xiaoqun Zhang. Nonlocal TV-Gaussian prior for Bayesian inverse problems with applications to limited CT reconstruction. Inverse Problems & Imaging, 2020, 14 (1) : 117-132. doi: 10.3934/ipi.2019066 [10] Hongmei Cao, Hao-Guang Li, Chao-Jiang Xu, Jiang Xu. Well-posedness of Cauchy problem for Landau equation in critical Besov space. Kinetic & Related Models, 2019, 12 (4) : 829-884. doi: 10.3934/krm.2019032 [11] Mila Nikolova. Model distortions in Bayesian MAP reconstruction. Inverse Problems & Imaging, 2007, 1 (2) : 399-422. doi: 10.3934/ipi.2007.1.399 [12] Scott Nollet, Frederico Xavier. Global inversion via the Palais-Smale condition. Discrete & Continuous Dynamical Systems - A, 2002, 8 (1) : 17-28. doi: 10.3934/dcds.2002.8.17 [13] Yang Zhang. Artifacts in the inversion of the broken ray transform in the plane. Inverse Problems & Imaging, 2020, 14 (1) : 1-26. doi: 10.3934/ipi.2019061 [14] Frank Natterer. Photo-acoustic inversion in convex domains. Inverse Problems & Imaging, 2012, 6 (2) : 315-320. doi: 10.3934/ipi.2012.6.315 [15] Neil K. Chada, Claudia Schillings, Simon Weissmann. On the incorporation of box-constraints for ensemble Kalman inversion. Foundations of Data Science, 2019, 1 (4) : 433-456. doi: 10.3934/fods.2019018 [16] Piotr Fijałkowski. A global inversion theorem for functions with singular points. Discrete & Continuous Dynamical Systems - B, 2018, 23 (1) : 173-180. doi: 10.3934/dcdsb.2018011 [17] Liying Wang, Weiguo Zhao, Dan Zhang, Linming Zhao. A geometric inversion algorithm for parameters calculation in Francis turbine. Discrete & Continuous Dynamical Systems - S, 2015, 8 (6) : 1373-1384. doi: 10.3934/dcdss.2015.8.1373 [18] Peter Kuchment, Fatma Terzioglu. Inversion of weighted divergent beam and cone transforms. Inverse Problems & Imaging, 2017, 11 (6) : 1071-1090. doi: 10.3934/ipi.2017049 [19] Laura Poggiolini, Marco Spadini. Local inversion of a class of piecewise regular maps. Communications on Pure & Applied Analysis, 2018, 17 (5) : 2207-2224. doi: 10.3934/cpaa.2018105 [20] T. J. Sullivan. Well-posed Bayesian inverse problems and heavy-tailed stable quasi-Banach space priors. Inverse Problems & Imaging, 2017, 11 (5) : 857-874. doi: 10.3934/ipi.2017040

2019 Impact Factor: 1.373


text:
# CT Density Tables

The use of CT data within a planning system necessitates a conversion from the Hounsfield scale, with units (HU) describing the radiodensity of the imaged tissue (compared to water, for X-ray energies), into density values, which the planning system can use to calculate dose deposition for treatment energies. A HU is defined as:

$HU_{material} = 1000 \times \frac{\mu_{material} - \mu_{water}}{\mu_{water}}$

Where the μ values are the linear attenuation coefficients of the material and water respectively. Thus the scale begins at -1000, where the linear attenuation coefficient is zero (air is approximately -1000) and generally remains below approximately 3000 for dense bone, with higher values for metallic objects such as implants.

The conversion to either mass or electron density values is unique to the CT scanner and operational energy. Physicists acquire scans of objects with known density values and relate those values with the resultant HU values in the image. This embedded spreadsheet (available here) contains CT density tables for 3 machines operating nominally at 120 kVp. Mass density values are expressed in g/cc. Relative electron densities are expressed relative to the value for water. The CB2 30% and 50% values are representative of the calcium carbonate concentration. These values are provided as reference only.


text:
The effective interest rate provides a true indication of the interest rate on loans that are progressively being reduced.

Effective Interest Rate Use

The effective interest rate is used to directly compare with the compounding interest rate as they both take into account the reduction of the principal amount.

The Rule

There are two ways to find the effective rate of interest- estimation and calculation.

• Estimation: A little less than $2\times$ flat interest rate
• Calculation: $\frac {2n}{n+1}\times$ flat interest rate

The flat rate is closest to being a true indication of the rate charged with fewer payments.

Example 1

Jake takes out a \$2,000 loan to pay for new furniture. The terms of the loan include equal quarterly repayments over two years at a simple interest rate of 9.2% p.a. Calculate the effective rate of interest to one decimal place.

Note the flat rate and number of instalments.

Flat rate $=9.2$
$n=2\times 4=8$

We are asked to calculate and need to provide a precise answer. Use the formula and substitute the known values.

Effective rate $=\frac {2n}{n+1}\times$ flat rate
Effective rate $=\frac {2\times 8}{8+1}\times 9.2$
Effective rate $=16.3555$

The effective rate of interest is 16.36% p.a.

Example 2

A flat interest rate of 6.4% p.a. is charged on a hire purchase with monthly repayments over two years. What is the effective interest rate?

a) 6.4% p.a.
b) 12.6% p.a.
c) 12.8% p.a.
d) 16.8% p.a.

This is a multiple choice question so we can estimate. We know that the effective interest rate should be a little less than two times the flat rate.

$2\times 6.4=12.8$

Remember, it is a little less than two times the flat rate so option b (12.6% p.a.) is correct.

Be Careful

An effective interest rate is different to a flat interest rate; the flat rate does not take into account the reductions in the balance owing after repayments are made.


text:
## Algebra 2 Common Core

Published by Prentice Hall

# Skills Handbook - Percents and Percent Applications - Exercises - Page 972: 17

20

#### Work Step by Step

To find this, you need to set up an equation. To do this, you need to convert the percent to a decimal. So divide 75 by 100 to get .75. Now, you can set up the equation, which is n x .75=15. Now that you have the equation, you can find the answer. To do this, you have to solve for n. So divide both sides by .75, and you will get n=20.

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:
Example of sequence of continuous function which is not Riemann integrable with following property

$$\{f_n\}$$ is a sequence of continuous functions with following properties:

1. $$0 \leq f_n(x) \leq 1, \forall x \in \Bbb R$$
2. $$f_n(x)$$ is monotonically decreasing sequnce as $$n\to \infty$$
3. The Limiting function $$f$$ is not Riemann integrable.

I know that such function is Lebesgue integrable using Monotone convergence theorem but not sure about Riemann integrable.

If there is counterexample please give me that. Or give me a hint so that I can prove this theorem

Any help will be appreciated.

• I think you can take the counter-example from here math.stackexchange.com/questions/612098/… – Yanko Mar 10 at 13:52
• Dear Sir, That $f_n$ is not continuous also not monotonically decreasing – SRJ Mar 10 at 14:00
• Oh yeah I didn't see you want $f_n$ to be continuous. (You could work out the monotonically decreasing by taking $1-f_n$). – Yanko Mar 10 at 14:01
• Now I think I'm not wrong that the answer is in the comment here math.stackexchange.com/questions/2670955/… (open the wikipedia page, 4th bullet) – Yanko Mar 10 at 14:09
• By 2 do you mean $f_1(x) \ge f_2(x) \ge \cdots$ for each $x?$ – zhw. Mar 10 at 17:47


text:
# How do you find the midpoint between two points?

Relevant MM Lessons:

## Overview: The Midpoint Formula

This question has its own dedicated lesson ». Make sure to check it out if you need a more thorough read, or want to become an expert on how the Midpoint Formula shows up on tests.Given any two coordinate points in the plane, we can find the point directly between them. When we're asked to do this, we could inspect to find the answer visually, but we should be able to rely on a systematic algebraic approach.The formula for the midpoint between two points, $(x_1, y_1)$ and $(x_2, y_2)$ is:$$\mathrm{MP} = \left( \frac{x_1 + x_2}{2}, \frac{y_1 + y_2}{2} \right)$$For some reason, when I was first taught this, I couldn't remember it for the life of me. A short while later, someone told me that it's simply representative of the average $x$ coordinate and the average $y$ coordinate, and it never left me since. This is the way I would recommend "memorizing" it.We can see this in action with a quick example. Let's say we are asked to find the midpoint between $(3,10)$ and $(11,4)$.We could blindly use the formula verbatim, and we will of course get the right answer, but let's instead think more conceptually in a way that we'll never forget. The midpoint will be the average $x$ coordinate and the average $y$ coordinate. The average of $3$ and $11$ is $7$. The average of $10$ and $4$ is also $7$. Therefore, the midpoint between $(3,10)$ and $(11,4)$ is $(7,7)$.And we can see from the picture that this makes sense visually as well.
• Popular Content
• Get Taught
• Other Stuff


text:
Encryption of log files

I'd like to encrypt the contents of a log file that my application writes. The log system has the following characteristics:

• The file format is binary.
• Log files are left open while the application is still running.
• New data is appended as a log entry is made.
• Log entries have varying lengths, I cannot align that with some cipher block size.
• When the application is restarted, it must read an existing log file, understand its contents and decide whether to append new items to this file or start a new file. This requires symmetric encryption.
• The encryption key must be embedded in the application and the receiver of the log file must know it. So I guess it's a static key, at least for that application.
• The decrypted data must not be any longer than the original plaintext, or the log viewer will try to make another complete log item from the additional bytes.

Now this won't allow me to use a super-secure encryption I guess. Somebody who can extract the static key from the application (together with the algorithm used) should be able to read the log file. But then again, the log file should only be encrypted because it may contain information that can reveal internal names that should be obfuscated and encoded in the application. Reading the log file should not help in de-obfuscating the program.

I've used AES in CBC mode to encrypt "secure" configuration files with a static application password that generates the IV and key through Rfc2898DeriveBytes (forgot the name, something like PBKFD...). Together with a random salt that is prepended to the file. But these files are always read and written in one piece. It handles padding well but I'm not yet sure how that works.

It is entirely unclear to me how I should append to a padded encrypted file at a later time. Could I just seek to the last block and overwrite it somehow? (I'm using .NET for my application, if somebody knows what I can do there.)

Then I've read about stream ciphers that process one byte at a time. I think I could stop writing at any point and continue from that point on. But they seem to be generally insecure up to the point that it's useless to encrypt the data at all.

In .NET, I would enclose my file stream with an instance of some encryption/decryption stream. I don't know whether I can get sequential read and write access to the encrypted file with this. I need to read an existing file until its end, then continue only writing. Does that work with encrypted files at all?

So how should I handle encrypting my log files? Are there certain algorithms or modes or ways that are good for this scenario?

Or should I just XOR my log file with a static key, like we used to do it as kids and call it "encryption"...

• Log files are only appended to, and eventually deleted in entirety.
• Log entries are binary, incl. NUL bytes. An int32 value takes exactly 4 bytes, for instance.
• A single log entry is technically limited to 256 MiB, but rarely ever nearly as large. (The file format spec is here.)
• Partial encryption would be sufficient, basically only the string entries need encryption, not numbers or the structure itself. (I didn't even think of that solution yet!)
• The log viewer can live-read the log files as they are written. But if there is data after the last complete log item, it must be a valid and complete log item. If it's not complete, the reader will wait for it to become complete. (You could flush each single byte to the file and the log item would appear after the last byte written.) Random noise at the end of the file will break the reading.

The live reading mode is especially interesting considering the padding. While I'm writing to a CryptoStream, the stream must buffer the data of at least one block size. If I close the stream before a block is completed, padding should be appended. If I want to flush the stream but keep it open, the padding would probably not be removed, which breaks that block.

Also, I found that with .NET CryptoStreams, I can either read a non-seekable file or write to it, not both. And I cannot seek in the stream. So appending to an existing file would probably not be an option anyway.

So maybe what I need is not possible with block ciphers in block mode.

But if we find a solution that encrypts only the separate string records (which are referenced from other structures by their file offset, so they're reusable), the problem would narrow down to encrypt separate (mostly short) strings, one at a time, in their own record bounds. I'd probably prefer an algorithm with a small block size to keep the padding overhead small. Is that a different question for this platform? (New problems would be generating the IV and maintaining it through all encrypted string records...)

-
Using a stream cipher (or a block cipher in CTR mode) would be tempting, but would be vulnerable to an attack where the attacker deliberately truncates the log file before letting your program append to it, in order to obtain multiple logs encrypted with the same keystream. Still better than just XOR with a static key, though. – Ilmari Karonen May 31 '14 at 23:29
Few questions so I can answer: Can you delete entries from the log using the program? Are log entries plain ASCII text? Do log entries contain null bytes 0x00? How large would a single log entry be? Can any part of the log file remain unencrypted, such as timestamps? Explain that final bullet point about the log viewer in more detail. – Richie Frame Jun 2 '14 at 0:00
I've updated my question to answer your questions. – LonelyPixel Jun 2 '14 at 17:37

Considering that you can never really solve your problem as long as you are running in an untrusted environment, your solution is fine.

To append to an old logfile you need to read the last and second last block, decrypt the last one using the second last one as "IV", remove the padding and start appending. Beginning by overwriting the last block you can now simply append your new encrypted blocks to the file. For encrypting you use the second last (cyphertext) block as "IV" again.

See https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Cipher-block_chaining_.28CBC.29 to understand the principle.

-

Then I've read about stream ciphers that process one byte at a time. I think I could stop writing at any point and continue from that point on. But they seem to be generally insecure up to the point that it's useless to encrypt the data at all.

Using just a stream cipher won't work. However, stream cipher (with a nonce/IV) + HMAC would. I.e. whenever you stop (or after every write) take the HMAC of the ciphertext so far and write it to another file.

Incrementally calculating an HMAC is efficient. I don't know how the interface looks in .NET, but in python I would do:

hmac.update(log_ctext) # update the running HMAC state
hmac.digest()          # find the current digest while retaining the state

That means when you parse the log file on startup to verify the HMAC, you are already ready to append new data without overwriting anything. You just have to be careful to throw out the whole file if the HMAC doesn't match, and generate a new nonce/IV.

-

If it's a hard constraint that the length of the encrypted log entry must exactly match the length of the unencrypted log entry, then you want a length-preserving encryption scheme. I recommend you use one of the length-preserving schemes pioneered for disk encryption. They essentially form a tweakable block cipher with a variable block length, so they'll be perfect for encrypting a variable-length log entry. I suggest you use a hash of the previous ciphertext as the tweak for encrypting the current log entry.

For very short log entries, you could also look at format-preserving encryption.

Note that none of these will provide any integrity protection, unless there is some redundancy in log entries that your log reader checks. If there is some redundancy that is checked by the log reader, then the tweakable variable-width-block block ciphers will provide the best possible integrity, given the constraints that encryption cannot increase the length of the record.

If encryption is allowed to increase the length of the record slightly, then I recommend using an authenticated encryption scheme, such as GCM, EAX, etc.

-


text:
# Uniform distance from a discontinuous function is continuous

Define the metric $$d(f,g)triangleq sup_{x in [0,1]} |f(x)-g(x)|$$ on the set $$operatorname{B}$$ of uniformly bounded functions from the interval $$[0,1]$$ to $$mathbb{R}$$, fix $$g in operatorname{B}$$, and define the map $$F:operatorname{B}rightarrow [0,infty)$$ by $$F(f):=d(g,f)$$. Is the map $$F$$ continuous? It certainly is on the subset $$C([0,1],mathbb{R})$$ but what about on the rest of the space?

MathOverflow Asked by Zorn's Llama on November 22, 2021

If $$d$$ is a metric on $$B$$ then the mapping $$F(f) := d(g,f)$$ is certainly continuous with respect to the topology induced by the metric $$d$$:

Let $$(f_n)_{ninmathbb{N}}$$ a sequence in $$B$$ that converges to $$f in B$$ w.r.t. $$d$$. This is equivalent to $$d(f,f_n) to 0.$$ Hence, by the triangular inequality $$F(f_n) = d(g,f_n) leq d(g,f) + d(f,f_n) to d(g,f) + 0 = F(f).$$ On the other hand by the reversed triangular inequality $$F(f_n) = d(g,f_n) geq d(g,f) - d(f,f_n) to d(g,f) + 0 = F(f).$$ This means $$F(f) leq lim_{ninmathbb{N}} F(f_n) leq F(f)$$ which implies the continuity of $$F$$.

Answered by Nathanael Skrepek on November 22, 2021

## Related Questions

### Smoothness of a variety implies homological smoothness of DbCoh

0  Asked on December 8, 2020 by dbcohsmoothness

### Reference for matrices with all eigenvalues 1 or -1

1  Asked on December 7, 2020

### Characterizations of groups whose general linear representations are all trivial

1  Asked on December 7, 2020 by qsh

### Continuous time Markov chains and invariance principle

0  Asked on December 6, 2020 by sharpe

### Continuity property for Čech cohomology

0  Asked on December 6, 2020 by xindaris

### Reference request: superconformal algebras and representations

0  Asked on December 6, 2020 by winawer

### Extending rational maps of nodal curves

1  Asked on December 5, 2020 by leo-herr

### How large is the smallest ordinal larger than any “minimal ordinal parameter” for any pair of an Ordinal Turing Machine and a real?

1  Asked on December 4, 2020 by lyrically-wicked

### Almost geodesic on non complete manifolds

1  Asked on December 4, 2020 by andrea-marino

### With Khinchine’s inequality, prove Fourier basis is unconditional in $L^{p}[0,1]$ only for $p=2$

0  Asked on December 3, 2020 by eric-yan

### Kähler manifolds deformation equivalent to projective manifolds

0  Asked on December 3, 2020 by user164740

### Duality of eta product identities: a new idea?

2  Asked on December 1, 2020 by wolfgang

### Is there a CAS that can solve a given system of equations in a finite group algebra $kG$?

2  Asked on December 1, 2020 by bernhard-boehmler

### Sparse perturbation

0  Asked on December 1, 2020 by yiming-xu

### What is known about the “unitary group” of a rigged Hilbert space?

2  Asked on November 30, 2020

### Odd Steinhaus problem for finite sets

0  Asked on November 30, 2020 by domotorp

### Higher-order derivatives of $(e^x + e^{-x})^{-1}$

1  Asked on November 28, 2020 by tobias

### Smallness condition for augmented algebras

1  Asked on November 28, 2020 by ttip

### number of integer points inside a triangle and its area

1  Asked on November 27, 2020 by johnny-t

### Unitary orbits on the Grassmann manifold of 2-planes in complex affine space

1  Asked on November 26, 2020 by norman-goldstein


text:
# Nominal renaming

21 views

### Todd Wilson

Sep 14, 2021, 9:09:03 PM9/14/21
to Abella
Under what circumstances will a theorem of the form

forall G E F, nabla x y, {G, f x x |- g (E x) (F x)} -> {G, f x y |- g (E x) (F y)}

be true? One such case is given in examples/misc/copy, but how general is this? Are there potential nominal-manipulation tactics besides `inst` and `permute` that are admissible but currently only provable in specific instances? In other words, how complete are the current nominal-manipulation tactics?

### Dale Miller

Sep 15, 2021, 4:13:11 AM9/15/21
to Abella
Dear Todd,

This is an interesting question.

On Wednesday, September 15, 2021 at 3:09:03 AM UTC+2 lambdaca...@gmail.com wrote:
Under what circumstances will a theorem of the form

forall G E F, nabla x y, {G, f x x |- g (E x) (F x)} -> {G, f x y |- g (E x) (F y)}

be true? One such case is given in examples/misc/copy, but how general is this?

This formula (with its quantification over G E F) should not be provable in Abella.  In particular, assume that G contains the formula
(pi X\ g X X :- f X X).
and let E and F be simply (w\w).  The formula

nabla x y, {G, f x x |- g x x} -> {G, f x y |- g x y}

is not provable.

On the contrary, the converse of what you asked about should be provable.  That is,
forall G E F, nabla x y, {G, f x y |- g (E x) (F y)} -> {G, f x x |- g (E x) (F x)}
should be true but not provable with the current set of tactics.

Are there potential nominal-manipulation tactics besides `inst` and `permute` that are admissible but currently only provable in specific instances? In other words, how complete are the current nominal-manipulation tactics?

As this converse suggests, the current set of tactics is not complete.

One way that we might make this system more complete is to replace the tactic

permute (Z1 Z2 ... Zn) <HYP NAME>.

with, say,

map (Z1 Z2 ... Zn) <HYP NAME>.

Here, we do not assume that Z1 Z2 ... Zn is a permutation.  This list could be just any (type preserving) mapping from nominals to nominals.  Mapping x and y both to x is sound and needed in this example.

Actually, we could incorporate into map the inst command as well since the Zi's could be substitution terms as well.

Probably we should explore changes to inst and perm to allow for much more general substitutions to be applied to nominal judgments around {|-} judgments.

Does such a generalization to tactics make them complete?  I'm not sure.  Maybe others have a sense of this completeness question.

Best regards, Dale

### Todd Wilson

Sep 15, 2021, 10:08:14 PM9/15/21
to Abella
Thanks for this information, although I think that one part of it is incorrect:

On Wednesday, September 15, 2021 at 1:13:11 AM UTC-7 dale.a...@gmail.com wrote:
On the contrary, the converse of what you asked about should be provable.  That is,
forall G E F, nabla x y, {G, f x y |- g (E x) (F y)} -> {G, f x x |- g (E x) (F x)}
should be true but not provable with the current set of tactics.

You can prove this by instantiating y to be x, at least in the current implementation:

Kind i type.
Type f  i -> i -> o.
Type g  i -> i -> o.

Theorem test : forall G E F, nabla x y, {G, f x y |- g (E x) (F y)} -> {G, f x x |- g (E x) (F x)}.
intros. inst H2 with n2 = n1. search.

The main theorem in examples/misc/copy proves one direction (the `copy_align` theorem) this way with an `inst`, and the other direction (the `copy2_align` theorem) using an induction. Part of my question was about how general the induction technique is: it doesn't seem to depend on much, even if it is not universally valid. And I'm interested in hearing what others have to say about the second part of my question concerning "completeness".

I should add that this kind of theorem comes up all the time when proving the correctness of an elaboration that simulates some constructors (like `let`) in terms of others (like 'lam` and `ap`), when f is usually the same as g and represents the simulation relation. The terms in the first argument of f are from the whole system and the terms from the second argument are from the subset. In the rules defining f, you have the choice when descending under binders between, e.g.,

f (lam E) (lam E') :- pi x\ f x x => f (E x) (E' x).

and

f (lam E) (lam E') :- pi x\ pi y\ f x y => f (E x) (E' y).

The second choice makes it easy to show that the relation is preserved under substitution, since you can instantiate x and y independently, but has the disadvantage that, during lifting, instances of x will appear in the E' terms, and you have to prove a strengthening lemma to show that these occurrences can't actually happen (i.e., that, more or less, the x's only appear in the first argument and the y's only appear in the second). The first choice eliminates this problem, but then you can't handle independent substitutions, unless you prove a lemma like the one I was originally asking about.

As a side question, if anyone has some successful experience navigating these issues to prove elaborations or simulations between systems, I'd be interested in seeing how you did it.

--Todd

### Dale Miller

Sep 16, 2021, 4:47:54 AM9/16/21
to Abella
Dear Todd,

Thanks for this information, although I think that one part of it is incorrect:

Thanks for this correction.  I was confusing arbitrary judgments and {|-} judgments, which was the point of your question.  This confusion also was part of my comment about the query and map tactics.  The query tactic works on arbitrary judgments so it is needed.  The map predicate I proposed only works on {|-} judgments and isn't needed since one can just use inst instead.

The main theorem in examples/misc/copy proves one direction (the `copy_align` theorem) this way with an `inst`, and the other direction (the `copy2_align` theorem) using an induction. Part of my question was about how general the induction technique is: it doesn't seem to depend on much, even if it is not universally valid. And I'm interested in hearing what others have to say about the second part of my question concerning "completeness".

I should add that this kind of theorem comes up all the time when proving the correctness of an elaboration that simulates some constructors (like `let`) in terms of others (like 'lam` and `ap`), when f is usually the same as g and represents the simulation relation. The terms in the first argument of f are from the whole system and the terms from the second argument are from the subset. In the rules defining f, you have the choice when descending under binders between, e.g.,

f (lam E) (lam E') :- pi x\ f x x => f (E x) (E' x).

and

f (lam E) (lam E') :- pi x\ pi y\ f x y => f (E x) (E' y).

The second choice makes it easy to show that the relation is preserved under substitution, since you can instantiate x and y independently, but has the disadvantage that, during lifting, instances of x will appear in the E' terms, and you have to prove a strengthening lemma to show that these occurrences can't actually happen (i.e., that, more or less, the x's only appear in the first argument and the y's only appear in the second). The first choice eliminates this problem, but then you can't handle independent substitutions, unless you prove a lemma like the one I was originally asking about.

I think that there is something deep here that we haven't described well enough yet.  One reason for saying this is that this seems closely related to the definition and meta-theory of logical relations (a semantic technique that is often employed for the kind of simulation proofs you are considering).  The definition of lifting a logical relation to higher types makes use of clauses such as

rel (lam E) (lam E') :- pi x\ pi y\ rel x y => rel (E x) (E' y).

for constructors of second-order type (such as lam).   An important result about logic relations is

|- forall x, rel x x

As a side question, if anyone has some successful experience navigating these issues to prove elaborations or simulations between systems, I'd be interested in seeing how you did it.

I've done some simulation proofs in the context of the pi-calculus but those proofs were more "first-order" and not of the kind you are looking at.  I also would like to hear from others on this topic.


text:
# How do you find the oxidation number of nitrogen in these molecules?

## $H N {O}_{3}$ ${N}_{2} {H}_{4}$ $N {O}_{2}^{+}$ ${N}_{2}$ $N {O}_{2}^{-}$ $N {O}_{2}$ ${N}_{2} {O}_{4}$ ${N}_{2} O$ $N O$

Oct 27, 2016

$H N {O}_{3}$ $\text{Nitrogen +V}$

#### Explanation:

${N}_{2} {H}_{4} ,$ $\text{Nitrogen -II}$

$N {O}_{2}^{+} ,$ $\text{Nitrogen +V}$

${N}_{2} ,$ $\text{Nitrogen 0}$

$N {O}_{2}^{-} ,$ $\text{Nitrogen +III}$

$N {O}_{2} ,$ $\text{Nitrogen +IV}$

${N}_{2} {H}_{4} ,$ $\text{Nitrogen -II}$

${N}_{2} O ,$ $\text{Nitrogen +I}$, $N \equiv {N}^{+} - {O}^{-}$, the terminal nitrogen is zerovalent, and the central $N$ is $+ I I$, i.e. average $+ I$ state.

${N}_{2} {O}_{4} ,$ $\text{Nitrogen +IV}$

$N O ,$ $\text{Nitrogen +II}$

I think I have got these right. Oxygen is more electronegative than nitrogen so it gets the electric charge in determining oxidation state.


text:
Canadian Mathematical Society www.cms.math.ca
 location:  Publications → journals
Search results

Search: MSC category 13A15 ( Ideals; multiplicative ideal theory )

 Expand all        Collapse all Results 1 - 2 of 2

1. CJM Online first

Favacchio, Giuseppe; Guardo, Elena
 The minimal free resolution of fat almost complete intersections in $\mathbb{P}^1\times \mathbb{P}^1$ A current research theme is to compare symbolic powers of an ideal $I$ with the regular powers of $I$. In this paper, we focus on the case that $I=I_X$ is an ideal defining an almost complete intersection (ACI) set of points $X$ in $\mathbb{P}^1 \times \mathbb{P}^1$. In particular, we describe a minimal free bigraded resolution of a non arithmetically Cohen-Macaulay (also non homogeneous) set $\mathcal Z$ of fat points whose support is an ACI, generalizing a result of S. Cooper et al. for homogeneous sets of triple points. We call $\mathcal Z$ a fat ACI. We also show that its symbolic and ordinary powers are equal, i.e, $I_{\mathcal Z}^{(m)}=I_{\mathcal Z}^{m}$ for any $m\geq 1.$ Keywords:points in $\mathbb{P}^1\times \mathbb{P}^1$, symbolic powers, resolution, arithmetically Cohen-MacaulayCategories:13C40, 13F20, 13A15, 14C20, 14M05

2. CJM 2012 (vol 65 pp. 823)

Guardo, Elena; Harbourne, Brian; Van Tuyl, Adam
 Symbolic Powers Versus Regular Powers of Ideals of General Points in $\mathbb{P}^1 \times \mathbb{P}^1$ Recent work of Ein-Lazarsfeld-Smith and Hochster-Huneke raised the problem of which symbolic powers of an ideal are contained in a given ordinary power of the ideal. Bocci-Harbourne developed methods to address this problem, which involve asymptotic numerical characters of symbolic powers of the ideals. Most of the work done up to now has been done for ideals defining 0-dimensional subschemes of projective space. Here we focus on certain subschemes given by a union of lines in $\mathbb{P}^3$ which can also be viewed as points in $\mathbb{P}^1 \times \mathbb{P}^1$. We also obtain results on the closely related problem, studied by Hochster and by Li-Swanson, of determining situations for which each symbolic power of an ideal is an ordinary power. Keywords:symbolic powers, multigraded, pointsCategories:13F20, 13A15, 14C20
 top of page | contact us | privacy | site map |

© Canadian Mathematical Society, 2017 : https://cms.math.ca/