text:
# Missing equation numbers in aligned environment inside tabular environment

I try to create a tabular environment containing a two-lined description on the left side of an equation on the right side. It looks like this:

\documentclass{report}

\usepackage[intlimits]{amsmath}
\usepackage{here}
\usepackage{floatflt}
\usepackage{caption}
\usepackage{listliketab}
\usepackage{tabularx}
\usepackage{booktabs}

\begin{document}
\begin{table}[htb]
\caption{testststt} \label{tab_BG1_zustand}
\begin{tabular}{p{6cm}p{6cm}}
\toprule
Zustandsgröße &  Beziehung \\ \midrule
{\!\begin{aligned} &\text{spezifisches Volumen} \\ &v = (\partial g / \partial p)_T} \end{aligned}$} &$v(\pi,\tau)\frac{p}{R T} = \pie \gamma_{\pi}$\\ \vspace{5mm} \\ {$\!\begin{aligned}
&\text{spezifische innere Energie} \\
& u=g-T(\partial g / \partial T)_p - p(\partial g / \partial p)_T \end{aligned}}
& $\frac{u(\pi,\tau )}{R T} = \tau \gamma_{\tau}$ \\ \bottomrule
\end{tabular}
\end{table}
\end{document}

Since it's in an aligned environment, I thought that I would get equation numbers on the right. However, there are none. I think it's because aligned is a non-math environment, so I don't get equation numbers for the inline math; but if I exchange it with align I can't really get it to work.

Update I edited the code according to Bernard's answer, but with the intent to number the right equation:

\begin{table}[htb]
\caption{testststt} \label{tab_BG1_zustand}
\begin{tabular}{p{6cm}p{6cm}}
\toprule
Zustandsgröße &  Beziehung \\ \midrule
{\!\begin{aligned} &\text{spezifisches Volumen} \\ &v = (\partial g / \partial p)_T} \end{aligned}$} & $$v(\pi,\tau)\frac{p}{R T} = \pie \gamma_{\pi}$$ \\ \vspace{5mm} \\ {$\!\begin{aligned}
&\text{spezifische innere Energie} \\
&u=g-T(\partial g / \partial T)_p - p(\partial g / \partial p)_T \end{aligned}}
& $$\frac{u(\pi,\tau )}{R T} = \tau \gamma_{\tau}$$ \\ \bottomrule
\end{tabular}
\end{table}

It now looks like this:

However, the right equations are too low - I want them to be in the middle of the cell (see original example).

• aligned is a math environment, but it's a "subsidiary" environment. subsidiary environments never get numbers. where do you want the number? at the far right, as if just the rightmost equation is an ordinary numbered equation? – barbara beeton May 12 '15 at 17:31
• (a) There are lots of syntax errors. (b) I do not see any alignments, which equations should be aligned where? (c) It is pretty unclear, where you want to have equation numbers. (d) aligned does not set equation numbers unlike align or alignat. – Heiko Oberdiek May 12 '15 at 17:37
• I would want the equation numbers at the far right, just as you described barbara. It's very possible that there are many syntax errors, I started working with Latex two days ago and I'm still a bit overwhelmed. – Phil Nope May 12 '15 at 17:43

You can use m-type columns and flalign for left aligning the numbered equation. Some vertical space corrections are needed, but they're hidden in a macro, so you don't need to specify them each time.

\documentclass{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}

\usepackage[intlimits]{amsmath}
\usepackage{booktabs,array}
\usepackage{caption}

\newcommand{\tableequation}[1]{%
\vspace*{-\baselineskip}
{\begin{flalign}#1&&&\end{flalign}}%
\vspace*{-\baselineskip}
}

\begin{document}

With a reference to one of the equations, \eqref{eq-sV}

\begin{table}[htb]
\centering

\caption{testststt} \label{tab_BG1_zustand}

\begin{tabular}{
@{}
@{}
m{6cm}
@{}
}
\toprule
Zustandsgröße &  Beziehung \\
\midrule

spezifisches Volumen\newline
$v = (\partial g / \partial p)_T$ &
\tableequation{
v(\pi,\tau)\frac{p}{R T} = \pi \gamma_{\pi} \label{eq-sV}
} \\

spezifische innere Energie\newline
$u=g-T(\partial g / \partial T)_p - p(\partial g / \partial p)_T$ &
\tableequation{
\frac{u(\pi,\tau )}{R T} = \tau \gamma_{\tau}
} \\
\bottomrule
\end{tabular}

\end{table}

\end{document}

• This is exactly what I was looking for. Thanks! – Phil Nope May 12 '15 at 21:50

• The cells in the left column uses an inner tabular. The second line is indented to emphasize the term in the first line.
• No fixed column widths.
• The equation numbers can be referenced, using amsmath macros for the formatting of the equation number.

Full example:

\documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage[intlimits]{amsmath}
\usepackage{caption}
\usepackage{booktabs}

\begin{document}
\begin{table}
\centering
\caption{testststt}
\label{tab_BG1_zustand}
\newcommand*{\SetEqNum}{%
\refstepcounter{equation}%
\thetag\theequation
}
\newcommand*{\DisplayEq}[1]{%
\ensuremath{\displaystyle #1}%
}
\newcommand*{\DefEq}[2]{%
\begin{tabular}{@{}l@{}}%
#1\\
\end{tabular}%
}
\begin{tabular}{llr}
\toprule
Zustandsgröße &  Beziehung
\\ \midrule
\DefEq{spezifisches Volumen}{v = (\partial g / \partial p)_T}
& \DisplayEq{v(\pi,\tau)\frac{p}{R T} = \pi \gamma_{\pi}}
& \SetEqNum\label{eq:Volumen}
\\
\DefEq{spezifische innere Energie}
{u=g-T(\partial g / \partial T)_p - p(\partial g / \partial p)_T}
& \DisplayEq{\frac{u(\pi,\tau )}{R T} = \tau \gamma_{\tau}}
& \SetEqNum\label{eq:InnereEnergie}
\\ \bottomrule
\end{tabular}
\end{table}

In der Tabelle~\ref{tab_BG1_zustand} gibt es die Beziehungen
\eqref{eq:Volumen} und~\eqref{eq:InnereEnergie}.
\end{document}

The p{6cm} is equivalent to \parbox[t]{6cm}, but \parbox[c]{6cm} would do better for this. Nor do you really need a display math environment when $\displaystyle ...$ will do. Especially, if you put the equation number into its own column.

\documentclass{report}

\usepackage[intlimits]{amsmath}
\usepackage{here}
\usepackage{floatflt}
\usepackage{caption}
\usepackage{listliketab}
\usepackage{tabularx}
\usepackage{booktabs}

\begin{document}
\begin{table}[htb]
\caption{testststt} \label{tab_BG1_zustand}
\begin{tabular}{llr}
\toprule
Zustandsgröße &  Beziehung \\ \midrule
\parbox[c]{6cm}{\text{spezifisches Volumen} \newline
$\displaystyle v = (\partial g / \partial p)_T$}
& \parbox[c]{6cm}{$\displaystyle v(\pi,\tau)\frac{p}{R T} = \pi \gamma_{\pi}$}
& \stepcounter{equation}(\theequation)
\\[5mm]
\parbox[c]{6cm}{\text{spezifische innere Energie} \newline
$\displaystyle u=g-T(\partial g / \partial T)_p - p(\partial g / \partial p)_T$}
& \parbox[c]{6cm}{$\displaystyle \frac{u(\pi,\tau )}{R T} = \tau \gamma_{\tau}$}
& \stepcounter{equation}(\theequation)
\\ \bottomrule
\end{tabular}
\end{table}
\end{document}

Here is a way. I used threeparttable in order to have the caption left-aligned w.r.t. the table. Off topic: you shouldn't load here since float defines an H option.

\documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[german]{babel}
\usepackage[showframe, nomarginpar]{geometry}
\usepackage[intlimits]{mathtools}
\usepackage{nccmath}
\usepackage{floatflt}
\usepackage{caption}
\usepackage{booktabs}
\usepackage{array, caption, threeparttable}
\newcolumntype{M}[1]{>{\fleqn}m{#1} <{\endfleqn}}

\begin{document}

\vspace*{1\baselineskip}
\begin{table}[!htb]
\centering
\captionsetup{singlelinecheck=off}
\begin{threeparttable}
\caption{testststt} \label{tab_BG1_zustand}
\setlength\abovedisplayskip{-2ex}
\setlength\belowdisplayskip{-1.5ex}
\begin{tabular}{M{6cm} M{6cm}}
\toprule
Zustandsgröße & Beziehung \\ \midrule
\begin{fleqn}\begin{gather*}
\shortintertext{spezifisches Volumen}
v =(∂ g / ∂ T)_T\end{gather*}\vskip-\abovedisplayskip\end{fleqn}
& $$\displaystyle v(π,τ)\frac{p}{R T} = π e γ_{π}$$ \\
\begin{fleqn}\begin{gather*}
\shortintertext{spezifische innere Energie}
u = g- T (∂ g / ∂ T)_p- p(∂ g / ∂ T)_T \end{gather*}\end{fleqn}
& $$\frac{u(π, τ)}{RT} = τ γ_{τ}$$\\
\bottomrule
\end{tabular}
\end{threeparttable}
\end{table}

\end{document}

• I would like to number the right most equation and see the equation number on the far right. I tried moving the to the right formula, but it messed with the formatting. Also, and this is different in your solution, the right equation should be in the vertical center of the right cell. Right now it's on the same height as the left equation. – Phil Nope May 12 '15 at 18:07
• I photoshopped a picture for clarification: like this – Phil Nope May 12 '15 at 18:33
• @Phil Nope: I adjusted my code. Should be like you want now. – Bernard May 13 '15 at 0:35


text:
# Ways to remove one element from a binary string so that XOR becomes zero in C++

C++Server Side ProgrammingProgramming

In this problem, we are given a binary string. Our task is to count the total number of ways in which we can remove one element such that XOR becomes zero.

Let’s take an example to understand the problem,

## Input

n = 11010

## Output

3

to solve this problem, we need the logic that if the number of 1’s is even then XOR of the string will be 0, otherwise, we need to remove one 1 from the string. We can remove any number of 0’s without affecting the XOR.

Program to show the implementation of our solution,

## Example

Live Demo

#include<iostream>
#include<string.h>
using namespace std;
int wayXorZero(string binaryString){
int oneCount = 0, zeroCount = 0;
int n = binaryString.length();
for (int i = 0; i < n; i++)
if (binaryString[i] == '1')
oneCount++;
else
zeroCount++;
if (oneCount % 2 == 0)
return zeroCount;
return oneCount;
}
int main(){
string binaryString = "10110100";
cout<<"Number of ways to make XOR zero is "<<wayXorZero(binaryString);
return 0;
}

## Output

Number of ways to make XOR zero is 4
Updated on 17-Jul-2020 11:25:29

format: plain


text:
<img src="https://d5nxst8fruw4z.cloudfront.net/atrk.gif?account=iA1Pi1a8Dy00ym" style="display:none" height="1" width="1" alt="" />

1.5: Connect Variable Expressions and the Order of Operations with Real-World Problems

Difficulty Level: At Grade Created by: CK-12
Estimated7 minsto complete
%
Progress
Practice Expressions for Real-Life Situations

MEMORY METER
This indicates how strong in your memory this concept is
Progress
Estimated7 minsto complete
%
Estimated7 minsto complete
%
MEMORY METER
This indicates how strong in your memory this concept is

Have you ever been to a ballet? Sara is going to see the "Nutcracker", but she needs to figure out the cost for tickets. She isn't sure if three or four of her friends are going to join her at the performance. The cost for one ticket is $35.00, and there is a$2.00 one time fee for the ticket purchase.

Can you write a variable expression to explain this situation? Can you figure out the total cost if three people attend the performance? Can you figure out the total cost if four people attend the performance?

Pay attention to this Concept, and you will be able to help Sara at the end of the Concept.

Guidance

When we have an unknown quantity in a problem, we can use a variable to help us to find the value of our problem. You can find many real-world scenarios where variable expressions would be helpful in solving problems.

Many different places sell tickets. There are also prices for adults and prices for children. The number of tickets can vary, or they can be the same. If we know the number of tickets, then we can figure out the total amount of revenue earned based on the cost of the ticket for an adult and for a child.

Take a look at this situation.

An amusement park charges eight dollars admission and one dollar and fifty-cents per ride. Write an expression to find the cost of admission and five ride tickets.

First, notice that we have eight dollars admission. That is the first part of the expression.

8

Next, they charge 1.50 per ride. \begin{align*}8 + 1.50x\end{align*} We used the variable for the number of rides since this is the variable or changeable facet. The number of rides can change. In this example, we were asked to figure out the cost for 5 rides. That is the value that we can substitute into our expression for \begin{align*}x\end{align*}. \begin{align*}8 + 1.50(5)\end{align*} Now we can use the order of operations to solve this problem. \begin{align*}& 8 + 7.50 \\ & 15.50\end{align*} The cost of admission plus five ride tickets is15.50.

Using variable expressions can help you solve for unknown quantities. Just remember to use the order of operations so that your work is accurate!!

An ice cream cone costs 3.50 plus an additional .35 for sprinkles. Write an expression to show how you would figure out the cost for two ice cream cones with sprinkles. Solution: \begin{align*}2(3.50 + .35)\end{align*} Example B How much would it cost for two cones? Solution: \begin{align*}7.70\end{align*} Example C How much would it cost for five cones with sprinkles? Solution: \begin{align*}19.25\end{align*} Now let's go back to the dilemma at the beginning of the Concept. Let's think about what we know. Sara knows the cost for one ticket. \begin{align*}35.00\end{align*} She isn't sure how many people are going. That is our variable. Let's use \begin{align*}x\end{align*}. \begin{align*}35x\end{align*} But there is also a \begin{align*}2.00\end{align*} one time charge. Let's add that to our expression. \begin{align*}35x + 2\end{align*} Now we can figure out the cost for three people by substituting three in for \begin{align*}x\end{align*}. \begin{align*}35(3) + 2 = 107\end{align*} We can also figure out the cost for four people. \begin{align*}35(4) + 2 = 142\end{align*} Our work is complete. Vocabulary Evaluate to figure out the value of a numerical or variable expression. Equation a mathematical statement with an equals sign where one side of the equation has the same value as the other side. Expression a group of numbers, symbols and variables that represents a quantity. Numerical Expression a group of numbers and operations. Variable Expression a group of numbers, operations and at least one variable. Variable a letter used to represent an unknown quantity. Grouping Symbols parentheses or brackets used to group numbers and operations. Guided Practice Here is one for you to try on your own. Harriet is making a cake. She needs to go to the store and purchase some almonds and a can of evaporated milk. When she arrives at the store, she picks up the can of evaporated milk. It costs1.99. Then she goes to get the almonds. Almonds are $3.99 per pound. Can you write a variable expression so that Harriet can calculate her total cost based on how many pounds she purchases? Solution To accomplish this task, first let's figure out the variable. The variable is going to be the number of pounds purchased since that is the changeable amount. The price per pound is$3.99. Now let's write the first part of the variable expression.

\begin{align*}3.99x\end{align*}

Harriet isn't only purchasing almonds, she is also buying a can of evaporated milk. We can add that cost to our variable expression.

\begin{align*}3.99x + 1.99\end{align*}

Practice

Directions:Write a variable expression for each situation described below.

1. A pound of apples costs $4.50. Kelly isn't sure how many pounds she is going to purchase. 2. Each touchdown at a football game is worth 7 points. Write a variable expression where the number of touchdowns scored can change. 3. Alex bought several bunches of bananas. Each bunch costs$.89. Write a variable expression to describe this situation.

4. If an ice cream cone costs $3.20 and hot fudge is an additional$.45, write a variable expression where the number of ice cream cones can change.

5. There are six children in the Smith family. If each child gets a haircut, write a variable expression to show the cost of the haircut so that the total cost can be calculated.

6. A turkey costs $6.75 per pound. Write a variable expression where the weight of the turkey is the changeable amount. 7. The car wash charges$15.00 per car. Write a variable expression that can be used to calculate the number of cars washed in one hour.

8. Kelly bought a pair of sneakers for $35.00. She also bought a pile of different laces. Each set of laces costs$3.00. Write a variable expression to show how Kelly could calculate her total cost.

Directions:Now go back to each variable expression that you wrote in numbers 1 - 8 and evaluate each expression as if the given value for the variable was 4. These are your answers for numbers 11 - 16.

Notes/Highlights Having trouble? Report an issue.

Color Highlighted Text Notes

Vocabulary Language: English

Algebraic Expression

An expression that has numbers, operations and variables, but no equals sign.

Equation

An equation is a mathematical sentence that describes two equal quantities. Equations contain equals signs.

Evaluate

To evaluate an expression or equation means to perform the included operations, commonly in order to find a specific value.

Expression

An expression is a mathematical phrase containing variables, operations and/or numbers. Expressions do not include comparative operators such as equal signs or inequality symbols.

Grouping Symbols

Grouping symbols are parentheses or brackets used to group numbers and operations.

Numerical expression

A numerical expression is a group of numbers and operations used to represent a quantity.

Show Hide Details
Description
Difficulty Level:
Authors:
Tags:
Subjects:


text:
# Strength of salt in a mixture is p%. Various concentration of slats are added

The strength of a salt solution is $$p$$% if $$100$$ ml of the solution contains $$p$$ grams of salt. If three salt solutions A, B, C are mixed in the proportion $$1 : 2: 3$$, then the resulting solution has strength $$20$$%. If instead, the proportion is $$3 : 2: 1$$, then the resulting solution has strength $$30$$%. A fourth solution, D, is produced by mixing B and C in the ratio $$2: 7$$. The ratio of the strength of D to that of A is

1) $$2:5$$

2) $$3:10$$

3) $$1:4$$

4) $$1:3$$

My attempt: Let's say A has $$a$$%, B has $$b$$% and C has $$c$$%. And we take $$1$$, $$2$$ and $$3$$ kgs of them respectively. This will give us $$20$$% solution. Therefore, $$\frac{a}{100}$$+$$\frac{2b}{100}+\frac{3c}{100}$$=$$1.2$$ kgs This means $$a+2b+3c=120$$…(1)

Similarly $$\frac{3a}{100}+\frac{2b}{100}+\frac{c}{100}$$=$$1.8$$ kgs So, $$3a+2b+c=180$$…(2)

Adding (1) and (2) we get, $$a+b+c=75$$ and subtracting them we get $$a-c=30$$. How to proceed further?

$$a+b+c=75$$ & $$a−c=30$$ give $$c=a-30$$ and $$b=105-2a$$.
Required ratio: $$\frac{2b+7c}{9a}=\frac{210-4a+7a-210}{9a}=1:3$$


text:
# Eulcidean Algorithim for GCD

• May 2nd 2013, 12:00 PM
kamui
Eulcidean Algorithim for GCD
Find the GCD for 198 and 765

I got as far as $765= 3 \times 198 +171$
I'm not sure what to do for the next step.
• May 2nd 2013, 01:17 PM
emakarov
Re: Eulcidean Algorithim for GCD
The next step is: 198 = 1 x 171 + 27. For each new step, you take the two rightmost numbers from the previous step.
• May 2nd 2013, 02:09 PM
Soroban
Re: Eulcidean Algorithim for GCD
ello, kamui!

Quote:

Find the GCD for 198 and 765

I got as far as: $765\:=\: 3 \times 198 +171$

I'm not sure what to do for the next step.

Then I guess you didn't really learn the Euclidean Algorithm.

1. Divide the larger number by the smaller.

2. Divide the divisor by the remainder.

3. Repeat step 2 until a zero remainder is achieved.

4. The GCD is the last divisor.

So we have:

. . $\begin{array}{ccccc}765 \div 198 &=& 3 & \text{rem.}171 \\ 198 \div 171 &=& 1 & \text{rem.}27 \\ 171 \div 27 &=& 6 & \text{rem.}9 \\ 27 \div {\color{red}9} &=& 3 & \text{rem.}0 \end{array}$

Therefore: . $\text{GCD}(198,765) \:=\:9$


text:
# How many perfect secrecy systems are there?

How many non-trivial*, interesting perfect secrecy systems are there other than the one-time-pad? Does it seem that the one-time-pad and perfect secrecy are synonymous, but are there any other cryptosystems that have perfect secrecy aside from the trivial examples?

*Here the non-trivial means; the simple type that may be created by, say, picking a set of integers, and randomly corresponding each of those integers with a 0 or 1 (the key), then sending some permutation of the integers as cipher-text.

• Shamir's secret sharing can be one example. Also, there are many information-theoretic secure cryptosystems that are close enough to perfect secrecy systems. – DiamondDuck May 14 '20 at 23:23
• @kelalaka by non-trivial I mean the simple type that may be created by, say, picking a set of integers, and randomly corresponding each of those integers with a 0 or 1 (the key), then sending some permutation of the integers as cipher-text. – GEG May 14 '20 at 23:43
• Note that there are also cryptosystems that are not encryption schemes (and thus don't provide any secrecy in the usual sense) but which do provide perfect information-theoretical security against a suitable class of attacks. Notable examples include Shamir's secret sharing scheme and some MACs based on universal hashing (which can be perfectly secure in the sense that even an attacker with unlimited computing power has no way of forging a message with a higher probability than by guessing the MAC at random). – Ilmari Karonen May 16 '20 at 18:26

How many non-trivial*, interesting perfect secrecy systems are there other than the one-time-pad?

Infinitely many.

Let $$\mathbb G$$ be a group (written multiplicatively). Then

• $$\operatorname{KeyGen}(1^n)=k\stackrel{\}{\gets}\mathbb G^n$$, that is the key is a vector of $$n$$ independently random group elements.
• $$\operatorname{Enc}(k,m):\mathbb G^n\times \mathbb G^n\to\mathbb G^n:(k,m)\mapsto m\cdot k$$, that is the plaintext is a vector of group elements and the ciphertext is simply the element-wise multiplication of each message element with the corresponding key element.
• $$\operatorname{Dec}(k,m):\mathbb G^n\times \mathbb G^n\to\mathbb G^n:(k,c)\mapsto c\cdot k^{-1}$$, that is we simply combine each ciphertext element with the inverse of the corresponding key element.

Note that the above defines an encryption scheme for each group there is and that's at least countably infinitely many ones (as $$(\mathbb Z_n,+)$$ works for all $$n\in\mathbb N$$). In particular it also works for non-abelian (i.e. non-commutative) groups.

The above scheme can be proven secure under a similar argument to the traditional one-time-pad and in fact the traditional one is simply this with the group $$(\mathbb Z_2,+)$$.

• Are any such systems secure under multiple key reuse, so the key space is so large that the same key can be used to encrypt multiple messages the length of the key? What about security under known plaintext attack? – GEG May 15 '20 at 13:36
• @GEG They have the exact same properties as the standard binary OTP. – SEJPM May 15 '20 at 13:46
• Arguably, though, all of these are just different kinds of "one-time pads". (In particular, I doubt any of the early one-time pad systems before the computer era used bitwise XOR. Most of them probably used addition modulo the ciphertext alphabet size instead. The choice of a two-symbol alphabet really only makes sense if you're using a binary computer.) – Ilmari Karonen May 16 '20 at 18:05
• @IlmariKaronen I understand why this answer may feel unsatisfying. Perhaps you are instead looking for answers to the unasked questions of "what other known perfectly secret non-equivalent constructions exist besides the OTP?" or "Does the perfect secrecy requirement impose structural limitations on cryptosystems beyond the keylength?" – SEJPM May 16 '20 at 18:26
• Not really. I mean, that would be an interesting question, but that's not what was asked here. All I was trying to point out is that, depending on reasonable choices of terminology, the number of "perfect secrecy systems […] other than the one-time-pad" demonstrated in your answer could be either "infinitely many" or "none". And that the narrow definition of "one-time pad" that you (and possibly the OP) seem to have had in mind in fact excludes most of the historically used one-time pad systems before the modern era. – Ilmari Karonen May 16 '20 at 18:35


text:
1. All Categories
2. Economics

# Economics : Recent Questions and Answers

## Comparing relative change for different base value

I need to compare change in employment size for a sample of companies. I could use percentage change, however, the problem with it is that when the base is small,...

## Nelson-Siegel-Svensson parameters provided by the Bundesbank

I am a college student and I have recently learned about Nelson-Siegel-Svensson method which is used by the German Federal Bank to determine the yield curve. I have to generate...

## Does the concept of Capitalism increase the net wealth?

I am currently going through a video by Peter Schiff from the occupy Wallstreet period where he is talking with the protestors at the time. I'm pretty...

## Arrow’s Impossibility & Validity of Social Welfare and Pareto Improvement Analysis

Arrow’s Impossibility states it is impossible to formulate a social ordering (Social Welfare Function) without violating some desirable conditions ( one of the “No dictatorship”, “ Pareto Efficiency”, “Independence...

## How can a government save, if it has deficit?

I am reading an IMF paper about China's debt (link) which says: ❝ Despite a large augmented fiscal deficit of 10 percent, fiscal savings remain higher than...

## Contribution by each factor

Must admit it has been many years since I have done advanced calculations or anything remotely like it, so please bear with me.I have problem that I hope to...

## Why are Americans at the top of nearly every field?

I live in India, and having spent several years in America before returning, I noticed that Americans dominate in nearly every sphere of human activity. For example, the US seems...

## What's the economic argument (if any) for taxing dividends as ordinary income?

My (limited) understanding is that dividends and share repurchases are economically very similar: while share repurchases are slightly less direct, both transactions are effectively ways for publicly traded companies to...

## GDP accounting: Insurance spending belong to which part of GDP?

We know that $GDP = C + I + G + NX$, where $C$ is household consumption and $I$ is private investment. I don't know whether insurance...

## Monetary policy rate and fiscal deficit

A colleague in work mentioned today that Chile is keeping a flat monetary policy rate given "there is a higher expected fiscal deficit". If there is an expected fiscal deficit...


text:
# Prove that a sum converges to a trigonometric expression

$$2^n \cos \left (\frac{n \pi}{2} \right )=\sum_{k=0}^{n} (-1)^k \binom{2n}{2k}$$

I expanded the LHS and got $$\binom{2n}{0}-\binom{2n}{2}+\binom{2n}{4}-\binom{2n}{6}+\cdots+(-1)^{n}\binom{2n}{2n}$$

Is this a telescoping series? Where can I go from here?

-
I would break this up into 3 cases: $n$ odd, $n=2 k$ where $k$ is even, and $n=2 k$ where $k$ is odd. Prove each case by induction. – Ron Gordon May 8 '13 at 9:28
Hint: What is $(1+i)^{2n}$ and $(1-i)^{2n}$ by binomial theorem? – achille hui May 8 '13 at 9:28
Convergence is usually associated with infinite series, not finite sums. Perhaps a better title would be "Prove that a binomial sum equals a trigonometric expression" – robjohn May 8 '13 at 9:48

\begin{align} \sum_{k=0}^n\binom{2n}{2k}x^{2k} &=\frac12\left(\sum_{k=0}^{2n}\binom{2n}{k}x^k+\sum_{k=0}^{2n}\binom{2n}{k}(-x)^k\right)\\[6pt] &=\frac{(1+x)^{2n}+(1-x)^{2n}}{2} \end{align} Plug in $x=i$ to get \begin{align} \sum_{k=0}^n(-1)^k\binom{2n}{2k} &=\frac{(1+i)^{2n}+(1-i)^{2n}}{2}\\ &=\frac{(2i)^n+(-2i)^n}{2}\\ &=2^n\frac{e^{in\pi/2}+e^{-in\pi/2}}{2}\\[9pt] &=2^n\cos(n\pi/2) \end{align}
$$\cos\frac{n\pi}2=\begin{cases}\;0&,\;\;\text{if}\;\;\;n=1\pmod 2\\{}\\\!\!\!-1&,\;\;\text{if}\;\;\;n=2\pmod 4\\{}\\\;1&,\;\;\text{if}\;\;\;n=0\pmod 4\end{cases}$$


text:
# LaTeX

#### ghoti

##### Karmic Sangoma
LaTeX is a document preparation system for high-quality typesetting. It is most often used for medium-to-large technical or scientific documents but it can be used for almost any form of publishing.
http://www.latex-project.org

Lets you do some great stuff with text:

#### icyrus

##### Executive Member
w1z4rd have you ever used docbook? I would be interested in some comparisons as I know latex well but not docbook.

#### ghoti

##### Karmic Sangoma
w1z4rd have you ever used docbook? I would be interested in some comparisons as I know latex well but not docbook.
No, I havent, I am still getting my mind around LaTeX

#### BCO

##### Honorary Master
Damn, and here I thought this thread was gonna be about gimp suits and stuff. Oh well.

#### Charlie.

##### Well-Known Member
I used LaTeX for a while, last year. Initially, I thought it rocked. After a while, however, I did become a little tired of the workflow - always having to break the flow of editing to jump back to the front of the document and define another macro to do something for the first time.

On the other hand, I had some awesome macros in the end, including some that would create infinite sum formulae, insert Fourier integrals at will, even write dx/dt with correctly italicised x and t characters and regular d's. Woot.


text:
New Titles  |  FAQ  |  Keep Informed  |  Review Cart  |  Contact Us Quick Search (Advanced Search ) Browse by Subject General Interest Logic & Foundations Number Theory Algebra & Algebraic Geometry Discrete Math & Combinatorics Analysis Differential Equations Geometry & Topology Probability & Statistics Applications Mathematical Physics Math Education

Holomorphic Dynamics and Renormalization: A Volume in Honour of John Milnor's 75th Birthday
Edited by: Mikhail Lyubich, University of Toronto, ON, Canada, and SUNY at Stony Brook, NY, and Michael Yampolsky, University of Toronto, ON, Canada
A co-publication of the AMS and Fields Institute.
 SEARCH THIS BOOK:
Fields Institute Communications
2008; 395 pp; hardcover
Volume: 53
ISBN-10: 0-8218-4275-7
ISBN-13: 978-0-8218-4275-1
List Price: US$123 Member Price: US$98.40
Order Code: FIC/53

The papers collected in this volume reflect some of the directions of research in two closely related fields: Complex Dynamics and Renormalization in Dynamical Systems.

While dynamics of polynomial mappings, particularly quadratics, has by now reached a mature state of development, much less is known about non-polynomial rational maps. The reader will be introduced into this fascinating world and a related area of transcendental dynamics by the papers in this volume. A graduate student will find an area rich with open problems and beautiful computer simulations.

A survey by V. Nekrashevych introduces the reader to iterated monodromy groups of rational mappings, a recently developed subject that links geometric group theory to combinatorics of rational maps. In this new language, many questions related to Thurston's theory of branched coverings of the sphere can be answered explicitly.

Renormalization theory occupies a central place in modern Complex Dynamics. The progress in understanding the structure of the Mandelbrot set, polynomial Julia sets, and Feigenbaum-type universalities stems from renormalization techniques. Renormalization of circle maps and rotation domains, such as Siegel disks, can be understood in the context of the classical KAM theory. Corresponding phenomena in higher dimensions, such as universal scaling in area-preserving maps in 2D, on the boundary of KAM, pose a challenging problem. A survey by H. Koch and several other papers in the volume will introduce the reader to this direction of study.

Titles in this series are co-published with the Fields Institute for Research in Mathematical Sciences (Toronto, Ontario, Canada).


text:
## Sunday, 2 February 2014

### Its only a matter of "Perspective"

We all have our own different way of looking at situations in life. Not only are there inter class variations, i.e differences between separate individuals, but there are significant intra class variations also, i.e the opinion of an individual is a function of time. The question is why?

Though I don't expect you to ask me for my opinion, I will give it anyway. Well my best guess is that these variations are manifestations of changes and differences in our position in the larger social structure that we are a part of and the unique path that each of has chosen that lands us all in different positions in the frame of reference of the situation. This mapping from our individualism to our take on any problem is highly nonlinear which renders us incapable of seeing others' viewpoint, unless of course, we are really good regressors. By the way you are a geek if you got that joke :p

The situation is quite similar when we are dealing with images. Today we are going to look at how to see an image from different perspectives. Consider a situation where your friend took a photograph standing at a point facing north-north-east. But you really want to see what the image looks like when you are facing north. Theoretically any two planes in 3-D space are related by a transformation known as a Homography and you can always do such a transformation. But before we dig our teeth into Homography we need to understand Perspective projection which is the most widely used model for representing image formation in a camera. Take a look at the schematic below:

 Perspective projection in camera

The above image tells you two things- first that I probably copied it from some Spanish website and secondly it tell us how we can model image capture of a 3-D point onto the image plane. Consider $F_c$ as the origin of the world's 3-D coordinate system. The plane $z=f$  is the image plane on which the 3-D scene is projected. For example a point P with world coordinates $(X,Y,Z)$ is projected to a point $(u,v,f)$ in the image plane. The relation between $P$ and its projection on the image plane is staring us in the face

$\frac{X}{Z}=\frac{u}{f}\;\;\;\; \frac{Y}{Z}=\frac{v}{f}$

Clearly the vectors $(X,Y,Z)$ and $(u,v,f)$ are equal up to a scale factor. Which brings us to the notion of homogeneous coordinates. This encapsulates the idea that as long as we know the ray passing through a point we can always choose our image plane by fixing $f$, the focal length. Coordinate $P$ is represented in homogeneous coordinates by

$\tilde{P}=(\frac{X}{Z},\frac{Y}{Z},1)$

Also note that the homogeneous representation of P and that of its projection are equal. You must have guessed by now that there is some relation between the pixel indices and the homogeneous coordinates. While this relation depends on the application, we shall look at one possible interpretation. In images, pixels are usually indexed from the top-left corner. So first we need to normalize the indices so that they lie between $[-1, 1]$ along the larger dimension. This is done by a simple operation

$S=max(Height, Width) \\ u=\frac{2i-Width}{S} \; \; \; \; v=\frac{2j-Height}{S} \\ \tilde{p}=(u,v,1)$

If at all it is required to change the image plane (which is equivalent to changing the scale), as in the case of Automatic Panorama Stitching, then we multiply the homogeneous coordinates by  a projection matrix

$\tilde{p}_0=\begin{bmatrix} f & 0 & 0 \\ 0 & f & 0\\0 & 0 & 1 \end{bmatrix} \times \left[ \begin{array}{c} u \\ v \\1 \end{array} \right] = K\tilde{p}$

For our purpose $K$ is simply a $3\times 3$ Identity matrix.

Now coming back to our objective, i.e looking at a photograph taken by your friend in the North-North-East direction from the "perspective" of a person facing North, let us assume that the image taken by your friend is this

 Image taken by your friend facing NNE

In order to understand the problem let us look at our coordinate system in a little detail

I hope this schematic does freak you out, because I spent a hell lot of my time making it :p. But its not all that complicated to understand. So first we need to understand that we are dealing with 3 coordinate systems here:
1) Global frame of reference, denoted by $[x,y,z]$, in which we know the positions of the two cameras
2) Frame of reference of your friends camera, denoted by $[x_1,y_1,z_1]$, in which we know the positions of each of the pixels on the image plane. A point in the "Global" frame of reference could be mapped to this coordinate system using a linear mapping

$\left[\begin{array}{c} x_1 \\ y_2 \\z_3 \end{array} \right] =R_1 \times \left[\begin{array}{c} x \\ y \\z \end{array} \right]$

where $R_1$ is a $3\times 3$ rotation matrix. You can use any of the representations of rotation matrix but in my code I've used the axis-angle representation in which one needs to specify the axis of rotation $\hat{n}$ and the angle of rotation $\theta$. Since any rotation matrix is orthogonal, the inverse mapping is as simple as

$\left[\begin{array}{c} x \\ y \\z \end{array} \right] =R_1^T \times \left[\begin{array}{c} x_1 \\ y_2 \\z_3 \end{array} \right]$

In our case the rotation matrix $R_1$ is parameterized by
$\theta=\frac{3 \pi}{2} \; \; \; \; \hat{n}=[0,1,0]$
3) Frame of reference in which we want to visualize the scene captured by our friend. This is marked by $[x_2,y_2,z_2]$. Rotation matrix $R_2$ for this coordinate system is similarly parameterized by
$\theta=\frac{11 \pi}{8} \; \; \; \; \hat{n}=[0,1,0]$

So now that we have gotten that out of the way, the question that we must answer is what is the transformation from our friends image plane to ours? The answer is now pretty simple and is known as a Homography
\begin{align}
\tilde{p_N}&=\alpha K_N R_N R_{NNE}^TK_{NNE}^{-1}\tilde{p}_{NNE} \\
&= \alpha H\tilde{p}_{NNE}
\end{align}

Note that the factor $\alpha$ is there simply to account for the fact that two homogenous coordinates are equal as long as they differ only by a scale factor.

That was as far as the theory goes. Now, there are two ways of practically doing this transformation - forward warping and inverse warping with one of them emerging as a clear winner.

Forward Warping
In this procedure each pixel is first normalized as discussed earlier and then transformed using the Homography matrix. But when we convert the homogeneous coordinates back to the pixel coordinates, there is no guarantee that we get integral values. On the contrary, most of the points would lie some between the integer valued pixels.
 Source: Marco Zuliani's lectures on Image Warping at UCSB
One way to deal with this problem is to round off the coordinates to integer values. This as you can imagine would result in multiple intensity values from the original image being mapped to the same pixel in the new image while leaving some holes in the new image where no intensity value got mapped. Look at the following example to see what I mean
 Forward warped image blatantly showing the problem of holes
Another possible solution could be to assign each integral coordinate the pixel intensity which is nearest to it. Though I haven't tried it out, according to literature, while the holes would fill up, the image starts displaying effects of aliasing. This brings us to our other alternative Inverse Warping.

Inverse Warping
In this method we do an inverse mapping to project each point in the target grid on the source grid, i.e the image plane of our friend. Then the pixel intensities are chosen based on a bilinear interpolation from the neighbouring pixels. Sounds complicated, right! Yes it is........No, I am kidding....its simple. Just look at the image below and go through the description. Then kick yourself if you don't get it right the first time :p

 When inverse mapping land you in a non-integer coordinate point
Say, the inverse homography landed you at a non-integer coordinate point $(p,q)$ in your friends image. The intuition is that the pixel intensity at this point should be a linear combination of the intensities at the corners with closer corners getting a higher weight in proportion to the closeness to this point. Thus the intensity at  $(p,q)$ is given by
\begin{align}
I=(1-\Delta x)(1-\Delta y) I(x,y) + (1-\Delta x)(\Delta y) I(x,y+1) \\
+ (\Delta x)(\Delta y) I(x+1,y+1) + (\Delta x)(1-\Delta y) I(x+1,y)
\end{align}

Now behold the beauty of this beast

 Brilliance of Inverse Warping
Isn't this a beauty!! You've got to admit this is kinda wicked :D....no ugly distortions....no holes....I feel like an artist looking at his creating. Nah...Lets scrap the sentimental talk.

Not only can you do such simple transformations, but more complicated transformations as well for example feast your eyes on the following results

 A more interesting Homography using Forward Warping

 The more interesting Homography using Inverse Warping
I would urge my readers to understand that while we are defining the Homography manually here , most applications such as Panorama Stitching requires the estimation of Homography using some matching keypoints in different images such as those given by SIFT descriptors. This knowledge renders much of the process discussed above unnecessary but of  course Homography estimation brings other challenges with itself. However, I feel that this exercise that we went through is particularly informative and useful to get a sense of what's going on.

Code shall be uploaded soon, it needs some serious cleaning and commenting to be useful to anybody :p