text:
# How to teach calculus (book recommendation)

I'm going to teach calculus for the first time to undergraduate students. I would like to know if there is some book about how to teach the concepts of calculus (e.g. limits, derivatives, etc.).

• I don't have a book to recommend, but I would be happy to chat with you about it, and share resources. – Sue VanHattum Jul 31 '15 at 21:30
• Look at all the calculus textbooks you can get your hands on. Some of them will have ways of explaining things that you've never seen before that will be instructive. – Alexander Woo Jul 31 '15 at 23:35
• I didn't mean buying any books. Many of your more experienced colleagues wherever you are will have a half dozen different calculus textbooks on their shelves and be quite happy to lend them to you. – Alexander Woo Aug 1 '15 at 1:16
• I'm going to check out some of these suggestions myself. Thanks, all. user26832, you might want to make a profile with a name, so people will know who you are. You can email me at mathanthologyeditor @ gmail. – Sue VanHattum Aug 1 '15 at 21:33
• Joseph, what do you admire about his teaching? (What makes him a master teacher?) – Sue VanHattum Aug 1 '15 at 23:55

There are so many Calc 1, 2, and Multi video lectures online now. Watch a few... take notes on what you think are some good traits of the person teaching. MIT's Calc course (super fast) might be helpful if you're teaching that style and speed.

Some resources

1. This text, How to Teach Mathematics - S. Krantz, has many useful guides for the beginning person. I don't agree with all, but it's a great resource.
2. Suzanne Kelton wrote a guide for the AMS. Its pdf is here: teaching Mathematics at the college level - pg. 31 goes into Calc stuff!
3. Also, do not be ashamed to search for AP Calculus teachers' resources. It may be a "high school" course, but some of the teachers out there are amazing and offer a lot of guidance. Specific topic choice may vary but good teachers are that no matter what. Lin McCullin's website is an prime example. Watch those videos yourself from his site :) Ignore test-specific things. Pedagogy!
4. If you are in the US, go to your MAA sectional meeting in the Fall!
5. Please, please, please incorporate technology as a reasonable tool that you actually teach how to use in the right situations. This is vital and super valuable.

Numbers and Functions: Steps into Analysis, R.P. Burn, Cambridge University Press, ISBN 0 521 78836 6.

This book takes a constructivist approach to the subject. It takes the form of a sequence of problems, introducing the key ideas step by step.

In his preface Burn identifies common problems student often encounter: the apparently needlessly formal approach of topics that are familiar from school as well as the insistent use of arbitrary and contrived definitions. Accordingly the book builds on high school concepts and naturally introduces key definitions.

Personally it saved me in my first year of uni.

Below is a review from 'The Mathematical Gazette'

http://www.jstor.org/stable/3621803?seq=1#page_scan_tab_contents

Mathematics should essentially be fun to do and to read and I think that generally students only love to do those things which interests them. So, one basic (and I think mandatory) component of your teaching should be about making the subject interesting for the students.

Presuming that by Calculus you mean Real Analysis I have the following suggestions for you.

• First, let the students feel themselves the importance of a rigorous study of calculus. For this, I think that the introductory chapters of Tom M. Apostol's Calculus I and Terence Tao's Analysis I are two excellent references. Also I would like to recommend reading the last three sections of Part II of the book The Princeton Companion to Mathematics.

• Second, when you will be giving assignments to your students try to be scientific in choosing the problems. To be precise, I don't recommend giving difficult (it's a relative term, though) problems to the beginners, nor do I recommend giving a set of problems which doesn't have any relation(s) among them. Though, it's difficult to express precisely what I mean by the above statements, I will nevertheless try to give an example which is intended to make the matter a bit more clear.

Consider the following problems,

1. Let $f:\mathbb{R}\to\mathbb{R}$ be a continuous function such that $f(x)=0$ for all $x\in\mathbb{Q}$. Show that, $f(x)=0$ for all $x\in\mathbb{R}$.

2. Let $f:\mathbb{R}\to\mathbb{R}$ be a continuous function. Let $T=\left\{\dfrac{m}{2^n}\mid m,n\in\mathbb{Z}\right\}$ such that we have $f(x)=0$ for all $x\in T$. Can we say that $f(x)=0$ for all $x\in\mathbb{R}$?

3. Let $f:\mathbb{R}\to\mathbb{R}$ be a continuous function. Let $S=\left\{\dfrac{a}{2^n}\mid a, n\in\mathbb{Z}\right\}$ ($a$ is a constant) such that we have $f(x)=0$ for all $x\in S$. Can we say that $f(x)=0$ for all $x\in\mathbb{R}$?

These problems have a very curious property. To solve the first problem, you need to show that $\mathbb{Q}$ is dense in $\mathbb{R}$. The second problem you need to show that a certain subset of $\mathbb{Q}$ is dense in $\mathbb{R}$. Finally, the third problem asks you to prove that a subset of the subset of Problem 2 is dense in $\mathbb{R}$. So you can see that the first problem is follows from the second one, whereas the second problem follows from the third one. Can you appreciate the order in which the exercises are arranged ? Can you intuitively grasp what I meant in the above lines ?

• Third, make your students familiar with some basic ideas of Mathematical Logic at the very beginning. For example, the concept of conjunction, disjunction, negation etc.

Finally, I think that for teaching calculus L. V. Tarasov's book Calculus: Basic Concepts for High Schools is an invaluable guide.

• Calculus = Real Analysis is a foolish assumption to make in America,sadly. These are all good recommendations for an honors course at a typical university,but not much else. – The Mathemagician Feb 25 '18 at 19:34


text:
# Cos sin problem?

• February 4th 2009, 07:16 PM
view360
Cos sin problem?
Hello. I have a test tomorrow and I'm not sure in one area.

$<\cos \theta, \sin \theta> \cdot <\cos (180+ \theta), \sin(180+ \theta)>$

Explain why the value does not depend on the value of $\theta$.

Could someone please talk me through this step by step? thanks.
• February 4th 2009, 07:19 PM
Jhevon
Quote:

Originally Posted by view360
Hello. I have a test tomorrow and I'm not sure in one area.

$<\cos \theta, \sin \theta> \cdot <\cos (180+ \theta), \sin(180+ \theta)>$

Explain why the value does not depend on the value of $\theta$.

Could someone please talk me through this step by step? thanks.

here's something you probably never thought of, take the dot product. what do you get?
• February 4th 2009, 07:23 PM
view360
Quote:

Originally Posted by Jhevon
here's something you probably never thought of, take the dot product. what do you get?

$<\cos \theta \cos(180+\theta), \sin \theta \sin(180+ \theta)>$
• February 4th 2009, 07:28 PM
Jhevon
Quote:

Originally Posted by view360
cos $theta$cos(180+ $theta$), sin $theta$sin(180+ $theta$)

that's not the dot product

$\left< a,b \right> \cdot \left< c,d \right> = ac + bd$
• February 4th 2009, 07:30 PM
view360
$\cos \theta \cos(180+ \theta) + \sin \theta \sin (180+ \theta)$?

btw is this really calc? I'm only a freshman, isn't calc a much more advanced class?
• February 4th 2009, 07:34 PM
Jhevon
Quote:

Originally Posted by view360
cos $theta$cos(180+ $theta$) + sin $theta$sin)180+ $theta$)?

yes, now recall that $\cos (A - B) = \cos A \cos B + \sin A \sin B$

Quote:

btw is this really calc? I'm only a freshman, isn't calc a much more advanced class?
yeah, you're right. i was tutoring calc 3 today and we were working with dot products, so my mind automatically filed this under calculus :p i'll have it changed.
• February 4th 2009, 07:41 PM
view360
Quote:

Originally Posted by Jhevon
yes, now recall that $\cos (A - B) = \cos A \cos B + \sin A \sin B$

yeah, you're right. i was tutoring calc 3 today and we were working with dot products, so my mind automatically filed this under calculus :p i'll have it changed.

Sorry if I sound stupid lol, but i'm not making any connections between the two?
• February 4th 2009, 07:44 PM
Jhevon
Quote:

Originally Posted by view360
Sorry if I sound stupid lol, but i'm not making any connections between the two?

replace A with $\theta$ and replace B with $180 + \theta$

do you see it now?
• February 4th 2009, 07:51 PM
view360
Quote:

Originally Posted by Jhevon
replace A with $\theta$ and replace B with $180 + \theta$

do you see it now?

Oh okay, so it equals cos(A-B), which if you replace it, equals cos(theta-180+theta). So it ends up just equaling cos180, the theta doesn't change that. But why is A = $\theta$ and B $180 + \theta$?

format: plain


text:
# $e^{1/z}$ and Laurent expansion

$e^\frac1z$ is not holomorphic at $z=0$, but it is known it can be expanded as $$e^\frac1z=\frac1z+\frac1{2!z^2}+\frac1{3!z^3}+\cdots$$ The coefficients of this Laurent expansion are computed the same way as Taylor's. The question is how is that possible? If function is not holomoprhic at $z=0$, then it's not true that it is holomophic at $|z|<R$ and Taylor's coefficients can not be used. Please someone explain.

-
Use the power series for $e^w$ and set $w=1/z$, knowing that it is invalid for $z=0$. Then use the uniqueness of the Laurent series. – wj32 Nov 6 '12 at 2:47
Taylor series is always an analytic function throughout its disk of convergence. Laurent series is a generalization of Taylor series for functions with singularities. It just turn out that Laurent series looks like Taylor series in this case. – glebovg Nov 6 '12 at 3:14
They are not Taylor coefficients. If $f(z)=e^{1/z}$, then $f^{(k)}(0)$ does not exist for $k\geq 0$. What is it that doesn't seem possible? There is a general integral formula for Laurent series coefficients, but they are instead often found using some other known series, like in this case, where $f(z) = a_0 + a_1z +a_2z^2+\cdots$ is valid for all $z\in\mathbb C$, and it follows that $f(1/z)= a_0 + a_1/z +a_2/z^2+\cdots$ is valid for $z\neq 0$. Your $a_0$ should be $1$. – Jonas Meyer Nov 6 '12 at 4:26
Can someone point me somewhere that derives the exponential series without using taylor series formulae? – bianchira Nov 18 '14 at 2:25

In general for $f$ entire, $$f(z)=a_0 +a_1z+a_2z^2+\ldots$$

From Cauchy's integral formula we have that $a_k=\frac{1}{2 \pi i} \oint_\gamma\frac{f(z)}{z^{k+1}}dz, \ k=\in \mathbb{Z}$ where $\gamma$ is the unit circle centered at zero($a_k=0$ for $k<0$).

The function $g(z)=f(\frac{1}{z})$ is analytic in $\mathbb{C}-\{0\}$ with Laurent series about zero $$g(z)=\ldots + \frac{b_{-2}}{z^2}+\frac{b_{-1}}{z}+b_0 +b_1z+b_2z^2+\ldots$$ with $b_k=\frac{1}{2 \pi i} \oint_\gamma\frac{g(z)}{z^{k+1}}dz, \ k=\in \mathbb{Z}$ where $\gamma$ is the unit circle centered at zero.

With substitution $z=\frac{1}{u}$ we get $b_k=\frac{1}{2 \pi i} \oint_\gamma\frac{g(\frac{1}{u})}{u^{-k-1}u^2}du=\frac{1}{2 \pi i} \oint_\gamma\frac{f(u)}{u^{-k+1}}du=a_{-k}.$

Therefore

$$g(z)=\ldots + \frac{a_{3}}{z^3} + \frac{a_2}{z^2}+\frac{a_1}{z}+a_0.$$

Or as wj32 said since $f(z)=a_0 +a_1z+a_2z^2+\ldots, \ \forall z \in \mathbb{C}$ we have $g(z)=f(\frac{1}{z})=\ldots + \frac{a_{3}}{z^3} + \frac{a_2}{z^2}+\frac{a_1}{z}+a_0 , \ \forall z \in \mathbb{C}- \{0\}$. From uniqueness of Laurent series this is the Laurent expansion of $g$.

-

I'm pretty sure most of former answers didn't get the key point.

The Laurent series expansion is defined on a "deleted neighborhood" around a singularity, in this case, $\{z: 0<\lvert z-0\rvert< R \}$. In this deleted neighborhood, $e^{1/z}$ is analytic. So for any point in this neighbourhood, we can expand $e^{z}$ first and then substitute $1/z$ in.

As you can see in the Laurent expansion you gave, you can plug in any $z$ arbitrarily close to zero, calculate the infinite sum, and get a finite and well defined value. The laurent series doesn't give any information about the behavior of a function "on" its singularities.

-


text:
# String tokenizer

### Objective:

• Create a function called wordsAndSpaces that splits a string on groups of spaces, preserving each group of space characters as a single token.
Example: wordsAndSpaces "extra spaces" gives ["extra", " ", "spaces"]

### Rules:

• Input strings will contains only alphanumeric characters and space characters (no need to handle special characters)
• Only Prelude functions are allowed (no imports e.g. Data.List.Split)

### Notes:

• I'm looking specifically for feedback on how I can break thought patterns I have developed from working in imperative languages. My code likely has the telltale signs of a recovering Java programmer :)
wordsAndSpaces :: String -> [String]
wordsAndSpaces = wordsAndSpaces' []

wordsAndSpaces' :: [String] -> String -> [String]
wordsAndSpaces' tokens [] = tokens
wordsAndSpaces' tokens (char : xs)
| shouldAddToLastToken char tokens = wordsAndSpaces' (addToLastToken char tokens) xs
| otherwise = wordsAndSpaces' (tokens ++ [[char]]) xs

shouldAddToLastToken :: Char -> [String] -> Bool
shouldAddToLastToken c tokens
| null tokens = False
| otherwise =
(isSpace c && (isSpace . last . last) tokens)
|| ((not . isSpace) c && (not . isSpace . last . last) tokens)

addToLastToken :: Char -> [String] -> [String]
addToLastToken char tokens = init tokens ++ [last tokens ++ [char]]

isSpace :: Char -> Bool
isSpace = (== ' ')

## 1 Answer

The big thing that jumped out to me was how you seem to be treating Haskell lists like Java... Arrays? (I haven’t used Java since... 2006?) If you’re repeatedly fiddling with the elements at the end of lists, you’re probably doing something wrong. I’m not sure what the complexity of this all is, but I think it might be something like $$\\mathcal{O}(m^2n^2)\$$ where $$\m\$$ is the length of the original string and $$\n\$$ is the number of tokens. Haskell lists are linked lists, finding arbitrary elements (of which the last is one) is an $$\\mathcal{O}(n)\$$ operation, as is appending any element to the tail of a list (++).

I think largely as you gain familiarity with the Prelude you’ll begin to intuit the shape of efficient Haskell algorithms. Now that’s not to say Haskell doesn’t also have arrays, but we tend to use them differently. (How exactly that is being way out of the scope of this question.)

In this case the concept you're looking for is a span. That is, the part of a list at the front that matches a predicate, and then the rest. In this case we care about the predicates isSpace and not . isSpace.

-- REPL session, if you're not familiar with REPLs yet coming from Java, check out GHCi
> span isSpace "   word word"
("   ","word word")
> span (not . isSpace) "wordword    word word"
("wordword","    word word")

span is in the Prelude, but it’s worth taking a crack at implementing it yourself to start building an intuition for living in Linked List World. Try it before you move on and I start to really blow your mind.

Here’s a solution using span. Spoiler’d so you can figure it out first.

wordsAndSpaces :: String -> [String]
wordsAndSpaces [] = []
wordsAndSpaces cs@(c:_) = case isSpace c of
True  -> let (w, rest) = span isSpace cs  in w : wordsAndSpaces rest
False -> let (w, rest) = break isSpace cs in w : wordsAndSpaces rest
-- break p = span (not . p), just a convenient name

In that solution you might notice how both tines of the fork (as it were) are very, very similar. Generally this is a hint that a handy library function exists or there’s some common trick that has a deeply unintuitive category theoretical name and/or requires a flash of abstractly reasoned insight to recognize. Luckily in this case you would just have to know about Data.List.groupBy :: (a -> a -> Bool) -> [a] -> [[a]].

Coming from outside the Prelude groupBy doesn’t fit your criteria for usage in this practice problem, but as with span it’s something worth knowing for the way we think about decomposing problems. If you didn’t immediately understand what groupBy is or does from its type, that’s more than alright for a beginner, but give it a think before reading on.

groupBy breaks a list into sublists based on which stretches of values are like one another. This probably makes most sense when you look at an example.

> groupBy (==) [1,1,2,2,2,3,4,5,5,5,5]
[[1,1],[2,2,2],[3],[4],[5,5,5,5]]

groupBy :: (a -> a -> Bool) -> [a] -> [[a]]
isSpace :: (a      -> Bool)

So the question is, how do we turn the unary predicate isSpace into a binary predicate to pass to groupBy? The first step to recognize is that the Bool return values mean different things. isSpace says whether or not a character is a space, groupBy’s predicate is asking whether two things are the same. So we can test the result of isSpace on two elements for equality.

predicate :: Char -> Char -> Bool
predicate c d = isSpace c == isSpace d

But it turns out we even do that so frequently that there's a name for it also, Data.Function.on :: (b -> b -> c) -> (a -> b) -> a -> a -> c. Used like—

predicate = (==) on isSpace

on takes a binary operation (b -> b -> c) and a unary operation (a -> b) and lifts the binop to work on as, whatever those may be. groupBy is a good example, sorts are another where you might do something like compare on color, if color had a type like Shape -> Color. We would like to sort Shapes by Color, so you use a higher order function (on) to build a function to do that! Try to implement on.

So, here's how a Haskeller would write wordsAndSpaces.

wordsAndSpaces = groupBy ((==) on isSpace)

With that (probably, hopefully, shocking) motivating example, now try to write groupBy. Think back to the solution using span, consider its symmetries, and try to go one level up the abstraction stack. Ultimately Haskell coding is about solving the smallest part of a problem that you can, recognizing which higher order function can plumb that into solving a slightly larger problem, then repeating that process over and over again until you reach the end.

In this case (though I’ve kind of meandered), first we had to have figured out how to say whether or not something is a space. Next you figure out identifying a single stretch of spaces or not-spaces. Then the trick is categorizing all of the maybe-or-not-spaces. Each step in the path is something small and tackle-able on its own, and we try to consider the most general possible solution to it so that we don't have to think about the whole problem at once.

• I really like how you described the method of tackling problems in Haskell -- start with something simple and concrete, then plug those simple solutions into higher order functions until you get the generalized solution! You have a great teaching style -- thank you for sharing principles, and not just code Apr 4 '21 at 22:13


text:
# Thread: Find the volume generated by rotating the given region about the specified line?

1. ## Find the volume generated by rotating the given region about the specified line?

2. Using the washer method, the volume of revolution about the x-axis is:

$V_x=\pi\int_0^1 (x-x^6)dx$

You can do the volume around the y-axis:

$V_y=\pi\int_0^1\bigg(g(y)^2-h(y)^2\bigg) dy$


text:
# How can I systematically detect unknown barcode/adapter sequences within a set of samples?

I have often downloaded datasets from the SRA where the authors failed to mention which adapters were trimmed during the processing.

Local alignments tend to overcome this obstacle, but it feels a bit barbaric.

fastQC works occasionally to pick them up, but sometimes fails to find the actual adapter sequences.

Usually, I ended up looking up the kits they used and trying to grep for all the possible barcodes.

Is there a more robust/efficient way to do this?

• This doesn't answer your question, but I hope there is a possibility to report such problems to SRA so that they ask the authors to publish the missing information. – bli May 31 '17 at 10:24
• Why do you feel that local alignment is a bit barbaric? It should be the default method in this day and age, unless you’re working with smallRNA sequencing. I tend to trim adapters to be on the safe side but I did lots of work without bothering, and just relying on local alignment. – Konrad Rudolph May 31 '17 at 11:01

The minion utility from the kraken/reaper toolkit may be helpful for this: http://wwwdev.ebi.ac.uk/enright-dev/kraken/reaper/src/reaper-latest/doc/minion.html

• This looks like exactly the right type of tool. Although too bad it was designed mainly for the 3' end adapter. I wonder if you could just flip all your reads and apply it to the 5' end. – story Jun 2 '17 at 14:43

You mention that FastQC "fails to find the actual adapter sequences" - I guess you mean in the Adapter Sequence Contamination plot. However, the kmer and Sequence Content Plots are often useful even when the former fails. I've used these in the past - you can sometimes just read off the adapter sequence from the start of the Sequence Content Plot (or at least see how many bases to trim).

I'm not aware of any existing methods to do this, but here are a couple of ideas about how it might be done:

Canu has a method of adapter trimming which involves looking for the absence of overlap for reads. If there are no other reads which share sequence across a particular region, then the read is broken up at the point of low coverage, and small pieces are discarded. It would be possible to use a method like this to hunt for possible adapter/barcode sequences by preserving the short reads.

Another option is to do a kmer search at the start of reads, and see if any of the high-abundance kmers can be assembled together and/or matched to existing known adapters or barcodes.

If you happen to know a sequence that should be highly abundant in the library, you can grep its beginning or end (with pattern match highlighting) and see if the same sequence systematically comes just before or just after respectively. This kind of visual inspection can help you finding the adaptor.

For instance, in a previous lab, we were working on D. melanogaster small RNA sequencing data and my colleague knew from previous experience with this kind of data that the following small RNA was likely to be abundant: http://flybase.org/reports/FBgn0065042.html

We just had to grep it in the fastq file to see many lines with this sequence, next to another sequence that happened to be always the same: the unknown adapter.

• May I know the reason of the downvote? I've seen this method applied in a case of small RNA-seq, where one highly abundant sequence was expected. Visually inspecting the output of grep of this sequence (with pattern highlight) gave a very good hint of what the adaptor was (the non-highlighted part). – bli Jun 1 '17 at 12:29
• The question is asking about how to detect unknown adapter sequences, so the OP will not know about abundant sequences in advance. That's kind of the point of the question... – ewels Jun 2 '17 at 7:49
• @tallphil I don't see the link between not knowing the adapter and not knowing of an abundant sequence expected to be present in the data. If I remember well, in the example I mention in my comment, my colleague knew from previous experience with this kind of data that the following small RNA was likely to be abundant: flybase.org/reports/FBgn0065042.html We just had to grep it in the fastq file to see many lines with this sequence, next to another sequence that happened to be always the same: the unknown adapter. – bli Jun 2 '17 at 8:04
• Actually I just re-read your post and now I see what you meant. This is a reasonable idea. However, I think you explained it poorly in the sense that a reader might be confused and think you meant that searching for the most abundant sequence might come up with the barcode. You should have specified that the "abundant sequence" in this case was a known nucleic acid sequence that would be expected to have adapters ligated to one or both ends. – story Jun 2 '17 at 14:36
• I tried to clarify my explanations. – bli Jun 3 '17 at 9:10


text:
# A Brief Stata Primer, with Mata and Linear Algebra

Here I briefly introduce the use of matrix algebra manipulations and maximum likelihood programming in Stata. Other software packages are arguably more adept for these tasks, but in this class we’ll focus on stata as the tool for all of our work. If you prefer to do you work in other mathematical packages (e.g. S Plus, Matlab, etc.) you are free to do so.

# Basic Stata Commands

## Getting Help

If you need to find general help in stata, type
help command
where command is some stata command. You can also do keyword searches
search keyword
To see the same set of results in a better help viewer, type
view search keyword
for example
view search reg

## Loading Data

### Loading Stata Datasets from the Web

For all of our class excercises, we will be using datasets on my website. These are easily accessed from within stata. For example, suppose you want to use the file mroz.dta that is used in the first problem set. To load this file, issue the command
webuse set http://rlhick.people.wm.edu/econ407/data/
followed by
webuse mroz
You will then have the file loaded into stata. My files are read-only, so if you plan on making changes, you should immediately save these locally so your changes to the data persist through time.

### Loading stata files stored on your hard disk

Suppose you have the file mroz.dta on your personal computer in a directory called /some/place. To load this file into stata, issue the command
use "/some/place/mroz"
(for mac/unix and the data will be loaded. For windows, if the file is in a directory \some\place, simply reverse the slash characters.

### Loading text files stored on your hard disk

Suppose you have the file mroz.csv on your personal computer in a directory called /some/place. To load this file into stata, issue the command
insheet "/some/place/mroz.csv"
(for mac/unix and the data will be loaded. For windows, if the file is in a directory \some\place, simply reverse the slash characters.

## Creating and Modifying Variables

The command
gen ln_gdp=log(gdp)
will generate the natural log of gdp for each row in your dataset. Beware of missing value warning messages.

Once a variable is created, it can be modified using the command
replace ln_gdp=ln_gdp+1
Conditional commands are also possible. Suppose you want to create a dummy called old =1 only if age is greater than 60 and otherwise zero. You can do this using conditional statements
gen old=1 if age>=60
followed by
replace old=0 if age<60

## A better way to create dummy variables

Suppose a variable x takes on the values 1,2, or 3. To create categorical (dummy) variables for each value, use
tab x, gen(dum_x)

## Starting Over

Sometimes, you want to get rid of all the variables for a new analysis, or simply to start over. To do this, use the
clear command

## Log Files

A very useful way to save your results is have stata automatically put everything in a log file. To initialize a log file and use it, issue
log using "/some/place/my_first.log", replace txt
Will create (or if it exists, will replace) the file my_first.log in the folder /some/place. If you don’t won’t to replace your existing work, use this command instead
log using "/some/place/my_first.log", append txt
And all of your results will be appended to the log file. When you are finished for a stata session, issue the command
log close
to close the file and save all changes. You may then open it using the text editor of your choosing.

## Do Files

Do files allow you to put all of the relevant stata commands for a project into one file, so that results can be easily replicated from one stata settion to the next. The use of do files are highly recommended for your own work, and are a required part of your assignments in the course. I will illustrate their use early in the class.

# Linear Algebra in Stata1

Stata has a linear algebra environment that can be started using the
mata
command from the stata command line. Notice, when you type mata from the stata command window, the command prompt changes from a . to :. This is really your only way of distinguishing if you are in the mata or stata environment. Once you have finished using mata you can return to the normal stata environment by typing
end
Commands for mata may also be nested inside of stata do files (command files) so long as all mata commands are between the commands
mata
and
end

## Getting Help

If you need to find general help on mata, type
help mata command
where command is some mata command. You can also do keyword searches
search mata keyword
To see the same set of results in a better help viewer, type
view search mata keyword
for example
view search mata inverse

## Creating matrices, vectors, and scalars

There are two ways to create a matrix. Consider a two by two matrix,
A=(1,2 \ 3,4)
will give you

$\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}$

Or, you could create an empty matrix of the desired dimension
B=J(2,3,.)
where $B$ is of dimension rows=2 and columns=3. To fill it element by element use
B[1,1]=5
B[1,2]=6
B[1,3]=7
B[2,1]=8
B[2,2]=9
B[2,3]=10
To display your matrix, type
b

### Building a matrix from submatrices

Suppose you have the matrices A to D defined as
A=(1,2 \ 3,4)
B=(5,6,7 \ 8,9,10)
C=(3,4 \ 5,6)
D=(1,2,3 \ 4,5,6)
The matrix $E=\begin{bmatrix}A & B \\ C & D \end{bmatrix}$
can be constructed by
E=(A,B \ C,D)
to yield

$\label{eq:ps1_question} \begin{bmatrix} 1&2&5&6&7 \\ 3&4&8&9&10 \\ 3&4&1&2&3 \\ 5&6&4&5&6 \end{bmatrix}$

### Creating Vectors

Row and column vectors can also be created using the same basic syntax:
f=(1,2,3)
is

$\begin{bmatrix} 1 & 2 & 3 \end{bmatrix}$

or, a column vector can be created by
g=(3\ 4 \5)
The special commands
id=(1::100)
and
id=(1:100)
are useful for constructing row and column vectors, respectively of incremented integer values between 1 and 100 (e.g. $1,2,3,\ldots,99,100$).

### Creating Scalars

These are easy. Simply define a scalar by
u=3

### Creating a vector of zeros or ones

Suppose we have 1000 observations and we wish to create a column of ones (this is especially useful for estimating a constant term), use this command
ones=J(1000, 1, 1)
This command can be combined with what we have previously to create the fully matrix of independent variables (with the constant in the first positions) using
X=(ones=J(1000, 1, 1),x)
so long as your matrix of independent variables has 1000 rows.

### Creating the Identity Matrix

The command
I(1000)
will create an identity matrix with 1000 rows.

## Stata datasets in Mata

Once you have loaded data into stata (.dta or .csv files), it is easy to access that information from within mata. For example, suppose we use the stata sample dataset, auto.dta accessed by
webuse auto.dta
There are generally two ways to get your .dta stata data into mata. One can copy the data or one can create a view that always refers back to the original stata dataset. Views are useful if you want to modify the data in mata and then return to stata with the original dataset changed based on operations in mata, while copying the data is both faster and requires less memory. If you need to do all your work in mata and don’t need to change any of the underlying .dta data, I recommend the copy method. The command is
X=st_data(.,.)
copies the entire currently loaded stata database into mata, while
X=st_data(.,("mpg","rep78","weight"))
copies the all rows and only the three variables listed (columns) into X. It is also possible to copy in only a subset of rows and columns as
X=st_data((1::5,7::9),("mpg","rep78","weight"))
copies in rows 1 to 4 and 7 to 9 with the three variables into X. Remember, once you end the mata session, all changes to the data following an st_data command are lost. The st_view command has identical syntax to st_data and will allow for changes to be preserved once back in stata. In this course, it is sufficient to use the command
X=st_data(.,.)
to load data into mata.

## The mata workspace

The command
mata describe
will list all the matrices, vectors, and scalars currently defined. To delete all of these, issue
mata clear
To delete only a few matrices, vectors, or scalars, issue
mata drop X f g

## Getting Information about your matrices and vectors

Stata offers three functions useful for checking conformability conditions. The function
rows(X) and cols(X)
return the number of rows and columns of X respectively, while
length(X)
Calculates the total number of elements in matrix X, equal to (# rows) $\times$ (# columns.)

## Important Commands

Operation Command
Transpose of B B'
Inverse of B luinv(B)
Inverse of B (if symmetric) invsym(B)
Diagonal Elements of matrix B diagonal(B)
Put vector B into diagonal square matrix diag(B)
Upper Triangular Elements of B uppertriangle(B)
Lower Triangular Elements of B lowertriangle(B)
Sort based on values in column i sort(B,i)
Sort based on values in column i and j sort(B,(i,j))
Multiplication of Matrices if missing elements cross(B,A)

## Multiplication and Addition

For matrices A and B of same dimensions, matrix addition is given by
C=A+B
Subtraction follows in a similar way. Multiplication (assuming conformability of A and B) is given by
C=A*B
Of course, combinations of these operators are possible as well. For example,
invsym(x'x)*x'y
Would be the OLS estimator we discuss in Chapter 1. There are many more functions and tools in the mata environment that I won’t describe here, but that are accessible to interested students.

# Maximum Likelihood in Stata

Under Construction.

1. This section is an abbreviated version of an excellent stata tutorial by Kurt Schmidheiny at the Universitat Pompeu Fabra, Barcelona Spain


text:
# Econometric Theory/Multiple Regression Analysis

Our first regressions (MLE and OLS) were bivariate. Our lines were simple, two variable lines. However, in most economic data, there are a multitude of possible independent things that can effect a dependent variable. So we can expand our explanatory functions to allow multiple independent variables.

Instead of our functions looking like $Y_=\alpha + \beta X_i + \epsilon_i$, our functions look like $Y_i = \beta_0 + \beta_1 X_{1,i} + \beta_2 X_{2,i} + \cdots + \beta_n X_{n,i} + \epsilon_i$

By adding more variables and data to our model, we can hopefully get a better fit and understanding of the dependent variable. However, with the added variables come added problems that will misguide our model.

## Goodness of FitEdit

When we move to the multiple regression case, our goodness of fit looks much like it previously did in the bivariate case. TSS = ESS + RSS. Our R² = ESS/TSS) = 1 - (RSS/TSS). We can still use our Coefficient of Determination, R² (R² = ESS/TSS = 1 - (RSS/TSS)), but there is a problem associated with it. R² will never decrease because of an addition of a variable, whether or not it helps us explain our dependent variable. When we add a new variable to the function, the ESS is calculated over a larger set of variables, and ESS will be greater than or equal to what we had before. This will cause our R² to increase, even if the addition of our new variable hurts our model. There is a tool to fix this problem. R² is replaced with Adjusted R² which adjusts it for the added degrees of freedom. Adjusted R² is signified by adding a bar above the 'R.'

$\bar{R^2} = 1 - (\frac{\hat{var(\epsilon)}} {\hat{var(Y)}})$

Last modified on 25 April 2013, at 16:28


text:
You go to the bank and deposit $2,500 into your savings. Your bank has annual interest rate of 8%, compounded monthly. How long would it take the investment to reach$5,000?

It would take 8 years and nine months for the investment to surpass $5,000. Explanation: The general formula for compound interest is $F V = P V {\left(1 + \frac{i}{n}\right)}^{n t}$Where $t$is the number of years the investment is left to accumulate interest. This is what we are trying to solve for. $n$is the number of compounding periods per year. In this case, since the interest is compounded monthly, $n = 12$. $F V$is the future value of the investment after $n t$compounding periods. In this case FV=$5,000.
$P V$ is the present value of the investment which is the amount of money originally deposited before accumulation of any interest. In this case PV=$2,500. $i$is the annual interest rate the bank offers to depositors. In this case $i = 0.08$. Before we start plugging numbers into our equation, let's solve the equation for $t$. Divide both sides by $P V$. $\frac{F V}{P V} = {\left(1 + \frac{i}{n}\right)}^{n t}$Take the natural log of both sides. Why the NATURAL log? Because it's the natural thing to do. Sorry, a little math humor there. In reality it really doesn't matter what base you use as long as you apply the same base to both sides of the equation. Try it with ${\log}_{\sqrt{17}}$and you'll still get the right answer. $\ln \left(\frac{F V}{P V}\right) = \ln {\left(1 + \frac{i}{n}\right)}^{n t} = n t \ln \left(1 + \frac{i}{n}\right)$Divide both sides by $n \ln \left(1 + \frac{i}{n}\right)$. $t = \frac{\ln \left(\frac{F V}{P V}\right)}{n \ln \left(1 + \frac{i}{n}\right)}$NOW we start plugging in numbers! $t = \frac{\ln \left(\frac{5000}{2500}\right)}{12 \ln \left(1 + \frac{0.08}{12}\right)} \approx 8.693$years 8.693 years is 8 years and $0.693 \cdot 12 \approx 8.3\$ months. Thus, you would have to wait 8 years and 9 months since the interest is compounded monthly.


text:
# Homework Help: GR Lagrangian (Part 2)

1. Sep 16, 2018

### Malamala

1. The problem statement, all variables and given/known data
This is a continuation of this problem. I will rewrite it here too:
The Lagrangian density for the $h=h^{00}$ term of the Einstein gravity tensor can be simplified to: $$L=-\frac{1}{2}h\Box h + (M_p)^ah^2\Box h - (M_p)^b h T$$ The equations of motion following from this Lagrangian looks roughly like (I didn't calculate this, they are given in the problem): $$\Box h = (M_p)^{a}\Box(h^2)-(M_p)^bT$$ For a point source $T=m\delta^3(x)$, solve the equation for h to second order in the source T, with $M_p=\frac{1}{\sqrt{G_N}}$ and calculate the correction to the Mercury angular frequency orbit around the sun compared to the first order approximation.

2. Relevant equations

3. The attempt at a solution
Continuing the same logic as before I write $$h=h_0+h_1+h_2...$$ where $h_0$ is first order in T, $h_1$ is second order and so on. Before, I got for the first order $$h_0=-\frac{M_p^b m }{4 \pi r}$$ Now if we go to the second order, the equation we need to solve is: $$\Box h_1 = (M_p)^a\Box(h_0^2)$$ which is equivalent to $$\Box (h_1 - (M_p)^a h_0^2) = 0$$ $$h_1 = (M_p)^a h_0^2 + f(x)$$ where $f(x)$ is such that $\Box f = \nabla f = 0$ (I replaced $\Box$ with $\nabla$ as the source is time independent). Is it ok up to now? Now first thing I am confused about, can I discard this $f$? in the equation of motion it seems like $h$ appear with $\Box$ so I think f will not affect the equations, but I am not 100% sure this is true. Now for the orbit, to first order I used $$m_{Mercury}\omega^2 r = \frac{m_{Mercury}}{M_p}(-\nabla h_0)$$ where that $M_p$ comes from the normalization (as I was told in the first post). And from here I got the first order approximation for $\omega$. For the second order, I tried the same thing (this is QFT class, so I don't think I am expected to use GR, and they ask for a rough approximation, anyway) $$m_{Mercury}\omega^2 r = \frac{m_{Mercury}}{M_p}(-\nabla (h_0+h_1))$$ However something is wrong as the correction should be very small, however, $h_1$ going like $h_0^2$, contains $m^2$ which here m is the mass of the sun so overall, the value of $h_1$ is bigger than $h_0$ which doesn't make sense for a second order correction. What is wrong with my calculations? Thank you!

2. Sep 16, 2018

### Orodruin

Staff Emeritus
Since $h_0 \ll 1$, clearly $h_0^2 \ll h_0$.


text:
# Bibliography backref on new line with smaller font size

At the moment I use

\usepackage[style=authoryear,dashed=false,
abbreviate=false,
natbib=true,backref=true,backend=biber]{biblatex}
\setlength\bibitemsep{1.7\itemsep}
\bibhang=0pt % don't ask, I'm still experimenting ;)

which outputs entries like

Eddy, Sean R (Nov. 2004). "How do RNA folding algorithms work?" In: Nature
Biotechnology 22.11, pages 1457–1458. ISSN: 1087-0156 (cited on page 1 and 3).

But ideally I'd like to have it like

Eddy, Sean R (Nov. 2004). "How do RNA folding algorithms work?" In: Nature
Biotechnology 22.11, pages 1457–1458. ISSN: 1087-0156.
(Cited on pages 1 and 3.)

with the backref line in a smaller font size. Note also the big "C" in "Cited" and the different punctuation.

Background info: I think the backref shouldn't be part of the actual main bib information as it's not an info from the article/book/whatever. Of course, the same is true for the "visited on" part but these kind of references (websites) are the exception anyway.

-

\documentclass{article}

\usepackage[style=authoryear,backref=true]{biblatex}

\setlength\bibitemsep{1.7\itemsep}

\renewcommand*{\finentrypunct}{}

\renewbibmacro*{pageref}{%
\iflistundef{pageref}
{}
%    {\printtext[parens]{% DELETED
{\newline\footnotesize\printtext[parens]{% NEW
\ifnumgreater{\value{pageref}}{1}
{\bibstring{backrefpages}\ppspace}
{\bibstring{backrefpage}\ppspace}%
%      \printlist[pageref][-\value{listtotal}]{pageref}}}}% DELETED

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@misc{A01,
author = {Author, A.},
year = {2001},
title = {Alpha},
}
@misc{B02,
author = {Buthor, B.},
year = {2002},
title = {Beta},
}
\end{filecontents}

This is a wonderful solution and exactly what I was looking for. - But it behaves a little bit faulty, at least if being used with biblatex-apa style. \addperiod always adds a period - even after additional remarks in parentheses and after URLs where no periods are supposed to be. If I comment out this line the final period vanishes but also from any other bibliography entry where it is needed. How to resolve this? – Psychic Birdy Oct 22 '12 at 20:26


text:
## Boundless: Finance: "Chapter 3, Section 10: Considering Inflation's Distortionary Effects"

### Impact of Inflation on Financial Statement Analysis

General price level changes creates distortions in financial statements. Inflation accounting is used in countries with high inflation.

#### LEARNING OBJECTIVE

• Discuss how inflation can impact a company's financial statements

#### KEY POINTS

• Many of the historical numbers appearing on financial statements are not economically relevant because prices have changed since they were incurred.
• Since the numbers on financial statements represent dollars expended at different points of time and, in turn, embody different amounts of purchasing power, they are simply not additive.
• Reported profits may exceed the earnings that could be distributed to shareholders without impairing the company's ongoing operations.
• Future earnings are not easily projected from historical earnings. Future capital needs are difficult to forecast and may lead to increased leverage, which increases the risk to the business.
• The asset values for inventory, equipment and plant do not reflect their economic value to the business.

#### TERMS

• Financial Accounting Standards Board

private, not-for-profit organization whose primary purpose is to develop generally accepted accounting principles (GAAP) within the United States in the public's interest

• historical cost basis

Under this type of accounting, assets and liabilities are recorded at their values when first acquired. They are not then generally restated for changes in values. Costs recorded in the Income Statement are based on the historical cost of items sold or used, rather than their replacement costs.

• hyperinflation

In economics, this occurs when a country experiences very high, accelerating, and perceptibly "unstoppable" rates of inflation. In such a condition, the general price level within an economy rapidly increases as the currency quickly loses real value.

FULL TEXT

#### Inflation's Impact on Financial Statements

In most countries, primary financial statements are prepared on the historical cost basis of accounting without regard either to changes in the general level of prices. Accountants in the United Kingdom and the United States have discussed the effect of inflation on financial statements since the early 1900s .

Hyperinflation Graph

German Hyperinflation Data

General price level changes in financial reporting creates distortions in financial statements such as:

• Many of the historical numbers appearing on financial statements are not economically relevant because prices have changed since they were incurred.
• Since the numbers on financial statements represent dollars expended at different points of time and, in turn, embody different amounts of purchasing power, they are simply not additive. Hence, adding cash of $10,000 held on December 31, 2002, with$10,000 representing the cost of land acquired in 1955 (when the price level was significantly lower) is a dubious operation because of the significantly different amount of purchasing power represented by the two identical numbers.
• Reported profits may exceed the earnings that could be distributed to shareholders without impairing the company's ongoing operations.
• The asset values for inventory, equipment and plant do not reflect their economic value to the business.
• Future earnings are not easily projected from historical earnings.
• The impact of price changes on monetary assets and liabilities is not clear.
• Future capital needs are difficult to forecast and may lead to increased leverage, which increases the risk to the business.
• When real economic performance is distorted, these distortions lead to social and political consequences that damage businesses (examples: poor tax policies and public misconceptions regarding corporate behavior).

Inflation accounting, a range of accounting systems designed to correct problems arising from historical cost accounting in the presence of inflation, is a solution to these problems. This type of accounting is used in countries experiencing high inflation or hyperinflation. For example, in countries such as these the International Accounting Standards Board requires corporate financial statements to be adjusted for changes in purchasing power using a price index.

Disinflation

Disinflation is a decrease in the inflation rate; a slowdown in the rate of increase of the general price level of goods, services.

#### LEARNING OBJECTIVE

• Describe what causes disinflation

#### KEY POINTS

• Disinflation occurs when the increase in the "consumer price level" slows down from the previous period when the prices were rising. Disinflation is the reduction in the general price level in the economy but for a very short period of time.
• The causes of disinflation may be a decrease in the growth rate of the money supply. If the central bank of a country enacts tighter monetary policy, the supply of money reduces, and money becomes more upscale and the demand for money remains constant.
• Disinflation may result from a recession. The central bank adopts contractionary monetary policy, goods, and services are more expensive. Even though the demand for commodities fall, the supply still remains unaltered.Thus, the prices would fall over a period of time leading to disinflation.

#### TERMS

• recession

A period of reduced economic activity.

A long-term fluctuation in economic activity between growth and recession.

FULL TEXT

Disinflation is a decrease in the rate of inflation–a slowdown in the rate of increase of the general price level of goods and services in a nation's gross domestic product over time. Disinflation occurs when the increase in the "consumer price level" slows down from the previous period when the prices were rising. Disinflation is the reduction in the general price level in the economy but for a very short period of time. Disinflation takes place only when an economy is suffering from recession.

Disinflation

Disinflation is a decrease in the rate of inflation as illustrated in the yellow region of this graph.

If the inflation rate is not very high to start with, disinflation can lead to deflation–decreases in the general price level of goods and services. For example if the annual inflation rate for the month of January is 5% and it is 4% in the month of February, the prices disinflated by 1% but are still increasing at a 4% annual rate. Again, if the current rate is 1% and it is -2% for the following month, prices disinflated by 3% (i.e., 1%-[-2]%) and are decreasing at a 2% annual rate.

The causes of disinflation are either a decrease in the growth rate of the money supply, or a business cycle contraction (recession). If the central bank of a country enacts tighter monetary policy, (i.e., the government start selling its securities) this reduces the supply of money in an economy. This contraction of the monetary policy is known as a "quantitative tightening technique. " When the government sell its securities in the market, the supply of money reduces, and money becomes more upscale and the demand for money remains constant. During a recession, competition among businesses for customers becomes more intense, and so retailers are no longer able to pass on higher prices to their customers. The main reason is that when the central bank adopts contractionary monetary policy, its becomes expensive to annex money, which leads to the fall in the demand for goods and services in the economy. Even though the demand for commodities fall, the supply of commodities still remains unaltered. Thus the prices fall over a period of time leading to disinflation.

When the growth rate of unemployment is below the natural rate of growth, this leads to an increase in the rate of inflation; whereas, when the growth rate of unemployment is above the natural rate of growth it leads to a decrease in the rate of inflation also known as disinflation. This happens when people are jobless, and they have a very small portion of money to spend, which indirectly implies reduction in the supply of money in an economy.

Deflation

Deflation is a decrease in the general price level of goods and services and occurs when the inflation rate falls below 0%.

#### LEARNING OBJECTIVE

• Explain how deflation can effect a business

#### KEY POINTS

• In the IS/LM model (Investment and Saving equilibrium/ Liquidity Preference and Money Supply equilibrium model), deflation is caused by a shift in the supply-and-demand curve for goods and services, particularly a fall in the aggregate level of demand.
• In more recent economic thinking, deflation is related to risk: where the risk-adjusted return on assets drops to negative, investors and buyers will hoard currency rather than invest it. This can produce a liquidity trap.
• In monetarist theory, deflation must be associated with either a reduction in the money supply, a reduction in the velocity of money or an increase in the number of transactions. But any of these may occur separately without deflation.
• In mainstream economics, deflation may be caused by a combination of the supply and demand for goods and the supply and demand for money; specifically the supply of money going down and the supply of goods going up.
• The effects of deflation are: decreasing nominal prices for goods and services, increasing buying power of cash money and all assets denominated in cash terms, possibly decreasing investment and lending if cash holdings are seen as preferable, and benefiting recipients of fixed incomes.

#### TERMS

• liquidity trap

A liquidity trap is a situation in which injections of cash into the private banking system by a central bank fail to lower interest rates and hence fail to stimulate economic growth. A liquidity trap is caused when people hoard cash because they expect an adverse event such as deflation, insufficient aggregate demand, or war.

• deflationary spiral

A deflationary spiral is a situation where decreases in price lead to lower production, which in turn leads to lower wages and demand, which leads to further decreases in price. Since reductions in general price level are called deflation, a deflationary spiral is when reductions in price lead to a vicious circle, where a problem exacerbates its own cause.

#### FULL TEXT

In economics, deflation is a decrease in the general price level of goods and services. This occurs when the inflation rate falls below 0% (a negative inflation rate). Inflation reduces the real value of money over time; conversely, deflation increases the real value of money – the currency of a national or regional economy. In turn, this allows one to buy more goods with the same amount of money over time.

Economists generally believe that deflation is a problem in a modern economy because they believe it may lead to a deflationary spiral .

US historical inflation rates

Annual inflation (in blue) and deflation (in green) rates in the United States from 1666 to 2004

In the IS/LM model (Investment and Saving equilibrium/ Liquidity Preference and Money Supply equilibrium model), deflation is caused by a shift in the supply-and-demand curve for goods and services, particularly with a fall in the aggregate level of demand. That is, there is a fall in how much the whole economy is willing to buy, and the going price for goods. Because the price of goods is falling, consumers have an incentive to delay purchases and consumption until prices fall further, which in turn reduces overall economic activity. Since this idles the productive capacity, investment also falls, leading to further reductions in aggregate demand. This is the deflationary spiral.

An answer to falling aggregate demand is stimulus, either from the central bank, by expanding the money supply; or by the fiscal authority to increase demand, and to borrow at interest rates which are below those available to private entities.

In more recent economic thinking, deflation is related to risk: where the risk-adjusted return on assets drops to negative, investors and buyers will hoard currency rather than invest it, even in the most solid of securities. This can produce a liquidity trap. A central bank cannot normally charge negative interest for money, and even charging zero interest often produces less stimulative effect than slightly higher rates of interest. In a closed economy, this is because charging zero interest also means having zero return on government securities, or even negative return on short maturities. In an open economy it creates a carry trade, and devalues the currency. A devalued currency produces higher prices for imports without necessarily stimulating exports to a like degree.

In monetarist theory, deflation must be associated with either a reduction in the money supply, a reduction in the velocity of money or an increase in the number of transactions. But any of these may occur separately without deflation. It may be attributed to a dramatic contraction of the money supply, or to adherence to a gold standard or to other external monetary base requirements.

In mainstream economics, deflation may be caused by a combination of the supply and demand for goods and the supply and demand for money, specifically: the supply of money going down and the supply of goods going up. Historic episodes of deflation have often been associated with the supply of goods going up (due to increased productivity) without an increase in the supply of money, or (as with the Great Depression and possibly Japan in the early 1990s) the demand for goods going down combined with a decrease in the money supply. Studies of the Great Depression by Ben Bernanke have indicated that, in response to decreased demand, the Federal Reserve of the time decreased the money supply, hence contributing to deflation.

The effects of deflation are thus: decreasing nominal prices for goods and services, increasing buying power of cash money and all assets denominated in cash terms, possibly decreasing investment and lending if cash holdings are seen as preferable (aka hoarding), and benefiting recipients of fixed incomes.


text:
Home > CC1 > Chapter Ch5 > Lesson 5.3.3 > Problem5-93

5-93.

Graph the trapezoid A(6, 5), B(8, −2), C(−4, −2), D(−2, 5). Homework Help ✎

Your graph should look like the one below.

1. Find the length of the bottom base (segment CB). Then find the length of the top base (segment AD). Use grid units.

• Both B and C are on the y = −2 line, so you just need to find the the distance between their x-coordinates to determine the length of CB. The same can be done for AD.

$\text{The length of segment }CB \text{ is }\left | 8 \right| + \left | -4 \right | =\ 12.\text{ Now find the length of segment } AD.$

1. Find the distance between the two bases, which is called the height. Use grid units.

• Use a similar method to part (a), but use the y-coordinates to find the distance between segment CB and segment AD.


text:
# Start a new discussion

## Not signed in

Want to take part in these discussions? Sign in if you have an account, or apply for one below

## Discussion Tag Cloud

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

• CommentRowNumber1.
• CommentAuthorUrs
• CommentTimeNov 7th 2012
• (edited Nov 7th 2012)

I have edited the old entry n-fold category a little, brought the content into proper order, fixed the link to cat-n-groups and cross-linked with n-fold complete Segal space.

• CommentRowNumber2.
• CommentAuthorMike Shulman
• CommentTimeFeb 27th 2018

Last summer a “DamienC” dropped a query box at n-fold category.

• CommentRowNumber3.
• CommentAuthorUrs
• CommentTimeFeb 27th 2018
• (edited Feb 27th 2018)

Thanks for the alert (maybe this was Damien Calaque?)

The query calls into question the statement in the entry that $n$-fold complete Segal spaces are like $n$-fold categories, saying that they are rather like $n$-categories.

I guess I wrote that statement. I still seem to think that it is correct, abstractly due to the iterative internalizaton nature of $n$-fold Segal spaces, and concretly due to how they are represented by $n$-fold simplicial sets.

• CommentRowNumber4.
• CommentAuthorMike Shulman
• CommentTimeFeb 27th 2018

But aren’t $n$-fold CSS used as a model for $(\infty,n)$-categories? If so, then even if they “look like” $n$-fold categories, it would be more correct to say that they are like $n$-fold categories satisfying a “globularity” condition making them equivalent to $n$-categories. There would instead be some “less complete” condition on an $n$-simplicial space that would be a model for “$(\infty,n)$-fold categories”.

• CommentRowNumber5.
• CommentAuthorUrs
• CommentTimeFeb 27th 2018

That seems reasonable.

• CommentRowNumber6.
• CommentAuthorMike Shulman
• CommentTimeFeb 27th 2018

Ok, I tried to clarify n-fold category.

• CommentRowNumber7.
• CommentAuthorRuneHaugseng
• CommentTimeFeb 28th 2018
The definition on the page "n-fold complete Segal space" is actually incorrect: If one just iterates the definition of a Segal space one indeed obtains an infinity-version of n-fold categories. (I have sometimes called these objects "n-uple Segal spaces", for lack of a better name.) To obtain (infinity,n)-categories one must impose a constancy condition (for example, for n=2 you have a bisimplicial space, and the 0th simplicial space in one direction should be constant); this gives what is usually called an n-fold Segal space. (Completeness is then a further condition on such n-fold Segal spaces, equivalent to being local for the class of fully faithful and essentially surjective morphisms.)
• CommentRowNumber8.
• CommentAuthorUrs
• CommentTimeFeb 28th 2018

Thanks. Somebody should fix it. Probably I should do it. But it might be more efficient if you could do it.

• CommentRowNumber9.
• CommentAuthorMike Shulman
• CommentTimeFeb 28th 2018

It would make more sense for “n-fold Segal space” to refer instead to what you call an “n-uple Segal space”.

• CommentRowNumber10.
• CommentAuthorRuneHaugseng
• CommentTimeFeb 28th 2018
I agree, but the terminology is quite well-established by now. Unfortunately it seems hard to find any terminology here that's not potentially confusing in one way or another.
• CommentRowNumber11.
• CommentAuthorRuneHaugseng
• CommentTimeMar 1st 2018
I wrote up a definition of n-fold Segal spaces. I'll try to add something on completeness later.
• CommentRowNumber12.
• CommentAuthorMike Shulman
• CommentTimeMar 1st 2018

Thanks!

• CommentRowNumber13.
• CommentAuthorUrs
• CommentTimeMar 2nd 2018

Thanks, indeed!

It’s been a long time since we have been editing significantly on $(\infty,n)$-category theoretic issues. There is much room and will there be much appreciation for you adding more notes in this direction.

• CommentRowNumber14.
• CommentAuthorRuneHaugseng
• CommentTimeMar 2nd 2018

Now I also added a brief discussion of completeness and fully faithful and essentially surjective morphisms. (I expect I’ve broken many nlab conventions in the process - for example, am I supposed to say $(\infty,1)$-category instead of $\infty$-category?) A lot more could certainly still be written here though!

• CommentRowNumber15.
• CommentAuthorMike Shulman
• CommentTimeMar 2nd 2018

Link for those coming to this thread directly: n-fold complete Segal space. (Actually we should in theory be having this discussion at the nForum thread on n-fold complete Segal spaces, where I see that the problem you just corrected was already pointed out 4 years ago.

We do generally say $(\infty,1)$-category instead of $\infty$-category. I did a search-and-replace on that for you. It’s also permissible to use the implicit infinity-category convention if it’s declared near the top of a page, but that’s probably not appropriate for a page like this one that’s about a particular model construction.

Can you give any more intuition for non-complete $n$-fold Segal spaces? I can think of a non-complete ordinary Segal space as either an “$\infty$-double category with connections” whose vertical direction is all invertible, or a “rigged $(\infty,1)$-category” consisting of an essentially surjective functor from an $\infty$-groupoid to an $(\infty,1)$-category. How can I think of a non-complete $n$-fold Segal space? It’s some kind of “$\infty$-$(n+1)$-fold category” with some other condition – what does that condition mean intuitively in $n$-fold-category language (e.g. for $n=2$ or $3$)?

• CommentRowNumber16.
• CommentAuthorRuneHaugseng
• CommentTimeMar 3rd 2018

I would rather say that Segal spaces and complete Segal spaces are both $\infty$-analogues of categories, with “category” used in two slightly different senses: On the one hand a category is an algebraic structure, and on the other hand a category is an object of the relative category (categories, equivalences) - or equivalently of the (2,1)-category of categories. For ordinary categories these are usually conflated, being of course very similar - since all FFES (=fully faithful and essentially surjective) functors have pseudo-inverses, you can define the (2,1)-category of categories without actually formally inverting anything.

Segal spaces (viewed internally in the $\infty$-world) give precisely the algebraic structure of categories (i.e. compositions and units). They are also monadic over graphs in the $\infty$-category of spaces, with the monad given by the same formula as for ordinary categories.

We can define FFES maps of Segal spaces, which produces a relative $\infty$-category. This relative $\infty$-category is arguably the most direct analogue of the way people usually work with categories. We can also invert the FFES maps, producing a new $\infty$-category - the “$\infty$-category of $\infty$-categories”.

However, in the $\infty$-setting we are lucky enough that this localization actually corresponds to a full subcategory of local objects - the complete Segal spaces. (It is not obvious that this is possible, as it is not immediately clear from the definition that the FFES maps are generated by a set of maps.) Thus the $\infty$-category of complete Segal spaces is the analogue of the (2,1)-category of categories. (On the other hand, we are unlucky in that FFES maps of Segal spaces do not necessarily have pseudo-inverses, at least in the most obvious sense, so unlike for ordinary categories we can’t construct this $\infty$-category just by looking at natural equivalences of maps between general Segal spaces.)

Similarly, $n$-fold Segal spaces describe the algebraic structure of n-categories (compositions and units). (As do Rezk’s $\Theta_n$-spaces with their Segal conditions - and they are indeed equivalent to $n$-fold Segal spaces (without completeness on both sides)). (They are also monadic over $n$-globular objects in spaces, with the same formula for the monad as for strict $n$-categories.) As before, we then consider FFES maps between $n$-fold Segal spaces, with the complete objects again turning out to be the ones local for these equivalences.

Alternatively, your second description can also be extended to $(\infty,n)$-categories: an $n$-fold Segal space (or equivalently a $\Theta_n$-space) is an $(\infty,n)$-category with extra structure in the form of a “flag” of $(\infty,i)$-categories for all $i \lt n$. This was recently proved in a preprint of Ayala and Francis.

• CommentRowNumber17.
• CommentAuthorMike Shulman
• CommentTimeMar 3rd 2018

Thanks! I understand your last paragraph. Do I understand correctly that the rest of it is saying that an $n$-fold Segal space is an “$n$-category object internal to $\infty$-groupoids”, i.e. an “$n\times (\infty,0)$-category”? As opposed to a complete $n$-fold Segal space which is an $(\infty,n)$-category and an $n$-uple Segal space which is a $1\times 1\times \cdots\times 1\times (\infty,0)$-category.


text:
# How to reduce the space between the hat of overset and the symbol?

I would like to place the \rightharpoonup on r and get them closer. I had tried the \overset and \Rvector package. But the spacing of the former is too much. And the latter performs bad when placing in smaller font size. I provide the code as follow:

 \documentclass[titlepage]{article}
\usepackage[cm]{fullpage}
\usepackage{amsmath,amssymb}
\begin{document}
$\mathbf{e}_{\overset{\rightharpoonup}{r}}$
\end{document}

-
Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Christian Hupfer Jul 20 '14 at 15:58
A tip: If you indent lines by 4 spaces or enclose words in backticks , they'll be marked as code, as can be seen in my edit. You can also highlight the code and click the "code" button (with "{}" on it). – Christian Hupfer Jul 20 '14 at 16:21
– Werner Jul 20 '14 at 16:32

Here's a quick-and-not-too-dirty offering: a macro called \harp. It assumes it'll be used in subscript and superscript positions only. For now, it only works with letters that do not have an ascender part. I.e., don't use if with letters such as b, d, f, h, etc. (If you do need to use the macro with such letters, you'll need to tweak the argument of the \raise macro.)

\documentclass[titlepage]{article}
\usepackage[cm]{fullpage}
\usepackage{amsmath,amssymb}
\newcommand\harp[1]{\mathstrut\mkern2.5mu#1\mkern-11mu\raise0.6ex%
\hbox{$\scriptscriptstyle\rightharpoonup$}}
\begin{document}
$\mathbf{e}_{\overset{\rightharpoonup}{r}} \text{ vs.\ } \mathbf{e}_{\harp{r}}$
\end{document}

-
Thanks,it works really good. – 陳智圓 Jul 20 '14 at 23:59

There are two orders of problems:

1. the distance from the arrow to the symbol is too big;

2. in subscripts or superscripts, the arrow is too wide.

Here's a solution for both.

\documentclass[titlepage]{article}
\usepackage{amsmath,graphicx}

\newcommand{\harp}[1]{\mathpalette\harpoonvec{#1}}
\newcommand{\harpvecsign}{\scriptscriptstyle\rightharpoonup}
\newcommand{\harpoonvec}[2]{%
\ifx\displaystyle#1\doalign{$\harpvecsign$}{#1#2}\fi
\ifx\textstyle#1\doalign{$\harpvecsign$}{#1#2}\fi
\ifx\scriptstyle#1\doalign{\scalebox{.6}[.9]{$\harpvecsign$}}{#1#2}\fi
\ifx\scriptscriptstyle#1\doalign{\scalebox{.5}[.8]{$\harpvecsign$}}{#1#2}\fi
}
\newcommand{\doalign}[2]{%
{\vbox{\offinterlineskip\ialign{\hfil##\hfil\cr#1\cr$#2$\cr}}}%
}

\begin{document}

\begin{equation*}
\mathbf{e}_{\harp{r}_{\harp{r}}}  \harp{\mathbf{g}} \harp{A}
\end{equation*}

\end{document}

-

A solution using the accents package. The difference of vertical spacing with respect to the O.P. method with \overset is null in scriptscriptstyle, slight in \scriptstyle and more important in \textstyle. Otherwise the placement is different :

\documentclass[titlepage]{article}
\usepackage{amsmath,amssymb}
\usepackage{accents}
\newcommand*\harp[1]{\mkern2mu\accentset{\rightharpoonup}{#1}\mkern2mu}%

\begin{document}

$\begin{array}{cc} \texttt{\small\textbackslash mathaccent: } & \texttt{\small\textbackslash overset: }\\ \mathbf{e}_{\scriptscriptstyle\harp r} & \mathbf{e}_{\scriptscriptstyle\overset{\rightharpoonup}{r}} \\[2pt] \mathbf{e}_{\harp r} & \mathbf{e}_{\overset{\rightharpoonup}{r}} \\[4pt] \harp{\mathbf g } & \overset{\rightharpoonup}{\mathbf g} \end{array}$%

\end{document}

-
The vertical space between the harpoon and the letter seems no smaller (and possibly even a bit larger) in your code as is already the case with the OP's code. – Mico Jul 20 '14 at 21:40
It is slightly smaller in scriptstyle(by 0.4pt), equal in scriptscriptstyle and noticeably smaller in textstyle (by 1.4pt). See my updated answer. – Bernard Jul 20 '14 at 23:04

Macros from the stackengine package allow one to set the vertical stacking gap. Compare items 1 vs. 2 and/or items 3 vs. 4, and/or 5 vs. 6 for a demonstration of changing the stacking gap. In addition, the appearance will also be affected by what is considered the baseline of the subscipt. In 1, 2, the baseline is between the "r" and the harpoon; in 3, 4, the "r" is the baseline, whereas in 5, 6, the "harpoon" is the baseline.

\documentclass[titlepage]{article}
\usepackage[cm]{fullpage}
\usepackage{amsmath,amssymb}
\usepackage{stackengine}
\stackMath
\begin{document}
$\mathbf{e}_{\stackanchor[-.5pt]{\scriptscriptstyle \rightharpoonup}{\scriptstyle r}} \mathbf{e}_{\stackanchor[0pt]{\scriptscriptstyle \rightharpoonup}{\scriptstyle r}} ~ \mathbf{e}_{\stackon[-.5pt]{\scriptstyle r}{\scriptscriptstyle \rightharpoonup}} \mathbf{e}_{\stackon[0pt]{\scriptstyle r}{\scriptscriptstyle \rightharpoonup}} ~ \mathbf{e}_{\stackunder[-.5pt]{\scriptscriptstyle \rightharpoonup}{\scriptstyle r}} \mathbf{e}_{\stackunder[0pt]{\scriptscriptstyle \rightharpoonup}{\scriptstyle r}}$
\end{document}
`

-


text:
## CryptoDB

### Paper: A Distributed and Computationally Secure Key Distribution Scheme

Authors: Vanesa Daza Javier Herranz Carles Padró Germ\'an S\'aez URL: http://eprint.iacr.org/2002/069 Search ePrint Search Google In 1999, Naor, Pinkas and Reingold introduced schemes in which some groups of servers distribute keys among a set of users in a distributed way. They gave some specific proposals both in the unconditional and in the computational security framework. Their computationally secure scheme is based on the Decisional Diffie-Hellman Assumption. This model assumes secure communication between users and servers. Furthermore it requires users to do some expensive computations in order to obtain a key. In this paper we modify the model introduced by Naor et al., requiring authenticated channels instead of assuming the existence of secure channels. Our model makes the user's computations easier, because most computations of the protocol are carried out by servers, keeping to a more realistic situation. We propose a basic scheme, that makes use of ElGamal cryptosystem, and that fits in with this model in the case of a passive adversary. We then add zero-knowledge proofs and verifiable secret sharing to prevent from the action of an active adversary. We consider general structures (not only the threshold ones) for those subsets of servers that can provide a key to a user and for those tolerated subsets of servers that can be corrupted by the adversary. We find necessary combinatorial conditions on these structures in order to provide security to our scheme.
##### BibTeX
@misc{eprint-2002-11593,
title={A Distributed and Computationally Secure Key Distribution Scheme},
booktitle={IACR Eprint archive},
keywords={cryptographic protocols / Key distribution, secret sharing schemes.},
url={http://eprint.iacr.org/2002/069},
note={Proceedings of Information Security Conference, ISC'02. LNCS 2433, pp. 342--356 jherranz@mat.upc.es 12153 received 1 Jun 2002, last revised 11 Apr 2003},
author={Vanesa Daza and Javier Herranz and Carles Padró and Germ\'an S\'aez},
year=2002
}


text:
# An air bubble in a glass slab with refractive index 1.5 (near normal incidence) is 5 cm deep when viewed from one surface and 3 cm deep when viewed from the opposite face. The thickness (in cm) of the slab is Option 1) 8 Option 2) 10 Option 3) 12 Option 4) 16

P Prateek Shrivastava

As we learnt in

Relation between real depth and apparent depth -

$\frac{n_{i}}{d}= \frac{n_{r}}{d{}'}$

- wherein

$n_{i}$ = Refractive index of medium of incident.

$n_{r}$ = Refractive index of medium of refraction.

d = distance of object.

$d{}'$ = apparent  depth

Apparent depth=5cm  from one side

$\therefore$ Real depth=1.5x5=7.5 cm

apparent depth=3cm from other side

$\therefore$ Real depth from other side =3x1.5cm=4.5

$\therefore$ Thickness of slab=7.5cm+4.5cm=12cm

Option 1)

8

This option is incorrect

Option 2)

10

This option is incorrect

Option 3)

12

This option is correct

Option 4)

16

This option is incorrect

Exams
Articles
Questions


text:
### Home > CALC > Chapter 1 > Lesson 1.4.2 > Problem1-152

1-152.

Use the eTool below to visualize the flag.
Click the link at right for the full version of the eTool: Calc 1-152 HW eTool

Sum together the volumes of the cone and the half-sphere. Note that the radius is obtained by using the trigonometry rule for 30° − 60° − 90° triangles.

$\text{The volume of a sphere is }\frac{4}{3}\pi r^{3},\text{ so the volume of half a}$

$\text{sphere would be half of that. The volume for a cone is }\frac{1}{3}\pi r^{2}h.$


text:
Image Registration Method Exhaustive¶

Code¶

#!/usr/bin/env python

"""
This script demonstrates the use of the Exhaustive optimizer in the
ImageRegistrationMethod to estimate a good initial rotation position.

Because gradient descent base optimization can get stuck in local
minima, a good initial transform is critical for reasonable
results. Search a reasonable space on a grid with brute force may be a
reliable way to get a starting location for further optimization.

The initial translation and center of rotation for the transform is
initialized based on the first principle moments of the intensities of
the image. Then in either 2D or 3D a Euler transform is used to
exhaustively search a grid of the rotation space at a certain step
size. The resulting transform is a reasonable guess where to start
further registration.
"""

from __future__ import print_function
from __future__ import division

import SimpleITK as sitk
import sys
import os
from math import pi

def command_iteration(method):
if (method.GetOptimizerIteration() == 0):
print("Scales: ", method.GetOptimizerScales())
print("{0:3} = {1:7.5f} : {2}".format(method.GetOptimizerIteration(),
method.GetMetricValue(),
method.GetOptimizerPosition()))

if len(sys.argv) < 4:
print("Usage:", sys.argv[0], "<fixedImageFilter> <movingImageFile>",
"<outputTransformFile>")
sys.exit(1)

R = sitk.ImageRegistrationMethod()

R.SetMetricAsMattesMutualInformation(numberOfHistogramBins=50)

sample_per_axis = 12
if fixed.GetDimension() == 2:
tx = sitk.Euler2DTransform()
# Set the number of samples (radius) in each dimension, with a
# default step size of 1.0
R.SetOptimizerAsExhaustive([sample_per_axis // 2, 0, 0])
# Utilize the scale to set the step size for each dimension
R.SetOptimizerScales([2.0 * pi / sample_per_axis, 1.0, 1.0])
elif fixed.GetDimension() == 3:
tx = sitk.Euler3DTransform()
R.SetOptimizerAsExhaustive([sample_per_axis // 2, sample_per_axis // 2,
sample_per_axis // 4, 0, 0, 0])
R.SetOptimizerScales(
[2.0 * pi / sample_per_axis, 2.0 * pi / sample_per_axis,
2.0 * pi / sample_per_axis, 1.0, 1.0, 1.0])

# Initialize the transform with a translation and the center of
# rotation from the moments of intensity.
tx = sitk.CenteredTransformInitializer(fixed, moving, tx)

R.SetInitialTransform(tx)

R.SetInterpolator(sitk.sitkLinear)

outTx = R.Execute(fixed, moving)

print("-------")
print(outTx)
print("Optimizer stop condition: {0}"
.format(R.GetOptimizerStopConditionDescription()))
print(" Iteration: {0}".format(R.GetOptimizerIteration()))
print(" Metric value: {0}".format(R.GetMetricValue()))

sitk.WriteTransform(outTx, sys.argv[3])

if ("SITK_NOSHOW" not in os.environ):
resampler = sitk.ResampleImageFilter()
resampler.SetReferenceImage(fixed)
resampler.SetInterpolator(sitk.sitkLinear)
resampler.SetDefaultPixelValue(1)
resampler.SetTransform(outTx)

out = resampler.Execute(moving)

simg1 = sitk.Cast(sitk.RescaleIntensity(fixed), sitk.sitkUInt8)
simg2 = sitk.Cast(sitk.RescaleIntensity(out), sitk.sitkUInt8)
cimg = sitk.Compose(simg1, simg2, simg1 // 2. + simg2 // 2.)
sitk.Show(cimg, "ImageRegistrationExhaustive Composition")

# Run with:
#
# Rscript --vanilla ImageRegistrationMethodExhaustive.R fixedImageFilter movingImageFile outputTransformFile
#

# This script demonstrates the use of the Exhaustive optimizer in the
# ImageRegistrationMethod to estimate a good initial rotation position.

# Because gradient descent base optimization can get stuck in local
# minima, a good initial transform is critical for reasonable
# results. Search a reasonable space on a grid with brute force may be a
# reliable way to get a starting location for further optimization.

# The initial translation and center of rotation for the transform is
# initialized based on the first principle moments of the intensities of
# the image. Then in either 2D or 3D a Euler transform is used to
# exhaustively search a grid of the rotation space at a certain step
# size. The resulting transform is a reasonable guess where to start
# further registration.

library(SimpleITK)

commandIteration <- function(method)
{
if (method$GetOptimizerIteration()==0) { cat("Scales:", method$GetOptimizerScales(), "\n")
}
msg <- paste(method$GetOptimizerIteration(), "=", method$GetMetricValue(), ":",
method$GetOptimizerPosition(), "\n" ) cat(msg) } args <- commandArgs( TRUE ) if (length(args) != 3) { stop("3 arguments expected - fixedImageFilter, movingImageFile, outputTransformFile") } fixed <- ReadImage(args[[1]], 'sitkFloat32') moving <- ReadImage(args[[2]], 'sitkFloat32') R <- ImageRegistrationMethod() R$SetMetricAsMattesMutualInformation(numberOfHistogramBins = 50)

sample_per_axis <- 12
if (fixed$GetDimension() == 2) { tx <- Euler2DTransform() # Set the number of samples (radius) in each dimension, with a # default step size of 1.0 R$SetOptimizerAsExhaustive(c(sample_per_axis%/%2,0,0))
# Utilize the scale to set the step size for each dimension
R$SetOptimizerScales(c(2.0*pi/sample_per_axis,1.0,1.0)) } else if (fixed.GetDimension() == 3) { tx <- Euler3DTransform() R$SetOptimizerAsExhaustive(c(sample_per_axis%/%2,sample_per_axis%/%2,sample_per_axis%/%4,0,0,0))
R$SetOptimizerScales(c(2.0*pi/sample_per_axis,2.0*pi/sample_per_axis,2.0*pi/sample_per_axis,1.0,1.0,1.0)) } # Initialize the transform with a translation and the center of # rotation from the moments of intensity. tx <- CenteredTransformInitializer(fixed, moving, tx) R$SetInitialTransform(tx)
R$SetInterpolator('sitkLinear') R$AddCommand( 'sitkIterationEvent', function() commandIteration(R) )

outTx <- R$Execute(fixed, moving) cat("-------\n") outTx cat("Optimizer stop condition:", R$GetOptimizerStopConditionDescription(), '\n')
cat("Iteration:", R$GetOptimizerIteration(), '\n') cat("Metric value:", R$GetMetricValue(), '\n')

WriteTransform(outTx, args[[3]])


text:
• •

### 基于SOM的流域分类和无资料区径流模拟

1. 1. 北京大学 环境科学与工程学院,水沙科学教育部重点实验室,北京 100871
2. 北京大学 城市与环境学院,地表过程分析与模拟教育部重点实验室,北京 100871
• 出版日期:2014-08-25 发布日期:2014-08-25
• 作者简介:

作者简介:伊璇(1989-),女,山东泰安人,博士生,主要研究方向为水资源管理与水污染控制,E-mail:xuanyi.eva@gmail.com

• 基金资助:
国家水体污染控制与治理科技重大专项项目(2013ZX07102-006)

### Classification and runoff simulation of data-scarce basins based on self-organizing maps

Xuan YI1(), Feng ZHOU2, Xinyu WANG1, Yonghui YANG1, Huaicheng GUO1()

1. 1. Laboratory of Water and Sediment Sciences, Ministry of Education, College of Environmental Sciences and Engineering, Peking University, Beijing 100871, China
2. Laboratory for Earth Surface Process, Ministry of Education, College of Urban and Environmental Sciences, Peking University, Beijing 100871, China
• Online:2014-08-25 Published:2014-08-25

Abstract:

Runoff prediction in ungauged basins (PUB) is one of the difficult research areas in hydrological studies. Parameter replacement using data from similar basins is one of the common methods in dealing with the PUB problem. When basins are similar in physical properties, their hydrological behaviors are assumed to be also similar and thus the hydrological model parameters can be transferred from the donor basin to the target basin. However, it is hard to determine whether a donor basin is indeed similar to a target basin and therefore it is not always clear whether the parameters can be transferred between the basins. Existing research often focus on river basin PUB problem, with inadequate attention on lake basins that contain a number of river streams. This study addresses the PUB question using Lake Dianchi Basin as an example. Lake Dianchi Basin has a complicated river network as well as serious PUB problems. Self-organizing maps (SOM) and hierarchical clustering analysis (HCA) were jointly used to identify analogy basins based on 16 physical attributes, including area, length, slope, drainage density, Ke, mean elevation, average precipitation, six land use types and three soil types. SOM method with K-means cluster was applied to classify similar sub-basins into distinct groups and Davis-Bouldin index was used to determine the optimal group numbers. After 1000 iterations the 43 sub-basins were classified into seven groups (I-VII). This SOM-based classification result is the same as the result of HCA except for two sub-basins. Among the seven groups, group I, IV, and VII contains most of the sub-basins and the other four groups contain no more than three sub-basins each. Different groups have different characteristics and the classification result provides a guidance for local management of the lake basin. For instance, group I is located in high elevation area where the density of streams and infiltration rate of the soil are both low therefore the area is flood-prone, thus the local government should pay more attention on flood control in such area. HBV model was used to simulate the runoff process and for sub-basins where the simulation went well, their parameters were used in the cross-basin test. The cross-basins test was applied to test whether or not hydrological model parameters could be transferred between two sub-basins in the same group. Six stations in three groups were selected as examples and sub-basins in each two sub-basin pair are from the same group. The result shows that the HBV model performs well in the runoff simulation of Lake Dianchi Basin (R2≥0.718, NSE≥=0.495). The cross-basin test result is also very promising (R2≥0.654 and NSE≥0.472) — it proves that ungauged sub-basins could borrow the model parameters of gauged basins in the same group. Thus, this research provides a solution for solving the PUB problem in the Lake Dianchi Basin. This research provides a basis for solving the problem of lack of data for runoff modeling for the basin. Meanwhile, SOM visualizes multi-dimensional properties of the basin, which is useful for practitioners in water resource management to comprehensively understand the spatial distribution of hydrological characteristics of Lake Dianchi Basin.

• TV 212.4


text:
# Convert American bought digital clocks to use in 50Hz main supply

#### electro_yas

Joined Dec 20, 2010
15
First you will need to change the voltage by a step down transformer.

This method can be used for the American digital clocks where main supply frequency is used as the clock pulse. Normally these digital clocks use LM8560 or SC8560 ,and these ICs have an option to select 50Hz or 60Hz. But America's main AC is 60Hz therefore this pin is not connected to any . Just look at the datasheets of these ICs and connect the relevant pin to the correct point.

#### Wendy

Joined Mar 24, 2008
22,328
Sure, it could be done, but your trying to convert a $20 (or much less) clock with a$30 (or more) project.

The simplest way is an inverter. Just build a precision time base in the oscillator section. With just a little more circuitry it can be a nifty battery backup.

Or find where the 60 hertz in used by the clock and modify that circuit. While you're about it disable the battery backup oscillator to use yours too. Thinking about it this is the simplest, but a lot skill required.

I suspect it would be much cheaper to buy one in the country of origin.

Last edited:

#### electro_yas

Joined Dec 20, 2010
15
Yes , you are correct it will take some money to buy a transformer to step down the voltage to the appropriate level but to change the frequency option you will need just one wire because many clock ICs have both the options.

I thought of making an inverter before and it was not worth it unless I have many American bought digital clocks. But it will be a good idea for other electronic gadgets even thought it will be impossible to maintain exactly 60Hz.

#### Wendy

Joined Mar 24, 2008
22,328
Actually it isn't that hard. Phase locked loops can use a simple reference and generate a completely new frequency. You could also convert 50Hz to 10Hz, then multiply it X6. There are many ways to generate a stable frequency from another. Are you really interested in a frequency conversion?

#### electro_yas

Joined Dec 20, 2010
15
I think for that you will need to first convert main supply into dc and again convert it into ac by a transformer like an inverter circuit. It can be done but expensive , is there any method which can be done with less cost and high energy efficient ?

#### blueroomelectronics

Joined Jul 22, 2007
1,757

#### thatoneguy

Joined Feb 19, 2009
6,359
There isn't an efficient(95%+) way to convert 50Hz to 60Hz. You could try a motor/generator combination for items other than a clock that aren't available in 50Hz, but those are rather cumbersome.

If you have the datasheet for the IC inside your clock, you can change the setting if the timebase is derived from the power line. Battery operated "Atomic Clocks" that set themselves by WWVB (US) are becoming very popular here, so line frequency is irrelevant. I believe there are a few stations in the EU that transmit a time standard as well, though I'm not familiar with how common the radio-set clocks are there.

Many new portable generators are now actually converting to DC then using an inverter to produce the output. This allows for higher fuel efficiency than running at the constant required RPM.

The reason I mention this is the use of DC->60Hz Inverters is very widespread now, and many off the shelf items are available. It is only a matter of converting the 50Hz to DC.

#### electro_yas

Joined Dec 20, 2010
15
"Battery operated "Atomic Clocks" that set themselves by WWVB"

How to construct a basic clock with that method.

#### thatoneguy

Joined Feb 19, 2009
6,359
"Battery operated "Atomic Clocks" that set themselves by WWVB"

How to construct a basic clock with that method.
What location are you in? WWVB is a low power 60kHz signal, which covers only most of the US. During the day, there is too much noise in that band, so the radio/atomic clocks set themselves between midnight and 6am, sometimes more than one time if the signal is available.

I don't have the information for Europe, Switzerland had one running at 40kHz, but I do not know of it's current status.

Ready made modules for the US are available, and the cost for a complete clock with time/temp/calendar is under \$20 here.


text:
# Grade 8 the Division of Algebraic Expression Worksheet (For CBSE, ICSE, IAS, NET, NRA 2022)

Get top class preparation for CBSE/Class-8 right from your home: get questions, notes, tests, video lectures and more- for all subjects of CBSE/Class-8.

(a)

(a)

(a)

(a)

(a)

## (6) Use the Short Division Method to Evaluate. Then Write Out the Quotient and the Remainder in the Boxes Given

(a)

(7) Find the Value of n if is factor of

(8) Find the value of k so that be a factor of

(a)

## (10) in below Question, Find the Quotient by Factorizing the Numerator

(a)

• To get the Answer by using long division method first arrange the indices in descending order.

• Now, divide by to get the first term of quotient.

• Multiply the divisor by
• Bring Down the next term (-28)
• Divide by to get second term of quotient,

• Multiply the divisor by 7

• Therefore, Quotient and Remainder

• To get the Answer by using long division method first arranges the indices in descending order.

• Divide by to get first term of quotient.

• Now, multiply the divisor by 3x,

• Bring Down the next term (6)
• Divide by to get second term of quotient.

• Now, multiply the divisor by 2,

• Therefore, Quotient and Remainder

• To get the Answer by using long division method first arranges the indices in descending order.

• Divide by to get first term of quotient.

• Now, multiply the divisor by ,

• Bring Down the next term
• Divide by to get second term of quotient.

• Now, multiply the divisor by ,

• Divide by to get third term of quotient.

• Now, multiply the divisor by ,

• So, Quotient and Remainder

• To get the Answer by using long division method first arranges the indices in descending order.

• Divide by to get first term of quotient.

• Now, multiply the divisor by ,

• Divide by to get Second term of quotient.

• Now, multiply the divisor by ,

• Now Bring Down next two term that is:
• Hence,
• Divide by to get third term of quotient.

• Now, multiply the divisor by ,

• So, Quotient and Remainder

• To get the Answer by using long division method first arrange the indices in descending order.

• Divide by to get first term of quotient.

• Now, multiply the divisor by ,

• Divide by to get Second term of quotient.

• Now, multiply the divisor by ,

• So, Quotient and Remainder

• Arrange the indices in to Descending order:

• Now factorize considering divisor as a factor

• Therefore, Quotient and Remainder

• If is factor of given equation than ,

• By putting the value of the value of equation will become ZERO.

• If is factor of given equation than,

• By putting the value of value of equation will become ZERO.

• Factorize the numerator,

• Now For,
• We know identities that
• Compare this identities with our equation
• So,

• So,

• From Equation-1 and equation-2;

• So, is factor of

• So, Quotient is

• Factorize the numerator,

• Now to factorize given equation; we made by summation of two such part that are factor of multiplication of coefficient of
• Hence
• Multiplication of coefficient
• Now,

• So, is factor of numerator
• So,

• Therefore, Quotient is

Developed by:


text:
# Yo Yo and Inertia!

1. Mar 25, 2005

### BlasterV

Yo-Yo's Inertia A yo-yo has a rotational inertia of 810 g · cm2 and a mass of 190 g. Its axle radius is 3.6 mm, and its string is 70 cm long. The yo-yo rolls from rest down to the end of the string.

I've tried 4 or 5 ways to get linear accel, but none work. b, c, d, and e are straight forward once you get a, but I haven't been able to successfully get it. Can anyone show me how to go about getting linear accel? Thanks

(a) What is its linear acceleration?
cm/s2
(b) How long does it take to reach the end of the string?
s
(c) As it reaches the end of the string, what is its linear speed?
cm/s
(d) As it reaches the end of the string, what is itstranslational kinetic energy?
J
(e) As it reaches the end of the string, what is its rotational kinetic energy?
J
(f) As it reaches the end of the string, what is its angular speed?

2. Mar 25, 2005

### marlon

you will need to use $$a = \frac {+}{-} \alpha R$$

where r is the radius of the yo-yo. You will need to find oud whether to take the + or the minus sign. Just figure out whether a (tangential acceleration) and alpha (angular acceleration) are in the same direction or opposite to each other.

You will also need both versions of Netwon's second law

F = ma
$$I \alpha = \tau$$

marlon

3. Mar 25, 2005

### marlon

As an addendum : realize that there are two forces acting on th yo-yo : the tension T and gravity Mg. Suppose that the y-axis is pointing upwards. Then also realiz that the rope is fixed with the yo-yo on the right side so that if the yo-yo is falling down, you have a rotation counterclockwise. This yields that alpha is positive and the torque is also positive.

The acceleration a is negative because the movement is downwards.

Ma = T-Mg

What will the second versio of Newton's second law yield ?

The solution for a must be $$a = \frac {-g}{1+ \frac{I}{MR^2}}$$

Where I is the rotational inertia of the yo-yo and R it's radius

marlon

4. Mar 25, 2005

Ive done this proof befoure and I believe that the linear acceleration is $$\frac{2}{3} g$$

Regards,

5. Mar 26, 2005

### marlon

How do you come to this conclusion ???

marlon

6. Mar 26, 2005

### Sirus

And how does this help the OP in understanding the problem? BlasterV, why don't you try the problem using what marlon has posted.

7. Mar 26, 2005

I am simply giving the answer to him so he can make sure his work is correct. I am not going to post how I got it since marlon alwready posted the method. If you would like to know, feel free to pm me and I will write it all out for you so you can see the solution.

Regards,

8. Mar 26, 2005

If you would like to know, pm me and I will write it out for you. The answer you wrote can be generalized for all kinds of yo-yo's.

Regards,

9. Mar 27, 2005

### Staff: Mentor

I think you are confusing this (yo-yo) problem with another: A falling spool (cylinder) unwinding as it falls. In that special case, $I = 1/2 MR^2$ where R is the radius of the cylinder (the cylinder is the axle). Plug that into marlon's general solution and you'll get $a = 2/3 g$.

But marlon gave the correct solution for the given yo-yo problem.

10. Mar 27, 2005

My mistake. Sorry about that marlon.

Regards,

11. Mar 28, 2005

### plusaf

so........

so, also assuming that the yo-yo's string has zero thickness, so that it can wind around the axle in one layer, the mass of the yoyo plus the radius of the axle should provide some inkling as to the torque that the string applies to the yoyo, and that torque, when applied to the rotational inertia of the yoyo will determine how fast it spins up (as it falls down... ) and that will lead to answers to maximum rotational velocity, linear velocity, etc.....

such fun!


text:
# inequalities – “Reversed” Bernstein Inequality

I’m studying harmonic analysis by myself, and I read some online notes that introduce the Bernstein inequality. One of them mention a reversed form of the Bernstein inequality, which is stated below:

Let $$mathbb{T} = mathbb{R} / mathbb{Z} = (0,1)$$ be the one-dimensional torus. Assume that a function $$f in L^{1}(mathbb{T})$$ satisfies $$hat{f}(j) = 0$$ for all $$|j| < n$$ (vanishing Fourier coefficients). Then for all $$1 leq p leq infty$$, there exists some constant $$C$$ independent of $$n,p$$ and $$f$$, such that
$$||f’||_{p} geq Cn||f||_{p}$$

It seems that an easier problem can be obtained by replacing $$f’$$ with $$f”$$ in the above inequality. The easier problem is addressed in the MO post below:

Does there exist some \$C\$ independent of \$n\$ and \$f\$ such that \$ |f”|_p geq Cn^2 | f |_p\$, where \$1 leq pleq infty\$?

However, it seems that the trick of convex Fourier coefficients used in the post above no longer applies to the harder problem (lower bounding the norm of the first derivative). Any suggestions/ideas?


text:
Find the lengths oft he medians of the triangle with vertices A(0, 0, 6), B(0, 4, 0) and C( 6, 0, 0).

### Question Asked by a Student from EXXAMM.com Team

Q 2676345276.     Find the lengths oft he medians of the triangle with vertices A(0, 0, 6), B(0, 4, 0) and
C( 6, 0, 0).

#### HINT

(Provided By a Student and Checked/Corrected by EXXAMM.com Team)

#### Access free resources including

• 100% free video lectures with detailed notes and examples
• Previous Year Papers
• Mock Tests
• Practices question categorized in topics and 4 levels with detailed solutions
• Syllabus & Pattern Analysis