text:
Continuity Equation

• Recognize continuity equation as a form of conservation of mass.

$Q= A_1 \times v_1 = A_2 \times v_2$ Where: Q = the volumetric flow rate (m$^3$/s) A = the cross sectional area of flow (m$^2$) v = the mean velocity (m/s)

Solved Example:

62-1-01

10 m$^3$/h of water flows through a pipe with 100 mm inside diameter. The pipe is reduced to an inside dimension of 80 mm. Using continuity equation, calculate the velocity in the 100 mm pipe.

Solution:

(10 m$^3$/h) (1 / 3600 h/s) = $v_{100}$ (3.14 (0.1 m)$^2$ / 4)

$v_{100} = (10 m^3/h) (1 / 3600 h/s) / (3.14 (0.1 m)^2 / 4) = 0.35 m/s$

Using equation the velocity in the 80 mm pipe can be calculated

(10 m$^3$/h) (1 / 3600 h/s) = $v_{80}$ (3.14 (0.08 m)$^2$ / 4)

or $v_{80} = (10 m^3/h) (1 / 3600 h/s) / (3.14 (0.08 m)^2 / 4) = 0.55 m/s$

Solved Example:

62-1-02

A fluid flowing through a pipe of diameter 450 mm with velocity 3 m/s is divided into two pipes of diameters 300 mm and 200 mm. The velocity of flow in 300 mm diameter pipe is 2.5 m/s, then the velocity of flow through 200 mm diameter pipe will be: (ESE Mechanical 2014)

Solved Example:

62-1-03

When 0.1 m$^3$/s water flows through a pipe of area 0.25 m$^2$, which later reduces to 0.1 m$^2$, what is the velocity of flow in the reduced pipe? (SSC JE CE Oct 2020 Morning)

Solved Example:

62-1-04

If an incompressible fluid enters a pipe with a velocity of 4 cm/s and moves out with a velocity of 2 cm/s, calculate the cross sectional area of the inlet if the diameter of the pipe at the outlet is 7 cm. (UPPCL JE CE 2016)


text:
C++ compilation: Fifty shades of Mojibake

Interestingly, writing was initially invented as a way to keep track of numbers. Words came much later.

Computers are good at numbers. It’s the only thing they understand really. So text has to be represented as a sequence of numbers which are interpreted and ascribed meaning.

Code, in the presence of arbitrary identifiers and string literals as to be considered as text. In the context of C++, how is the text of our program interepreted and transcoded during compilation?

Let say we want to execute this program:

#include <iostream>
int main() {
std::cout << "Γειά σου Κόσμε";
}

Possibly, what the compiler sees looks like this:

23696e636c756465203c696f73747265616d3e0a696e74206d
61696e2829207b0a202020207374643a3a636f7574203c3c20
22ce93ceb5ceb9ceac20cf83cebfcf8520ce9acf8ccf83cebc
ceb5223b0a7d0a

These numbers represent characters, but which numbers represent which characters? How many bytes are used to represent individual characters?

That’s where encodings come in.

An encoding is a method by which a sequence of 1 or more bytes is mapped to something we understand as being a character. There are some nuances there: there are a variety of encodings.

• Some encodings will map 1 byte (or less) to a unique character which means they can represent a ridiculously low number of characters - that is for example ascii or ebcdic.

• Some encodings will map a fixed number of bytes (often 2) to unique characters. Still widely insufficient to represent all characters used by people. That’s for example UCS2.

• Some encodings will have a variadic number of bytes per characters, which make them memory efficient at the cost of 0(n) indexing - this is for example UTF-8.

Ok, I lied. Encodings don’t map to characters. Character is a really fuzzy, hard-to-define term. Some encodings map to glyphs - basically an index into the font file - while more modern encodings map to a code point which is a number assigned to a character or part of a “character”.

In any case, each encoding maps to a character set which is, to simplify the set of characters and an encoding can represent.

An encoding maps to one specific character set, while the same character set can be represented with different encodings. For example ASCII is both an encoding and a character set, while UTF-8 and UTF-16 are two encoding that map to the Unicode character set.

You can find the definition of all these things on the Unicode glossary

We have been encoding text for machines for over 150 years, and because of reasons that made sense at the time we have a lot of encodings.

Over 250 officially registered.

Physical source file characters

You are caught up on the basis, so what’s the encoding of the above snippet? And therein lies the rub: We don’t know, the compiler doesn’t know.

Encodings are not stored along the rest of the sequence of bytes that constitute our piece of text. Encodings are not something we can observe.

But we can’t possibly interpret that sequence of numbers without knowing which encoding was used to create it. Just like you can’t interpret a language without knowing what language is spoken. (You can’t of course have text without encodings, like you can’t have words without language.)

Of course, we can ask the user, maybe the user knows (haha).

Both GCC and MSVC have an option for that (-finput-charset and /source-charset respectively).

That works as long as all your headers included in a given file share the same encoding. Do you know how the files that make up you third party libraries were encoded? Probably not. Might as well guess. Which is what compilers do by default. They guess.

Clang and GCC guess everything is encoded in UTF-8, while MSVC derives the encoding from the locale of the computer you are compiling your program on.

MSVC assumptions work great as long as people don’t try to ever share their code, especially with people living in a different country, or using a different operating system. But why would anybody ever do that?

You may have noticed that as long you stick to ASCII encoding, your program will compile just fine. This is because most 1 byte encodings, including UTF-8 are ASCII supersets - so they have the same mapping as ASCII for all codepoints in the ASCII range. The biggest exception to that is EBCDIC which is only used on IBM systems. Shift-JIS, - an encoding suitable to encode Japanese 1 - is mostly ASCII compatible with a couple of exceptions.

This is the first reason why people tend to avoid non-ASCII characters in source code.

But what if you really want you have Greek in your source file? Well, GCC and clang will already support that as they assume UTF-8, MSVC has an option to interpret files as UTF-8, so everything is great, right?

Well, not so fast. First, that puts the responsibility on downstream code they compile your code with the right flags. So some information necessary to build your code is offloaded to the build system, which is brittle and a maintenance burden. And as I said, compiler flags operate on translation units whereas you want to set the encoding on individual files. Modules will solve everything as in a fully modular world 1 file = 1 translation unit.

In the meantime, maybe we can put the encoding in the source file, like python does?

#pragma encoding "UTF-8"
#include <iostream>
int main() {
std::cout << "Γειά σου Κόσμε";
}

There is a couple of issues with is. First, it doesn’t work for EBCDIC encodings at all. If interpreted as EBCDIC, the above UTF-8 file might look something like that

?/_/?>?>??????>%??/_??>?_/>???#???????????l?ce?c???'?\

Doesn’t look like C++ to me.

Ok, so let’s not care about EBCDIC2, as people working on these systems already have to transcode everything. We can use that directive at the beginning of all and single files that is UTF-8?

Except UTF-8 is the right default, all open source code is UTF-8, and compiling in UTF-8 is at this point standard practice.

So forcing people to write #pragma encoding "UTF-8" for the compiler to assume UTF-8 would be the bad default.

Maybe we could force compiler to assume UTF-8 unless otherwise specified by a pragma (or some other mechanism)? That would break some code. How much is anyone’s guess. Re-encoding an entire codebase from any encoding to UTF-8 should be a straight forward, not breaking operation in most cases, but, ironically, it is likely that some encoding test code would break.

Nevertheless, very few languages don’t assume UTF-8 by default, except of course C++. And it’s becoming necessary, as every compiler speaking the same language as immediate benefits.

First of, the UTF-8 string const char8_t * = u8"こんにちは世界"; might be interpreted by MSVC as const char8_t * = u8"ã“ã‚“ã«ã¡ã¯ä¸–ç•Œ"; on many windows machines in the US an western europe.

Not what we want.

Because of course u8 string literals are not strings in UTF-8, but strings that will be converted from the source encoding to UTF-8. This is confusing and not portable.

But of course it gets worse. Some compilers accept identifiers composed of codepoints outside of the basic source character set supported by the standard3.

This poses interesting questions:

• Can we mangle portably these symbols?
• Can we reflect portably on these symbols?

If all parts of the systems do not expect and produced UTF-8, the results are inconsistent and therefore, not portable.

I have no idea what the committee will elect to do, but I hope we will at least find a way to push implementers and user gently towards more UTF-8 sources files.

Which is not even one half of the problem. Because so far, we only converted the source to the internal encoding - which is not specified but can be thought of as being Unicode. So internally, the compiler can represent any codepoint. Great.

u8, u and U character and string literals get then converted to UTF-8, utf-16 and utf-32 respectively, which is a lossless operation.

So if you have a u8 literal inside a UTF-8 source file, it will be stored in your program memory unmodified - although this is not really guaranteed by the standard, an implementation could for example normalize unicode strings. Great!

But then, there are char and wchar_t literals. This is where things start to really fall apart.

So, remember that all strings need to be encoded to something. But what? C++ will encode all literals with the encoding it think will be used by the operating system of the computer the program will run on.

Most compilers have an option for that but by default, implementations will assume that this is the same encoding as the one derived from the locale of the environment the compiler is running on.

This is the execution encoding.

Presumed execution encoding

The deeper assumption of course is that the Internet does not exist or all people have all the same locale4 or there is a binary per encoding.

This of course works wonderfully well on most linux/OSX/Android systems because all components talk UTF-8, so the compiler will convert literals to UTF-8, which will then be interpreted as UTF-8 at runtime.

Using MSVC on the other end, the execution encoding, by default, will depend on how your Windows is configured, which basically depends on where you live.

All of that raise interesting challenges…

• Conversion from Unicode to non Unicode might be lossy. So they are lossy. Implementations are not required to emit a diagnostic and MSVC will happily drop characters on the floor5 while GCC will make that ill-formed.
• Of course, the assumption that the machine where the code is compiled matches the one of the machine is run is not illustrative of the reality.
• The presumed execution encoding is not exposed so the only conversion functions you can use are the delightful ones provided by the C and C++ standards.

Oh, so you want to execute your program?

At runtime, your program will be confronted by standard facilities such as iostream that might (loosely) transcode your text to what they think the environment expects or produces (using wonderful interfaces such as codecvt and locale.

Or worse, strings that you want to display but you don’t know their encodings (because they come from a part of the system you don’t have control over), or strings that are simply not text - for example, paths are considering non-displayable bag of bytes on some platforms.

And of course, many systems will produce UTF-8 which simply cannot be converted in the narrow encoding if it is not UTF-8, leading to loss of data - and therefore meaning.

Unfortunately, the standard is somewhat limited there as there is nothing it can do to control its environment.

Windows users can rejoice that it is becoming easier to have well behaving UTF-8 strings in your program thanks to the combination of:

I’ve started to work on a project to illustrates how this works.

That doesn’t solve the problem for EBCDIC platforms and legacy codebases.

Alas, it doesn’t appear that the standard will be realistically able to move away from non-unicode encodings any time soon, and the narrow and wide literals are here to stay.

Therefore, to properly support text, the standard might have to add char8_t overloads to any standard facilities dealing with text, from I/O to reflection, DNS, etc.

I do not think it is worth it trying to patch <locale> or <iostream>, as the assumptions they were designed on are simply no longer valid, nor do I think it is worth trying to deprecate them as so much code depend on them.

It will be interesting to see how that pans out from an education perspective. Nevertheless, that duplication is probably a necessary evil; Improved Unicode is what ultimately lead to Python 3 and we might want to avoid that in C++.

1. For a very loose definition of “suitable”. Shift-JIS can only encode a bit over 10% of Japanese characters. ↩

2. A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 1 2 3 4 5 6 7 8 9
_ { } [ ] # ( ) < > % : ; . ? * + - / ^ & | ~ ! = , \ " '

↩
3. It hurts writing that because the idea that locale and encoding are tied to begin with is bonkers to begin with. But remember these assumptions were made 70 years ago. ↩

format: plain


text:
# Here we go again! Newtons and Watts...

1. ### Leafhill

21
Hi!

So I thought I knew the laws of physics and electronics, but I've recently stumbled on to a puzzling bit of "Math vs Pratical application". I'm messing up the forces and equations in my strained little head, so I'll let you guys have a go.

I'll go into practical applications of this and RC-helicopters if needed later. This should cut to the core of my problem:

I know a Newton is the force required to continuously accelerate a frictionless 1kg brick by 1 m/s^2 (horizontal motion). My question is how many watts would I need to do the same thing?

Say I have a motor with 85% efficiency mounted to a coil of wire tied to my frictionless 1 kg brick. How many watts do I give the motor to acheive that same continuous horizontal acceleration?

I've really tried to find solutions in this forum and the rest of the net, but all I come up with is watts needed lift stuff. I've found that Watt = Joule/s = Nm/s, but this doesn't really help me.

I would appreciate any help!
Thank you!

### Staff: Mentor

Work is force multiplied by distance: W = F * D

Power is work per unit time: P = W/delta_t

So the power required depends on how far and how fast you push the block or whatever.

Does that help?

3. ### Leafhill

21

Still have some issues to understand, though. My brick is not actually moving so distance is kind of irrelevant. Its got the 1m/s^2 acceleration force (1 N), but what if a spring is holding it in place? It's not moving anywhere, but the force is still there and my motor is working hard maintaining this force.

What am I missing?

### Staff: Mentor

How can the motor be moving and the object not?

5. ### Leafhill

21
No, the motor is not moving, but it is connected to a power supply. This applies a force on its output shaft trying to pull on the object even if it is not able to actually move it.

6. ### stewartcs

2,279
Energy is being consumed by the motor but no mechanical work is being done on the brick since it is not moving.

CS

7. ### Leafhill

21
Correct!
The object is not moving, but the force of one Newton is there and it is consuming power. How much?

I'm sure you allready know this, but to be sure we and anyone else reading this are on the same page I'll write it anyway. Inside the motor is a copper coil facing a magnet. These are unresponsive until an electric current is passed through the coil. Based on the direction of the current, it will push the coil (and the output shaft of the motor) clock wise or counter clock wise. This "push" or force will be there even if nothing is actually moving as long as the current is running through the coil.

DL

8. ### saunderson

62
i guess you have the average power in mind!? The power the motor must provide at any time is

$$P = \frac{\mathrm dW}{\mathrm dt} \qquad \mbox{with} \qquad W = \int \mathrm dr ~ F = \int \mathrm dt ~ v(t) \, F$$

(i treat the problem as one dimensional) so

$$P = \frac{\mathrm dW}{\mathrm dt} = \int \limits_{t_0}^t \mathrm dt^\prime ~ a \, F = a F (t - t_0) \qquad \mbox{with} \qquad a = \mathrm{const}$$

the average power must be

$$\left<P\right> = \frac{1}{T} \int \limits_{t_0}^{t_0+T} \mathrm dt^\prime ~ P(t^\prime)$$

for the simple case of $$t_0=0$$ this yield

$$\left<P\right> = \frac{1}{2} a F T$$

so you can prove it with the law of conservation of energy. Assumed that the mass is initially at rest and we stop our treatment at $$t=T$$, then the energy in your system must be

$$E=m a s \qquad \mbox{with} \qquad s = \frac{1}{2} a T^2$$

so the average power is

$$\left<P\right> = \frac{\Delta W}{\Delta t} = \frac{E}{T} = mas \cdot \sqrt{\frac{a}{2s}}$$

$$T$$ applied to the equation of the average power i derived above yields

$$\left<P\right> = \frac{1}{2} a F T = \frac{1}{2} a F \sqrt{\frac{2s}{a}} = \frac{1}{2} a^2 m \sqrt{\frac{2s}{a}}$$

That's an indication that the power of the motor must change with time! To be exact

$$P(t) = aFt$$

That are my thoughts!

Last edited: Mar 2, 2010
9. ### stewartcs

2,279
Since the motor is not rotating, only holding the brick stationary, the amount of power used to hold the brick stationary will be determined based on the locked rotor current of the motor.

The catch is you are presuming the motor can only put out enough torque that is equivalent to 1 N of force on the brick. The locked rotor current depends on the specifics of the motor so I don't know of any analytical way to get the "equivalent power" for 1 N of force on the brick. It would depend on the motor specification.

CS

10. ### Leafhill

21
Hi, stewartcs!

The motor output force does NOT depend on the motor specification. I can with high accuracy (using dedicated electric equipment) control how many amps and volts (or if you will watts) should be applied to the motor. The more I supply the motor, the more the motor will respond with a powerful force on the output shaft.

Saunderson: I'm not as versed in the math as you clearly are, but I don't see why the supplied power would need to be dependent on time. One amount of watts will give one amount of Newtons pulling the brick, no matter when or for how long it is done. Maybe you can explain in more detail what you mean?

Last edited: Mar 2, 2010
11. ### saunderson

62
The connection between the force exerted on an object and the power which is dissipated is

$$P = \frac{\mathrm dW}{\mathrm dt} = \frac{\mathrm d}{\mathrm dt} \Bigl( \int \mathrm dt ~ \frac{\mathrm d\vec r(t)}{\mathrm dt} ~ F(\vec r,t) \Bigr) = \vec v \cdot \vec F$$

Maybe it is helpful for you to imagine the power as a kind of energy current. So, the faster the object is, the more energy must flow on the object.

You can treat the force $$F=ma$$ with $$a=\mbox{const}$$ as to be conservative. It's easy to see that

$$\Delta T = \frac{1}{2} m \Bigl( v_2^2-v_1^2 \Bigr)$$

rises for higher velocities (presumed $$\Delta v = v_2 - v_1 = \mbox{const}$$), so the energy current (Power) must rise too.

I hope i could help!?

Last edited: Mar 2, 2010

### Staff: Mentor

Just to make sure that you understand something -- what is the efficiency of the motor when it has a locked shaft? How much useful work is it doing? (Remeber, W = F*D)

13. ### Leafhill

21
Hi, berkeman!

The motors I use is normally specified at 85% efficiency under normal load. This is not at locked shaft where it probably will be a bit lower. It will also heat up due to the higher current being pulled, but a proper motor controller can continuously monitor this and reduce this current to protect the motor.

It seems that "useful work" is a relative term. I would say that keeping a spring tight is quit useful in some applications even if the spring is not going anywhere.

Maybe another way of approaching the problem is in order:

This is a slightly different scenario, but poses the same problem:
An small RC-helicopter (electric) is able to hover (float in the air without moving) consuming about 60 Watts of power from the buildt in battery. I have one of these in my living room :-)
Much of this power is lost as heat in the electric circuits and controllers and not to forget the low efficiency of the propeller. All losses can be known, but since I don't have exact specifications for this scenario we can assume that a total of 3W (5% of input power) end up as pure lift. How much does the helicopter weigh? Or rather, how many newtons of lift is being produced with these 3 Watts?

Remember that the helicopter does not move (up/down or sideways), but is continuously fighting gravity of 9.81 m/s^2 midair.

Why do I feel this should be easy, but is still so difficult for me to calculate.

14. ### saunderson

62
Another possibility to convince you: how much is the acceleration of an object if the energy flow (Power) on it is constant? (as one dimensional treatment)

$$P = v(t) F(t) = m v(t) a(t) = m v(t) \dot v(t) = \frac{m}{2} \frac{\mathrm d}{\mathrm dt} \Bigl( v^2(t) \Bigr)$$

integration of both sides yields

$$\frac{2P}{m} \cdot t = v^2(t) \qquad \Leftrightarrow \qquad v(t) = \sqrt{\frac{2P}{m} ~ t}$$

so the acceleration of the object is

$$a(t) = \frac{P}{m} \Bigl(\frac{2P}{m} ~ t \Bigr)^{-\frac{1}{2}}$$

Significant: acceleration is not constant! In addition the acceleration diminishes with time.

you can prove the validity of $$v(t), a(t)$$ by applying them to the first equation.

(for simplicity i omit to set the initial conditions and the special theory of relativity)

very crazy if you look at the singularity at the origin :)

Last edited: Mar 2, 2010
15. ### Leafhill

21
Hi, Saunderson!

I'm sure your equations are correct, but I'm more practical than theoretical, and have difficulties accepting the results.

My view is something like this:
If you are a waiter and holding a tray of food in one hand, you are continuously working against gravity by applying a force to counteract it. This is burning watts and calories in your arm and although it may feel like the tray gets havier as time passes its still the same forces acting on the tray (gravity pulling down and your arm keeping it up).

This is a very interesting subject and I really appreciate all your answers. I'm really eager to get to the bottom of this:-)

16. ### rcgldr

7,398
The simple answer is power = force x speed or power = torque x angular_velocity at any moment in time. In order for your motor to accelerate the brick using a continuous 1 newton of force and the corresponding constant acceleration, the power at any moment increases linearly with speed (until the motor reaches it's maximum power output). The previous posts work out the details.

### Staff: Mentor

Nope. Try a lot lower. Like zero % efficiency.

No useful work is done if the object isn't moving.

And on your helicopter example, air is most defintely being accelerated and moved. That is where the engine power is being put to use.

18. ### saunderson

62
Physically you do no work because you are physically a rigid body! At least at the macroscopic level.

### Staff: Mentor

There's a similar thread somewhere her on the PF that's been active for a couple of days. Something about pusing against a wall and the concept of work. I haven't read it, but from the title it sounds like it might help you out.


text:
location:  Publications → journals
Search results

Search: All articles in the CJM digital archive with keyword Lie

 Expand all        Collapse all Results 1 - 25 of 51

1. CJM Online first

Chen, Xianghong; Seeger, Andreas
 Convolution powers of Salem measures with applications We study the regularity of convolution powers for measures supported on Salem sets, and prove related results on Fourier restriction and Fourier multipliers. In particular we show that for $\alpha$ of the form ${d}/{n}$, $n=2,3,\dots$ there exist $\alpha$-Salem measures for which the $L^2$ Fourier restriction theorem holds in the range $p\le \frac{2d}{2d-\alpha}$. The results rely on ideas of KÃ¶rner. We extend some of his constructions to obtain upper regular $\alpha$-Salem measures, with sharp regularity results for $n$-fold convolutions for all $n\in \mathbb{N}$. Keywords:convolution powers, Fourier restriction, Salem sets, Salem measures, random sparse sets, Fourier multipliers of Bochner-Riesz typeCategories:42A85, 42B99, 42B15, 42A61

2. CJM Online first

Fischer, Vera; Mejia, Diego Alejandro
 Splitting, Bounding, and Almost Disjointness can be quite Different We prove the consistency of $$\operatorname{add}(\mathcal{N})\lt \operatorname{cov}(\mathcal{N}) \lt \mathfrak{p}=\mathfrak{s} =\mathfrak{g}\lt \operatorname{add}(\mathcal{M}) = \operatorname{cof}(\mathcal{M}) \lt \mathfrak{a} =\mathfrak{r}=\operatorname{non}(\mathcal{N})=\mathfrak{c}$$ with $\mathrm{ZFC}$, where each of these cardinal invariants assume arbitrary uncountable regular values. Keywords:cardinal characteristics of the continuum, splitting, bounding number, maximal almost-disjoint families, template forcing iterations, isomorphism-of-namesCategories:03E17, 03E35, 03E40

3. CJM 2016 (vol 68 pp. 841)

Gupta, Sanjiv Kumar; Hare, Kathryn
 Characterizing the Absolute Continuity of the Convolution of Orbital Measures in a Classical Lie Algebra Let $\mathfrak{g}$ be a compact, simple Lie algebra of dimension $d$. It is a classical result that the convolution of any $d$ non-trivial, $G$-invariant, orbital measures is absolutely continuous with respect to Lebesgue measure on $\mathfrak{g}$ and the sum of any $d$ non-trivial orbits has non-empty interior. The number $d$ was later reduced to the rank of the Lie algebra (or rank $+1$ in the case of type $A_{n}$). More recently, the minimal integer $k=k(X)$ such that the $k$-fold convolution of the orbital measure supported on the orbit generated by $X$ is an absolutely continuous measure was calculated for each $X\in \mathfrak{g}$. In this paper $\mathfrak{g}$ is any of the classical, compact, simple Lie algebras. We characterize the tuples $(X_{1},\dots,X_{L})$, with $X_{i}\in \mathfrak{g},$ which have the property that the convolution of the $L$-orbital measures supported on the orbits generated by the $X_{i}$ is absolutely continuous and, equivalently, the sum of their orbits has non-empty interior. The characterization depends on the Lie type of $\mathfrak{g}$ and the structure of the annihilating roots of the $X_{i}$. Such a characterization was previously known only for type $A_{n}$. Keywords:compact Lie algebra, orbital measure, absolutely continuous measureCategories:43A80, 17B45, 58C35

4. CJM 2016 (vol 68 pp. 961)

Greenberg, Matthew; Seveso, Marco
 $p$-adic Families of Cohomological Modular Forms for Indefinite Quaternion Algebras and the Jacquet-Langlands Correspondence We use the method of Ash and Stevens to prove the existence of small slope $p$-adic families of cohomological modular forms for an indefinite quaternion algebra $B$. We prove that the Jacquet-Langlands correspondence relating modular forms on $\textbf{GL}_2/\mathbb{Q}$ and cohomomological modular forms for $B$ is compatible with the formation of $p$-adic families. This result is an analogue of a theorem of Chenevier concerning definite quaternion algebras. Keywords:modular forms, p-adic families, Jacquet-Langlands correspondence, Shimura curves, eigencurvesCategories:11F11, 11F67, 11F85

5. CJM Online first

Hartz, Michael
 On the isomorphism problem for multiplier algebras of Nevanlinna-Pick spaces We continue the investigation of the isomorphism problem for multiplier algebras of reproducing kernel Hilbert spaces with the complete Nevanlinna-Pick property. In contrast to previous work in this area, we do not study these spaces by identifying them with restrictions of a universal space, namely the Drury-Arveson space. Instead, we work directly with the Hilbert spaces and their reproducing kernels. In particular, we show that two multiplier algebras of Nevanlinna-Pick spaces on the same set are equal if and only if the Hilbert spaces are equal. Most of the article is devoted to the study of a special class of complete Nevanlinna-Pick spaces on homogeneous varieties. We provide a complete answer to the question of when two multiplier algebras of spaces of this type are algebraically or isometrically isomorphic. This generalizes results of Davidson, Ramsey, Shalit, and the author. Keywords:non-selfadjoint operator algebras, reproducing kernel Hilbert spaces, multiplier algebra, Nevanlinna-Pick kernels, isomorphism problemCategories:47L30, 46E22, 47A13

6. CJM Online first

Marquis, Timothée; Neeb, Karl-Hermann
 Isomorphisms of twisted Hilbert loop algebras The closest infinite dimensional relatives of compact Lie algebras are Hilbert-Lie algebras, i.e. real Hilbert spaces with a Lie algebra structure for which the scalar product is invariant. Locally affine Lie algebras (LALAs) correspond to double extensions of (twisted) loop algebras over simple Hilbert-Lie algebras $\mathfrak{k}$, also called affinisations of $\mathfrak{k}$. They possess a root space decomposition whose corresponding root system is a locally affine root system of one of the $7$ families $A_J^{(1)}$, $B_J^{(1)}$, $C_J^{(1)}$, $D_J^{(1)}$, $B_J^{(2)}$, $C_J^{(2)}$ and $BC_J^{(2)}$ for some infinite set $J$. To each of these types corresponds a minimal" affinisation of some simple Hilbert-Lie algebra $\mathfrak{k}$, which we call standard. In this paper, we give for each affinisation $\mathfrak{g}$ of a simple Hilbert-Lie algebra $\mathfrak{k}$ an explicit isomorphism from $\mathfrak{g}$ to one of the standard affinisations of $\mathfrak{k}$. The existence of such an isomorphism could also be derived from the classification of locally affine root systems, but for representation theoretic purposes it is crucial to obtain it explicitly as a deformation between two twists which is compatible with the root decompositions. We illustrate this by applying our isomorphism theorem to the study of positive energy highest weight representations of $\mathfrak{g}$. In subsequent work, the present paper will be used to obtain a complete classification of the positive energy highest weight representations of affinisations of $\mathfrak{k}$. Keywords:locally affine Lie algebra, Hilbert-Lie algebra, positive energy representationCategories:17B65, 17B70, 17B22, 17B10

7. CJM 2016 (vol 68 pp. 762)

Colesanti, Andrea; Gómez, Eugenia Saorín; Nicolás, Jesus Yepes
 On a Linear Refinement of the PrÃ©kopa-Leindler Inequality If $f,g:\mathbb{R}^n\longrightarrow\mathbb{R}_{\geq0}$ are non-negative measurable functions, then the PrÃ©kopa-Leindler inequality asserts that the integral of the Asplund sum (provided that it is measurable) is greater or equal than the $0$-mean of the integrals of $f$ and $g$. In this paper we prove that under the sole assumption that $f$ and $g$ have a common projection onto a hyperplane, the PrÃ©kopa-Leindler inequality admits a linear refinement. Moreover, the same inequality can be obtained when assuming that both projections (not necessarily equal as functions) have the same integral. An analogous approach may be also carried out for the so-called Borell-Brascamp-Lieb inequality. Keywords:PrÃ©kopa-Leindler inequality, linearity, Asplund sum, projections, Borell-Brascamp-Lieb inequalityCategories:52A40, 26D15, 26B25

8. CJM 2016 (vol 68 pp. 698)

 Quantum Families of Invertible Maps and Related Problems The notion of families of quantum invertible maps (C$^*$-algebra homomorphisms satisfying PodleÅ' condition) is employed to strengthen and reinterpret several results concerning universal quantum groups acting on finite quantum spaces. In particular Wang's quantum automorphism groups are shown to be universal with respect to quantum families of invertible maps. Further the construction of the Hopf image of Banica and Bichon is phrased in the purely analytic language and employed to define the quantum subgroup generated by a family of quantum subgroups or more generally a family of quantum invertible maps. Keywords:quantum families of invertible maps, Hopf image, universal quantum groupCategories:46L89, 46L65

9. CJM 2016 (vol 68 pp. 309)

Daws, Matthew
 Categorical Aspects of Quantum Groups: Multipliers and Intrinsic Groups We show that the assignment of the (left) completely bounded multiplier algebra $M_{cb}^l(L^1(\mathbb G))$ to a locally compact quantum group $\mathbb G$, and the assignment of the intrinsic group, form functors between appropriate categories. Morphisms of locally compact quantum groups can be described by Hopf $*$-homomorphisms between universal $C^*$-algebras, by bicharacters, or by special sorts of coactions. We show that the whole theory of completely bounded multipliers can be lifted to the universal $C^*$-algebra level, and that then the different pictures of both multipliers (reduced, universal, and as centralisers) and morphisms interact in extremely natural ways. The intrinsic group of a quantum group can be realised as a class of multipliers, and so our techniques immediately apply. We also show how to think of the intrinsic group using the universal $C^*$-algebra picture, and then, again, show how the differing views on the intrinsic group interact naturally with morphisms. We show that the intrinsic group is the maximal classical'' quantum subgroup of a locally compact quantum group, show that it is even closed in the strong Vaes sense, and that the intrinsic group functor is an adjoint to the inclusion functor from locally compact groups to quantum groups. Keywords:locally compact quantum group, morphism, intrinsic group, multiplier, centraliserCategories:20G42, 22D25, 43A22, 43A35, 43A95, 46L52, 46L89, 47L25

10. CJM Online first

Cordero-Erausquin, Dario
 Transport inequalities for log-concave measures, quantitative forms and applications We review some simple techniques based on monotone mass transport that allow to obtain transport-type inequalities for any log-concave probability measure. We discuss quantitative forms of these inequalities, with application to the variance Brascamp-Lieb inequality. Keywords:log-concave measures, transport inequality, Brascamp-Lieb inequality, quantitative inequalitiesCategories:52A40, 60E15, 49Q20

11. CJM 2015 (vol 68 pp. 150)

Stavrova, Anastasia
 Non-stable $K_1$-functors of Multiloop Groups Let $k$ be a field of characteristic 0. Let $G$ be a reductive group over the ring of Laurent polynomials $R=k[x_1^{\pm 1},...,x_n^{\pm 1}]$. Assume that $G$ contains a maximal $R$-torus, and that every semisimple normal subgroup of $G$ contains a two-dimensional split torus $\mathbf{G}_m^2$. We show that the natural map of non-stable $K_1$-functors, also called Whitehead groups, $K_1^G(R)\to K_1^G\bigl( k((x_1))...((x_n)) \bigr)$ is injective, and an isomorphism if $G$ is semisimple. As an application, we provide a way to compute the difference between the full automorphism group of a Lie torus (in the sense of Yoshii-Neher) and the subgroup generated by exponential automorphisms. Keywords:loop reductive group, non-stable $K_1$-functor, Whitehead group, Laurent polynomials, Lie torusCategories:20G35, 19B99, 17B67

12. CJM 2015 (vol 68 pp. 258)

Calixto, Lucas; Moura, Adriano; Savage, Alistair
 Equivariant Map Queer Lie Superalgebras An equivariant map queer Lie superalgebra is the Lie superalgebra of regular maps from an algebraic variety (or scheme) $X$ to a queer Lie superalgebra $\mathfrak{q}$ that are equivariant with respect to the action of a finite group $\Gamma$ acting on $X$ and $\mathfrak{q}$. In this paper, we classify all irreducible finite-dimensional representations of the equivariant map queer Lie superalgebras under the assumption that $\Gamma$ is abelian and acts freely on $X$. We show that such representations are parameterized by a certain set of $\Gamma$-equivariant finitely supported maps from $X$ to the set of isomorphism classes of irreducible finite-dimensional representations of $\mathfrak{q}$. In the special case where $X$ is the torus, we obtain a classification of the irreducible finite-dimensional representations of the twisted loop queer superalgebra. Keywords:Lie superalgebra, queer Lie superalgebra, loop superalgebra, equivariant map superalgebra, finite-dimensional representation, finite-dimensional moduleCategories:17B65, 17B10

13. CJM 2015 (vol 67 pp. 827)

Kaniuth, Eberhard
 The Bochner-Schoenberg-Eberlein Property and Spectral Synthesis for Certain Banach Algebra Products Associated with two commutative Banach algebras $A$ and $B$ and a character $\theta$ of $B$ is a certain Banach algebra product $A\times_\theta B$, which is a splitting extension of $B$ by $A$. We investigate two topics for the algebra $A\times_\theta B$ in relation to the corresponding ones of $A$ and $B$. The first one is the Bochner-Schoenberg-Eberlein property and the algebra of Bochner-Schoenberg-Eberlein functions on the spectrum, whereas the second one concerns the wide range of spectral synthesis problems for $A\times_\theta B$. Keywords:commutative Banach algebra, splitting extension, Gelfand spectrum, set of synthesis, weak spectral set, multiplier algebra, BSE-algebra, BSE-functionCategories:46J10, 46J25, 43A30, 43A45

14. CJM 2014 (vol 67 pp. 55)

Barron, Tatyana; Kerner, Dmitry; Tvalavadze, Marina
 On Varieties of Lie Algebras of Maximal Class We study complex projective varieties that parametrize (finite-dimensional) filiform Lie algebras over ${\mathbb C}$, using equations derived by Millionshchikov. In the infinite-dimensional case we concentrate our attention on ${\mathbb N}$-graded Lie algebras of maximal class. As shown by A. Fialowski there are only three isomorphism types of $\mathbb{N}$-graded Lie algebras $L=\oplus^{\infty}_{i=1} L_i$ of maximal class generated by $L_1$ and $L_2$, $L=\langle L_1, L_2 \rangle$. Vergne described the structure of these algebras with the property $L=\langle L_1 \rangle$. In this paper we study those generated by the first and $q$-th components where $q\gt 2$, $L=\langle L_1, L_q \rangle$. Under some technical condition, there can only be one isomorphism type of such algebras. For $q=3$ we fully classify them. This gives a partial answer to a question posed by Millionshchikov. Keywords:filiform Lie algebras, graded Lie algebras, projective varieties, topology, classificationCategories:17B70, 14F45

15. CJM 2014 (vol 67 pp. 573)

Chen, Fulin; Gao, Yun; Jing, Naihuan; Tan, Shaobin
 Twisted Vertex Operators and Unitary Lie Algebras A representation of the central extension of the unitary Lie algebra coordinated with a skew Laurent polynomial ring is constructed using vertex operators over an integral $\mathbb Z_2$-lattice. The irreducible decomposition of the representation is explicitly computed and described. As a by-product, some fundamental representations of affine Kac-Moody Lie algebra of type $A_n^{(2)}$ are recovered by the new method. Keywords:Lie algebra, vertex operator, representation theoryCategories:17B60, 17B69

16. CJM 2014 (vol 66 pp. 1358)

 Sharp Localized Inequalities for Fourier Multipliers In the paper we study sharp localized $L^q\colon L^p$ estimates for Fourier multipliers resulting from modulation of the jumps of LÃ©vy processes. The proofs of these estimates rest on probabilistic methods and exploit related sharp bounds for differentially subordinated martingales, which are of independent interest. The lower bounds for the constants involve the analysis of laminates, a family of certain special probability measures on $2\times 2$ matrices. As an application, we obtain new sharp bounds for the real and imaginary parts of the Beurling-Ahlfors operator . Keywords:Fourier multiplier, martingale, laminateCategories:42B15, 60G44, 42B20

17. CJM 2013 (vol 66 pp. 1250)

Feigin, Evgeny; Finkelberg, Michael; Littelmann, Peter
 Symplectic Degenerate Flag Varieties A simple finite dimensional module $V_\lambda$ of a simple complex algebraic group $G$ is naturally endowed with a filtration induced by the PBW-filtration of $U(\mathrm{Lie}\, G)$. The associated graded space $V_\lambda^a$ is a module for the group $G^a$, which can be roughly described as a semi-direct product of a Borel subgroup of $G$ and a large commutative unipotent group $\mathbb{G}_a^M$. In analogy to the flag variety $\mathcal{F}_\lambda=G.[v_\lambda]\subset \mathbb{P}(V_\lambda)$, we call the closure $\overline{G^a.[v_\lambda]}\subset \mathbb{P}(V_\lambda^a)$ of the $G^a$-orbit through the highest weight line the degenerate flag variety $\mathcal{F}^a_\lambda$. In general this is a singular variety, but we conjecture that it has many nice properties similar to that of Schubert varieties. In this paper we consider the case of $G$ being the symplectic group. The symplectic case is important for the conjecture because it is the first known case where even for fundamental weights $\omega$ the varieties $\mathcal{F}^a_\omega$ differ from $\mathcal{F}_\omega$. We give an explicit construction of the varieties $Sp\mathcal{F}^a_\lambda$ and construct desingularizations, similar to the Bott-Samelson resolutions in the classical case. We prove that $Sp\mathcal{F}^a_\lambda$ are normal locally complete intersections with terminal and rational singularities. We also show that these varieties are Frobenius split. Using the above mentioned results, we prove an analogue of the Borel-Weil theorem and obtain a $q$-character formula for the characters of irreducible $Sp_{2n}$-modules via the Atiyah-Bott-Lefschetz fixed points formula. Keywords:Lie algebras, flag varieties, symplectic groups, representationsCategories:14M15, 22E46

18. CJM 2013 (vol 65 pp. 1005)

Forrest, Brian; Miao, Tianxuan
 Uniformly Continuous Functionals and M-Weakly Amenable Groups Let $G$ be a locally compact group. Let $A_{M}(G)$ ($A_{0}(G)$)denote the closure of $A(G)$, the Fourier algebra of $G$ in the space of bounded (completely bounded) multipliers of $A(G)$. We call a locally compact group M-weakly amenable if $A_M(G)$ has a bounded approximate identity. We will show that when $G$ is M-weakly amenable, the algebras $A_{M}(G)$ and $A_{0}(G)$ have properties that are characteristic of the Fourier algebra of an amenable group. Along the way we show that the sets of tolopolically invariant means associated with these algebras have the same cardinality as those of the Fourier algebra. Keywords:Fourier algebra, multipliers, weakly amenable, uniformly continuous functionalsCategories:43A07, 43A22, 46J10, 47L25

19. CJM 2012 (vol 66 pp. 700)

He, Jianxun; Xiao, Jinsen
 Inversion of the Radon Transform on the Free Nilpotent Lie Group of Step Two Let $F_{2n,2}$ be the free nilpotent Lie group of step two on $2n$ generators, and let $\mathbf P$ denote the affine automorphism group of $F_{2n,2}$. In this article the theory of continuous wavelet transform on $F_{2n,2}$ associated with $\mathbf P$ is developed, and then a type of radial wavelets is constructed. Secondly, the Radon transform on $F_{2n,2}$ is studied and two equivalent characterizations of the range for Radon transform are given. Several kinds of inversion Radon transform formulae are established. One is obtained from the Euclidean Fourier transform, the others are from group Fourier transform. By using wavelet transform we deduce an inversion formula of the Radon transform, which does not require the smoothness of functions if the wavelet satisfies the differentiability property. Specially, if $n=1$, $F_{2,2}$ is the $3$-dimensional Heisenberg group $H^1$, the inversion formula of the Radon transform is valid which is associated with the sub-Laplacian on $F_{2,2}$. This result cannot be extended to the case $n\geq 2$. Keywords:Radon transform, wavelet transform, free nilpotent Lie group, unitary representation, inversion formula, sub-LaplacianCategories:43A85, 44A12, 52A38

20. CJM 2012 (vol 65 pp. 82)

Félix, Yves; Halperin, Steve; Thomas, Jean-Claude
 The Ranks of the Homotopy Groups of a Finite Dimensional Complex Let $X$ be an $n$-dimensional, finite, simply connected CW complex and set $\alpha_X =\limsup_i \frac{\log\mbox{ rank}\, \pi_i(X)}{i}$. When $0\lt \alpha_X\lt \infty$, we give upper and lower bound for $\sum_{i=k+2}^{k+n} \textrm{rank}\, \pi_i(X)$ for $k$ sufficiently large. We show also for any $r$ that $\alpha_X$ can be estimated from the integers rk$\,\pi_i(X)$, $i\leq nr$ with an error bound depending explicitly on $r$. Keywords:homotopy groups, graded Lie algebra, exponential growth, LS categoryCategories:55P35, 55P62, , , , 17B70

21. CJM 2012 (vol 66 pp. 102)

Birth, Lidia; Glöckner, Helge
 Continuity of convolution of test functions on Lie groups For a Lie group $G$, we show that the map $C^\infty_c(G)\times C^\infty_c(G)\to C^\infty_c(G)$, $(\gamma,\eta)\mapsto \gamma*\eta$ taking a pair of test functions to their convolution is continuous if and only if $G$ is $\sigma$-compact. More generally, consider $r,s,t \in \mathbb{N}_0\cup\{\infty\}$ with $t\leq r+s$, locally convex spaces $E_1$, $E_2$ and a continuous bilinear map $b\colon E_1\times E_2\to F$ to a complete locally convex space $F$. Let $\beta\colon C^r_c(G,E_1)\times C^s_c(G,E_2)\to C^t_c(G,F)$, $(\gamma,\eta)\mapsto \gamma *_b\eta$ be the associated convolution map. The main result is a characterization of those $(G,r,s,t,b)$ for which $\beta$ is continuous. Convolution of compactly supported continuous functions on a locally compact group is also discussed, as well as convolution of compactly supported $L^1$-functions and convolution of compactly supported Radon measures. Keywords:Lie group, locally compact group, smooth function, compact support, test function, second countability, countable basis, sigma-compactness, convolution, continuity, seminorm, product estimatesCategories:22E30, 46F05, 22D15, 42A85, 43A10, 43A15, 46A03, 46A13, 46E25

22. CJM 2012 (vol 65 pp. 510)

Blasco de la Cruz, Oscar; Villarroya Alvarez, Paco
 Transference of vector-valued multipliers on weighted $L^p$-spaces We prove restriction and extension of multipliers between weighted Lebesgue spaces with two different weights, which belong to a class more general than periodic weights, and two different exponents of integrability which can be below one. We also develop some ad-hoc methods which apply to weights defined by the product of periodic weights with functions of power type. Our vector-valued approach allow us to extend results to transference of maximal multipliers and provide transference of Littlewood-Paley inequalities. Keywords:Fourier multipliers, restriction theorems, weighted spacesCategories:42B15, 42B35

23. CJM 2012 (vol 65 pp. 299)

Grafakos, Loukas; Miyachi, Akihiko; Tomita, Naohito
 On Multilinear Fourier Multipliers of Limited Smoothness In this paper, we prove certain $L^2$-estimate for multilinear Fourier multiplier operators with multipliers of limited smoothness. As a result, we extend the result of CalderÃ³n and Torchinsky in the linear theory to the multilinear case. The sharpness of our results and some related estimates in Hardy spaces are also discussed. Keywords:multilinear Fourier multipliers, HÃ¶rmander multiplier theorem, Hardy spacesCategories:42B15, 42B20

24. CJM 2012 (vol 65 pp. 241)

Aguiar, Marcelo; Lauve, Aaron
 Lagrange's Theorem for Hopf Monoids in Species Following Radford's proof of Lagrange's theorem for pointed Hopf algebras, we prove Lagrange's theorem for Hopf monoids in the category of connected species. As a corollary, we obtain necessary conditions for a given subspecies $\mathbf k$ of a Hopf monoid $\mathbf h$ to be a Hopf submonoid: the quotient of any one of the generating series of $\mathbf h$ by the corresponding generating series of $\mathbf k$ must have nonnegative coefficients. Other corollaries include a necessary condition for a sequence of nonnegative integers to be the dimension sequence of a Hopf monoid in the form of certain polynomial inequalities, and of a set-theoretic Hopf monoid in the form of certain linear inequalities. The latter express that the binomial transform of the sequence must be nonnegative. Keywords:Hopf monoids, species, graded Hopf algebras, Lagrange's theorem, generating series, PoincarÃ©-Birkhoff-Witt theorem, Hopf kernel, Lie kernel, primitive element, partition, composition, linear order, cyclic order, derangementCategories:05A15, 05A20, 05E99, 16T05, 16T30, 18D10, 18D35

25. CJM 2012 (vol 65 pp. 66)

Deng, Shaoqiang; Hu, Zhiguang
 On Flag Curvature of Homogeneous Randers Spaces In this paper we give an explicit formula for the flag curvature of homogeneous Randers spaces of Douglas type and apply this formula to obtain some interesting results. We first deduce an explicit formula for the flag curvature of an arbitrary left invariant Randers metric on a two-step nilpotent Lie group. Then we obtain a classification of negatively curved homogeneous Randers spaces of Douglas type. This results, in particular, in many examples of homogeneous non-Riemannian Finsler spaces with negative flag curvature. Finally, we prove a rigidity result that a homogeneous Randers space of Berwald type whose flag curvature is everywhere nonzero must be Riemannian. Keywords:homogeneous Randers manifolds, flag curvature, Douglas spaces, two-step nilpotent Lie groupsCategories:22E46, 53C30
 Page 1 2 3 Next
 top of page | contact us | privacy | site map |


text:
# zbMATH — the first resource for mathematics

A non-continuous description of the shape category of compacta. (English) Zbl 0697.55012
J. E. Felt [Proc. Am. Math. Soc. 46, 426-430 (1974; Zbl 0292.55013)] has related $$\epsilon$$-continuous maps and shape morphisms between metric compacta obtaining a bijection between shape morphisms and inverse limits of certain equivalence classes of $$\epsilon$$-continuous functions. In the reviewed article the author does further investigations and defines the notion of a proximate net $$\alpha =(\alpha_ n): X\to Y$$ as a sequence of (not necessarily continuous) functions $$\alpha_ n: X\to Y$$ such that for every $$\epsilon >0$$ there exists an index $$n_ 0$$ such that $$\alpha_ n$$ is $$\epsilon$$-homotopic to $$\alpha_{n+1}$$ for every $$n\geq n_ 0$$. The class of metric compacta together with homotopy classes of proximate nets as morphisms is then organized into a category which is shown to be isomorphic to the shape category of metric compacta. The last section concerns internally movable compacta where if the codomain is internally movable then every homotopy class of proximate nets has a continuous representative.
Reviewer: I.Ivanšić

##### MSC:
 55P55 Shape theory 54C56 Shape theory in general topology
Full Text:


text:
# positive definite matrix plus positive semi matrix equals positive definite?

I have a questions related to the positive definite[PD] matrix and positive semi definite[PSD] matrix

I see and get the property about PD and PSD

1) PD + PD = PD
2) PSD+ PSD = PSD

how about the positive definite[PD] matrix plus positive semi definite matrix ?

(I mean sum of positive definite matrix and positive semi definite matrix : PD + PSD)

Is it right to be positive definite matrix?

For example, If matrix B is $R \times R$ and it is sum of identity matrix $I$ and symmetry matrix A

that is, $B=I+A$

1) $I=\det(I)=1>0$ positive definite
2) $X^{T}AX=X^{T}L^{T}LX=U^{T}U=||U||\geqslant 0$ positive semidefinite

I think that it would be positive definite, I am not so sure...

So I would like to get some help from you

Thank you very much in advance !

• Hint: $x^T (A+B) x = x^T A x + x^T B x$... – user251257 Mar 9 '16 at 14:36
• @user251257 So it depends on $x^{T}(I+A)x= x^{T}Ix+x^{T}Ax >0$ so it is positive definite! Thank you for your help – user2874612 Mar 10 '16 at 1:19

Let us consider $A$ is PD and $B$ is PSD. Then $x^T(A + B)x = x^TAx + x^TBx > 0$ for $0 \neq x \in R^n.$ Hence $A+B$ is PD matrix.


text:
# Math Help - Not understanding answer...

The question posed is: "Suppose you flip a coin n times. If you win a dollar every time the coin comes up heads and lose a dollar every time it comes up tails, what is the probability that you will win k dollars?"

The answer given is: "If 2 doesn't divide $n + k$, the probability is 0. If 2 does divide $n + k$, the probability is ${n \choose \frac {n + k}{2} }$"

Does this make sense to anyone?

2. Originally Posted by earachefl
The question posed is: "Suppose you flip a coin n times. If you win a dollar every time the coin comes up heads and lose a dollar every time it comes up tails, what is the probability that you will win k dollars?"

The answer given is: "If 2 doesn't divide $n + k$, the probability is 0. If 2 does divide $n + k$, the probability is ${n \choose \frac {n + k}{2} }$"

Does this make sense to anyone?
To win k dollars requires n1 wins and n2 losses such that n1+n2=n, and
n1-n2=k.

This last imples that 2 n1 - (n1+n2) = k, so:

2 n1 = k+n

Hence k+n is even so the probabilty of winning k dollars in n trials is 0 if k+n is odd.

Also if k+n is even then the number of wins is (k+n)/2, and the probability of this is:

$
p(k, n) = {n \choose \frac{k+n}{2}} (1/2)^n
$

RonL

3. So they did leave out part of the answer:
$
(1/2)^n
$

which does make sense. Thanks!


text:
# How to ask a question?

I asked a question: Explanation of transistor amplifying action. I wrote my question very specifically by highlighting the main points which I do not understand but even I have not got any useful answer.

I don't know why someone downvoted my question. Perhaps the downvote is due to the grammatical or formatting mistakes; I can just speculate.

I want to ask more questions but I am afraid I would be again downvoted and banned.

I have more question to ask like on $LC$ tuned circuit and on pull down resister. Please tell me how should I ask these questions.

I also want to ask this question: https://physics.stackexchange.com/questions/82949/steady-state-of-diffusion-current-in-semiconductors on this website because I think on physic.SE people are not so much familiar with solid state electronics. When I was using my previous account I cross-posted this question on this website but it get downvoted and soon deleted by the community moderator.

So should I cross-post this question from phys.SE?

This is a response to @ChrisLaplante.
My comment was not for the whole SE network(i.e. every SE website), it is only for https://electronics.stackexchange.com/. Although my comment has been edited by someone its essence is pretty much same as before. I had an account on this website which I have deleted. With my previous account I asked some questions which were downvoted silently. I did not know why my questions were downvoted that's why I could not improve them. I was banned to ask more questions. I do not have enough knowledge to answer Engineering questions that's why I could not lift the ban. Once I was banned on Phys.SE too but by posting answers I lifted that ban. I have made a new account here and asked two questions. My two question are not well received by the community and are downvoted. Now I know why my questions were downvoted in my previous account $-$ Because I did make some grammatical and formatting mistakes. But now I do not know why these two present questions are still remain downvoted although a gentle person has corrected the grammatical and formatting mistakes in it. Perhaps on this website people forget after downvoting.
Now let's come to the point. I am not mistaken this website. It is a FACT. On http://math.stackexchange.com I did make the same grammatical and formatting mistakes(like not capitalizing the word "I") but nobody downvoted for this reason. Math.SE is very good website there are very friendly people, they have given me very useful answers. This website should learn from Math.SE.
Do you know what most of the people do here(on EE.SE)? They downvote silently and walk away. They do not tell what's wrong in the post. They do not even bother whether the OP has corrected the error in his question or not. Like any country is known by the behaviour of its people, any website is known by the behaviour of its users. If majority of the people(users) of a community(website) discriminate(and humiliate) on the basis of language then that community(website) will be called "A Linguistic discriminating community(website)"
I did not came here to dissrespect anyone. I came here to learn and to ask questions. I did not want to make things personal but people here have prejudices for me, they made things personal. Yes I am an Engg. student and never understood any of my subjects. You know why? Because human race is alike, people behave in real life the same they do on any internet website. Throughout my academic carrier I have always been mocked because I ask questions which are difficult to understand and difficult to answer. My teachers always say: Your question is nonsense, it is not understandable, you are confused and confusing me too, etc etc. But the truth is my teachers do not have the qualification to answer my questions.
No one can take away my right to learn. I can self study like I did in school time. Mr. Lathrop is right - I do not belong here. This website is an English based website for intelligent students.

• I edited my question because i think my question is been misinterpreted. I do not expect for SE system to teach me the engineering subjects. I want to ask some questions on this site. As my question are related to engineering stream so they should be On-topic here. My questions usually get downvoted. I want to know what's the reason behind these downvotes so i could present rest of my questions as clearly as possible. Please do not deviate from the question. If there are some personal issues with me then its ok i will not become a part of this site. Regards. Mar 8 '14 at 15:05
• One thing that would greatly help is to observe proper capitalization rules. I realize English probably isn't your first language, but bad formatting can be a contributing factor to people not wanting to put forth effort to understand your question. Mar 10 '14 at 22:38
• @ChrisLaplante I have responded to your comment in my question. It is clear most of the users(not everyone) here downvote the posts which have bad English. Mar 13 '14 at 9:56
• For the record, I don't down-vote strictly due to grammar or capitalization problems. Those are pet peeves, but I base my votes on the validity and quality of the question (or answer). I overlook (and usually correct) English where possible, but if the question makes no sense or isn't salvageable, shows little or no effort, etc. then a down-vote is warranted. Mar 13 '14 at 15:31
• @JYelton Thanks a lot for the edits that you made in my posts. you don't have to justify anything. I realized that I had made this mistake in my all posts on other SE sites and I have edited them. Mar 13 '14 at 16:21
• @anupam no, not most, just the same few cranky farts. Mar 16 '14 at 2:47
• This site might be helpful Apr 26 '16 at 23:36

You have asked this before, and apparently learned nothing from the answers.

You just asked another question on the main site, and it's full of the same things you were told not to do. I did give a brief answer, but with so many wrong statements, invalid assumptions, and overall sloppiness, it's no surprise it is getting downvoted. All the problems make it difficult to answer because a lot of stuff would have to be unraveled first before the context for a meaningful answer could be established, let alone actually answering the question.

In short, you were banned from asking questions for a good reason. You tried to weasel around the ban by creating a new account. That's probably against the rules in the first place. However, you haven't cleaned up your act, which is even worse from my point of view (the moderators may take a particularly dim view of creating another account to circumvent a ban).

On a separate topic, you say that you are about to graduate with a degree in electrical engineering, but yet you are asking how a voltage divider works. You need to seriously think about your career plans, and take your education seriously - including how you're learning (or not learning) from your questions here.

• I accept your original answer. You are right I do not belong here and I never did. It is not this website who ostracize me. This is I who leaves this discriminating English website. I will learn English one day but I do speak a second language. Regards Mar 11 '14 at 15:11
• @Anupam: Please don't mistake Olin's attitude for that of the website (or network) as a whole Mar 11 '14 at 20:29
• @Chris: At least 7 others agree with me. SE is launching new sites in other languages, but this site is in English. While non-native English speakers do get some slack, the problem here was this user was told several times some of the things he was doing wrong, but refused to do anything about it. Using the wrong tense of a verb or the occasional misspelling can be overlooked because these things can be hard to get right. However, there is no excuse for the easy and universal rules like capitalizing first letters of sentences and the word "I". Mar 11 '14 at 20:51
• @OlinLathrop; I understand your frustration, but nevertheless there are users on here who are willing to work with non-native speakers to improve their questions (regardless of how many times they make capitalization or spelling mistakes). At the end of the day, we're building a reference site. So, if I can fix the grammar on an otherwise great question which will help future visitors, I'll do it, every time. Anyway, it seems the core problem with this user was his questions were poorly formatted & had bad assumptions. His poor grammar and capitalization problems only added fuel to the fire. Mar 11 '14 at 21:11
• @Chris: Editing a sloppy post is a short term fix but usually causes more long term problems. Telling the OP what is wrong so he can fix it is fine, but doing it for him only teaches that he doesn't have to care, and he will be back doing the same thing again. That was precisely the problem here. This guy was told what was wrong, but never went back and fixed things and kept doing the same things in new posts. This site isn't for everyone. To keep quality up we need to shed those that can't be bothered to take some care, rather than perpetually cleaning up behind them. Mar 12 '14 at 13:08
• @OlinLathrop; I'm certainly not making excuses for this user. I was speaking more broadly; you have to understand that your opinion regarding editing and content policing in general is completely opposite to the goals of the site/network. See this question, for instance; meta.stackexchange.com/questions/87611/to-edit-or-not-to-edit . I know you won't budge in this regard, but I will ask you to stop standing in the way of those who are willing to edit posts. E.g.: meta.electronics.stackexchange.com/questions/3413/…, Mar 13 '14 at 0:54
• @Chris: I have no means to prevent others from editing posts, so talk of standing in their way makes no sense. Otherwise, I have a right to express my opinion, just as you are doing here. Your actions are hurting this site. Clearly you don't agree with that. However, you're just going to have to get over the fact I do agree with it. Mar 13 '14 at 21:31
• @Olin; Impeding is not the same as preventing. Regardless, for some reason you believe that your way is better than how all the other sites do it. But like you say, you are entitled to your opinion. Mar 14 '14 at 0:44
• @ChrisLaplante Olin just thinks he knows better then the sum of all all sites experience. Mar 14 '14 at 15:53

For your original question ban I posted this answer and some time later I thought to check if you had edited any of your original posts and I couldn't see any edits or other positive activity. Apparently asking new questions is important to you but you couldn't be bothered to fix up any old content. With regard to cross-posting see:

Is cross-posting a question on multiple Stack Exchange sites permitted if the question is on-topic for each site?

Who knows why your new question got downvoted, possibly because it seems to be a few questions rolled into one or maybe because someone thought the Physics.SE answer(s) were satisfactory. You could ask a Physics.SE mod to consider your other question for migration - I'm not sure of the guidelines in that regard but as it looks like you've been suspended to "cool down" on Physics.SE for a while I'm not sure you could even flag it.

• I am having hard time in finding my old posts. On 23feb/2014 i deleted my previous account. Believe me i had made some edits. You are incorrectly writting in your answer"I couldn't see any edits". When i do not write my question in detail people say your question is very unclear. When i write them in detail people say you are asking multiple questions. I just want to know what the heck that circuit is. I i hadn't written the specific points on which i have confusion anybody woud downvote that and you would say :"probably your question is too-broad it is not specific" Mar 8 '14 at 13:00
• "someone thought the Physics.SE answer(s) were satisfactory.". Let's be literal for the time being. On phys.SE this question is already deleted by community mod(because it was downvoted) so i didn't literally cross-posted. I written my question incorrectly on this so i am going to edit my question. Mar 8 '14 at 13:08


text:
# Coproduct , direct sum

1. Aug 14, 2011

### Sumanta

Hi ,

I was trying to understand why or where would the problem arise in the definition of the direct sum for the coproduct/direct sum for the set (1, 1, 1, .....) infinite number of times. I was trying to reason out as follows. I posted this on the set theory but I am not sure how to tag it to algebra hence I decided to copy paste the same.

(1, 1, 1, ......)$\rightarrow$ Y

$\uparrow$

f$_{i}$$\rightarrow$ Y

Pls note that the Y is the same as I cannot write the angular arrow.

Now if I say that f$_{i}$ acting on (e$_{i}$) maps it to ( 0, 0, ...1 at the ith coordinate , 0, ....) then what is the place where I am making a mistake. The problem as I see is that either the map from the set (1, 1, 1, ...) to Y is either not unique or map from f$_{i}$$\rightarrow$ Y does not give the same value as the other path. I am really not sure which is the one and why.

Now Y can be any kind of general space. So I first thought if Y was just the {0} or the whole space R$^{\infty}$. But I see very clearly that {0} choice does not give a counter example. Not sure how to handle the second case. Even thought with Y= N ( countable ) but still could not get to any kind of solution.
Thx

Last edited: Aug 14, 2011
2. Aug 15, 2011

### Sumanta

Hi,

I thought about the problem and I think this could be thought of as a way of thinking.

So what we need is the following.

Given data:

f$_{i}$: X$_{i}$$\stackrel{injective}{\rightarrow}$ P
g$_{i}$: X$_{i}$ $\stackrel{homomorphism}{\rightarrow}$ X

Now define in someway

g: P $\stackrel{homomorphism}{\rightarrow}$ X

P is the coproduct we are trying to define. Pls note that we need to define g given g$_{i}$. g is actually to be defined so that it completes the commutative diagram and then only P is the coproduct.

The most obvious way of defining g on each of the basis elements is g := $\sum g_{i}$ where i ranges over the index set. Now all our group, ring homomorphism operations are defined over finite sums or finite products. So there is no way we could make sense of an infinite sum in the definition of g. Thus we have to restrict it to finite sum. Hence if we have to restrict it to finite sum then only a finite number of elements could be non zero and the rest are all 0s.

This is my understanding and if somebody could point out that there is some gaps it would be very helpful.

Thx


text:
# Partition Function- Are the energies of the individual microstates, free energies?

$$Z=\sum_i e^{-\beta E_i}$$ I am relatively new to statistical mechanics, and I am wondering if the individual energies ($E_i$) in the equation above are free energies associated with each microstate? If it is, would it be Gibb's Free Energy or Helmholtz's Free Energy?

• It's not free energy, it's energy. Feb 27, 2018 at 15:22

No, the $E_i$s are energies. In statistical mechanics it can be show (see for example here) that the Helmotz's free energy $F$ is related to the partition function of the system in the following way $$F = -kT\log Z$$ and all other thermodynamic relations, e.g. that with the Gibbs's free energy, can be found starting from it.


text:
QUESTION

# A firm uses capital and labor to produce a single output good. The production function is given by F(K, L) = K L0.5 where K is the amount of capital...

A firm uses capital and labor to produce a single output good. The production function is given by F(K, L) = K L0.5 where K is the amount of capital and L is the amount of labor employed by the firm. The unit prices of capital and labor are given by, respectively, r = $6 and w =$5. Based on this information, characterize the optimal (output maximizing) allocation of inputs given that the firm decides to limit its total cost to \$36,000. Illustrate your solution graphically: draw the relevant isocost line and sketch the relevant isoquant.


text:
# How to make a single barplot with different yticks, ytick labels and ylabel on its left and right side?

I have earlier asked two questions here related to barplots and labels/ticks for double y-axes: (1) How to make an xbar plot, with pgfplots, having different y tick labels on the left and right side y axis?, and (2) How to order barplots in aligned rows and columns?, and got good answers.

In my former question number (2) I needed to order barplots in 3 rows and 2 colums. In each row the leftmost barplot had outer yticks and ytick labeles on its left side, while the rightmost barplot had yticks and ytick labels on its right side. In addition, the ylabel for each barplot was turned horizontally and placed above the ytick labels.

My new question here is a combination of my previous two : How can I reduce the number of barplot columns, in question (2), from two to one, but retain all other structure, i.e. the single barplot in each row should have outer yticks, ytick labels and ylabel on both its left and right side?

Although the answer I got to my original two questions are very good ones, I am, unfortunalely, not able to combine them to answer my new question.

Below I have added the code I got from StackExchange as an answer to my previous question (2).

    \documentclass{article}
\usepackage{pgfplots}
\usepackage{filecontents}

\pgfplotsset{
width=4cm,
height=4cm,
title style = {yshift = 10pt,name=title},
xtick align = inside,
xtick pos = both,
xticklabel pos = upper,
yticklabel style={name=yticklabel},
xlabel style={name=xlabel},
ylabel style={rotate=-90},
xmin=-5,
xmax = 140,
ytick align = outside,
ytick pos = left,
yticklabel pos=left,
ymin =0,
ymax = 5,
ytick=data,
xbar,
nodes near coords,
every node near coord/.append style = {anchor=west},
yticklabel shift=0.25cm,
region/.style={
extra description/.append code={\node (region label) at ({yticklabel cs:0.5}-|ylabel.west) [anchor=east,xshift=-1ex] {#1};}
},
region title/.style={
extra description/.append code={\node at (region label.east|-xlabel.base) [anchor=base east] {#1};}
}
}

% Measurements contry 1

\begin{filecontents}{data1.dat}
Age-interval Y-Position meas1 meas2 winner
20-30 1 15 45 John
30-40 2 20 13 Al
40-50 3 12 4 Andrew
50-60 4 24 1 Tom
\end{filecontents}

% Measurements contry 2

\begin{filecontents}{data2.dat}
Age-interval Y-Position meas1 meas2 winner
20-30 1 44 30 Peter
30-40 2 15 33 Steve
40-50 3 2 48 David
50-60 4 66 98 Alister
\end{filecontents}

% Measurements contry 3

\begin{filecontents}{data3.dat}
Age-interval Y-Position meas1 meas2 winner
20-30 1 13 22 Arne
30-40 2 1 48 Per
40-50 3 2 4 Ola
50-60 4 33 61 Anders
\end{filecontents}
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{figure}
\begin{tikzpicture}
\matrix[column sep=4pt, row sep=2pt]{
\begin{axis}[
xlabel = {Meas. 1},
yticklabel pos=left,
yticklabels from table={data1.dat}{Age-interval},
ylabel = {Age interval},
ylabel style = {
at=(yticklabel.east|-xlabel.base),
anchor=base east,
name=ylabel
},
bar width=4pt,
region=Ohio,
region title=Region
]

y=Y-Position,
x=meas1,
] {data1.dat};
\end{axis}
&
\begin{axis}[
xlabel = {Meas. 2},
yticklabel pos=right,
yticklabels from table={data1.dat}{winner},
ylabel = {Winner},
ylabel style = {
at={(yticklabel.west|-xlabel.base)},
anchor=base west,
},
ytick pos = right,
bar width=4pt,
]

y=Y-Position,
x=meas2,
] {data1.dat};
\end{axis}
\\
\begin{axis}[
yticklabel pos=left,
yticklabels from table={data2.dat}{Age-interval},
bar width=4pt,
xticklabels = none,
region=South Carolina
]

y=Y-Position,
x=meas1,
] {data2.dat};
\end{axis}
&
\begin{axis}[
yticklabel pos=right,
yticklabels from table={data2.dat}{winner},
ytick pos = right,
bar width=4pt,
xticklabels = none,
]

y=Y-Position,
x=meas2,
] {data2.dat};
\end{axis}

\\

\begin{axis}[
yticklabel pos=left,
yticklabels from table={data3.dat}{Age-interval},
bar width=4pt,
xticklabels = none,
region=Norway
]

y=Y-Position,
x=meas1,
] {data3.dat};
\end{axis}
&

\begin{axis}[
yticklabel pos=right,
yticklabels from table={data3.dat}{winner},
ytick pos = right,
bar width=4pt,
xticklabels = none,
]

y=Y-Position,
x=meas2,
] {data3.dat};
\end{axis}
\\};

\end{tikzpicture}
\caption{Results of some contest for men}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}

This code produces the following figure:

So posing my new question in a new way: how to delete the second column of barplots, that one below and including the "Meas. 2" heading, in the figure above and keeping the columns "Region", "Age interval", "Meas. 1" and "Winner", as well as equipping the barplots under "Meas. 1" with outer yticks also on its right side?

Thanks Jake. That answer helped me a lot! Here you have your bounty points :) Though...I have two follow-up questions. I am not sure if this is the right place, but I think these questions are very related to the example I use above:

1) How can I left/center/right justify the words in each of the colums "Region", "Age interval", and "Winner"?

2) If I want to add another column with additional information about each winner, say his or her body weigth, how can I add that? I guess in case that the y-tick options are used up since I have used them on both left and right side of the bar plots?

-
What do you mean by the second column other than not drawing them? Also please consider accepting the answers to your previous questions. That would mark the question as solved and would indicate the solution is conclusive. –  percusse May 4 '12 at 13:36
@percusse: Does my included figure answer your queistion? My problem is that the answer to my former question (1) does not work in the context of my former question (2). I am not able to combine the two answers into one –  Espen Donali May 4 '12 at 13:42
Thank you for your edit. What I am trying to understand is the deletion part. Do you want to keep the Winner name list and Meas 2. title? That part is not clear for me. What if you don't draw the second column? What gets lost? Can you clarify that part if possible? –  percusse May 4 '12 at 13:45
Also every answer is specific to each question. So as far as I can tell they answer your concerns on your previous problems. This is a different problem with probably in need of a different answer. –  percusse May 4 '12 at 13:48
Ok, I see your point. I want to delete the column "Meas. 2", but retain the column "Winner". In addition, the columns of barplots below "Meas. 1" should get outer yticks on its right side, pointing towards the names of the winners in the "Winner" column. –  Espen Donali May 4 '12 at 14:01

You can use extra y ticks for this. Using every extra y tick/.style, you can pass all options to these additional y ticks that you can pass to "normal" ticks. The only annoyance with this approach is that you can't use extra y ticks=data, instead you'll have to manually specify the ticks (using, in this case, extra y ticks={1,...,4}).

\documentclass{article}
\usepackage{pgfplots}
\usepackage{filecontents}

\pgfplotsset{
width=4cm,
height=4cm,
title style = {yshift = 10pt,name=title},
xtick align = inside,
xtick pos = both,
xticklabel pos = upper,
yticklabel style={name=yticklabel},
xlabel style={name=xlabel},
ylabel style={rotate=-90},
xmin=-5,
xmax = 140,
ytick align = outside,
ytick pos = left,
yticklabel pos=left,
ymin =0,
ymax = 5,
ytick=data,
xbar,
nodes near coords,
every node near coord/.append style = {anchor=west},
yticklabel shift=0.25cm,
region/.style={
extra description/.append code={\node (region label) at ({yticklabel cs:0.5}-|ylabel.west) [anchor=east,xshift=-1ex] {#1};}
},
region title/.style={
extra description/.append code={\node at (region label.east|-xlabel.base) [anchor=base east] {#1};}
},
extra y ticks={1,...,4},
every extra y tick/.style={
yticklabel style={name=name label},
ytick pos=right,
yticklabel pos=right,
ytick align = outside
},
winner title/.style={
extra description/.append code={\node at (name label.west|-xlabel.base) [anchor=base west] {#1};}
}
}

% Measurements contry 1

\begin{filecontents}{data1.dat}
Age-interval Y-Position meas1 meas2 winner
20-30 1 15 45 John
30-40 2 20 13 Al
40-50 3 12 4 Andrew
50-60 4 24 1 Tom
\end{filecontents}

% Measurements contry 2

\begin{filecontents}{data2.dat}
Age-interval Y-Position meas1 meas2 winner
20-30 1 44 30 Peter
30-40 2 15 33 Steve
40-50 3 2 48 David
50-60 4 66 98 Alister
\end{filecontents}

% Measurements contry 3

\begin{filecontents}{data3.dat}
Age-interval Y-Position meas1 meas2 winner
20-30 1 13 22 Arne
30-40 2 1 48 Per
40-50 3 2 4 Ola
50-60 4 33 61 Anders
\end{filecontents}
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{figure}
\begin{tikzpicture}
\matrix[column sep=4pt, row sep=2pt]{
\begin{axis}[
xlabel = {Meas. 1},
winner title=Winner,
yticklabel pos=left,
yticklabels from table={data1.dat}{Age-interval},
every extra y tick/.append style={
yticklabels from table={data1.dat}{winner}
},
ylabel = {Age interval},
ylabel style = {
at=(yticklabel.east|-xlabel.base),
anchor=base east,
name=ylabel
},
bar width=4pt,
region=Ohio,
region title=Region
]

y=Y-Position,
x=meas1,
] {data1.dat};
\end{axis}

\\
\begin{axis}[
yticklabel pos=left,
yticklabels from table={data2.dat}{Age-interval},
every extra y tick/.append style={
yticklabels from table={data2.dat}{winner}
},
bar width=4pt,
xticklabels = none,
region=South Carolina
]

y=Y-Position,
x=meas1,
] {data2.dat};
\end{axis}
&
\\

\begin{axis}[
yticklabel pos=left,
yticklabels from table={data3.dat}{Age-interval},
every extra y tick/.append style={
yticklabels from table={data3.dat}{winner}
},
bar width=4pt,
xticklabels = none,
region=Norway
]

y=Y-Position,
x=meas1,
] {data3.dat};
\end{axis}
&
\\};

\end{tikzpicture}
\caption{Results of some contest for men}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\end{document}

-
Hi Jake, thanks, this is promissing. But there seems to be an error in your code. The same set of men are winners in each and every region. In the block of code below the line "every extra y tick/.style" there is a line saying yticklabels from table={data1.dat}{winner}, resulting that all three regions get the same list of winners. As in my original example, the winners are unique for each region. So..how to add two different sets of y-ticklabels to each barplot? The left one being "Age-interval" and the right one being "Winner" –  Espen Donali May 7 '12 at 18:03
Well, you just need to add every extra y tick/.append style={yticklabels from table ...} to each of the plots, instead of putting it in the axis options. I've edited my answer. –  Jake May 7 '12 at 18:10


text:
# Levenshtein distance using dynamic programming in Python 3

I had to implement a function for getting the Levenshtein distance of two strings for a problem. It linked to the Wikipedia Article for Levenshtein distance and mentioned I can use the dynamic programming solution. Following is my implementation.

def levenshtein_distance(s, t):
m, n = len(s) + 1, len(t) + 1
d = [[0] * n for _ in range(m)]

for i in range(1, m):
d[i][0] = i

for j in range(1, n):
d[0][j] = j

for j in range(1, n):
for i in range(1, m):
substitution_cost = 0 if s[i - 1] == t[j - 1] else 1
d[i][j] = min(d[i - 1][j] + 1,
d[i][j - 1] + 1,
d[i - 1][j - 1] + substitution_cost)

return d[m - 1][n - 1]

This function did work and my code passed the test case but I'm not sure if this is the most optimum solution.

Any pointers or suggestions will be appreciated.

• You don't actually need such a big array (d) because you're only ever accessing two consecutive rows at a time. Hence a 2 x m array is sufficient, while accessing the two rows in an alternating fashion (à la j % 2). However, sometimes you're interested not just in the smallest distance but also what is the actual "path" through the array (as in: which operations do you have to apply to transform s into t), in which case you do need the full array. Oct 19 at 12:48
• Correction, you don't even need the full array then - you could simply store the best "path" that lead to d[i][j%2] in a separate data structure -- which, however, would then take up the same size as storing the full d as you're currently doing. Oct 19 at 12:57
• I personally would find it easier to read without the blank lines between the for loops. But PEP8 leaves that up to the author's judgment, using blank lines to separate logical sections is apparently fine. I'd be interested to hear a more experienced opinion on blank lines in short functions. Oct 19 at 22:51

## Documentation

Add a docstring for levenshtein_distance which explains what Levenshtein distance is. Explain the algorithm (or give a link to some existing explanation) if easy. I count about 5 sections in the algorithm--put a comment above each to explain what it's doing. Not all code needs a lot of comments, but algorithms do.

## Variable names

Your names here are: d, s, t, i, j, m, and substitution_cost. One of these is not like the others. Make all of them have descriptive names like substitution_cost.

## Tests

You're worried your algorithm is not correct. So add some explicit tests and test cases.

## Optimality

Time how long your function takes on various lengths of string. Measure the runtime experimentally to make sure it's what you expect.

Kill two birds with one stone, documented examples and testing, by using doctests:

def levenshtein_distance(s, t):
"""Return the Levenshtein edit distance between t and s.

>>> levenshtein_distance('kitten', 'sitting')
3
>>> levenshtein_distance('flaw', 'lawn')
2
"""

Test the that your code produces these expected results with

python -mdoctest levenshtein.py

Take the chance to write a good docstring too.

• Do note that doctests aren't a substitute for tests nor a substitute for documentation: they serve a number of adjacent purposes, but primarily they supplement (and verify the correctness of) documentation. Ideally, every bug you encounter gets a test once fixed (or potentially prior to fixing in TDD), but you don't want that in your documentation! Oct 20 at 2:47

Just in case you might be interested in a memoized version. (Maybe somewhat cleaner, but slower by a constant factor.)

#!/usr/bin/env python3

from functools import cache

def levenshtein_distance(s, t):
'''
>>> levenshtein_distance("snowy", "sunny")
3
'''

@cache
def d(i, j):
return (
i if j == 0 else
j if i == 0 else
d(i - 1, j - 1) if s[i - 1] == t[j - 1] else
min(
d(i - 1, j) + 1,
d(i, j - 1) + 1,
d(i - 1, j - 1) + 1
)
)

return d(len(s), len(t))

if __name__ == "__main__":
import doctest
doctest.testmod()

• Why are you including #!/usr/bin/env python3 this is not neccecary for Python 3. Why are you using lru_cache? From Python 3.9 the standard is @cache docs.python.org/3/library/functools.html. Not super happy with your formating either, this is what black gives: pastebin.com/EShFq31D. Assert should only be used for testing, not production code. It would be clearer using docs.python.org/3/library/doctest.html. Oct 19 at 22:15
• Good points, thanks. For this purpose I don't like the way black formats the if .. else construct. Should use doctest, no doubt, but didn't know it. Mainly just wanted to show how a memoized version can avoid the explicit array management. Oct 20 at 15:39


text:
Having trouble applying Hall's Theorem

1. Jan 21, 2008

junho

1. Let k>0 and let A1,A2,...,An be a collection of k-subsets of finite set X such that every element of X appears in exactly k sets in the collection. Prove that |X| = n

2. Teacher provided us with the following hints:
-- Use a variation of Hall's Theorem.

3. I have no clue how to approach this problem. I don't even understand how proving |X|=n implies anything?

Last edited: Jan 21, 2008
2. Jan 21, 2008

HallsofIvy

Staff Emeritus
?? |X|= n is the conclusion you want to prove! Why should it imply anything?

"k- subsets" here means subsets of X containing exactly k members? The "overlapping" is the problem here so imaging "painting" the members of each Ai a different color! In other words, imagine that these are all distinct items. Since there are n sets, each containing k items, how many items are there altogether.

But we are told that each item in X appears in exactly k sets. In other words each item in X is counted k times in the formula above.

3. Jan 21, 2008

junho

By that, I meant that I don't know understand what solving for |X| = n proves and therefore I can't figure out the reasoning and logic to bring me to that solution.

But thanks for the tips! I'll see if I can use it to help me figure it all out.

4. Jan 21, 2008

HallsofIvy

Staff Emeritus
??? It proves just what it says: that X contains n elements!

I can't think what else you could mean.

5. Jan 22, 2008

junho

Hahaha, well I guess that's the meaning that I missed. Sorry for my horrible math skills. The last time I took any university level math was 5 years ago. I'm just going back to school now for some upper level math courses to complete a minor in Math.

I've basically forgotten everything.


text:
1. ## i cant do this one quadratic question!

Express y=ax^2+4x+2a in the form y=a(x+b)^2+c in terms of a.

usually when i do these sorts of questions i dont complete the square, i find the axis of symmetry and then find the turning point and put it into the equation.
But in this case im lost because i cant remember how to complete the square!

2. Originally Posted by Kash
Express y=ax^2+4x+2a in the form y=a(x+b)^2+c in terms of a.

usually when i do these sorts of questions i dont complete the square, i find the axis of symmetry and then find the turning point and put it into the equation.
But in this case im lost because i cant remember how to complete the square!
$\displaystyle = a \left( x^2 + \frac{4}{a} x + 2 \right)$.

Now complete the square of the quadratic inside the brackets.

3. Originally Posted by Kash
im lost because i cant remember how to complete the square!
For lessons with worked examples, try here.


text:
»  Home »  Products »  Features »  Commands for working with ICD codes

## Commands for working with ICD codes

### Highlights

• Designed for use with
• The US National Center for Health Statistics (NCHS) ICD-10-CM diagnosis codes for healthcare encounter and claims data
• The US Centers for Medicare and Medicaid Services (CMS) ICD-10-PCS procedure codes for healthcare claims data
• The World Health Organization's ICD-10 codes for morbidity and mortality reporting
• NCHS ICD-9-CM diagnosis codes for healthcare encounter and claims data
• CMS ICD-9-CM procedure codes for healthcare claims data
• Suite of data-management commands lets you
• Easily generate new variables based on codes
• Indicators for different conditions
• Short descriptions
• Category codes from billable codes
• And more
• Verify that a variable contains valid codes and flag invalid codes
• Standardize the format of codes
• Interactive utilities let you
• Look up descriptions for codes
• Search for codes from keywords
• ICD-10 and ICD-10-CM/PCS commands let you indicate the version of the codes in your dataset

Information about diagnoses and procedures in administrative healthcare data is often encoded using one of the ICD coding systems. For example, the standard system for mortality reporting has been the World Health Organization's ICD-10 system since 1999. Since October of 2015, the U.S. has used ICD-10-CM to encode diagnoses and ICD-10-PCS to encode procedures.

When administrative data are gathered from multiple sources, the format of the codes may not be fully standardized. Thus, there may be reporting errors. Finally, the sheer number of codes available in these encoding systems means that analyzing the data in a meaningful way is often impossible without summarizing information.

Stata has a suite of commands for working with ICD codes, known collectively as the icd commands. Whether you want to add text to codes or create indicator variables, want to verify that the codes in your data are valid, or are using the codes as a step in a larger project, the icd commands provide valuable tools for reporting and research.

### Show me

Suppose we are conducting a study of mortality in the United States in 2010. We have vital statistics data from the CDC that contain records on more than 2.4 million deaths.

. use female agerc cause place using vital10.dta, clear
(US mortality data, 2010 -- CDC Vital Statistics)

. describe

Contains data from vital10.dta
obs:     2,472,542                          US mortality data, 2010 -- CDC
Vital Statistics
vars:             4                          31 Mar 2015 13:46
size:    32,143,046

storage   display    value
variable name   type    format     label      variable label

female          float   %9.0g      female     Decedent is female, female=1,
male=0
place           byte    %8.0g      pod        Place of death and status
cause           str4    %9s                   Cause of death (ICD-10 code)
agerc           float   %14.0g     agerc      Age, Census recode

Sorted by:

We want to identify all deaths that are due to respiratory illnesses. Any of 275 codes can currently be used to define a respiratory illness, far more than we would ever want to type! A plausible alternative is to use a lookup table, but definitions are often provided in terms of a range of codes, leaving you to type the codes at least once to create the lookup table anyway.

Because the CDC reported mortality using ICD-10 codes in 2010, we can use the icd10 commands to make our work easier.

We might want to start by verifying that all of the codes in our data are indeed valid codes and use the same format for storage. The default version for icd10 is codes from 2016, but we need to make sure we specify the version that applies for our data.

We start by using icd10 check with version(2010).

. icd10 check cause, version(2010)
(cause contains no missing values)

cause contains undefined codes:

1.  Invalid placement of period                       0
2.  Too many periods                                  0
3.  Code too short                                    0
4.  Code too long                                     0
5.  Invalid 1st char (not A-Z)                        0
6.  Invalid 2nd char (not 0-9)                        0
7.  Invalid 3rd char (not 0-9)                        0
8.  Invalid 4th char (not 0-9)                        0
77.  Valid only for previous versions             15,177
88.  Valid only for later versions                     0
99.  Code not defined                                  0
___________
Total                                        15,177

However, we discover that more than 15,000 records are using codes from a previous year. Out of 2.4 million, that isn't such a bad error rate, but if we used 2009, could we do better? Let's specify version(2009) and get a list of the codes with any problems. We'll also create a variable that indicates the type of problem that icd10 check finds.

. icd10 check cause, version(2009) generate(problem09) summary
(cause contains no missing values)

cause contains undefined codes:

1.  Invalid placement of period                       0
2.  Too many periods                                  0
3.  Code too short                                    0
4.  Code too long                                     0
5.  Invalid 1st char (not A-Z)                        0
6.  Invalid 2nd char (not 0-9)                        0
7.  Invalid 3rd char (not 0-9)                        0
8.  Invalid 4th char (not 0-9)                        0
77.  Valid only for previous versions                  0
88.  Valid only for later versions                 2,188
99.  Code not defined                                  0
___________
Total                                         2,188

Summary of invalid and undefined codes

cause   Count   Problem

A099    2135   Valid only for later versions
R636      43   Valid only for later versions
R263      10   Valid only for later versions

We think all respiratory diagnoses fall in the range of J10 to J98.9, but we might want to look up these three codes real quick just to set our minds at ease.

. icd10 lookup A09.9 R63.6 R26.3

A09.9 Gastroenteritis and colitis of unspecified origin
R26.3 Immobility
R63.6 Insufficient intake of food and water due to self neglect

We're fairly confident that we can ignore these codes. They don't apply to our study of respiratory illness. We'll use 2009 as our reference year for the rest of our analysis. To generate our respiratory cause of death indicator (resp), we type

. icd10 generate resp = cause, range(J10/J989)

We may wish to further examine deaths from pneumonia. For example, if we want to add an indicator for a pneumonia cause of death only to those decedents that we already know have a respiratory diagnosis, we can type

. icd10 generate pneumonia = cause if resp==1, range(J12/J189)

. tabulate pneumonia

pneumonia        Freq.     Percent        Cum.

0      187,594       79.07       79.07
1       49,660       20.93      100.00

Total      237,254      100.00

We see that about 21% of all deaths from respiratory illnesses in the US in 2010 were from pneumonia.

Now suppose we were giving a presentation and wanted to show a graph of common pneumonia diagnoses among decedents with a pneumonia-related cause of death. For this, we'll want to combine the icd10 generate command with a few other data management commands and Stata's graph hbar command.

First let's speed things up a bit by using contract to make a dataset of frequencies. Because we only want to graph the relative frequency of each pneumonia code within all pneumonia diagnoses, we can discard the other records. We'll also extract the category code from each cause of death.

. contract cause if pneumonia == 1, percent(percent) freq(deaths)

. icd10 generate catcode=cause, category

. list cause death percent, sepby(catcode) noobs

cause   deaths   percent

J120       14      0.03
J121       18      0.04
J122        3      0.01
J128        3      0.01
J129      133      0.27

J13       277      0.56

J14        31      0.06

J150       88      0.18
J151      231      0.47
J152      625      1.26
J153        2      0.00
J154      189      0.38
J155       25      0.05
J156       24      0.05
J157       24      0.05
J158       39      0.08
J159     1264      2.55

J180      955      1.92
J181     1775      3.57
J182       64      0.13
J188       12      0.02
J189    43864     88.33

There are several codes with few deaths, so we'll collapse them all into a single “All other pneumonia diagnoses” category and have icd10 generate add WHO's description of the code to our dataset for the others. Let's keep all codes with at least 1% of the total.

. icd10 generate descr = cause if percent >= 1, description addcode(begin) version(2009)

. replace descr = "All other pneumonia diagnoses" if percent < 1

Note that with this icd10 generate, we needed to specify version(2009) to ensure icd10 added the descriptions from 2009. We need one more trick to make our graph. We're going to contract our data again, this time by our newly-created description variable, and then indicate whether the description is grouped or not.

. contract descr [fw=deaths], freq(tdeaths) percent(tpercent)

. generate grouped = descr=="All other pneumonia diagnoses"

. graph hbar (asis) tpercent, over(descr, sort(tpercent) descending
axis(outergap(-5))) over(grouped, axis(off)) nofill
blabel(bar, format(%3.1f))
title("2010 US Mortality", span)
subtitle("Top 5 Pneumonia Diagnoses", span) name(pctg)

Finally, we have our pneumonia mortality graph, showing nicely-formatted ICD-10 codes, labeled with the official WHO descriptions.

## Show me more

You can read more about ICD coding, including tips for working with records with multiple diagnosis codes, in the Introduction to ICD commands.

Also, see worked examples for the individual coding systems

For more about the other commands used above, see