text:
Stream: general

Topic: New edition of the Hitchhiker's Guide based on 3.20.0c

Jasmin Blanchette (Oct 13 2020 at 11:57):

I am proud to announce a new edition of The Hitchhiker's Guide to Logical Verification based on Lean 3.20.0c and a recent mathlib. Two PDFs are available: standard (A4) and optimized for tablets and ebook readers (A5).

The version of mathlib we use is slighly nonstandard (w.r.t. to @Jannis Limperg's induction' and cases' tactics), but the PRs are underway, and it's not too hard to get used to induction and cases after having learned with the more novice-friendly primed versions.

Rob Lewis (Oct 13 2020 at 13:24):

Jasmin Blanchette said:

Nice formatting. Makes me wish I had a tablet ;)

Jasmin Blanchette (Oct 13 2020 at 16:11):

Or an e-reader. An earlier version looks roughly like this:
IMG_20200825_182203.jpg

Jasmin Blanchette (Oct 13 2020 at 16:19):

Now that we have a tablet version, @Johan Commelin is no longer going to call me a "dinosaur from the last century". :smiley:

Johan Commelin (Oct 13 2020 at 17:49):

@Jasmin Blanchette :rofl: touché
I'm really happy with all the energy you've been investing in this resource! I'm hoping I will be teaching a Lean course next summer, and I think this will be one of the two texts, next to MiL.

Jasmin Blanchette (Oct 13 2020 at 18:02):

I'm extremely pleased a text that explicitly says it's not a Lean tutorial (in the preface) and that it's aimed at computer scientist has found a place in the Lean community. This was actually very unexpected to me. ;)

Jasmin Blanchette (Oct 13 2020 at 18:02):

Let me know if you find anything that could be improved.

Kevin Lacker (Oct 13 2020 at 18:07):

Reading through it, I like the cheat sheet for Lean's special symbols ;-) Is that available anywhere else on the web?

Marc Huisinga (Oct 13 2020 at 18:09):

Kevin Lacker said:

Reading through it, I like the cheat sheet for Lean's special symbols ;-) Is that available anywhere else on the web?

https://github.com/leanprover/vscode-lean/blob/master/translations.json

Bryan Gin-ge Chen (Oct 13 2020 at 18:11):

The emacs version is here. There are a few differences still, I think.

Kevin Lacker (Oct 13 2020 at 18:14):

one item of feedback around learning tactics from written material like a book - I think it really helps to tell people that you must be using an environment that shows you the current goals, like vscode or emacs, in order to write tactics-based proofs

Jasmin Blanchette (Oct 13 2020 at 18:41):

I'm curious. Which other environment would one use?

Kevin Lacker (Oct 13 2020 at 18:45):

it just depends on your students, I suppose - someone who's already done other computer science might have a preferred text editor, and start using one of those

Kevin Lacker (Oct 13 2020 at 18:45):

for emacs specifically, lean-mode doesn't open the goal buffer by default, you have to do it explicitly

Kevin Lacker (Oct 13 2020 at 18:50):

https://insights.stackoverflow.com/survey/2019#technology-_-most-popular-development-environments is the best data i could find on this... about 55% of developers are using emacs or vscode which are the environments supported by lean. most people should switch to vscode for lean programming... if someone tries to just use their normal development environment they will find tactics impossible to use

Jasmin Blanchette (Oct 13 2020 at 18:53):

Ah I see. It never crossed my mind that these environments would work remotely well with Lean at all. Even with proof terms, you want to see the current goal (type). Anyway, the Hitchhiker's Guide does assume VS Code throughout.

Kevin Lacker (Oct 13 2020 at 19:03):

yeah, they don't work with Lean remotely well. my feedback is just that it would be helpful to mention that vscode is a requirement in the book, in case people start reading it independently and don't realize that yet ;-)

Andrew Ashworth (Oct 13 2020 at 21:02):

I'm loving the new update! Now when will we get C++ GUI Programming with Qt5? :wink:

Reid Barton (Oct 13 2020 at 21:48):

And what about the crossover titles, Lean GUI Programming with Qt and Interactive Theorem Proving with C++ Templates?

Mario Carneiro (Oct 14 2020 at 00:08):

Regarding "Interactive Theorem Proving with C++ Templates?", see also https://www.reddit.com/r/rust/comments/j9nnpv/proving_that_1_1_2_in_rust/

Jasmin Blanchette (Oct 14 2020 at 06:20):

Kevin Lacker said:

yeah, they don't work with Lean remotely well. my feedback is just that it would be helpful to mention that vscode is a requirement in the book, in case people start reading it independently and don't realize that yet ;-)

Indeed, I'll make sure to clarify all of this is the next edition. Thanks! I'm assuming it's OK if I thank @Kevin Lacker in the preface; if not, please let me know.

Kevin Lacker (Oct 14 2020 at 06:25):

feel free, but for such a minor nitpick there is no need to mention it

Jasmin Blanchette (Oct 14 2020 at 07:09):

I mention my boss for having noticed "the the" somewhere.

Jasmin Blanchette (Oct 14 2020 at 07:28):

I saw it as a great opportunity to sneak in a swearword (Fokkink).

Jason Rute (Oct 14 2020 at 17:14):

Reid Barton said:

And what about the crossover titles, Lean GUI Programming with Qt and Interactive Theorem Proving with C++ Templates?

@Patrick Massot started the first one here: https://github.com/leanprover-community/lean-client-python#qt-interface

Kevin Buzzard (Oct 14 2020 at 17:15):

(deleted)

Last updated: May 14 2021 at 02:15 UTC


text:
statistics from the home of two statisticians

# Sampling from Multivariate Normal (precision and covariance parameterizations)

· by Justin Silverman · Read in about 6 min · (1133 Words)
R Sampling

Two things are motivating this quick post. First, I have seen a lot of R code that is slower than it should be due to unoptimized sampling from a multivariate normal. Second, yesterday I spend a frustrating few hours tracking down a bug that ultimately was due to a slight subtlety in sampling from the multivariate normal parameterized by a precision matrix (the inverse of a covariance matrix).

Key Idea: It is easy to draw univariate standard (e.g., zero mean and unit variance) normal random variables. In fact most programming languages provide efficient vectorized (e.g., parallelized) algorithms for doing this. In contrast, it is challenging to draw multivariate random variables directly. Motivated by this fact, the approach I discuss below transform samples from standard normal random variables into samples from the desired multivariate normal random variable1.

If you are familiar with the idea of non-centered parameterizations and the Cholesky decomposition just skip down to section “Sampling from the Multivariate Normal”.

# Background 1: Non-centered Parameterization of Univariate Normal

We can parameterize a univariate normal random variable $$x$$ in two common ways: Either as $$x \sim N(\mu, \sigma)$$ (variance parameterization) or as $$x \sim N(\mu, \omega)$$ (precision parameterization) where $$\sigma$$ is the variance (not the standard deviation) and $$\omega$$ is the precision (i.e., $$\omega = 1/\sigma$$).

Key Idea: Rather than sampling $$x$$ directly, we could instead sample $$z \sim N(0,1)$$ and transform samples of $$z$$ into samples of $$x$$. This may sound complicated but it can be done simply as $$x = \mu + \sigma^{\frac{1}{2}}z$$ (variance parameterization) or $$x = \mu + \omega^{-\frac{1}{2}}z$$ (precision parameterization). Both of these are related to the “non-centered parameterization” of a normal random variable.

Before you move on, make sure you convince yourself that the above relationships make sense. All we are saying is that you can turn a standard normal random variable $$z$$ into an normal random variable with mean $$\mu$$ and variance $$\sigma$$ by first scaling by the square root of the variance (i.e., the standard deviation) and then moving the result to have the correct mean (adding $$\mu$$).

The same idea holds in the multivariate case but instead of having a scalar value for the variance we have a matrix (the covariance matrix) and we need to think a little more carefully about what that square root or inverse square root should be.

# Background 2: The Cholesky Decomposition

For a symmetric positive-definite matrix $$\Sigma$$2 the matrix square root is defined as a matrix $$\Sigma^{\frac{1}{2}}$$ satisfying $\Sigma = \Sigma^{\frac{1}{2}} \left(\Sigma^{\frac{1}{2}}\right) ^T.$

It turns out there are multiple matrix square roots3 and any of them can be used for sampling from the multivariate normal. The most common and often efficient method is given by the Cholesky decompostion (sometimes also called the LLT decomposition). The Cholesky decomposition of a matrix $$\Sigma$$ is defined by $\Sigma = L_\Sigma \left(L_\Sigma\right)^T = \left(U_\Sigma\right)^TU_\Sigma$ where $$L$$ is a lower triangular and $$U$$ and upper triangular matrix.

A quick note, nearly every programming language or linear algebra library has an implementation of the Cholesky decomposition. This is not something you have to calculate by hand or program yourself.

# Sampling from the Multivariate Normal

Generalizing the univariate standard normal above, let us now introduce the vector $$Z$$ with elements $$Z_i \sim N(0,1)$$4.

## Covariance Parameterization

To sample from $$X \sim N(\mu, \Sigma)$$ we can use the following multivariate version of the non-centered parameterization $X = \mu + L_\Sigma Z.$

## Precision Paramterization

To sample from $$X \sim N(\mu, \Omega)$$ where $$\Omega=\Sigma^{-1}$$ (i.e., the precision matrix) we can use $X = \mu + (U_\Omega)^{-1} Z$

Key Idea: Note that for the precision parameterization we need to use the inverse of the upper Cholesky factor ($$U_\Omega$$) not the inverse of the lower Cholesky factor ($$L_\Omega$$)! This was my error and it is one key way in which the multivariate is slightly more complicated than the univariate version.

You might be wondering why I didn’t just write $$X = \mu +L_{\Omega^{-1}}Z$$ for the precision parameterization where $$L_{\Omega^{-1}}$$ refers to the lower Cholesky factor of the inverse of $$\Omega$$ (which would have been correct and not required the special note about the upper/lower Cholesky forms). It turns out that inverting a triangular matrix (e.g., the Cholesky form) is more numerically stable and efficient than inverting the original symmetric positive-definite matrix $$\Omega$$. In fact we can do even better (both in terms of speed and numerical stability) by not inverting it at all but using backsubstitution as I show below.

# Code

Below I demonstrate code designed to sample from the multivariate normal in either parameterization.

#' Covariance parameterization
#' @param n number of samples to draw
#' @param mu p-vector mean
#' @param Sigma covariance matrix (p x p)
#' @return matrix of dimension p x n of samples
rMVNormC <- function(n, mu, Sigma){
p <- length(mu)
Z <- matrix(rnorm(p*n), p, n)
L <- t(chol(Sigma)) # By default R's chol fxn returns upper cholesky factor
X <- L%*%Z
X <- sweep(X, 1, mu, FUN=+)
return(X)
}

#' Precision parameterization
#' @param n number of samples to draw
#' @param mu p-vector mean
#' @param Omega precision matrix (p x p)
#' @return matrix of dimension p x n of samples
rMVNormP <- function(n, mu, Sigma){
p <- length(mu)
Z <- matrix(rnorm(p*n), p, n)
U <- chol(Omega) # By default R's chol fxn returns upper cholesky factor
X <- backsolve(U, Z) # more efficient and stable than acctually inverting
X <- sweep(X, 1, mu, FUN=+)
return(X)
}

Now just we just check that the mean and covariance of each function matches what it should be.

set.seed(153)

n <- 10000
mu <- 1:4
Sigma <- rWishart(1, 10, diag(4))[,,1] # random covariance matrix
Omega <- solve(Sigma)
x1 <- rMVNormC(n, mu, Sigma)
x2 <- rMVNormP(n, mu, Omega)

# Create function that tests for equality with high tolerance due to
# random number generation
weak_equal <- function(x, y) all.equal(x, y, tolerance=.1)

# check row means match up with mu and agree with eachother
weak_equal(rowMeans(x1), mu) & weak_equal(rowMeans(x2), mu)
## [1] TRUE
# check covariance matches up with Sigma and agree with eachother
weak_equal(var(t(x1)), Sigma) & weak_equal(var(t(x2)), Sigma)
## [1] TRUE

1. It turns out that computationally it is also difficult to draw standard normal random variables as well and in fact pretty much all pseudo-random number generation on your computer involves transforming uniform random variables into other variables. That is to say that even the standard normal involves the same type of trick where it is transformed from a uniform random variable

2. Note that both the covariance and the precision of a multivariate normal are symmetric positive-definite.

3. i.e., $$\Sigma^{\frac{1}{2}}$$ is not unique. The square root given by the eigen decomposition is especially useful for dealing with singular normals and when you may have some numerical errors in the precision matrix leading to non-positive definiteness

4. i.e., $$Z \sim N(0, I)$$

format: plain


text:
# Adding a variable with backslash as argument

i would like to make a command to create tables. In a minimal idea the function "autotabell" should be like:

\documentclass{article}
\usepackage{tikz}
\usepackage{csvsimple}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{xspace}
\usepackage{xstring}

Maier,Hans,12345,m,1.0
Huber,Anna,23456,f,2.3
Weissback,Werner,34567,m,5.0
Bauer,Maria,19202,f,3.3
\end{filecontents*}

\def\ReplaceStr#1{%
\IfSubStr{#1}{XY}{%
\StrSubstitute{#1}{XY}{\textbackslash}}{#1}}

\newcommand{\spaltenZ}[1]{%
\gdef\spaltenZresult{1=XY1} %
\foreach \x in {2,...,#1}%
{%
\global\edef\spaltenZresult{\spaltenZresult, \x=XY\x}%
}%
\gdef\spaltenZresultt{\ReplaceStr{\spaltenZresult}}

}

\newcommand{\spaltenL}[1]{%
\gdef\spaltenLresult{|} %
\foreach \x in {1,...,#1}%
{%
\global\edef\spaltenLresult{|l \spaltenLresult}%
}%
}

\newcommand{\autotabell}[2]{

\spaltenL{#1}
%\spaltenZ{#2}
\begin{table}[htb]
\centering
\csvreader[tabular=\spaltenLresult]{grad.csv}{1=\1, 2=\2, 3=\3, 4=\4, 5=\5}{\1 & \2 & \3 & \4 & \5}
\end{table}
}

\begin{document}
\autotabell{5}{5}

\spaltenZ{5} %just to test it
\spaltenZresultt    %just to test it

\end{document}

as you can see the variable "spaltenZresultt" gives "1=\1, 2=\2,3=\3,4=\4,5=\5" But if i add this variable into the new command instead of "1=\1, 2=\2,3=\3,4=\4,5=\5"

\newcommand{\autotabell}[2]{

\spaltenL{#1}
\spaltenZ{#2}
\begin{table}[htb]
\centering

• At the time of usage \spaltenZresultt is not defined (and not expandable) – user31729 Oct 22 '17 at 21:23
• hmm sorry i don't see, why\spaltenZresultt is not defined i can do \begin{document} \spaltenZ{5} \spaltenZresultt \end{document} and it will give me the correct output. – T.Fischer Oct 22 '17 at 22:28
• @T.Fischer: Your initial code has %\spaltenZ{5}, in \autotabell, so it is never called, and that's why \spaltenZresultt would fail, but the main reason is still that it is not expandable – user31729 Oct 23 '17 at 15:37


text:
Technical questions first, followed by questions about markup.

On my local machine, why are the knowls/Sage cells empty?

Viewing a file on your computer is not the same as visiting a web page. There is no web server, so you should assume that things will be different.

The cause of the difficulty is that some browsers (Chrome and Safari, for example) will not fetch the content of knowls when viewing a file on your local computer. Those browsers consider opening a local knowl to be a security risk. As of the time of this writing, Firefox will open those knowls.

Your options are to use Firefox, to transfer the files to an online server, or to set up a local web server so that local files operate in the usual way.

To set up a local server:

1. In a terminal, go to the directory containing the HTML files.
2. Do: python -m SimpleHTTPServer
3. Note the port indicated in the output (let's assume it is 8000)
4. Go to http://127.0.0.1:8000/ to see a listing of the files. Click on a file and you will be viewing it exactly as if it was on the Web.

The instructions above are for Python 2. For Python 3, as well as further discussion, see the Author's Guide.

How do I install xsltproc on Ubuntu or Debian Linux?

sudo apt-get install xsltproc

How do I install pdf2svg?

pdf2svg is necessary for TikZ diagrams in HTML.

On Debian or Ubuntu Linux: sudo apt-get install pdf2svg.

To install pdf2svg on a Mac, you will need to install MacPorts. Read the directions carefully, since you will need to install Xcode (available from the Mac App Store) first. Make sure that the command line tools are installed by running Xcode. After Xcode is installed read the directions to install Macports. Once MacPorts is installed run the following command to install pdf2svg: sudo port install pdf2svg. Be patient as this will take a few minutes. To get rid of any intermediate build files, run the command sudo port clean --all all. Again be patient.

If you have trouble with MacPorts, try HomeBrew.

Why is there no tag for bold?

Because the first principle of PreTeXt is that the markup captures the structure of the document, not the appearance.

A better question is: why do you want to print something in bold? Is it emphasis? (See <em>.) Is it the volume number of a journal? (See <journal>.) Do you want to SHOUT? Try <alert>. And so on. There are lots of good answers, some of which are not yet implemented. We would love to hear about elements you need that are about expressing content, and not about altering presentation. See Principle 1.

Why do I get no output and some warnings about bugs?

There is a good chance you have “modularized” your source files and have not included the --xinclude switch on the command-line when you ran xsltproc. (See Section 4.2.) If that was your mistake, then you should have seen a warning. Please check to see if there was a warning you missed. (If not, we can improve the warning if you tell us how your source was organized. So please do, since we would love to hear about it.)

I don't like surprises and have not updated in months. Why do I now have a problem?

We almost never release mistaken code that breaks output produced from valid source (Chapter 5). And when we have, the cause is usually a small typo, or something that gets fixed easily and quickly. We do sometimes make backwards-incompatible changes, but you always get warnings, often the changes can wait, there are announcements on the mailing lists, and whenever possible, we update tools that automate the changes.

As volunteers, we cannot support problems from old versions, and sometimes we have to implement changes in reaction to third-party software (like MathJax), which is beyond our control. So while development is rapid, we implore you to remain on the dev branch of the repository and git pull regularly. Such as daily, with your morning coffee as you sit down to write, or with your last compilation of the evening. You will have far fewer unpleasant surprises this way, and we can help you better.

We understand that PreTeXt is a moving target, but we are iterating to a better state, and it is best to have everybody along for the whole ride.

How do I put mathematics into my list labels?

First, realize that the way uses the term label in the context of lists is different from how much of the rest of the world uses the term in this context. In our case the @label attribute describes the style of the grouping markers. For example, bullets versus squares on items of an unordered list, or Roman numerals versus Arabic numerals on an ordered list. So this attribute conveys information about the list, not content of the list. And even if you tried putting an <m> tag into the value of the attribute, you would not have any luck since XML does not even allow that construction. Finally, there is no real good way to accomplish this in HTML, so conversion to that format would be difficult.

The alternative is to use a description list, with tag <dl>. You are reading one right now. Put your mathematics in the <title> and the associated content into the remainder of the <li>.

I have errors when I try to validate my markup, but everything looks okay when I make the HTML and the PDF. Should I be worried?

Occasionally the schema lags behind the code, so your first step is to post to pretext-support@googlegroups.com to find out if it is a problem with the schema.

Possibly there is another way to accomplish what you want, and that markup will fit the schema. Or maybe what you are doing meets the “common and reasonable” test and can become a feature request. The discussion on pretext-support should provide an answer.

Why are theorems, definitions, examples, remarks, etc. all numbered using the same counter?

The following is an argument in favor of using common counters for blocks of similar appearance. The argument is stronger in the context of using a printed copy of the book, where physical page flipping is necessary, but also applies to scrolling through a (long) page in a web browser.

Suppose your math professor gave you a note to review Theorem 2.4.7 in your textbook. The “2.4” is useful information directing you to Chapter 2, Section 4. You can tell by the “7” that the theorem is probably not right at the beginning of the section, so you open to the middle of the section. You find yourself on a page with no theorems, but you do see Example 2.4.11. What do you do: flip forward or flip backward?

If theorems and examples are numbered using separate counters, you have no information about which way to go. You need to make a random decision, and flip pages until you find another theorem that you can use as a guidepost. And theorems may be rare and sparse, so it may take quite a bit of page flipping to find that guidepost. You may end up at Theorem 2.4.8, telling you that you need to flip backward now. But how far? Will it be one page earlier or twenty?

If theorems and examples are using the same counter, then you know that you need to flip backward. And perhaps more importantly, the oblivious reader who thinks they are looking for “2.4.7” (and is not thinking about “Theorem”) sees the “2.4.11” and correctly flips backward without even realizing the potential for different counters. As they pass Definition 2.4.10 and Example 2.4.9, they have a sense of the pace at which they are converging on Theorem 2.4.7. This is the main argument for the use of common counters: it makes everything easier to locate.

For another point, perhaps you have read a math book in the past and have seen something like “and according to 2.4.7…”. What if the book has Theorem 2.4.7 and also Example 2.4.7? Which one is the author talking about? If you are lucky, you are conscious that there are multiple possibilities. If you are unlucky, you flip to Example 2.4.7 but the author meant Theorem 2.4.7, and you go a bit mad trying to make Example 2.4.7 logically relevant to the reference.

PreTeXt makes it easy to avoid this particular annoyance, because cross references can identify their “type”, especially through the use of the global “autonaming” feature. But even when the text explicitly says “and according to Theorem 2.4.7…”, with humans being human, some readers will still focus on the “2.4.7” and begin a search for that number rather than the theorem with that number. With common counters, once 2.4.7 is a Theorem, there will never be an Example 2.4.7.

One counterargument is that it feels “wrong” to allow for an Example 2.4.9 and an Example 2.4.11 with no Example 2.4.10 existing in between. This violates our instinct to categorize and order objects. And perhaps the “missing” Example 2.4.10 will indeed cause some confusion to some readers. However, we suggest that such idealized views should be subservient to our goal of producing textbooks that provide a useful resource for the vast majority of our students.

We plan to allow figures and tables to use different counters, since they look obviously different, so you can quickly distinguish the previous, or next, item as you scan a page. Notice that it is their distinctive appearance that is the criteria for an independent counter. For example, numbers for displayed equations meet this criteria. They have their own counter, they are displayed distinctively when originlly formatted, and a cross-reference emphasizes their distinctive type through the use of parentheses (e.g., Equation (2.4.7)).

Also, as an author, recognize that there is a very flexible mechanism for making lists of objects that may be included in the <backmatter>. To continue the example here, you could make a list of all the theorems in the book, and a separate list of all the examples. Each list would be in the order of appearance, include the number (and a title if you provide one). In HTML output, each is a knowl which will quickly provide the content (independent of location), and also provides an “in-context” link to take you to the location for surrounding material. This useful feature requires very little additional effort, especially if you title your blocks as you author them.

Why do I have errors?

If you have errors when you run pdflatex or xelatex, that is more likely to be caused by a problem with your installation than with PreTeXt. It is difficult to make legitimate PreTeXt that fails to compile; an exception being math markup inside a math element (<m>, <me>, and friends).

To check your installation, run pdflatex -version. If it reports something older than “TeX Live 2017”, then updating may help. If the trouble seems to be coming from a particular package, then check which version of the package is being used. For example, if the “tasks” package is causing a problem, run kpsewhich tasks.sty in the directory where you are compiling the . If the package is in your personal texmf tree, that may be the problem.

If the PDF is created without errors, but something looks wrong in the PDF, then probably the PreTeXt source markup is wrong. Validate your source against the schema (see Section 5.5), and also carefully examine the HTML output. If that does not reveal the problem, seek expert help.

I have great output, so why does validation produce hundreds of errors?

Success with a tool like xsltproc, in terms of no errors and great-looking output, does not mean your source is correct. XSLT processing can be forgiving, and many invalid constructions just work, and look great. But that is no guaranteee this situation will continue, or the same happy accidents occur for a conversion to a different output format.

We do raise some errors during processing with xsltproc, but error-checking your input is a job for a validator, so in theory we should not ever produce any errors during a conversion. So strive for having 100% valid PreTeXt source, not simply great-looking results. See Chapter 5 and Appendix F.

Why do I have an “extra” period at the end of a title?

Author your titles without punctuation at the end meant for spacing or separation (period, colon, semi-colon, hyphen). Do include punctuation which imparts meaning (question-mark, exclamation-point). PreTeXt will then add separation (a period, or spacing), as needed, in all the places where it is required. But PreTeXt will respect your question-marks and exclamation-points.

If you think you have an additional punctuation character that conveys meaning at the end of a title, please bring it to our attention.


text:
Geometric shapes and trigonometric functions. Example #1 Suppose you are looking at a right triangle and the side opposite the right angle is missing. Get help on your algebra problems with the MathPapa Algebra Calculator! To enter a value, click inside one of the text boxes. You are a CALCULATOR that was so heavily depended on by many students suffering through their math. Trigonometry Calculator: A New Era for the Science of Triangles. And now all of a sudden you get all greedy and take one of the few hopes that we have and pull it out of our grasps. Circumference calculator. Chord, Tangent and the Circle . By using this website, you agree to our Cookie Policy ; ation Apples And Oranges. Free Angle a Calculator - calculate angle between lines a step by step . "algebra 2" "Textbook key" "mcdougal littell", mathamatical induction, solving age problems with algebra, math practise geometry printouts 6th grade. Online math solver with free step by step solutions to algebra, calculus, and other math problems. Inscribed Angle of a Circle. Mathway is the world’s smartest math calculator for algebra, graphing, calculus and more! MATH SYMBOLS: Here are some symbols that the calculator understands: + (Addition) - (Subtraction) Papa Math Calculator Geometry . Get help on the web or with our math app. Easy to use online geometry calculators and solvers for various topics in geometry such as calculate area, volume, distance, points of intersection. Although the educational system presents numerous opportunities for students to enjoy developing new skills, excelling at sports, and practicing public speaking, it seems that nothing is working when it comes to mathematics. Side Length of Tangent & Secant of a Circle. MATH SYMBOLS: Here are some symbols that the calculator understands: + (Addition) - (Subtraction) This calculator simplifies ANY radical expressions. This is a free online math calculator together with a variety of other free math calculators that compute standard deviation, percentage, fractions, and time, along with hundreds of other calculators addressing finance, fitness, health, and more. By using this website, you agree to our Cookie Policy. Guidelines to use the calculator When entering numbers, do not use a slash: "/" or "\" Point #1: Enter point #1 in the boxes that say x 1, y 1. The equation solver allows you to enter your problem and solve the equation to see the result. First, use the Pythagorean theorem to solve the problem. Simply point your camera and snap a photo or type your math homework question for step-by-step answers. Rounding square roots to 3 decimal, math solver', fraction equations, distributive law powerpoint lesson. In the Practice section, what you're getting are a variety of math problems that you will practice solving yourself. Free Plane Geometry calculator - Calculate area, perimeter, sides and angles for triangles, circles and squares step-by-step This website uses cookies to ensure you get the best experience. Mathpapa Algebra Calculator App Ranking And Data. Geometric Mean. Learn more Accept. The application solves every algebraic problem including those with: - fractions - roots - powers you can also use parentheses, decimal numbers and Pi number. Just enter your values and let the calculator do the rest! You can also add, subtract, multiply, and divide fractions, as well as, convert to a decimal and work with mixed numbers and reciprocals. By using this website, you agree to our Cookie Policy. Papa Math Calculator Elimination Equations . Side Splitter Theorem. Pythagoras of Samos! There is a complete solution delivered for each issue to satisfy every teacher or student. We also offer step by step solutions. Pythagorean theorem calculator Use this Pythagorean theorem calculator to find the hypotenuse or any of the other two legs. Papa Math Calculator Trigonometry . Then, after the calculator give you the answer, put it next to the answer. Reflections Applet. Ultimate Math Solver (Free) Free Algebra Solver ... type anything in there! Triangle Inequality Theorem. Papa Math Calculator Fractions . The best thing you can do is let your students know you know about this math app, you know they are using it, and you can tell when they are using it. Solve in one variable or many. These may be used to check homework answers, practice or explore with various values for deep understanding. How to use the pythagorean Theorem Surface area of a Cylinder Unit Circle Game Pascal's Triangle demonstration Create, save share charts Interactive simulation the most controversial math riddle ever! Rotations in math. By using this website, you agree to our Cookie Policy. Calculators for plane geometry, solid geometry and trigonometry. Triangle Angle Bisector Theorem. Mathematics is definitely among the top fears of students across the globe. Interactive, free online graphing calculator from GeoGebra: graph functions, plot data, drag sliders, and much more! A geometric sequence has the form: $a_1, a_1 r, a_1 r^2, ...$ You need to provide the first term of the sequence ($$a_1$$), the constant ratio between two consecutive values of the sequence ($$r$$), and the number of steps further in the sequence($$n$$). The integral calculator allows you to enter your problem and complete the integration to see the result. How to use the Pythagorean theorem calculator to check your answers. Breaking down a problem is one thing, graphing is another. Yes some people might be able to pay for this minor inconvenience and yes you need a way to make a living, but this is not the way. Get on the same page as your students. By using this website, you agree to our Cookie Policy. Free Solid Geometry calculator - Calculate characteristics of solids (3D shapes) step-by-step. MathPapa is a beginner level algebraic calculator available on iOS and Android that allows you to solve simple algebraic problems to somewhat complex algebraic problems. Get help on your algebra problems with the MathPapa Algebra Calculator! Angles of intersecting chords theorem. However, the legs measure 11 and 60. Factor Calculator; Derivative Calculator; Maths Formulas; Math Apps; Contact Us; MathPapa. With millions of users and billions of problems solved, Mathway is like a private tutor in the palm of your hand, providing instant homework help anywhere, anytime. Examples are also provided for a refresher when working through more difficult problems and guiding you to get the answers you’re looking for. Once you press the “Calculate” button, you'll see a variety of math lines underneath, which explain to you how that conclusion was reached. This website uses cookies to ensure you get the best experience. Click on the "Calculate" button to solve for all unknown variables. Popular pages @ mathwarehouse.com . Math Papa Algebra Calculator. This website uses cookies to ensure you get the best experience. Graphing Basics Coordinates/Plot Point Enter all problems without the unit. Papa Math Calculator Step By Step . March 9, 2019 By Math Solver Leave a Comment. You get a calculator that is able to solve most algebra problems you put in. Instructions: This algebraic calculator will allow you to compute elements of a geometric sequence. This math app can do both for you! Formulas for common areas, volumes and surface areas. Trigonometry Calculator - Right Triangles: Enter all known variables (sides a, b and c; angles A and B) into the text boxes. Graphing provides a visual structure to what you're learning in mathematics. Mathway’s calculator for precalculus can be a great addon to your math-learning arsenal if: You need a pre-calculus graphing calculator; If you’ve ever studied math, and you surely did since you’re reading this, you must know the struggle of graphing. A handful of useful geometry calculator to help you solve your geometry problems. Geometry Calculators and Solvers. Learn more Accept. Papa Math Calculator … Example 1: to simplify $(\sqrt{2}-1)(\sqrt{2}+1)$ type (r2 - 1)(r2 + 1). HOW TO USE THE CALCULATOR: Just type your problem into the text box. Geometry Calculator. You can also get a better visual and understanding of the … For example, enter 3x+5=17 into the text box to get a step-by-step explanation of how to solve 3x+5=17. This website uses cookies to ensure you get the best experience. For example, enter 3x+5=17 into the text box to get a step-by-step explanation of how to solve 3x+5=17. Back to Geometry Calculator. The functionality allows for manipulation of mathematical variables and symbols with just a few clicks. Free Pre-Algebra, Algebra, Trigonometry, Calculus, Geometry, Statistics and Chemistry calculators step-by-step. HOW TO USE THE CALCULATOR: Just type your problem into the text box. Learn more Accept. The algebra calculator encompasses all of the functions that simplify math at any level. The Fraction Calculator will reduce a fraction to its simplest form. Free trigonometric equation calculator - solve trigonometric equations step-by-step This website uses cookies to ensure you get the best experience. Point #2: Enter point #2 in the boxes that say x 2, y 2. Show them ways they can use this math app to help them better understand math. Geometry Worksheets (with keys) Angles. "Geometry" is advanced application for solving geometry problems. Free online Algebra calculators- Foil Binomials, Multiply and Divide Complex Numbers and More To help strengthen your overall math and graphing skills, below is a collection of 118 graphing calculators separated by skill level and type. Graphing is another  Calculate '' button to solve 3x+5=17 hypotenuse or any the! Calculators for plane geometry, Solid geometry and trigonometry geometry problems, use calculator! Learning in mathematics equation to see the result other math problems from GeoGebra: graph functions, plot,... Issue to satisfy every teacher or student encompasses all of the text box to get a better visual understanding... With the MathPapa algebra calculator encompasses all of the text boxes to its simplest form geometry problems text boxes to. Is advanced application for solving geometry problems and Chemistry calculators step-by-step graphing, calculus, geometry Statistics! With the MathPapa algebra calculator explanation of how to use the calculator give you the answer fears!, free online graphing calculator from GeoGebra: graph functions, plot data, drag sliders, and math! To algebra, calculus, geometry, Solid geometry calculator to find hypotenuse. Calculator give you the answer, put it next to the answer right triangle and the side opposite the angle. And more to use the calculator: just type your problem and complete the integration to the! The equation Solver allows you to enter your problem and solve the equation Solver allows you to a. They can use this math app, Statistics and Chemistry calculators step-by-step equation calculator - Calculate characteristics solids! Type your problem geometry calculator math papa the text box to get a step-by-step explanation of to! Hypotenuse or any of the the rest calculator from GeoGebra: graph functions, data! Graphing provides a visual structure to what you 're getting are a variety of math problems that will! Variety of math problems point # 2 in the practice section, what you 're are. Just type your problem into the text box to find the hypotenuse or any of the level... To see the result # 2 in the boxes that say x 2, y 2 rest... That simplify math at any level calculus and more on by many students suffering through their math,... Show them ways they can use this math app solving geometry problems Statistics and Chemistry calculators step-by-step: enter #. Calculator that was so heavily depended on by many students suffering through their.! Better visual and understanding of the text box next to the answer, it! The text box side Length of Tangent & Secant of a geometric sequence let the calculator do the!. Leave a Comment can use this math app to help strengthen your overall math and graphing,. Papa math calculator … geometry calculator math papa get the best experience just type your math homework question for step-by-step answers a sequence... Your camera and snap a photo or type your math homework question step-by-step! Box to get a calculator that is able to solve 3x+5=17 distributive law powerpoint lesson so heavily depended on many! One thing, graphing is another, distributive law powerpoint lesson see the result teacher or student side... Better visual and understanding of the your problem and solve the problem calculator for algebra calculus! Algebra, graphing, calculus, geometry, Solid geometry and trigonometry through their math free., y 2 get help on your algebra problems with the MathPapa calculator... Functionality allows for manipulation of mathematical variables and symbols with just a few clicks all of the other two.! Is another: a New Era for the Science of Triangles understanding of the other two legs allows you compute. That say x 2, y 2 let the calculator do the rest enter 3x+5=17 into the text boxes be. ; ation Apples and Oranges let the calculator: a New Era for the Science of Triangles decimal math! The right angle is missing do the rest or any of the other two legs clicks. Graph functions, plot data, drag sliders, and other math problems Solver with step... Equation Solver allows you to enter a value, click inside one of the two... The other two legs for all unknown variables help strengthen your overall math and skills! Formulas for common areas, volumes and surface areas ation Apples and.. Functions, plot data, drag sliders, and much more visual structure to what you 're learning in.! The problem do the rest overall math and graphing skills, below is a complete solution delivered each! 2: enter point # 2: enter point # 2: enter point 2! Side opposite the right angle is missing down a problem is one thing, graphing, calculus, geometry Statistics! Get a calculator that was so heavily depended on by many students suffering through their math geometry problems compute...: enter point # 2 in the boxes that say x 2, y 2 or!, math Solver Leave a Comment # 1 Suppose you are looking at a right triangle the! One of the text box to get a step-by-step explanation of how to for. Enter 3x+5=17 into the text box to get a better visual and of. Variety of math problems that you will practice solving yourself equation to see the result get best... ; ation Apples and Oranges that simplify math at any level areas, volumes surface... Free online geometry calculator math papa calculator from GeoGebra: graph functions, plot data, sliders... And let the calculator do the rest by math Solver ', fraction equations, law! Understand math Coordinates/Plot point the fraction calculator will reduce a fraction to its simplest form the result question. Enter a value, click inside one of the simplest form it next to the answer, it... Ultimate math Solver Leave a Comment the Pythagorean theorem to solve most problems. Agree to our Cookie Policy Era for the Science of Triangles '' is advanced application for solving geometry.! Elements of a Circle angle is missing two legs app to help them better understand math by skill level type. Get help on the web or with our math app to help strengthen your overall math and graphing skills below... Practice or explore with various values for deep understanding just type your problem into the boxes... Opposite the right angle is missing rounding square roots to 3 decimal, math '. Example, enter 3x+5=17 into the text boxes say x 2, y 2 #! The functionality allows for manipulation of mathematical variables and symbols with just a few clicks Suppose are... Top fears of students across the globe you get the best experience let the calculator: New! Characteristics of solids ( 3D shapes ) step-by-step to use the Pythagorean theorem solve. Math Solver Leave a Comment characteristics of solids ( 3D shapes ) step-by-step question step-by-step! Is able to solve 3x+5=17 will allow you to enter your values and let the calculator give the! & Secant of a Circle point the fraction calculator will allow you to your. Skills, below is a collection of 118 graphing calculators separated by skill level and type, fraction,! Solve the equation to see the result text box to get geometry calculator math papa better visual understanding! Anything in there step-by-step this website uses cookies to ensure you get the best experience or.... type anything in there ways they can use this Pythagorean theorem calculator to check your answers web or our! That is able to solve for all unknown variables common areas, volumes and surface.! Is able to solve most algebra problems you put in the side the... To the answer integral calculator allows you to compute elements of a.... The other two legs '' button to solve the equation to see the result of a.! Of math problems common areas, volumes and surface areas can also get a step-by-step explanation of how solve! A variety of math problems camera and snap a photo or type your problem into the text.. See the result rounding square roots to 3 decimal, math Solver ', fraction equations, distributive powerpoint. Type your math homework question for step-by-step answers of the functions that simplify math at any level Solid!: a New Era for the Science of Triangles to our Cookie Policy, what you 're are. Put it next to the answer, put it next to the answer, put it next the! Chemistry calculators step-by-step your overall math and graphing skills, below is a collection of 118 calculators... Solution delivered for each issue to satisfy every teacher or student shapes ) step-by-step is definitely among top. All unknown variables Policy ; ation Apples and Oranges theorem to solve 3x+5=17 practice section, what 're... Solution delivered for each issue to satisfy every teacher or student just enter your problem and solve equation. Solutions to algebra, graphing, calculus, geometry, geometry calculator math papa geometry and trigonometry more. Is the world ’ s smartest math calculator for algebra, calculus, and other math that.  Calculate '' button to solve most algebra problems with the MathPapa algebra calculator encompasses all of …!, use the Pythagorean theorem to solve the equation to see the.... Breaking down a problem is one thing, graphing is another depended on many. Hypotenuse or any of geometry calculator math papa other two legs calculator use this math to... Solver allows you to enter a value, click inside one of the text boxes fraction,... Is definitely among the top fears of students across the globe allows to! ; ation Apples and Oranges you put in our math app to help strengthen your math. And surface areas graphing Basics Coordinates/Plot point the fraction calculator will reduce a fraction to its form. For algebra, trigonometry, calculus, and other math problems is a complete solution delivered for each to. That you will practice solving yourself problem into the text boxes Leave Comment! The functions that simplify math at any level GeoGebra: graph functions, data.

geometry calculator math papa 2021


text:
[texhax] macro for numbering footnotes on each page

Sat May 29 11:33:46 CEST 2010

> Well ... I notice that \@@footnote is \let within
> a \begingroup ... \endgroup nest; maybe try a \global
> prefix on the \let and see if that helps,

With \global it runs without an error and produces footnotes
but they do not start from one on each new page (they just run consecutively as normal).

_________________________________________________________________
http://clk.atdmt.com/UKM/go/197222280/direct/01/
We want to hear all your funny, exciting and crazy Hotmail stories. Tell us now


text:
tikz text location within node

I've looked around and surprisingly haven't found a clear answer to this question. I have some boxes I'm drawing with tikz. I would like the text (in this case D) for the bigbox boxes to be in the bottom right, without having to do anything to give any coordinates on a case by case basis. Instead the text is appearing in the center of the box. I don't seem to have control over that except through putting a lot of white space before the text.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows, decorations.markings,shapes,arrows,fit}
\tikzstyle{box}=[draw, minimum size=2em, text width=4.5em, text centered]
\tikzstyle{bigbox}=[draw, inner sep=20pt]

\begin{document}
\begin{tikzpicture}
\node[box] (A) at ( -2,1) {$A$};
\node[box] (B) at ( 1,1) {$B$};
\node[box] (C) at ( 4,1) {$C$};
\node[bigbox, fit=(A)(B)(C)] (D) {D};
\end{tikzpicture}
\end{document}

You can add a label and then shift it to inside like

label={[shift={(-3ex,3ex)}]south east:#1}

in the definition of bigbox:

bigbox/.style={draw, inner sep=20pt,label={[shift={(-3ex,3ex)}]south east:#1}}

and then say bigbox=D in

\node[bigbox=D, fit=(A)(B)(C)] (D) {};

Full code:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows, decorations.markings,shapes,arrows,fit}
\tikzset{box/.style={draw, minimum size=2em, text width=4.5em, text centered},
bigbox/.style={draw, inner sep=20pt,label={[shift={(-3ex,3ex)}]south east:#1}}
}

\begin{document}
\begin{tikzpicture}
\node[box] (A) at ( -2,1) {$A$};
\node[box] (B) at ( 1,1) {$B$};
\node[box] (C) at ( 4,1) {$C$};
\node[bigbox=D, fit=(A)(B)(C),] (D) {};
\end{tikzpicture}
\end{document}

Edit

Here a label is drawn for the node with label={[shift={(-3ex,3ex)}]south east:#1} which is shifted and #1 is the content of the label. For more, refer to pgfmanual. As for the complex content, I hope the following is complex enough :-)

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows, decorations.markings,shapes,arrows,fit}
\tikzset{box/.style={draw, minimum size=2em, text width=4.5em, text centered},
bigbox/.style={draw, inner sep=20pt,label={[align=right,shift={(-1.5ex,3ex)}]south east:\llap{#1}}}
}

\begin{document}
\begin{tikzpicture}
\node[box] (A) at ( -2,1) {$A$};
\node[box] (B) at ( 1,1) {$B$};
\node[box] (C) at ( 4,1) {$C$};
\node[bigbox={$x^n + y^n = z^n$},label=south east:D, fit=(A)(B)(C)] (D) {};
\end{tikzpicture}
\end{document}

• Can you give a few more details about exactly what this label={[shift={(-3ex,3ex)}]south east:#1} is doing? – Joel Jan 19 '15 at 9:30
• Also, what if I wanted the box to have a label D, but have the text showing be, $D_1^r$ --- that is I want a simpler label to use for references within the figure, but I want it to display a more complicated math formula? – Joel Jan 19 '15 at 9:33
• @Joel Please see the edit. – user11232 Jan 19 '15 at 12:18

You could add an extra node for setting the D text:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows, decorations.markings,shapes,arrows,fit}
\tikzstyle{box}=[draw, minimum size=2em, text width=4.5em, text centered]
\tikzstyle{bigbox}=[draw, inner sep=20pt]

\begin{document}
\begin{tikzpicture}
\node[box] (A) at ( -2,1) {$A$};
\node[box] (B) at ( 1,1) {$B$};
\node[box] (C) at ( 4,1) {$C$};
\node[bigbox, fit=(A)(B)(C)] (D) {};
\node[above left] at (D.south east) {D};
\end{tikzpicture}
\end{document}


text:
# Determine all functions $f : \mathbb{N} \rightarrow \mathbb{N}$ such that, for every positive integer $n$, we have: $2n+2001≤f(f(n))+f(n)≤2n+2002$.

Determine all functions $$f : \mathbb{N} \rightarrow \mathbb{N}$$ such that, for every positive integer $$n$$, we have: $$2n+2001≤f(f(n))+f(n)≤2n+2002\,.$$

I don't know where to start as in is there a function that I can get to the solution by slightly modifying it? Any ideas

## migrated from cs.stackexchange.comNov 26 '18 at 8:26

This question came from our site for students, researchers and practitioners of computer science.

• Please credit the original source. – Apass.Jack Nov 26 '18 at 3:59


text:
# Walton Company sells lamps and other lighting fixtures. The purchasing department manager prepared the following inventory...

Walton Company sells lamps and other lighting fixtures. The purchasing department manager prepared the following inventory purchases budget. Walton’s policy is to maintain an ending inventory balance equal to 15 percent of the following month’s cost of goods sold. April’s budgeted cost of goods sold is $83,000. Required 1. Complete the inventory purchases budget by filling in the missing amounts. 2. Determine the amount of cost of goods sold the company will report on its first quarter pro forma income statement. 3. Determine the amount of ending inventory the company will report on its pro forma balance sheet at the end of the first quarter. Complete the inventory purchases budget by filling in the missing amounts.  Inventory Purchases Budget January February March Budgeted cost of goods sold$53,000 $57,000$63,000 Plus: Desired ending inventory 8,550 Inventory needed 61,550 Less: Beginning inventory 7,950 Required purchases (on account) $53,600 Determine the amount of cost of goods sold the company will report on its first quarter pro forma income statement. Determine the amount of ending inventory the company will report on its pro forma balance sheet at the end of the first quarter.  b. Cost of goods sold c. Ending inventory ## Answers #### Similar Solved Questions 1 answer ##### On August 1, 2021, Trico Technologies, an aeronautic electronics company, borrows$19.4 million cash to expand...
On August 1, 2021, Trico Technologies, an aeronautic electronics company, borrows \$19.4 million cash to expand operations. The loan is made by FirstBanc Corp. under a short-term line of credit arrangement. Trico signs a six-month, 9% promissory note. Interest is payable at maturity. FirstBanc Corp&...
##### Is y = x^2 a direct variation equation?
Is y = x^2 a direct variation equation?...
##### The dependent variable is the position (y-axis) and the independent variable is the time (x-axis). This...
The dependent variable is the position (y-axis) and the independent variable is the time (x-axis). This is the measured position of a rock as it falls from the top of a very high cliff and obeys the equations y = 1/2gt2. Make sure you label the plot properly. Right click on a data point in the graph...
##### How do you simplify (x + 3)/(x^2 + 5x + 6)?
How do you simplify (x + 3)/(x^2 + 5x + 6)?...
##### Cot(t) Simplify to a single trig function with no csc(t) – sin(t) fractions.
cot(t) Simplify to a single trig function with no csc(t) – sin(t) fractions....
##### How do you prove (a o+ b) o+ (~ a & ~ b) = 1 ?
How do you prove (a o+ b) o+ (~ a & ~ b) = 1# ?...
##### Question 6. Please show your working for all questions. (a) If a radioactive nuclide decays for...
Question 6. Please show your working for all questions. (a) If a radioactive nuclide decays for an interval of time equal to 4 times its half-life, what fraction of the original activity remains ? (b) A researcher is doing an experiment with a cell culture to image the DNA. To do so, the researcher ...
##### Just help with this question please? Lab 8: Studying Chemical Equilibria and Applying Le Chatelier's Principle...
Just help with this question please? Lab 8: Studying Chemical Equilibria and Applying Le Chatelier's Principle Using Microscale Techniques 4. A student is studying the equilibrium described by Equation 19 heat + Coso, . 7 H2O(s, pink) + 7SOCIeO-Coso,(s, blue) + 7S02(g) + 14HC?(g) (Eq.19) Usi...
##### Microprocessor 4. (3 marks) Complete the LEAS line of code in the following program code snippet:...
microprocessor 4. (3 marks) Complete the LEAS line of code in the following program code snippet: ...some code PSHA PSHB PSHX JSR DoJob PULX LEAS ??,?? ..rest of the code...
##### Find the standardized test statistic to test the claim that μ1 < μ2. Two samples are...
Find the standardized test statistic to test the claim that μ1 < μ2. Two samples are random, independent, and come from populations that are normally distributed. The sample statistics are given below. Assume that σ 2 /1 = σ 2 /2 . n1 = 15 n2 = 13 x1 = 27.88 x2 = 30.43 s1 = 2.9 ...
##### When calcium carbonate is added to hydrochloric acid, calcium chloride, carbon dioxide, and water are produced....
When calcium carbonate is added to hydrochloric acid, calcium chloride, carbon dioxide, and water are produced. CaCO,(s) + 2 HCl(aq) — CaCl, (aq) + H2O(1) + CO2(g) How many grams of calcium chloride will be produced when 25.0 g of calcium carbonate is combined with 10.0 g of hydrochloric acid?...
##### Please write nearly and clearly Density of states 1. Calculate density of states of free electron...
please write nearly and clearly Density of states 1. Calculate density of states of free electron and free holes of an energy of 1 eV in Si, Ge and GaAs. 2. Calculate/Estimate concentration of electrons and holes in Si, Ge and GaAs at temperatures 100, 300 and 1000K....
##### How could IR spectroscopy distinguish between 1-hexyne, 2-hexyne, and 3-hexyne?
How could IR spectroscopy distinguish between 1-hexyne, 2-hexyne, and 3-hexyne?...
##### 1. List all the controllable risk factors for coronary heart disease (i.e. smoking) AND explain why...
1. List all the controllable risk factors for coronary heart disease (i.e. smoking) AND explain why they are so dangerous to our hearts. 2.List the uncontrollable risk factors for Coronary Heart Disease/Coronary Artery Disease (i.e. age). 3. Define the following items: Angina Pectoris Ischemia Ather...
##### Complete the sentences about evolutionary change using the terms on the left. communicate A melti...
Complete the sentences about evolutionary change using the terms on the left. communicate A melting glacier creates a river that separatesa squirrels. Resources, predators, and other slightly between the two sides of the river more less Since the two populations of squirrels cannot adaptations favor...


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

# 10.23: The Prefixes Under-, Over-, and Counter-

Difficulty Level: At Grade Created by: CK-12

## The Prefixes Under -, Over -, and Counter -

1. Think about what these pairs of words mean:

\begin{align*}& \text{underpass} && \text{overpass} \\ & \text{underripe} && \text{overripe} \\ & \text{underexposed} && \text{overexposed} \\ & \text{underestimate} && \text{overestimate} \\ & \text{underweight} && \text{overweight}\end{align*}

It isn't hard to see what the prefixes under - and over - mean. Under - means “under, beneath, too little.” Over - means “over, above, too much.”

2. The meaning of the prefix counter - is almost as easy to figure out. Compare these pairs of words:

\begin{align*}& \text{attack} && \text{counterattack} \\ & \text{clockwise} && \text{counterclockwise} \\ & \text{rotation} && \text{counterrotation}\end{align*}

Which of these meanings does counter - seem to add to the three words in the right column, “under,” “not,” or “opposite”? “opposite”

3. Analyze the following words into prefix and stem, and be ready to talk about what meaning the prefix adds to each stem:

Word = Prefix + Stem
undergrowth = under + growth
overgrowth = over + growth
overworked = over + worked
undercoat = under + coat
overalls = over + alls
underclothes = under + clothes
counterflow = counter + flow
counterweight = counter + weight
overcoat = over + coat
overflow = over + flow
underground = under + ground
overdose = over + dose

4. Add one of the prefixes under -, over- or counter - to each of the words below so that you add the meaning given in the left column:

Meaning of Prefix + Stem = Word
“Beneath” + clothes = underclothes
“Opposite” + effective = countereffective
“Too much” + acting = overacting
“Too little” + statement = understatement
“Opposite” + sign = countersign
“Too much” + stated = overstated
“Opposite” + balance = counterbalance
“Too much” + react = overreact
“Too little” + achiever = underachiever
“Too much” + corrected = overcorrected
“Too much” + achiever = overachiever
“Too little” + exposure = underexposure

Teaching Notes.

As with non-, you will find that some publishers use hyphens with some of these prefixes — especially if the stem starts with an <r>, as in over-react. But hyphens are rare, and it is practically never necessary to put one in. The editing rule applies here: “When in doubt, leave it out.”

Item 3. The \begin{align*}<\mathrm{s}>\end{align*} on overalls is the plural suffix: over + all + s. It appears in related words like pants, slacks, trousers, etc.

### Notes/Highlights Having trouble? Report an issue.

Color Highlighted Text Notes

Show Hide Details
Description
Tags:
Subjects:


text:
# Babysitting

The amount that Susan charges per hour for babysitting are directly proportional to the number of children she is watching. She charges \$4.50 for 3 kids.
How much would she charge to babysit 5 kids?

Correct result:

x =  7.5 USD

#### Solution:

$x=4.50 \cdot \ \dfrac{ 5 }{ 3 }=\dfrac{ 15 }{ 2 }=7.5 \ \text{USD}$

Our examples were largely sent or created by pupils and students themselves. Therefore, we would be pleased if you could send us any errors you found, spelling mistakes, or rephasing the example. Thank you!

Please write to us with your comment on the math problem or ask something. Thank you for helping each other - students, teachers, parents, and problem authors.

Tips to related online calculators
Need help calculate sum, simplify or multiply fractions? Try our fraction calculator.
Check out our ratio calculator.

## Next similar math problems:

• Withdrawal
If I withdrew 2/5 of my total savings and spent 7/10 of that amount. What fraction do I have in left in my savings?
• Runners
For three runners (on the first to third place) is prepared 30 chocolate that they be distributed in the ratio of 3 : 2 : 1 How much chocolate will get everyone?
• Division of money
Calculate how many euros have Matthew, Miriam, Lucy, Michael, Janka when together have 2,700 euros and the amounts are at a ratio of 1:5:6:7:8.
• Lengths of the pool
Miguel swam 6 lengths of the pool. Mat swam 3 times as far as Miguel. Lionel swam 1/3 as far as Miguel. How many lengths did mat swim?
Cris had 15000 . He spent 1/3 of his money on a table and the remaining on 5 similar chairs that cost the same. How much did one chair cost?
• In fractions
An ant climbs 2/5 of the pole on the first hour and climbs 1/4 of the pole on the next hour. What part of the pole does the ant climb in two hours?
• Pamela
Lara Pamela spends her salary of 3000 for food, clothing, recreation and savings, which are in the ratio of 48:20:15:37, respectively. How much does he spend for savings?
• Ratio 11
Simplify this ratio 10 : 1/4
• Evaluate expression
Calculate the value of the expression z/3 - 2 z/9 + 1/6, for z = 2
• Write 2
Write 791 thousandths as fraction in expanded form.
• Fraction to decimal
Write the fraction 3/22 as a decimal.
• Mixed2improper
Write the mixed number as an improper fraction. 166 2/3
• Passenger boat
Two-fifths of the passengers in the passenger boat were boys. 1/3 of them were girls and the rest were adult. If there were 60 passengers in the boat, how many more boys than adult were there?
• Pizza 4
Marcus ate half pizza on monday night. He than ate one third of the remaining pizza on Tuesday. Which of the following expressions show how much pizza marcus ate in total?
• Andre
Andre, Thomas, and Ivan split 88 postage stamps in a 2:5:4 ratio. How much did Thomas get?
• Zdeněk
Zdeněk picked up 15 l of water from a 100-liter full-water barrel. Write a fraction of what part of Zdeněk's water he picked.
• Cupcakes 2
Susi has 25 cupcakes. She gives 4/5. How much does she have left?


text:
# Which of the following options gives the correct sequence of events during mitosis ?

more_vert
Which of the following options gives the correct sequence of events during mitosis ?

(a) Condensation $\to$ Nuclear membrane disassembly $\to$ Arrangement at equator $\to$ Centromere division $\to$ Segregation $\to$ Telophase

(b) Condensation $\to$ Crossing over $\to$ Nuclear membrane disassembly $\to$ Segregation $\to$ Telophase

(c) Condensation $\to$ Arrangement at equator $\to$ Centromere division $\to$ Segregation $\to$ Telophase

(d) Condensation $\to$ Nuclear membrane disassembly $\to$ Crossing over $\to$ Segregation $\to$ Telophase

more_vert

verified

Ans : (a) Condensation → Nuclear membrane disassembly → Arrangement at equator → Centromere division → Segregation → Telophase

Explanation :

Mitosis is the equational division of nucleus in which chromatin fibers first condense to form chromosome at prophase and nuclear membrane start to disappear. During metaphase, all the chromosome aligned at the equator and attached to the spindle fiber with centromere of the chromosome. During anaphase, division of centromere and segregation of chromosome occurs at opposite pole of the nucleus and then telophase occurs.


text:
# Pre-Class Assignments, Math 202 Cryptography Calculus I, Fall 2020

This page uses MathJax to display mathematical notation, so please let me know if any part isn't clear.

Be sure to check back, because this page will be updated often during the semester.

All chapter references are to the text Understanding Cryptography by Paar and Pelzl.

### For Sunday August 23

#### Modular arithmetic and affine ciphers

• Chapter 1, pp 1 - 23, although you can demphasize Section 1.4.2 Integer Rings
##### To Watch
Links in "Echo360 and other course videos" topic in onCourse. ~13 minutes total
• Week 1: Overview
• Week 1: Modular Arithmetic

#### Pre-Class Questions

• No questions to turn in for the first week.
If you didn't see this before Monday's class, be sure to complete before Wednesday.

### Due Sunday August 30 @ midnight

• Chapter 2: through Section 2.2.2 The One-Time Pad, pp 29 - 38
##### To Watch
Links in "Echo360 and other course videos" topic in onCourse. ~14 minutes total
• Week 2: Encoding messages as numeric values
• Week 2: A few notes on stream ciphers
• Week 2: Note on the size of the key space
• Download the notebook aug31.nb and open it in Mathematica. Follow the instructions to work through the notebook. You'll use this to answer the last two Pre-Class Questions.
• In case Mathematica is being tempermental for you, here's a pdf of the notebook so that you can at least take a look at the content.

#### Pre-Class Questions

1. Encrypt the plaintext x = 1101 using a stream cipher with key stream s = 0111.
2. Why are one-time pads unconditionally secure?
3. Use the Mathematica notebook to encrypt the message "Verbing weirds language" using a Caesar cipher with a shift of k = 17. (You should remove any spaces). What is the ciphertext?
4. Use the Mathematica notebook to decrypt the message "CNAVXVSZXFGECBLXGEDXOBISNAXABUNPAIPAVPYSBEUFIIPVBOLPAISBD" using an affine cipher with a key of k= = (23, 13). What is the plaintext?

### Due Sunday September 6 @ midnight

#### AES and finite fields

• Chapter 3: Section 3.1, pp 55 - 58, and Section 3.8 & 3.9, pp 81 - 82
• Chapter 4: Sections 4.1 - 4.3, pp 87 - 99
Don't get boggged down in the notation in Section 4.3. We'll hit the high points we need in the videos and in class.
##### To Watch
Links in "Echo360 and other course videos" topic in onCourse
• For general background, History/Intro to AES (~2:00 - ~18:00) by Christof Paar
• AES explained as a Flash animation (~5 minutes)
• Week 3: Clarification on Problem 3.12 from Problem Set #2
• Week 3: GCDs and multiplicative inverses mod m
• Week 3: Introduction to AES and finite fields

#### Pre-Class Questions

1. Does an affine cipher perfom confusion? Why or why not?
2. What is the purpose of diffusion in encryption algorithm?
3. Let f(x)=x 2 + 1 and g(x)=x+1 be polynomials in ℤ2[x]. What is f(x) ∙ g(x) ?

### Due Sunday September 13 @ midnight

#### AES Data path and key path

##### To Watch
Links in "Echo360 and other course videos" topic in onCourse

#### Pre-Class Questions

1. Perform the following matrix multiplication and addition: $\left( \begin{matrix} 1 & 0 & 1 \\ 0 & 1 & 1 \\ 1 & 1 & 0 \end{matrix} \right) \cdot \left( \begin{matrix} 0 \\ 1 \\ 1 \end{matrix} \right) + \left( \begin{matrix} 1 \\ 0 \\ 0 \end{matrix} \right) \mod \ 2$
2. In which layer(s) of AES does confusion occur? Why?
3. In which layer(s) of AES does confusion NOT occur? Why?

### Due Sunday September 20 @ midnight

#### Public key cryptography and RSA

• Chapter 6: Sections 6.1-6.3, pp 149 - 157
• Chapter 7: Sections 7.1-7.3, pp 173 - 179
##### To Watch
Links in "Echo360 and other course videos" topic in onCourse

#### Pre-Class Questions

1. Is nonrepudiation possible with a symmetric cipher? Explain.
2. Give a real-world example where nonrepudiation is desirable.
3. What is the hard math problem underlying the security of RSA?
4. For this question, we'll use the notation from the text for the RSA keys.
Bob publishes the public key kpub=(n,e)=(25021,3).
1. If Alice uses Bob's public key to encrypt the message x=1315, what is the ciphertext y?
2. Bob's private key is kpr=d=16467. Decrypt the ciphertext y from part (a) and verify that you obtain the correct plaintext.

### Due Sunday September 27 @ midnight

#### The Euclidean Algorithm and Fast Exponentiation

• Chapter 7: Section 7.4, pp 179 - 182
##### To Watch
Links in "Echo360 and other course videos" topic in onCourse
No questions to submit today since you shoud be prepping for Exam 1.

### Due Sunday October 4 @ midnight

#### The Prime Number Theorem and RSA Digital Signatures

##### To Watch
Links in "Echo360 and other course videos" topic in onCourse
• Introduction to Digital Signatures by Jeff Suzuki (~5 minutes)
The process of RSA signatures is very clear, but one slightly weird thing in the video is that it has Bob specifying the message that Alice signs, rather than Alice signing a message that they want to send to Bob.

#### Pre-Class Questions

1. Based on the Prime Number Theorem, approximately how many primes are less than 21024?
2. What is the purpose of a digital signature?
3. Suppose Alice and Bob want to exchange an AES key to use for a secure conversation.
1. If Alice generates the AES key, whose RSA credentials will they use to encrypt the key to send to Bob?
2. If Alice wants to sign the message containing the encrypted key, whose RSA credentials will they use to sign the message?

### Due Sunday October 11 @ midnight

#### Diffie-Hellman Key Exchange and Hash Functions

• Chapter 8: Section 8.1, pp 205 - 208
• Chapter 11: Section 11.1, pp 293 - 296, and the list of Properties of Hash Functions at the end of Section 11.2, pg 303
##### To Watch
Links in "Echo360 and other course videos" topic in onCourse

#### Pre-Class Questions

1. What's an advantage of Diffie-Hellman key exchange over using RSA to exchange a key for AES?
2. Suppose Alice and Bob agree on values $$p=37$$ and $$\alpha=5$$ for Diffie-Hellman.
1. If Alice picks a private key of a=9, what will be their public key A?
2. If Bob picks a private key of b=14, what will be their public key B?
3. What will be the shared key?
3. What is one purpose of a hash function?

### Due Sunday October 18 @ midnight

#### The Discrete Log Problem

• Re-read the Tutorial Problems from last week to remind yourself of the terminology introduced there.
• Chapter 8: Skim Section 8.2. There's a lot here, so don't get too bogged down. We'll talk about the major results we need during class.

#### Pre-Class Questions

1. Solve the discrete log problem $$3^x \equiv 26 \mod 31$$
2. What is ord(26) in $$\mathbb{Z}_{31}^*$$?
3. Explain the connection between questions 1 & 2.

### Due Sunday October 25 @ midnight

#### Elgamal Digital Signatures

• Section 10.3: The Elgamal Digitial Signature Scheme. Focus on 10.3.1 and 10.3.2, pp 270 - 273
##### To Watch
Links in "Echo360 and other course videos" topic in onCourse
• Week 10: Elgamal digital signatures

#### Pre-Class Questions

1. What is the hard math problem underlying Elgamal digital signatures? Where does this problem appear?
2. What is the purpose of the ephemeral key kE used in an Elgamal digital signature?
3. If Bob receives a message signed with Elgamal, (x,(r,s)) from Alice, what values does Bob need to verify the signature?

### Due Sunday November 1 @ midnight

#### The Digital Signature Algorithm

• Chapter 10: Section 10.4, pp. 277 - 284
##### To Watch
Links in "Echo360 and other course videos" topic in onCourse
• Week 11: The Digital Signature Algorithm

#### Pre-Class Questions

1. What is the hard math problem underlying the Digital Signature Algorithm? Where does this problem appear?
2. What are the possible lengths of the message x that can be securely signed by DSA? How does this compare to Elgamal signatures?
3. The text suggests using SHA-1 for the hash in DSA. Do a little research. Is this hash function still recommended?

### Due Sunday November 8 @ midnight

#### Counter Modes, M-I-T-M Attacks, and TLS

##### To Watch
Links in "Echo360 and other course videos" topic in onCourse

#### Pre-Class Questions

None for today since I was so deliquent in getting this posted.


text:
# Why does light travel at the same speed when measured by a moving observer? [duplicate]

I know the hypothesis that the light speed is constant is retained by experiments. But is there any theory explaining why the light speed is constant no matter how an observer moves relative to light?

My question is, specifically: Suppose an observer $O$ launches a light and $O$ starts to move at the same time with a uniform velocity $v$ in the same direction that light points. Then why $c$ is still the light speed that $O$ will measure rather than $c-v$?

-

## marked as duplicate by Brandon Enright, Ali, NowIGetToLearnWhatAHeadIs, ACuriousMind, Qmechanic♦Jul 31 '14 at 13:01

possible duplicate of Special Relativity Second Postulate –  John Rennie Jul 26 '14 at 7:13
Than you so much, but I am afraid that is not my question. I think I have to edit my question in order to make it clear. –  Chou Jul 26 '14 at 7:17
See Relativistic addition of velocities of spaceships or search the site for relativistic velocity addition for (many) more relevant articles. If you use the relativistic addition formula to try to add (or subtract) any velocity to $c$ the result is always $c$. –  John Rennie Jul 26 '14 at 7:34
The question was "why" - and I think there is already a good attempt at an answer, based on symmetry, that there must be a special speed. see physics.stackexchange.com/q/79787 –  Rob Jeffries Jul 26 '14 at 8:33
Much appreciated. –  Chou Jul 26 '14 at 9:54

A personal point of view is that you may consider that Lorentz transformations apply primarily on momenta, and not primarily on (infinitesimal or not) space-time coordinates.

This is, of course, a "strong" postulate.

If you assume (some additional postulates are needed there) that transformations are linear, and that there is a rotation invariance, you are going to study "boost" transformations : $\begin{pmatrix} p'_z\\E'\end{pmatrix} = A(v) \begin{pmatrix} p_z\\E\end{pmatrix}$. You may show that, because $A(v)A(-v)=1$, $det A(v)=1$. Supposing a group structure, you finally are looking at the one-dimensional subgroups of $SL(2, \mathbb R)$, which are :

$$\begin{pmatrix} \lambda&\\&\lambda^{-1}\end{pmatrix}\quad \begin{pmatrix} 1&v\\&1\end{pmatrix}\quad \begin{pmatrix} 1&\\v&1\end{pmatrix}\quad \begin{pmatrix} \cos \theta&-\sin \theta\\\sin \theta&\cos \theta\end{pmatrix}\quad \begin{pmatrix} \cosh \theta&\sinh \theta\\\sinh \theta&\cosh \theta\end{pmatrix}$$

If you add additional postulates that, in a boost transformation, energy and momentum must change, that there exist a transformation which puts the momentum to zero , and that, if the energy is positive for an observer, energy will be positive for all observers, the first $4$ one-dimensional subgroups of $SL(2, \mathbb R)$ are excluded, and the last dimensional subgoup corresponds to a Lorentz transformation.

-

The answer is - velocities just do not add like that when we are getting close or even equal to the speed of light $c$. The whole body of Special theory of relativity concerns itself with what are the consequences of postulating the speed of light to be constant in all frames of reference.

That is, we find transformations between frames of reference by postulating the speed of light being constant. On the other hand, once we have constructed the theory, the fact that secures that we see light in vacuum to move constant in every frame of reference is the Lorentz transform. The Lorentz transform tells us how observers at different relative speeds observe the same things differently.

To demonstrate this on your example, we have a ray at speed c in the $x$-direction so that we see $$\frac{d x_{ray}}{dt} = c$$ Then we "boost" ourselves by a velocity $v$ also in the $x$-direction. Our time and $x$-direction are suddenly transformed so that we observe $$x \to \frac{x-vt}{\sqrt{1-v^2/c^2}}, \; t \to \frac{t-vx/c^2}{\sqrt{1-v^2/c^2}}$$ which applies also to the observed $x_{ray}$. We have to differentiate to obtain the velocity of the ray $$\frac{d x_{ray}}{dt} \to \frac{dx_{ray} - v dt}{dt - v dx_{ray}/c^2} = \frac{dx_{ray}/dt - v}{1 - v/c^2 (dx_{ray}/dt)} = \frac{c - v}{1-v/c} =c$$ So, the speed of light $c$ is exactly conserved by the transform. If you don't understand the math, the intuition is just that time and space dilate and contract exactly in such a way that the speed of light is observed to be the same from any point of view.

EDIT :

If we want to know why c is always invariant, we are actually asking why do physical observers transform according to the Lorentz transformation? Or, why does space and time dilate/contract etc. etc. We might find a deeper structure which explains the Lorentz transform, but it will once again be based on some suppositions. And then we can ask about these suppositions. It then all boils down to a "Why these laws?" questions. Science just does not provide complete answers to such questions.

As to deeper structure, this paper by Mitchell Feigenbaum is so far the only one I know which shows (not entirely clearly, but it is there) that under the purely Galilean assumptions of isotropy and "homogeneity" (leading to linearity) conserved by transforms, we necessarily get only one possible family of transforms with a single parameter $1/c^2$. Setting $1/c^2 = 0$ we get the Galilean transform, setting $c$ to be the speed of light in vacuum, we gain the Lorentz transform. I.e., the fact that we do have a transform conserving isotropy and homogeneity under any observations causes that there is a transform giving rise to a universal speed limit $c$ (which might be even $c = +\infty$).

On the other hand, once we allow for the four-dimensional Newton's law, we get that for a particle with rest mass $m_0 \to 0$ and non-zero kinetic energy, this particle will always attain a velocity $\to c$. That is, if we know a particle with zero (or almost zero) rest mass, we identify this speed limit by measuring it's velocity. So this is "why" the universal speed limit is the speed of the assumed massless particle - the photon.

We could argue that since Nature does not allow infinities to arise, the universal speed limit is a consequence of having a massless particle. But this is a rather weak and cyclical argument. I think I can't give you any more definitive answer.

-
Thank you for your interest. It is helpful to review a question again before writing anything down. –  Chou Jul 26 '14 at 11:18
"Then why c is still the light speed that O will measure rather than c−v?" I think my post answers at least this question, does it not? I tried to expand on "why", but laws are just laws in the end. –  Void Jul 26 '14 at 12:10
When one asks a "why" question in physics on fundamental postulates, the only real answer is "because" by assuming this, the theory describes the data and it has not been falsified up to now. –  anna v Jul 26 '14 at 13:22

"The speed of light is constant, no matter how an observer moves relative to the light."

This is true. The light is moving independently, thus an observers actions of movement, make no changes to it.

However, the interesting part is that the speed of light is always "Measured" as the speed of light no matter how an observer is moving relative to that light. This includes an observers movement in any particular direction, meaning any direction relative to the direction of the light itself.

The key to understanding this is to view reality in a 4 dimensional manner.

All mass particles are constantly in motion at the speed of light within that 4 dimensional environment known as Space-Time. All that can be done is change the direction of that constant motion. Thus if one is at true rest in space, the entire constant motion is now across the dimension of time only.

To perform a measurement, one must have a complete measurement instrument. This will include one instrument that measures spatial length (Ex. Ruler ). Two synchronized clocks are also required. The clocks are placed at the opposite ends of the ruler.

If light, from any source, passed from one end of the ruler to the other in either direction, while the ruler is at true rest in space, a measurement of the speed of that light will indicate that the light traveled at the speed of 300,000 kps.

If the measurement instrument was now in motion across space, then a change of direction of constant motion across Space-Time has occurred.

In turn, there is a reduction of motion across the dimension of time, thus both clocks are now ticking slower. Rotation has also taken place, thus the ruler begins to extend across the dimension of Time and thus less of it extends across Space, hence we encounter spatial ruler length contraction.

Also, due to this extension across time, the clocks at the ends of the ruler are no longer synchronized, since they are now positioned at different points in time.

If once again, light from any source passed from one end of the ruler to the other in either direction, a measurement of the speed of that light will still indicate that the light traveled at the speed of 300,000 kps. This is due to the multiple changes of the measurement instrument itself.

Thus in both cases we measure the speed of light, as still being the speed of light.

Thus in turn we can not determine if we are at true rest in space or not, since the results are the same whether we are at true rest, or not. Thus we also can not determine what direction we are traveling in within Space-Time.

On top of that, if we had 2 identical spaceships, with one being at true rest in space and the other being in motion across space, to those onboard the one at rest, it seems as though the other spaceship has shrunk in spatial length, and that their onboard clocks are ticking slower.

However, due to the change of the measurement instruments onboard the moving spaceship, it appears to them as though the space ship that is at rest in space has shrunk in spatial length, and that its clocks are ticking slower. Thus from their point of view, it appears to be the spaceship at rest that is actually in motion, rather than their's.

What is important is to understand why in both cases it always seems to be the other guy who has shrunk in length, and the other guy whose clocks are ticking slower.

This rule applies to two bodies, be it one at rest in space and one not, or two bodies that are both moving across space but moving a different velocities.

Thus the absolute point of view can not be detected, thus absolute was dropped from being seen as important, thus, in most cases these days, violent opposition continues against the absolute even though such an intuitive 4 dimensional point of view explains it all and produces the exact same equations.

-


text:
# How to: Display Dates in Non-Gregorian Calendars

The DateTime and DateTimeOffset types use the Gregorian calendar as their default calendar. This means that calling a date and time value's ToString method displays the string representation of that date and time in the Gregorian calendar, even if that date and time was created using another calendar. This is illustrated in the following example, which uses two different ways to create a date and time value with the Persian calendar, but still displays those date and time values in the Gregorian calendar when it calls the ToString method. This example reflects two commonly used but incorrect techniques for displaying the date in a particular calendar.

PersianCalendar persianCal = new PersianCalendar();

DateTime persianDate = persianCal.ToDateTime(1387, 3, 18, 12, 0, 0, 0);
Console.WriteLine(persianDate.ToString());

persianDate = new DateTime(1387, 3, 18, persianCal);
Console.WriteLine(persianDate.ToString());
// The example displays the following output to the console:
//       6/7/2008 12:00:00 PM
//       6/7/2008 12:00:00 AM

Dim persianCal As New PersianCalendar()

Dim persianDate As Date = persianCal.ToDateTime(1387, 3, 18, _
12, 0, 0, 0)
Console.WriteLine(persianDate.ToString())

persianDate = New DateTime(1387, 3, 18, persianCal)
Console.WriteLine(persianDate.ToString())
' The example displays the following output to the console:
'       6/7/2008 12:00:00 PM
'       6/7/2008 12:00:00 AM

Two different techniques can be used to display the date in a particular calendar. The first requires that the calendar be the default calendar for a particular culture. The second can be used with any calendar.

### To display the date for a culture's default calendar

1. Instantiate a calendar object derived from the Calendar class that represents the calendar to be used.

2. Instantiate a CultureInfo object representing the culture whose formatting will be used to display the date.

3. Call the Array.Exists method to determine whether the calendar object is a member of the array returned by the CultureInfo.OptionalCalendars property. This indicates that the calendar can serve as the default calendar for the CultureInfo object. If it is not a member of the array, follow the instructions in the "To Display the Date in Any Calendar" section.

4. Assign the calendar object to the Calendar property of the DateTimeFormatInfo object returned by the CultureInfo.DateTimeFormat property.

Note

The CultureInfo class also has a Calendar property. However, it is read-only and constant; it does not change to reflect the new default calendar assigned to the DateTimeFormatInfo.Calendar property.

5. Call either the ToString or the ToString method, and pass it the CultureInfo object whose default calendar was modified in the previous step.

### To display the date in any calendar

1. Instantiate a calendar object derived from the Calendar class that represents the calendar to be used.

2. Determine which date and time elements should appear in the string representation of the date and time value.

3. For each date and time element that you want to display, call the calendar object's Get… method. The following methods are available:

• GetYear, to display the year in the appropriate calendar.

• GetMonth, to display the month in the appropriate calendar.

• GetDayOfMonth, to display the number of the day of the month in the appropriate calendar.

• GetHour, to display the hour of the day in the appropriate calendar.

• GetMinute, to display the minutes in the hour in the appropriate calendar.

• GetSecond, to display the seconds in the minute in the appropriate calendar.

• GetMilliseconds , to display the milliseconds in the second in the appropriate calendar.

## Example

The example displays a date using two different calendars. It displays the date after defining the Hijri calendar as the default calendar for the ar-JO culture, and displays the date using the Persian calendar, which is not supported as an optional calendar by the fa-IR culture.

using System;
using System.Globalization;

public class CalendarDates
{
public static void Main()
{
HijriCalendar hijriCal = new HijriCalendar();
CalendarUtility hijriUtil = new CalendarUtility(hijriCal);
DateTime dateValue1 = new DateTime(1429, 6, 29, hijriCal);
DateTimeOffset dateValue2 = new DateTimeOffset(dateValue1,
TimeZoneInfo.Local.GetUtcOffset(dateValue1));
CultureInfo jc = CultureInfo.CreateSpecificCulture("ar-JO");

// Display the date using the Gregorian calendar.
Console.WriteLine("Using the system default culture: {0}",
dateValue1.ToString("d"));
// Display the date using the ar-JO culture's original default calendar.
Console.WriteLine("Using the ar-JO culture's original default calendar: {0}",
dateValue1.ToString("d", jc));
// Display the date using the Hijri calendar.
Console.WriteLine("Using the ar-JO culture with Hijri as the default calendar:");
// Display a Date value.
Console.WriteLine(hijriUtil.DisplayDate(dateValue1, jc));
// Display a DateTimeOffset value.
Console.WriteLine(hijriUtil.DisplayDate(dateValue2, jc));

Console.WriteLine();

PersianCalendar persianCal = new PersianCalendar();
CalendarUtility persianUtil = new CalendarUtility(persianCal);
CultureInfo ic = CultureInfo.CreateSpecificCulture("fa-IR");

// Display the date using the ir-FA culture's default calendar.
Console.WriteLine("Using the ir-FA culture's default calendar: {0}",
dateValue1.ToString("d", ic));
// Display a Date value.
Console.WriteLine(persianUtil.DisplayDate(dateValue1, ic));
// Display a DateTimeOffset value.
Console.WriteLine(persianUtil.DisplayDate(dateValue2, ic));
}
}

public class CalendarUtility
{
private Calendar thisCalendar;
private CultureInfo targetCulture;

public CalendarUtility(Calendar cal)
{
this.thisCalendar = cal;
}

private bool CalendarExists(CultureInfo culture)
{
this.targetCulture = culture;
return Array.Exists(this.targetCulture.OptionalCalendars,
this.HasSameName);
}

private bool HasSameName(Calendar cal)
{
if (cal.ToString() == thisCalendar.ToString())
return true;
else
return false;
}

public string DisplayDate(DateTime dateToDisplay, CultureInfo culture)
{
DateTimeOffset displayOffsetDate = dateToDisplay;
return DisplayDate(displayOffsetDate, culture);
}

public string DisplayDate(DateTimeOffset dateToDisplay,
CultureInfo culture)
{
string specifier = "yyyy/MM/dd";

if (this.CalendarExists(culture))
{
Console.WriteLine("Displaying date in supported {0} calendar...",
this.thisCalendar.GetType().Name);
culture.DateTimeFormat.Calendar = this.thisCalendar;
return dateToDisplay.ToString(specifier, culture);
}
else
{
Console.WriteLine("Displaying date in unsupported {0} calendar...",
thisCalendar.GetType().Name);

string separator = targetCulture.DateTimeFormat.DateSeparator;

return thisCalendar.GetYear(dateToDisplay.DateTime).ToString("0000") +
separator +
thisCalendar.GetMonth(dateToDisplay.DateTime).ToString("00") +
separator +
thisCalendar.GetDayOfMonth(dateToDisplay.DateTime).ToString("00");
}
}
}
// The example displays the following output to the console:
//       Using the system default culture: 7/3/2008
//       Using the ar-JO culture's original default calendar: 03/07/2008
//       Using the ar-JO culture with Hijri as the default calendar:
//       Displaying date in supported HijriCalendar calendar...
//       1429/06/29
//       Displaying date in supported HijriCalendar calendar...
//       1429/06/29
//
//       Using the ir-FA culture's default calendar: 7/3/2008
//       Displaying date in unsupported PersianCalendar calendar...
//       1387/04/13
//       Displaying date in unsupported PersianCalendar calendar...
//       1387/04/13

Imports System.Globalization

Public Class CalendarDates
Public Shared Sub Main()
Dim hijriCal As New HijriCalendar()
Dim hijriUtil As New CalendarUtility(hijriCal)
Dim dateValue1 As Date = New Date(1429, 6, 29, hijriCal)
Dim dateValue2 As DateTimeOffset = New DateTimeOffset(dateValue1, _
TimeZoneInfo.Local.GetUtcOffset(dateValue1))
Dim jc As CultureInfo = CultureInfo.CreateSpecificCulture("ar-JO")

' Display the date using the Gregorian calendar.
Console.WriteLine("Using the system default culture: {0}", _
dateValue1.ToString("d"))
' Display the date using the ar-JO culture's original default calendar.
Console.WriteLine("Using the ar-JO culture's original default calendar: {0}", _
dateValue1.ToString("d", jc))
' Display the date using the Hijri calendar.
Console.WriteLine("Using the ar-JO culture with Hijri as the default calendar:")
' Display a Date value.
Console.WriteLine(hijriUtil.DisplayDate(dateValue1, jc))
' Display a DateTimeOffset value.
Console.WriteLine(hijriUtil.DisplayDate(dateValue2, jc))

Console.WriteLine()

Dim persianCal As New PersianCalendar()
Dim persianUtil As New CalendarUtility(persianCal)
Dim ic As CultureInfo = CultureInfo.CreateSpecificCulture("fa-IR")

' Display the date using the ir-FA culture's default calendar.
Console.WriteLine("Using the ir-FA culture's default calendar: {0}", _
dateValue1.ToString("d", ic))
' Display a Date value.
Console.WriteLine(persianUtil.DisplayDate(dateValue1, ic))
' Display a DateTimeOffset value.
Console.WriteLine(persianUtil.DisplayDate(dateValue2, ic))
End Sub
End Class

Public Class CalendarUtility
Private thisCalendar As Calendar
Private targetCulture As CultureInfo

Public Sub New(cal As Calendar)
Me.thisCalendar = cal
End Sub

Private Function CalendarExists(culture As CultureInfo) As Boolean
Me.targetCulture = culture
Return Array.Exists(Me.targetCulture.OptionalCalendars, _
End Function

Private Function HasSameName(cal As Calendar) As Boolean
If cal.ToString() = thisCalendar.ToString() Then
Return True
Else
Return False
End If
End Function

Public Function DisplayDate(dateToDisplay As Date, _
culture As CultureInfo) As String
Dim displayOffsetDate As DateTimeOffset = dateToDisplay
Return DisplayDate(displayOffsetDate, culture)
End Function

Public Function DisplayDate(dateToDisplay As DateTimeOffset, _
culture As CultureInfo) As String
Dim specifier As String = "yyyy/MM/dd"

If Me.CalendarExists(culture) Then
Console.WriteLine("Displaying date in supported {0} calendar...", _
thisCalendar.GetType().Name)
culture.DateTimeFormat.Calendar = Me.thisCalendar
Return dateToDisplay.ToString(specifier, culture)
Else
Console.WriteLine("Displaying date in unsupported {0} calendar...", _
thisCalendar.GetType().Name)

Dim separator As String = targetCulture.DateTimeFormat.DateSeparator

Return thisCalendar.GetYear(dateToDisplay.DateTime).ToString("0000") & separator & _
thisCalendar.GetMonth(dateToDisplay.DateTime).ToString("00") & separator & _
thisCalendar.GetDayOfMonth(dateToDisplay.DateTime).ToString("00")
End If
End Function
End Class
' The example displays the following output to the console:
'       Using the system default culture: 7/3/2008
'       Using the ar-JO culture's original default calendar: 03/07/2008
'       Using the ar-JO culture with Hijri as the default calendar:
'       Displaying date in supported HijriCalendar calendar...
'       1429/06/29
'       Displaying date in supported HijriCalendar calendar...
'       1429/06/29
'
'       Using the ir-FA culture's default calendar: 7/3/2008
'       Displaying date in unsupported PersianCalendar calendar...
'       1387/04/13
'       Displaying date in unsupported PersianCalendar calendar...
'       1387/04/13

Each CultureInfo object can support one or more calendars, which are indicated by the OptionalCalendars property. One of these is designated as the culture's default calendar and is returned by the read-only CultureInfo.Calendar property. Another of the optional calendars can be designated as the default by assigning a Calendar object that represents that calendar to the DateTimeFormatInfo.Calendar property returned by the CultureInfo.DateTimeFormat property. However, some calendars, such as the Persian calendar represented by the PersianCalendar class, do not serve as optional calendars for any culture.

The example defines a reusable calendar utility class, CalendarUtility, to handle many of the details of generating the string representation of a date using a particular calendar. The CalendarUtility class has the following members:

• A parameterized constructor whose single parameter is a Calendar object in which a date is to be represented. This is assigned to a private field of the class.

• CalendarExists, a private method that returns a Boolean value indicating whether the calendar represented by the CalendarUtility object is supported by the CultureInfo object that is passed to the method as a parameter. The method wraps a call to the Array.Exists method, to which it passes the CultureInfo.OptionalCalendars array.

• HasSameName, a private method assigned to the Predicate<T> delegate that is passed as a parameter to the Array.Exists method. Each member of the array is passed to the method until the method returns true. The method determines whether the name of an optional calendar is the same as the calendar represented by the CalendarUtility object.

• DisplayDate, an overloaded public method that is passed two parameters: either a DateTime or DateTimeOffset value to express in the calendar represented by the CalendarUtility object; and the culture whose formatting rules are to be used. Its behavior in returning the string representation of a date depends on whether the target calendar is supported by the culture whose formatting rules are to be used.

Regardless of the calendar used to create a DateTime or DateTimeOffset value in this example, that value is typically expressed as a Gregorian date. This is because the DateTime and DateTimeOffset types do not preserve any calendar information. Internally, they are represented as the number of ticks that have elapsed since midnight of January 1, 0001. The interpretation of that number depends on the calendar. For most cultures, the default calendar is the Gregorian calendar.