text:
### Theory:

The numbers with more decimal expansions (like $$1.278$$, $$3.4218$$,...) cannot be located directly on the number line.

To resolve this issue, we are going to learn the concept called 'Successive magnification'.
The process of visualisation of representation of numbers on the number line through a magnifying glass is called the process of successive magnification.
Procedure for the process of successive magnification:

Step 1: Locate the range of number[nearest smallest and largest integers.]

Step 2: Look for the range of the number on the number line and magnify that range alone. That is, divide the portion into $$10$$ parts.

Step 3: Now let us look for the number with the first decimal point on the number line and find the range of that.

Step 4: Again magnify the range and divide the portion into $$10$$ parts.

Step 5: Now look for the number with two decimal point on the number line.

Step 6: Repeat the process until you locate the entire decimals on the number line.
Example:
Represent the number $$1.257$$ on the following number line.

Step 1: The range of the number $$1.257$$ is $$1$$ and $$2$$.

Step 2: Look for the range of the number on the number line and magnify that range alone. That is, divide the portion into $$10$$ parts.

Step 3: Now let us look for the number with the first decimal point on the number line and find the range of that.

Step 4: Again magnify the range and divide the portion into $$10$$ parts. Now look for the number with two decimal point on the number line.

Step 5: Again magnify the range and divide the portion into $$10$$ parts. Now look for the number with three decimal point on the number line.

Thus, we located the number $$1.257$$ on the number line by the process of successive magnification.


text:
<meta http-equiv="refresh" content="1; url=/nojavascript/">
You are viewing an older version of this Concept. Go to the latest version.

# Volume of Cylinders

V = πr^2h
%
Progress
Practice Volume of Cylinders
Progress
%
Volume of Cylinders

Have you ever compared jars and wondered which one held more? Take a look at this dilemma.

Jillian’s grandmother loves to cook. One day in between sewing projects, she takes Jillian to the grocery store and comes home with a big bag of assorted beans. Grandma’s baked beans are Jillian’s favorite, and she is thrilled that Grandma is going to cook them for dinner.

Jillian takes two different jars from the cupboard. One is long and thin and one is wide.

“Which jar should I use?” Jillian asks her grandmother.

“Use whichever one will hold the most,” her grandmother says.

Jillian looks at the two jars. Here is what they look like.

Jillian has measured each jar to try to figure out which one will hold the most. She just isn’t sure what to do now.

This is your task. Jillian will need to figure out the volume of each cylinder. This Concept will teach you all about calculating volume. Calculate the volume of each cylinder and then you will know which one will hold the most beans.

### Guidance

Volume is the amount of space contained within a solid figure. Since cylinders often contain liquid, you can imagine that the volume of cylinders often has to do with some kind of liquid. In the case of cylinders, you can think of volume as capacity.

Here is a cylinder that is probably used in a science lab. Here volume would be compared with capacity of liquid.

Here is a picture of a swimming pool. When you think about volume in this case, it is the capacity of the pool. The volume would be the amount of water in the pool.

This paint can is a cylinder. If we wanted to figure out the volume of this cylinder, we would need to figure out the amount of space inside the paint can. This would be the volume of the cylinder.

We can think about the volume of a cylinder as we would think about the volume of a prism. We can use unit cubes to fill a cylinder.

You can see that we have started to fill this cylinder with cubes to calculate the volume. The problem is that the cubes don’t fit perfectly inside the cylinder. To calculate the volume of a cylinder accurately, we need to use a formula.

Which formula can we use to calculate the volume of a cylinder?

To calculate the volume of a cylinder, we need to calculate the area of the circular base. That will give us a measure for the number of unit cubes that can fit across the bottom of the cylinder. The height of the cylinder will show us how high cubes can be stacked inside the cylinder.

Here is the formula for finding the volume of a cylinder.

$V = \pi r^2h$

Let's apply this formula.

The radius of the circular base is 2 inches. The height of the cylinder is 7 inches. If we take both of these given measures and substitute them into the formula, we can solve for the volume of the cylinder.

$V & = \pi r^2h\\V & = (3.14)(2^2)(7)\\V & = (3.14)(4)(7)\\V & = (3.14)(28)\\V & = 87.92 \ in^3$

The volume of the cylinder is $87.92 \ in^3$ .

Use the formula to find the volume of the following cylinders.

#### Example A

Solution: $25.12 in^3$

#### Example B

$d = 10 \ ft, \ h = 12 \ ft$

Solution: $942 ft^3$

#### Example C

$r = 6 \ in, \ h = 10 \ in$

Solution: $1130.4 in^3$

Here is the original problem once again. Use what you have learned about the volume of cylinders to help Jillian problem solve this dilemma.

Jillian’s grandmother loves to cook. One day in between sewing projects, she takes Jillian to the grocery store and comes home with a big bag of assorted beans. Grandma’s baked beans are Jillian’s favorite, and she is thrilled that Grandma is going to cook them for dinner.

Jillian takes two different jars from the cupboard. One is long and thin and one is wide.

“Which jar should I use?” Jillian asks her grandmother.

“Use whichever one will hold the most,” her grandmother says.

Jillian looks at the two jars. Here is what they look like.

Jillian has measured each jar to try to figure out which one will hold the most. She just isn’t sure what to do now.

First, let’s go back and reread the problem.

Jillian needs to figure out the volume of each cylinder. She can use the formula below to do this. Jillian suspects that the wide jar will hold more. What do you think

$V = \pi r^2h$

Let’s start with the long thin jar. The diameter of the jar is 8 inches. We need the radius of the jar, so we can divide the diameter in half. The radius of this jar is 4 inches.

$V & = (3.14)4^2(16)\\V & = (3.14)(16)(16)\\V & = 803.84 \ in^ 3$

Wow! That jar sure does hold a lot. Let’s work on the wide jar now. The diameter of this jar is 12 inches, so the radius is 6 inches.

$V & = (3.14)6^2(6)\\V & = (3.14)(36)(6)\\V & = 678.24 \ in^3$

Jillian is amazed. The long, thin jar holds more volume than the wide jar does. Jillian takes the beans and puts them into the jar.

Sometimes volume can be tricky! What looks like it holds more sometimes doesn’t!

### Vocabulary

Here are the vocabulary words in this Concept.

Volume
the amount of space inside a three-dimensional figure.
Surface Area
the entire outer covering or surface of a three-dimensional figure. It is calculated by the sum of the areas of each of the faces and bases of a solid.
Cylinder
a three-dimensional figure with two congruent parallel circular bases and a curved flat surface connecting the bases.
the measure of the distance halfway across a circle.

### Guided Practice

Here is one for you to try on your own.

A water tank has a radius of 50 feet and a height of 400 feet. How many cubic feet of water will the tank hold when it is full?

First, let’s determine what the problem is asking us to find. We need to find the volume of the tank, which is the amount of water it can hold. What information have we been given? We know the radius and the height of the tank, so we can put this information into the formula and solve for $V$ , volume.

$V & = \pi r^2h\\V & = \pi (50)^2 (400)\\V & = \pi (2,500) (400)\\V & = 1,000,000 \pi\\V & = 3,140,000 \ in.^3$

The water tank will hold more than 3 million cubic feet of water!

### Video Review

Here is a video for review.

### Practice

Directions: Find the volume of each of the following cylinders.

1. $r = 5 \ in, \ h = 8 \ in$

2. $r = 4 \ in, \ h = 7 \ in$

3. $r = 3 \ ft, \ h = 5 \ ft$

4. $r = 3 \ ft, \ h = 8 \ ft$

5. $r = 4 \ cm, \ h = 9 \ cm$

6.

7.

8.

9.

10.

11.

12.

13.

14.

15.

### Vocabulary Language: English

Cylinder

Cylinder

A cylinder is a solid figure with two parallel congruent circular bases.

The radius of a circle is the distance from the center of the circle to the edge of the circle.
Surface Area

Surface Area

Surface area is the total area of all of the surfaces of a three-dimensional object.
Volume

Volume

Volume is the amount of space inside the bounds of a three-dimensional object.

format: plain


text:
# Equation of Plane

## Theorem

A plane $P$ is the set of all $\tuple {x, y, z} \in \R^3$, where:

$\alpha_1 x + \alpha_2 y + \alpha_3 z = \gamma$

where $\alpha_1, \alpha_2, \alpha_3, \gamma \in \R$ are given, and not all of $\alpha_1, \alpha_2, \alpha_3$ are zero.


text:
Cybervanes - 1 year ago 100
PHP Question

# Grading using weighted averages in php

How could I grade this test with php? I need a percentage score...

I have an array of questions containing the correct / incorrect bool and the corresponding weight.

Do I need to find the average of correct answers first?

What would the equation be?

``````\$questions = array(
0=>array(
'Question'=>"Some Question",
'Correct'=>true,
'Weight'=>5,
),
1=>array(
'Question'=>"Some Question",
'Correct'=>false,
'Weight'=>5,
),
2=>array(
'Question'=>"Some Question",
'Correct'=>true,
'Weight'=>4,
),
3=>array(
'Question'=>"Some Question",
'Correct'=>true,
'Weight'=>0,
),
4=>array(
'Question'=>"Some Question",
'Correct'=>false,
'Weight'=>5,
),
5=>array(
'Question'=>"Some Question",
'Correct'=>true,
'Weight'=>4,
),
);
\$weights = array(
0=>0
1=>0
2=>.05
3=>.20
4=>.25
5=>.50
);
\$totalQuestions=0;
\$points=0;
foreach(\$questions as \$question){
\$totalQuestions++;
if(\$question['Correct']){
\$points = \$points = \$weights[\$question['Weight'];
}
}
``````

You can calculate the amount of weights the candidate earned (i.e. the points you have) and then the total weights possible (i.e. a perfect score).

Then you can divide the candidate score by the total score:

Score = Candidate score / Total Score

From there you can calculate the percentage:

Percentage = Score * 100

``````\$totalQuestions=0;
\$totalWeights=0;
\$weightsEarned=0;
foreach(\$questions as \$question){
\$totalQuestions++;
\$totalWeights+=\$weights[\$question['Weight']];
if(\$question['Correct']){


text:
## Sum Shift

• assignment Visualization of Wave Functions on a Ring

assignment Homework

##### Visualization of Wave Functions on a Ring
Central Forces Spring 2021 Using either this Geogebra applet or this Mathematica notebook, explore the wave functions on a ring. (Note: The Geogebra applet may be a little easier to use and understand and is accessible if you don't have access to Mathematica, but it is more limited in the wave functions that you can represent. Also, the animation is pretty jumpy in some browsers, especially Firefox. Imagine that the motion is smooth.)
1. Look at graphs of the following states \begin{align} \Phi_1(\phi)&=\frac{1}{\sqrt{2}}(\left|{2}\right\rangle +\left|{-2}\right\rangle )\\ \Phi_2(\phi)&=\frac{1}{\sqrt{2}}(\left|{2}\right\rangle -\left|{-2}\right\rangle )\\ \Phi_3(\phi)&=\frac{1}{\sqrt{2}}(\left|{2}\right\rangle +i\left|{-2}\right\rangle ) \end{align} Write a short description of how these states differ from each other.
2. Find a state for which the probability density does not depend on time. Write the state in both ket and wave function notation. These are called stationary states. Generalize your result to give a characterization of the set of all possible states that are stationary states.
3. Find a state that is right-moving. Write the state in both ket and wave function notation. Generalize your result to give a characterization of the set of all possible states that are right-moving.
4. Find a state that is a standing wave. Write the state in both ket and wave function notation. Generalize your result to give a characterization of the set of all possible states that are standing waves.
• assignment Theta Parameters

assignment Homework

##### Theta Parameters
AIMS Maxwell Fall 21 AIMS Maxwell Spring 2021 Static Fields Winter 2021 Static Fields Winter 2022

The function $\theta(x)$ (the Heaviside or unit step function) is a defined as: $$\theta(x) =\begin{cases} 1 & \textrm{for}\; x>0 \\ 0 & \textrm{for}\; x<0 \end{cases}$$ This function is discontinuous at $x=0$ and is generally taken to have a value of $\theta(0)=1/2$.

Make sketches of the following functions, by hand, on axes with the same scale and domain. Briefly describe, using good scientific writing that includes both words and equations, the role that the number two plays in the shape of each graph: \begin{align} y &= \theta (x)\\ y &= 2+\theta (x)\\ y &= \theta(2+x)\\ y &= 2\theta (x)\\ y &= \theta (2x) \end{align}

• assignment Quantum Particle in a 2-D Box

assignment Homework

##### Quantum Particle in a 2-D Box
Central Forces Spring 2021

(2 points each)

You know that the normalized spatial eigenfunctions for a particle in a 1-D box of length $L$ are $\sqrt{\frac{2}{L}}\sin{\frac{n\pi x}{L}}$. If you want the eigenfunctions for a particle in a 2-D box, then you just multiply together the eigenfunctions for a 1-D box in each direction. (This is what the separation of variables procedure tells you to do.)

1. Find the normalized eigenfunctions for a particle in a 2-D box with sides of length $L_x$ in the $x$-direction and length $L_y$ in the $y$-direction.
2. Find the Hamiltonian for a 2-D box and show that your eigenstates are indeed eigenstates and find a formula for the possible energies
3. Any sufficiently smooth spatial wave function inside a 2-D box can be expanded in a double sum of the product wave functions, i.e. $$\psi(x,y)=\sum_{n=1}^{\infty}\sum_{m=1}^{\infty}\, c_{nm}\; \hbox{eigenfunction}_n(x)\;\hbox{eigenfunction}_m(y)$$ Using your expressions from part (a) above, write out all the terms in this sum out to $n=3$, $m=3$. Arrange the terms, conventionally, in terms of increasing energy.

You may find it easier to work in bra/ket notation: \begin{align*} \left|{\psi}\right\rangle &=\sum_{n=1}^{\infty}\sum_{m=1}^{\infty}\, c_{nm}\left|{n}\right\rangle \left|{m}\right\rangle \\ &=\sum_{n=1}^{\infty}\sum_{m=1}^{\infty}\, c_{nm}\left|{nm}\right\rangle \end{align*}

4. Find a formula for the $c_{nm}$s in part (b). Find the formula first in bra ket notation and then rewrite it in wave function notation.

• assignment Circle Vector, Version 2

assignment Homework

##### Circle Vector, Version 2
AIMS Maxwell Fall 21 AIMS Maxwell Spring 2021 Static Fields Winter 2021 Static Fields Winter 2022

Learn more about the geometry of $\vert \vec{r}-\vec{r'}\vert$ in two dimensions.

1. Make sketches of the following functions, by hand, on the same axes: \begin{align} y &= \sin x\\ y &= \sin(2+x) \end{align} Briefly describe the role that the number 2 plays in the shape of the second graph
2. Make a sketch of the graph $$\vert \vec{r} - \vec{a} \vert = 2$$

for each of the following values of $\vec a$: \begin{align} \vec a &= \vec 0\\ \vec a &= 2 \hat x- 3 \hat y\\ \vec a &= \text{points due east and is 2 units long} \end{align}

3. Derive a more familiar equation equivalent to $$\vert \vec r - \vec a \vert = 2$$ for arbitrary $\vec a$, by expanding $\vec r$ and $\vec a$ in rectangular coordinates. Simplify as much as possible. (Ok, ok, I know this is a terribly worded question. What do I mean by “more familiar"? What do I mean by “simplify as much as possible"? Why am I making you read my mind? Try it anyway. Real life is not full of carefully worded problems. Bonus points to anyone who can figure out a better way of wording the question that doesn't give the point away.)
4. Write a brief description of the geometric meaning of the equation $$\vert \vec r - \vec a \vert = 2$$

• face Time Evolution Refresher (Mini-Lecture)

face Lecture

30 min.

##### Time Evolution Refresher (Mini-Lecture)
Central Forces Spring 2021

Quantum Ring Sequence

The instructor gives a brief lecture about time dependence of energy eigenstates (e.g. McIntyre, 3.1). Notes for the students are attached.
• computer Approximating Functions with Power Series

computer Computer Simulation

30 min.

##### Approximating Functions with Power Series
Theoretical Mechanics Fall 2020 Theoretical Mechanics Fall 2021 AIMS Maxwell Fall 21 AIMS Maxwell Spring 2021 Central Forces Spring 2021 Static Fields Winter 2021 Static Fields Winter 2022

Power Series Sequence (E&M)

Students use a prepared Mathematica notebook to plot $\sin\theta$ simultaneously with several terms of a power series expansion to judge how well the approximation fits. Students can alter the worksheet to change the number of terms in the expansion and even to change the function that is being considered. Students should have already calculated the coefficients for the power series expansion in a previous activity, Calculating Coefficients for a Power Series.
• assignment Gibbs entropy is extensive

assignment Homework

##### Gibbs entropy is extensive
Gibbs entropy Probability

Consider two noninteracting systems $A$ and $B$. We can either treat these systems as separate, or as a single combined system $AB$. We can enumerate all states of the combined by enumerating all states of each separate system. The probability of the combined state $(i_A,j_B)$ is given by $P_{ij}^{AB} = P_i^AP_j^B$. In other words, the probabilities combine in the same way as two dice rolls would, or the probabilities of any other uncorrelated events.

1. Show that the entropy of the combined system $S_{AB}$ is the sum of entropies of the two separate systems considered individually, i.e. $S_{AB} = S_A+S_B$. This means that entropy is extensive. Use the Gibbs entropy for this computation. You need make no approximation in solving this problem.
2. Show that if you have $N$ identical non-interacting systems, their total entropy is $NS_1$ where $S_1$ is the entropy of a single system.

##### Note
In real materials, we treat properties as being extensive even when there are interactions in the system. In this case, extensivity is a property of large systems, in which surface effects may be neglected.

• assignment Series Notation 1

assignment Homework

##### Series Notation 1

Power Series Sequence (E&M)

AIMS Maxwell Fall 21 AIMS Maxwell Spring 2021 Static Fields Winter 2021 Static Fields Winter 2022

Write out the first four nonzero terms in the series:

1. $\sum\limits_{n=0}^\infty \frac{1}{n!}$

2. $\sum\limits_{n=1}^\infty \frac{(-1)^n}{n!}$
3. $$\sum\limits_{n=0}^\infty {(-2)^{n}\,\theta^{2n}}$$

• assignment Series Notation 2

assignment Homework

##### Series Notation 2

Power Series Sequence (E&M)

AIMS Maxwell Fall 21 AIMS Maxwell Spring 2021 Static Fields Winter 2021 Static Fields Winter 2022

Write (a good guess for) the following series using sigma $\left(\sum\right)$ notation. (If you only know a few terms of a series, you don't know for sure how the series continues.)

1. $1 - 2\,\theta^2 + 4\,\theta^4 - 8\,\theta^6 +\,\dots$

2. $\frac14 - \frac19 + \frac{1}{16} - \frac{1}{25}+\,\dots$

• group Representations of the Infinite Square Well

group Small Group Activity

120 min.

##### Representations of the Infinite Square Well
Quantum Fundamentals Winter 2021
• Central Forces Spring 2021

In each of the following sums, shift the index $n\rightarrow n+2$. Don't forget to shift the limits of the sum as well. Then write out all of the terms in the sum (if the sum has a finite number of terms) or the first five terms in the sum (if the sum has an infinite number of terms) and convince yourself that the two different expressions for each sum are the same:

1. $$\sum_{n=0}^3 n$$
2. $$\sum_{n=1}^5 e^{in\phi}$$
3. $$\sum_{n=0}^{\infty} a_n n(n-1)z^{n-2}$$


text:
topical media & game development

object-oriented programming

# Beyond object-orientation?

No introduction to object orientation is complete without an indication of the trends and technologies that surround the field. The word trend should be understood in its positive meaning of set examples and emerging guidelines. And `technologies', such as for example CORBA (the OMG Common Object Request Broker Architecture), as those that set the technological landscape which determines whether object-oriented approaches can be deployed effectively in practice.

#### Trends -- modeling

• patterns -- examples of design
• UML -- Unified Modeling Language

#### Technologies -- components

• Web -- global infrastructure
• CORBA/DCOM - the software bus
• Java -- the platform?

#### Challenges

• Applications $->$ Frameworks $<-$ Patterns

slide: Trends and technologies

At the design front, we may observe two dominant trends. The first may be called the patterns movement, which came into the forefront after the publication of Design Patterns, authored by a group of authors that is commonly known as the `Gang of Four',  [GOF94]. The design patterns published there, and elsewhere e.g.  [Coplien95], may be regarded as the outcome of mining actual framework and application designs for valid solutions that may be generalized to broader classes of problems. Design patterns focus on understanding and describing structural and behavioral properties of (fragments of) software systems.

Equally focused on understanding structure and behavior, but more from a modeling perspective, is the Unified Modeling Language (UML), which has resulted from a common effort of leading experts in object-oriented analysis and design, Grady Booch, Ivar Jacobson and James Rumbaugh, also known as `The Three Amigos'. UML, indeed the second trend, aims at providing the full notational repertoire needed for modeling every conceivable structural and behavioral aspect of software systems. An excellent introduction to UML is given in  [Fowler97]. In Appendix UML you will find a brief introduction to the UML.

With respect to technology, the field is still very much in flux. A dominant factor here is the rapid increase in Internet usage and, more in particular, the Web. The Web has boosted the interest of the IT business world in the deployment of distributed object or component technology to extend their range of business. Nevertheless, the very existence of this infrastructure is in itself somewhat embarrassing, in that the Web and the technology around which it is built is not object-oriented. Perhaps it should be, but it simply isn't. Our embarrassment is aggravated when we observe, following  [Szyperski97], that the technology which may change this, in casu component software, is in itself not object-oriented but, paraphrasing the subtitle of this excellent book, `beyond object orientation'. And even worse, object-oriented approaches at framework development have failed more often than they have succeeded, an observation which is confirmed by for example  [Surviving]. Reading this you may think that object-orientation is in a deplorable state, and close the book. It isn't. First of all, because in terms of modeling and design there is no beyond object-orientation. And secondly, quoting Szyperski, `object-technology, if harnessed carefully, is possibly one of the best ways to realize component technology ...'. Well, believe me, it is the best way. Whether it is CORBA, Microsof (D)COM or Java that will become the dominant component technology is quite another issue; component technology that ignores the object-lessons is doomed to fail!

#### Challenges

Ignoring the component question for the moment, we may ask ourselves what the major challenges are that are confronting us as software developers. Briefly put, we still need to go a long way before we understand our applications well enough in terms of the (problem-solving) patterns underlying their construction that we can realize these patterns robustly in frameworks that are not only reusable conceptually, but that will also be (re)used in practice to develop cost-effective, competitive, economically viable applications.

More concretely, a major challenge for the next decade will be to develop and deploy frameworks that operate in areas such as finance, medical care, social welfare and insurance. This is explicitly not only a technical problem, but also a problem of coming to agreement with respect to the abstractions and corresponding standards that provide the computational infrastructure for these domains. Also on my wish-list is the separation of logic and control, by which I mean the decoupling of the more or less invariant functionality as may be provided by for example business objects and business processes and the more variable logic that controls these processes. In other words, it is necessary that the business logic is made explicit and that it is factored out of the code effectuating it.

#### Challenges in O-O

• vertical framework development -- finance, medical care, insurance
• separation of 'logic' from 'control' -- business rules
• distributed object technology -- heterogeneous systems
• visualisation -- structure and processes
• knowledge intensive applications -- declarative
• heterogeneous systems -- fragmented applications

slide: Challenges

Another challenge is to integrate the various technologies into our frameworks and systems. In effect we will see more and more heterogeneous systems, composed of components from a variety of suppliers. These components may be implemented in every conceivable language, and may run on different platforms. How to connect these components in a reliable manner is still an open problem. And more generally, although there are solutions for crossing the various boundaries, the platform boundary and the language boundary, there are still a lot of problems to solve. In this book we will explore some of these problems, and get some experience with some of the solutions.

Both our hardware and software technology are improving rapidly. Yet, we are still stuck with the WIMP interfaces. In my opinion, it is time for a change. What I would like to see is an exploration of 3D user interfaces and 3D visualisations of the structure and processes underlying information-intensive applications. Although not specifically related to object-oriented software development, this is an area where object orientation can prove its worth.

When we think about real applications, for example information or business services on the Internet, they are usually the kind of applications that we may characterize as knowledge-intensive applications. In a somewhat idealistic vision, we may think of application development that consists of composing components from perhaps even a number of frameworks, so that we don't have to bother with the tiresome details of network access and GUI development. Then what remains to be done is to glue it all together, and provide the information and knowledge that enables our application to deliver its services. Partly we can rely on database technology for the storage and retrieval of information. But in addition we will need other declarative formalisms for expressing, for example, our business logic or, as another example, for expressing the synchronisation constraints of our multimedia presentation.

Considering Web applications, even as they are today, we see applications that consist of a mixture of code, tools and information. The phrase fragmented applications seems apt here. For example a store selling books on the Internet needs everything ranging from Javascript enabled webpages, to a secure CORBA-based accounting server. It is very likely that such applications will be developed partly by composing already existing components.

In his book,  [Szyperski97] argues that component-technology must be considered as the next stage, that is (as the subtitle of his book indicates) beyond object orientation. This is true to the extent that naive object orientation, characterized by weak encapsulation and white-box or implementation inheritance, has proven to be not entirely successful. What we need is a more robust specification of the behavioral properties of objects, for example by contractual specifications, and a stronger notion of encapsulation, in which not only the inner world of the object is protected from invasions from the outside, but where the outer world is also shielded from the object itself, so that the object cannot reach out into a world that might not even exist. More concretely, objects must be designed that allows them to be used in a distributed environment. They must observe, as Wegner puts it, the distribution boundary.

(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.


text:
# Practice Problems for Module 4

Sections 7.1 and 7.2

Directions. The following are review problems. We recommend you work the problems yourself, and then click "Answer" to check your answer. If you do not understand a problem, you can click "Video" to learn how to solve it. You can also follow the link for the full video page to find related videos.
1. Evaluate the following integrals.
1. $$\displaystyle \int \! x^2e^{2x} \, dx$$

$$\displaystyle \int \! x^2e^{2x} \, dx = \frac{1}{2}x^2e^{2x}-\frac{1}{2} xe^{2x} + \frac{1}{4}e^{2x}+C$$

To see the full video page and find related videos, click the following link.

2. $$\displaystyle \int \! \left( \ln (x)\right)^2\, dx$$

$$\displaystyle \int \!\left( \ln (x)\right)^2\, dx = x\left( \ln (x)\right)^2-2x\ln(x)+2x+C$$

To see the full video page and find related videos, click the following link.

3. $$\displaystyle \int \! x\tan^2(x)\, dx$$

$$\displaystyle \int \! x\tan^2(x)\, dx =x \tan(x)-\frac{1}{2} x^2+\ln|\cos(x)|+C$$

To see the full video page and find related videos, click the following link.

4. $$\displaystyle \int \! 6x^5\cos(x^3) \, dx$$

$$\displaystyle \int \! 6x^5\cos(x^3) \, dx = 2x^3\sin(x^3)+2\cos(x^3)+C$$

To see the full video page and find related videos, click the following link.

5. $$\displaystyle \int \! \sin(2x)e^{5x} \, dx$$

$$\displaystyle \int \! \sin(2x)e^{5x} \, dx = \frac{5}{29} \sin(2x)e^{5x}-\frac{2}{29} \cos(2x)e^{5x}+C$$

To see the full video page and find related videos, click the following link.

2. Evaluate the following integrals.
1. $$\displaystyle \int \! \tan^3(x) \, dx$$

$$\displaystyle \int \! \tan^3(x) \, dx =\frac{1}{2}\tan^2(x)+\ln|\cos(x)|+C$$

To see the full video page and find related videos, click the following link.

2. $$\displaystyle \int \! \dfrac{\sin^3(x)}{\sec^2(x)} \, dx$$

$$\displaystyle \int \! \dfrac{\sin^3(x)}{\sec^2(x)} \, dx =\frac{1}{5}\cos^5(x)-\frac{1}{3}\cos^3(x)+C$$
Video Errata: The rule of thumb mentioned in the video is not always true. Rather than worrying about the size of the powers when dealing with powers of trig functions time powers of trig functions, it’s better to consider which one can be reduced down in terms of the other after differentiating and then using trig identities. This often involves, but not always, the Pythagorean identities. You can then let $$u$$ be the trig function you can write the other in terms of. For this problem, by letting $$u = \sin(x)$$, you run into issues because you’ll have to deal with a single (not raised to a power) $$\cos(x)$$ that’s left over when writing $$du$$. You should try this yourself. However, sometimes either works just as well.

To see the full video page and find related videos, click the following link.

3. $$\displaystyle \int \! \cos^2(x)\sin^2(x) \, dx$$

$$\displaystyle \int \! \cos^2(x)\sin^2(x) \, dx = \frac{x}{8} - \frac{1}{32}\sin(4x)+C$$

To see the full video page and find related videos, click the following link.

4. $$\displaystyle \int \! \sec^4(x)\tan^3(x) \, dx$$

$$\displaystyle \int \! \sec^4(x)\tan^3(x) \, dx = \frac{1}{4}\tan^4(x)+\frac{1}{6}\tan^6(x)+C$$

To see the full video page and find related videos, click the following link.

5. $$\displaystyle \int \! \sin(3x)\cos(x) \, dx$$

$$\displaystyle \int \! \sin(3x)\cos(x) \, dx = -\frac{1}{8}\cos(4x)-\frac{1}{4}\cos(2x)+C$$

To see the full video page and find related videos, click the following link.


text:
# Prove that $3 - 2 ^ {1/7}$ is Irrational

How to prove that $3 - 2 ^ {1/7}$ is irrational?

If I do

$$\frac p q = 3 - 2 ^ {1/7}$$

$$2 ^ {1/7} = 3 - \frac p q$$

Hint needed

Should I multiply by $7$ times??

• Yes, multiply it by itself seven times. But don't worry about the right hand side. All it matters is that $3-p/q$ is also of the form $m/n$, (rational). Mar 23 '15 at 19:16
• Show first that $\sqrt[7]{2}$ is irrational. A similar proof to the one for the irrationality of $\sqrt{2}$ works.
– mfl
Mar 23 '15 at 19:16
• $3 - \dfrac p q = \dfrac{3q}q - \dfrac p q = \dfrac{3q-p}q = \dfrac m n$, so you have $2^{1/7}=\dfrac m n$. The "3" is just clutter, so get rid of it that way. ${}\qquad{}$ Mar 23 '15 at 19:22
• Nice @MichaelHardy a good explanation... Mar 23 '15 at 19:24
• You just asked a question that hinged on the obvious fact that if $r$ is irrational, then $6-r$ is irrational. Why are you repeating yourself here? Mar 23 '15 at 19:27

Suppose $3-2^{1/7}=\frac{m}{n},$ for some $m,n\in\Bbb Z,$ $n\neq0.$ Then $(3n-m)^7=n^7+n^7,$ which contradicts Fermat's Last Theorem!.

• I really like this answer.
– user207710
Mar 23 '15 at 19:19
• Technically correct, but perhaps a tiny bit of overkill! Mar 23 '15 at 19:25
• Well, Fermat's Last Theorem requires very deep number theory and algebraic geometry. The uniqueness of prime factorization is a much simpler and more direct tool. Mar 23 '15 at 19:33
• Definitely the hard way! Mar 24 '15 at 1:31
• @HussainHalai Fermat's Last Theorem was unsolved for 300 years. When it was finally proven, in 1995, the proof was hundreds of pages long. This is definitely overkill! Apr 13 '15 at 8:42

Suppose $3-2^{1/7}$ is rational,Hence $2^{1/7}=3-(3-2^{1/7})$ is rational.we will prove that $2^{1/7}$ is irrational.

Direct Proof:Just use the rational root test on the polynomial equation $x^7-2=0$ (note that $\sqrt[7]{2}$ is a solution to this equation). If this equation were to have a rational root $\frac{a}{b}$ with gcd$(a,b)=1$ (with $a,b\in \mathbb{Z}$ and $b\not=0$), then $b\vert 1$ and $a\vert 2$. Thus, $\frac{a}{b}\in\{\pm 1,\pm 2\}$. However, none of $\pm 1,\pm 2$ are solutions of $x^7-2=0$. Therefore the equation $x^7-2=0$ has no rational solutions and $\sqrt[7]{2}$ is irrational.Hence We are done!

Alternatively, suppose we have $\sqrt[7]{2}=\frac{a}{b}$ for some $a,b\in \mathbb{Z}$, $b\not=0$, and $\gcd(a,b)=1$. Then, rearranging and cubing, we have $2b^7=a^7$. Therefore $a^7$ is even....what does that say about $a$? What, in turn, does that say about $b$? It's really not that different from the classic proof that $\sqrt{2}$ is irrational.

• You also need to assume $\,\gcd(a,b)=1\,$ to apply the Rational Root Test. Thankfully, the proof is infinitely simpler than that for FLT sledgehammer used elsewhere. Mar 23 '15 at 19:28
• Fixed Now !Thank You @BillDubuque Mar 23 '15 at 19:33

You can safely ignore the term $3$.

Let $p^7=2q^7$, with $p$ and $q$ relative primes. Then $p^7$ is even, so that $p$ is even, so that $q^7$ is a multiple of $2^6$ so that $q$ is even, a contradiction.


text:
# Understanding “the mean minimizes the mean squared error”

I am trying to understand the sentence

the mean minimizes the mean squared error.

from wikipedia https://en.wikipedia.org/wiki/Average_absolute_deviation. From a previous post Formal proof that mean minimize squared error function I can see a formal proof which according to the authors prove that the mean minimaze. But my objection on that prove is that is you substitute m with median all the reasoning still stands.

Therefore, I restricted myself to one dimension and built the following example :

MSE = 1/n[SUM(Y_hat_i - Y_i)**2]

Given the following distribution Y = [5,3,2,7,4], minimizing MSE I intended as in the following: I should find a function Y_hat such that when it is applied to the MSE formula (more specifically to each element of the Y distribution), we are sure that we obtain the minimum value. For simplicity, I could consider the Y_hat as any measure or function for the central tendency, including, mean, median, mode, etc.

Lets suppose, Y_hat = mean (=4.2 for our distribution), therefore, I did all the calculations such as:

1/5 [(4.2-5)**2 + (4.2-3)**2+ (4.2-2)**2 + (4.2-7)**2  + (4.2-4)**2 ] = 2.96

Let's suppose, Y_hat = median (=4 for our distribution), therefore, I did all the calculations such as:

1/5 [(4-5)**2 + (4-3)**2+ (4-2)**2 + (4-7)**2  + (4-4)**2 ] = 2.8

If I did all the calculation correctly, the result shows that for this case, the median is minimizing better than the mean.

I am sure, I am doing something wrong and missing important aspects of the overall reasoning.

Please, could you provide any clarification on the above topic? I would really appreciate it.

Many Thanks in advance, Best Regards, Carlo

If you have $$(y_i)_{i=1}^n$$, consider the mean squared difference from the $$y_i$$ to a value $$a$$.

This is $$s(a) =\sum_{i=1}^n (y_i-a)^2$$.

Manipulating this,

$$\begin{array}\\ s(a) &=\sum_{i=1}^n (y_i-a)^2\\ &=\sum_{i=1}^n (y_i^2-2ay_i+a^2)\\ &=\sum_{i=1}^n y_i^2-\sum_{i=1}^n2ay_i+\sum_{i=1}^na^2\\ &=\sum_{i=1}^n y_i^2-2a\sum_{i=1}^ny_i+na^2\\ \end{array}$$

There are a number of ways to minimize this expression. Perhaps the easiest is to differentiate with respect to $$a$$. This gives $$s'(a) =-2\sum_{i=1}^ny_i+2na$$ and this is zero when $$a =\dfrac{\sum_{i=1}^ny_i}{n}$$, the mean of the values.

Note that, since $$s''(a) =2n > 0$$, this value of $$a$$ gives a minimum.

An even easier way is to write $$\bar{y} =\dfrac{\sum_{i=1}^ny_i}{n}$$ and $$\bar{y^2} =\dfrac{\sum_{i=1}^ny_i^2}{n}$$.

Then

$$\begin{array}\\ \frac1{n}s(a) &=\frac1{n}\sum_{i=1}^n y_i^2-2a\frac1{n}\sum_{i=1}^ny_i+a^2\\ &=a^2-2a\bar{y}+\bar{y^2}\\ &=a^2-2a\bar{y}+\bar{y}^2-\bar{y}^2+\bar{y^2}\\ &=(a-\bar{y})^2+\bar{y^2}-\bar{y}^2\\ \end{array}$$

Since $$\bar{y^2}-\bar{y}^2$$ is independent of $$a$$, this is clearly a minimum when $$a = \bar{y}$$ and the value at the minimum is $$\bar{y^2}-\bar{y}^2$$.

• Many Thanks MartyCohen. This is what I was looking for. Your prove clearly shows that to min MSE, Y_hat MUST be the mean. Thank you once again. – Carlo Allocca Dec 6 '17 at 19:09

Check your calculation, we have $$\frac{(4-5)^2 + (4-3)^2+ (4-2)^2 + (4-7)^2 + (4-4)^2}{5} = \frac{15}{5} = 3 > 2.96.$$ The mean minimizes the MSE indeed, no contradiction here.

• Yes, you are right Martin. Thanks for the double check. My question is Why the mean is the function that minimizes the MSE? – Carlo Allocca Dec 6 '17 at 18:57
• I am looking at the prove given here math.stackexchange.com/questions/967138/… but if I substitute m with median everything still work. What am I missing? – Carlo Allocca Dec 6 '17 at 18:59
• I am no statistician, but it is common in calculus for the absolute min value to occur at several different $x$s. Could the same thing be happening here? Or, in your case, are the mean and median equal so there is no contradiction? – Randall Dec 6 '17 at 19:05
• Thanks Randall. Problem solved by MartyCohen above. – Carlo Allocca Dec 6 '17 at 19:10
• @CarloAllocca I would say that the post of Reiner Martin matches more your question. – callculus Dec 6 '17 at 19:13


text:
# Induced image of the fundamental group of a covering space

I have been reading Hatcher´s Algebraic Topology, and he wants to prove that if we have a covering space $$(E,p)$$, with $$p(e)=x_0$$ then $$p_*(\pi_1(E,e)$$) consists of the homotopy classes of loops in $$X$$ starting at $$x_0$$ such that their lifts are loops in $$E$$ starting at $$e$$.To do this in the proof he says that a loop representing an element of the image $$p_*$$ is homotopic to a loop having such a lift , and intuitively it seems right but i cant seem to see why this is true theoretically , so any help is apreciated, Thanks.

Let $$\gamma$$ be a loop on $$x_0$$ that represents $$p_*([\vartheta])\,\in\pi_1(X,x_0)$$ with $$[\vartheta] \in\pi_1(E,e)$$.
This means $$[\gamma] =p_*([\vartheta]) =[p\circ\vartheta]$$, that is, $$\gamma$$ is homotopic to $$p\circ\vartheta$$, which lifted to $$e$$ obviously gives $$\vartheta$$.


text:
Strictly Convex and Strictly Monotonic Preferences

On the assumptions for a well behaved preference, I read recently that a preference must be complete, transitive, continuous, strictly monotonous (if the vectors x≥y and x≠y, then x is strictly preferable to y) or sometimes just monotonous (if x>>y, then x is strictly preferable to y) and strictly convex. But my doubt now follows: if you assume strict convexity (any linear combination with a different bundle in the same indifference curve will be strictly preferable) for a preference, it seems to me that any degree of monotonicity will be strict -- right? Am I missing something?

• What you call "strictly monotonous" should instead read "strongly monotonic." Preferences that are strongly monotonic state that when $x \geq y$ and $x \neq y$, then $x \succeq y$. Preferences that are strictly monotonic when $x \geq y$, then $x \succeq y$ and when $x >> y$, $x \succ y$. – jmbejara Mar 18 '14 at 22:38
• Also, just to note, a "preference" relation is usually defined as a binary relation that is complete and transitive. The other properties are assumed so that we can derive "demand functions." We want the consumer's constrained maximization problem to produce a unique solution that is continuous in prices (among other properties). – jmbejara Mar 19 '14 at 1:18
• @jmbejara: From what I have seen, there is unfortunately no real convention in the literature on the definition of the different variants of monotonicity axioms (weak,strong,strict,...). For instance, Mas-Collel's textbook defines "strongly monotonicity" as [$x \geq y$ and $x\neq y$ implies $x \succ y$], not $x \succeq y$. Kreps' textbook calls the same property "strict monotonicity". Jehle and Reny on the other hand agree with you definition of strict monotonicity. Finally I have seen papers referring to what you call "strict monotonicity" as "monotonicity". Quite a mess... – Martin Van der Linden Mar 19 '14 at 15:10
• You're right about strong monotonicity. It is correct, however, in my solution below. However, I think there is definitely agreement between strict and strong, as the same concepts appear elsewhere and more generally in mathematics. (Check me if I'm wrong.) See wikipedia. I believe the idea is that strongly convex means that strictly increasing the quantity of at least one good strictly increases utility. Strict convexity means all goods must be increased to guarantee strictly more utility. en.wikipedia.org/wiki/Convex_function#Strongly_convex_functions – jmbejara Mar 19 '14 at 15:27
• I am not sure I follow you on "strongly convex means that strictly increasing the quantity of at least one good strictly increases utility". Do you mean "strongly monotonic"? I know nothing about the conventional use of the "strong" and "strict" qualifiers in math, so I would not dare checking you on that ;). But I do know that there is alas no agreement in the economic literature or profession at least... I have checked some other references quickly to get a better sample and there is a real confusion, strong and strict being used interchangeably to define the same axiom by different authors. – Martin Van der Linden Mar 19 '14 at 16:47

Definitions

To clarify, preferences that are strongly monotonic state that when $x \geq y$ and $x \neq y$, then $x \succ y$. Preferences are strictly monotonic when $x \geq y$ imply $x \succeq y$ and $x>>y$ imply $x \succ y$. The difference is that strong monotonicity requires only one more of any good to be strictly preferred.

Strict convexity (of preferences) means that when $x \neq y$ and $x \succeq y$, then $t x + (1-t) y \succ y$ for all $t \in (0,1)$.

Example with no (positive) monotonicity

Consider preferences like those depicted below. The top indifference curve (U1) is strictly less preferred than the bottom (U2). Preferences over these goods (which might better be called "bads") are strictly convex. Whenever $x \neq y$ and $x \succeq y$, then $t x + (1-t) y \succ y$ for all $t \in (0,1)$.

However, these preferences are in no degree monotonic. (In a sense, they are monotonically decreasing, but we usually take "monotonic preferences" to be increasing as in the definition I gave above.) For the right domain, preferences of this kind are indeed complete and transitive.

So, strictly convex preferences do not imply monotonicity (at least in the direction that you want).

Monotonicity and strict convexity imply strong monotonicity

Suppose we use a definition of monotonicity where $x \geq y$ imply $x \succeq y$. Then, it is true that this form of monotonicity together with strict convexity (as defined above) imply strong monotonicity (as defined above).

To show this, let $x$ and $y$ be given such that $x \geq y$ and $x \neq y$. Then by this form of monotonicity, $x \succeq y$. This allows us to use strict convexity to say that $\forall t \in (0,1)$ we have $t x + (1-t) y \succ y$. Now, either $x \succ y$ or $x \sim y$. Suppose by way of contradiction that $x \sim y$. Then $\forall t \in (0,1)$ we have $$t x + (1-t) y \succ y \sim x.$$ But it is clear that $t x + (1-t) y \leq x$, so by monotonicity $t x + (1-t) y \preceq x$. This is a contradiction. So it must be that $x \succ y$. Thus, the preferences are strongly monotonic.

• But in your proof you're not deliberately raising every dimension of the vector? And by strict convexity tx+(1−t)y≤x is actually tx+(1−t)y<x. Right? Now I'm thinking my assumption maybe wrong. Another thing: I was thinking with the definition of Mas-Collel for monotonocity, but the document in which I was reading the definition of monotonicity uses this definition: if x>>y, then x⪰y. edit: I apologize for my lack of rigorousness in this question (and other questions before). – John Doe Mar 20 '14 at 22:11
• I am not raising every dimension of the vector. The expression $t x + (1-t) y \leq x$ is correct as it stands. $<$ would not make sense because $x$ and $y$ are vectors. $<<$ would make conform to the fact that these are vectors, but like you mentioned, I am not raising every dimension. So $\leq$ is appropriate. As for the definition, Martin has pointed out that the definitions vary a lot. So, my proof is careful to provide the definition that it relies. on. The proof would work just as well with the alternative definition that you gave, after adjusting the assumptions. – jmbejara Mar 21 '14 at 3:33

Here is an attempt to make up for my ugly mistake on the strict convexity of Leontieff preferences ;).

If I read you right, the guess you want to check is whether for complete, transitive and continuous preferences, strict convexity implies that any monotonic preference relation is also strictly monotonic. I believe your guess is right and this can be shown by contradiction (the construction of the different bundle in the proof are illustrated in the picture).

• Assume that there exists $x,y$ such that $x \geq y, x\neq y$ and $y$ is not strictly preferred to $x$.
• By monotonicity, $x_l = y_l$ for some good $l$ (otherwise $x \succ y$).

• By completeness we must have $y \succeq x$.
• As $x \neq y$ and preferences are continuous, there must exist a bundle $k$, a convex combination of $x$ and $y$, which leaves the agent indifferent with $x$, that is for some $\alpha \in [0,1)$ we have $k = \alpha x + (1-\alpha) y$ and $x \sim k$. (This step is not really needed but helps sticking to your definition of strict convexity).
• By strict convexity, there exists a convex combination $z$ of $k$ and $x$ such that $z$ is strictly preferred to $x$, that is for some $\lambda \in (0,1)$ we have $z = \lambda x + (1-\lambda) y$ and $z \succ x$.
• By continuity, strict upper contour sets are open, so there exists a neighborhood of $z$, $N_\epsilon(z)$ such that for every $m \in N_\epsilon(z)$, $m \succ x$.
• Take any $w \in N_\epsilon(z)$ such that $w << z$. By construction $w << x$, so by monotonicity we must have $x \succ w$. But by $w \in N_\epsilon(z)$, we must have $w \succ x$, a contradiction.


text:
Seven competing ways to recover the Michaelis-Menten equation reveal the alternative approaches to steady state modeling 1footnote 11footnote 1Reference: Michel, D. & Ruelle, P. 2013. Seven competing ways to recover the Michaelis-Menten equation reveal the alternative approaches to steady state modeling J. Math. Chem. 51, 2271-2284. DOI 10.1007/s10910-013-0237-5

# Seven competing ways to recover the Michaelis-Menten equation reveal the alternative approaches to steady state modeling 111Reference: Michel, D. & Ruelle, P. 2013. Seven competing ways to recover the Michaelis-Menten equation reveal the alternative approaches to steady state modeling J. Math. Chem. 51, 2271-2284. DOI 10.1007/s10910-013-0237-5

Denis Michel and Philippe Ruelle

Universite de Rennes1-IRSET. Campus de Beaulieu. 35000 Rennes France. denis.michel@live.fr
Université catholique de Louvain - UCL. Institut de Recherche en Mathématique et Physique.
IRMP. Chemin du Cyclotron, 2. B-1348 Louvain-la-Neuve, Belgium. philippe.ruelle@uclouvain.be

The Michaelis-Menten enzymatic reaction is sufficient to perceive many subtleties of network modeling, including the concentration and time scales separations, the formal equivalence between bulk phase and single-molecule approaches, or the relationships between single-cycle transient probabilities and steady state rates. Seven methods proposed by different authors and yielding the same famous Michaelis-Menten equation, are selected here to illustrate the kinetic and probabilistic use of rate constants and to review basic techniques for handling them. Finally, the general rate of an ordered multistep reaction, of which the Michaelis-Menten reaction is a particular case, is deduced from a Markovian approach.

## 1 Preliminary tools: the helpful scale separations

The approximation of concentration and time scales separations is often reasonable in cellular biochemistry, but some discernment is necessary for its proper application, in particular to define pseudo-first order constants and decide which reactions can be considered as in quasi-equilibrium compared to others.

### 1.1 Concentration scale separation

The wide differences of molecular concentrations in the cell greatly facilitate network modeling. The concentration of the more concentrated reactant, generally called the ligand or the substrate in enzymology, can be associated to second-order constants to give so-called pseudo-first order constants. This approximation strongly simplifies elementary treatments, for example to define hyperbolic saturation functions through equating the concentrations of total and free ligand. To apply the concentration scale separation, it is important to decide which reactant should be fused to the second-order constant. Depending on the cases, the same molecule can behave as either the leading macromolecule or as the ligand. This is the case, for example, for a transcription factor, say the estrogen receptor (ER), activated by the estrogen hormone (E2) and then capable of binding to a given unique gene (G) from the X chromosome. Even if ERs are not very numerous in the cell, they are however much more abundant than the single gene. Hence, ER can be considered as a diffusible ligand whose concentration varies slowly compared to the dynamics of its interaction with the gene. Conversely, when studying the activation of ER by E2, the ligand is now E2, which should be integrated in pseudo-first order rates of ER state changes. If the binding of E2 to ER and the binding of ER to G are to be mixed in the same model, a new approximation intervenes: the time scale separation.

### 1.2 Time scale separation

In the example introduced above, the interactions between E2 and ER can be considered as more dynamic than those occuring between ER and G. Time scale separation is particularly important to obtain smooth graded interactions between a ligand and a very unique binding site [1]. This approximation allows kinetic and equilibrium constants to coexist in the same equation, as long proposed [2]. Once built, the first-order network can be treated through different methods yiedling equivalent results. A survey of some of them is proposed below using a founder example of historical importance: the Michaelis-Menten (MM) enzymatic reaction. In these methods, rate constants are envisioned as frequencies corresponding to the inverse of mean waiting times. Indeed, molecular events are primarily dictated by waiting times whereas the transitions are themselves considered as instantaneous. Before examining the MM reaction, it is first necessary to introduce elementary recipes mixing kinetic and probabilistic thinking [3, 4] and which can be addressed using the simple questions of Fig.1.

## 2 Shortcuts to steady state modeling

Fundamental kinetic rules are illustrated by the three simple reactions shown in Fig.1. For (a) and (b), what is the rate constant of the global transition from A to B and what is the mean lifetime in state A ? For (c), what is the probability for A to shift to B rather than to C and what is the mean lifetime in state A ?

Figure 1. Basic rules of direct rate constant manipulation.

In Fig.1a, there are two ways to leave A so that the global rate is the sum of the individual rates . This intuitive result is related to a property of the exponential distribution . If and are two independent random variables with exponential law, then . Indeed, is characterized by its tail . Hence and = .

The rate of the global transition of Fig.1b is obviously lower than that of Fig.1a since there are two waiting times from A and B. The mean time to reach B from A is and the mean lifetime of A is . Hence, in case of continuous supply with A, the frequency of the arrivals to B is the reciprocal of its mean time: .

For Fig.1c, the probability to obtain B is and the mean lifetime in state A is the same as for Fig.1a: . These results are the very basic ingredients of network modeling and will be used in the following section.

## 3 Seven ways to the Michaelis-Menten reaction rate

The 2-step Michaelis-Menten enzyme reaction scheme represented in Fig.2 has become an unavoidable chapter of enzymology textbooks and a masterpiece of biochemistry courses. Interestingly, a sort of game has been established by different authors to test their alternative methods of treatment using the MM reaction. Some of them are of great pedagogical interest and will be listed below, but let us first consider the pioneer work of Michaelis and Menten.

### 3.1 Michaelis-Menten: the quasi-equilibrium assumption

The names of Michaelis and Menten [5] are associated with both the hyperbolic equilibrium fraction of saturation and the elementary steady state enzymatic reaction rate where is precisely known as the Michaelis constant. But in fact, if the founding contribution of Michaelis and Menten to biochemical modeling cannot be denied, they did not discover these two fundamental bases of systems biology. The Michaelis-Menten equilibrium hyperbola, also known as the isotherm of Langmuir, was described by Jean-Baptiste Biot [6] and the Michaelis constant was introduced by Briggs and Haldane [8]. The name of Michaelis was perhaps given to the Michaelis constant in honour of his previous scientific contribution. Nevertheless, the approach of Michaelis-Menten remains interesting because they seemed to assume, non-explicitely or unintentionally, the principle of time scale separation. As explained by Briggs and Haldane, Michaelis and Menten considered that the kinetics of noncovalent interaction between the enzyme and the substrate is much more rapid than that of the catalytic reaction, so that they used the dissociation equilibrium constant instead of the Michaelis constant introduced later. Further confusing the situation, Michaelis and Menten did not write their constant but [5], which should be interpreted as the for the substrate () [8].

The method of Michaelis-Menten can be described as follows. Given that catalysis concerns only the fraction of enzyme bound to the substrate, the rate of product synthesis () normalized by the total amount of enzyme is

 k=kc[ES][E]tot=kc[ES][E]+[ES]. (1a) where [E] is the concentration of the free enzyme. Considering that the catalytic reaction is infrequent compared to the binding and dissociation reactions, the substrate and the enzyme can be assumed to be in equilibrium and the equilibrium constant can be written as a ratio of concentrations, Kd=[E][S][ES]. (1b) Combining these two equations yields k=kc[S]Kd+[S]. (1c)

### 3.2 Briggs and Haldane: the steady-state assumption

In the classical scheme represented in Fig.2, the catalytic transition is represented by a one-way arrow.

Figure 2. The famous Michaelis-Menten enzymatic reaction, where an enzyme catalyses the conversion of a substrate into a product . The final reaction of rate is considered as irreversible.

The system is thus said to be micro-irreversible, which means that it is out of equilibrium and can be sustained only through to a continuous refuelling with fresh substrate. An in depth analysis of the legitimacy of the quasi-steady state approximation is proposed in [7]. The fraction of enzyme bound to the substrate is the steady state resultant of its formation and its disappearance according to [8]

 ka[E][S]=(kd+kc)[ES]. (2a) Therefore we have [E][ES]=kd+kcka[S], (2b) so that k=kc[ES][E]+[ES]=kcka[S]kd+kc+ka[S]=kc[S]KM+[S], (2c) where KM=(kd+kc)/ka. (2d)

### 3.3 The first-order network of King and Altman

The method of King and Altman [9] was a precursor of modern single-molecule approaches in that it is basically probabilistic. Let us recall its rules.

• All rates should be first- or pseudo-first order (). In the scheme of Fig.2, there is a second-order constant: (). As explained in section 1, by virtue of the excess of substrate relative to the enzyme, a pseudo-first order constant can be defined .

• A single kind of molecule should be considered in the different nodes of the network: the leading molecule is in the present case the enzyme.

• Finally, every state transition must be associated to a single arrow, possibly gathering several channels.

The MM scheme of Fig.3 is a simplistic network made of only two nodes. Since there are two ways to convert into , it is necessary to give to this transition the rate obtained by summing the individual rates (as for Fig.1a). As a result, one obtains the first order network schematized in Fig.3.

Figure 3. The MM reaction redrawn as a 2-node network in the manner of King and Altman.

This scheme shows that a single enzyme can exist only in two forms. The probability of each form is straightforwardly defined by a King and Altman-like graphical method:

 PES=→←+→=ka[S]kd+kc+ka[S], (3a) and PE=←←+→=kd+kckd+kc+ka[S], (3b) so that the rate is simply k=kcPES=kcka[S]kc+kd+ka[S]. (3c)

### 3.4 The frequency of successful enzyme cycles

The total time necessary for a single enzyme to achieve the reaction of Fig.2 is the sum of two residence times: that of waiting for catching a substrate molecule and then of , waiting for either a reaction or a dissociation [3]. The first one is simply and the second one is (see the question of Fig.1c), so that

 T=1ka[S]+1kd+kc. (4)

The turnover frequency is the reciprocal of this time, , but all the turnovers are not successful since can simply dissociate into instead of giving . The probability of this latter possibility is (see Fig.1c), giving the final expression

 k=νkckd+kc=kcka[S]kc+kd+ka[S]. (5)

### 3.5 The frequency of non-abortive cycles

This is the pessimistic counterpart of the previous approach, but which works as well [10]. The probability that merely dissociates instead of reacting is the complementary to the previous one and in the case, the whole chain is reinitiated. This situation can be explicitly transcribed into

 ⟨T⟩=1ka[S]+1kd+kc+kdkd+kc⟨T⟩. (6a) It implies, after some rearrangements, k=1⟨T⟩=kcka[S]kc+kd+ka[S]. (6b)

### 3.6 Sum of direct conversion times

This powerful method is inspired from [11, 12, 13]. In the steady state, the rate of product formation is the inverse of the sum of the forward conversion times for all enzyme states, which can be written as

 k=1∑iT→i, (7)

where is the time necessary to directly reach the objective (release of the product) when starting from the enzyme state . For the Michaelis-Menten reaction, only two states of the enzyme are to be considered: waiting for a substrate and waiting for reacting. For the latter, the calculation is immediate,

 T→ES=1kc. (8)

For , the forward rate is conditioned by the probability that when bound to , the reaction proceeds rather than the substrate dissociates, which is, as defined previously, equal to . Hence, one has

 T→ES+T→E=1kc+1ka[S]kckd+kc, (9)

which implies

 k=1T→ES+T→E=kcka[S]kc+kd+ka[S]. (10)

### 3.7 The point of view of a single substrate molecule

For a given substrate molecule, the binding of a diffusing enzyme appears as in the scheme

The enzyme concentration included in the pseudo-first order binding constant is of course that of the free enzyme, which is itself determined by the population of substrate molecules which partly sequestrates it: . The steady state value of is given by

 ka[S]([E]tot−[ES])=(kd+kc)[ES]

which gives

 [ES]=ka[E]tot[S]kd+kc+ka[S]

Introducing this value in the reaction rate gives the final equation.

### 3.8 The free enzyme activity

Using the same probabilistic treatment as previously, the global reaction rate is

 v=ka[S][E]kckc+kd=kcKM[S][E]

where the concentration of the free enzyme, not sequestrated by other substrates, is

 [E]=[E]totKMKM+[S]

which gives, when reintroduced in the preceding rate, the correct final formula.

### 3.9 Transient approach

Interestingly, all the methods described above avoid transient treatments, but the mean cycling time obtained in this way expectedly gives the same results. At the single-enzyme level, a single-MM reaction follows a biexponential cycle [14]. The MM behaviour can be recovered as the reciprocal of the mean time of a single cycle between the enzyme state waiting for a substrate () and the enzyme state that released the first product (). The transient behaviour of this cycle is obtained by solving the following system

 \textupdPE0(t)dt = kdPES(t)−ka[S]PE0(t), (11a) \textupdPES(t)dt = ka[S]PE0(t)−(kd+kc)PES(t), (11b) \textupdPE1(t)dt = kcPES(t). (11c) At every time, a single enzyme can take only one of these three states so that PE0+PES+PE1=1. (11d)

With the initial condition , this system predicts that the probability of cycle achievement at time approaches 1 according to

 PE1(t)=1−\textupe−μt(μλsinhλt+coshλt), (12a) where μ=(kd+kc+ka[S])/2,λ=√μ2−kcka[S]. (12b)

The first moment of the distribution (12a) gives the mean time of a single cycle,

 ⟨T⟩=∫∞0tPE1(t)dt=2μμ2−λ2=kd+kc+ka[S]kcka[S] (13)

whose inverse is the average product formation rate.

### 3.10 Markovian modeling

A brute force approach is to define the general equation valid for any -step enzymatic reaction and then to simplify it for the case of the 2-step MM reaction. Indeed, the reaction of Michaelis-Menten is a minimal version of the heterogeneous linear walk represented in Fig.4 and involved in many research areas beside this particular context [15, 16, 17].

Figure 4. First order chain where the different nodes represent different states of the same enzyme (conformation, post-translational modification, substrate(s) ligation(s) complexes etc.). The kinetic constants associated to each transition are labelled with + or - depending on whether they are forward or backward transitions and the indices refer to the starting state of the enzyme. It is important to note that the enzyme is not consumed during the reaction but is simply recycled ().

Note that to obtain such a chain, it is sometimes necessary to prune some branches in case of disordered events (see an example in Appendix 5.1). This -step chain is micro-irreversible because . This general chain can be used as a common frame adaptable to many different enzymatic reaction schemes, simply by replacing the first-order constants by appropriate pseudo-first order ones. The mean arrival time of this generic reaction is (see Appendix 5.2 for a derivation of this expression)

 ⟨T⟩=n−1∑ℓ=0n−ℓ−1∑i=01k+iℓ+i∏j=i+1k−jk+j. (14)

This impressive formula dramatically simplifies for the Michaelis-Menten reaction, reduced to three constants , and ,

 ⟨T⟩=1ka[S]+1kc+kdka[S]kc. (15)

Considering that a single enzyme is recycled with a period the frequency of the successive state conversion cycles corresponds to the reaction rate

 k=1⟨T⟩=kcka[S]kc+kd+ka[S]. (16)

## 4 Conclusion

The previous section includes ten methods, of which only the first one does not correspond to a steady state situation. Somewhat ironically the so-called Michaelis-Menten reaction has not been properly described by Michaelis-Menten. Alternative methods exist to recover the steady state MM equation in addition to those reviewed here, including for example the chemical master equation [18], but the methods listed above provide the main recipes for modeling first order biochemical networks, which are the basics of systems biology.

## 5 Appendices

### 5.1 Branch pruning to generate a linear chain

The reduction of disordered cycles to ordered transitions has been addressed for example in [4, 13]. The most general treatment of a linear chain with one input and one output and including a branched module, leads to a Michaelian kinetics with respect to the distribution of the reaction time between the input and output, irrespective of the complexity of the intervening module.

Figure 5. How to compress lateral alternative states (top scheme) into an unbranched ordered chain (bottom scheme).

In a simplified case, if the fraction of time spent by the enzyme in the forms and (Fig.5), is negligible compared to its total mean cycling time, these alternative forms can be eliminated and the disordered individual rates can be replaced by ordered rates according to

 kAB = kAk′Bk′B+k−A+kBk′Ak′A+k−B, (17a) k−AB = k′−Bk−Ak−A+k′B+k′−Ak−Bk−B+k′A. (17b)

In addition, postulating that the walk is random implies that the transitions and do not influence each other. For example, if they are the pseudo-first order rates of ligation to two substrates and , the binding of one substrate has no influence on the binding of the other one. In this case, and and the global rates are

 kAB=kAkBR,k−AB=k−Ak−BR, (18a) with R=(kA+k−B)(k−A+kB)kA+kB+k−A+k−B. (18b)

### 5.2 Mean completion time for a general chain

Eq. (14) can be rigorously obtained through a continuous time Markovian modeling. In the following formulation, the probabilities of the different enzymatic states are written , , and correspond to the amount of final state at time . Their evolution is determined by a linear differential system,

 ddtPi(t)=n∑j=0^AijPj(t),i=0,1,…,n, (19)

with the initial condition . The matrix is numerical and contains the transition rates: the coefficient is equal to the rate of the transition . As the only allowed transitions are from to , the matrix is tridiagonal; in addition all its column sums are equal to 0, (a consequence of the conservation law ). The last column of is also zero since is an absorbing state. For this reason, it is sufficient to consider the restriction of to its first rows and columns, . The differential system can then be written as

 ddt→P(t)=A→P(t),where\ →P(t)=(Pi(t))0≤i≤n−1, (20)

supplemented by the extra equation , as well as the initial condition .

Our purpose is to compute

 ⟨T⟩=∫∞0dttdPn(t)dt=k+n−1∫∞0dttPn−1(t). (21)

Up to the factor , this is the last component of the length vector .

Let us observe that the solution of the differential system is formally given by

 →P(t)=∞∑k=0tkk!Ak→P(0)=etA→P(0), (22)

where, as indicated, the exponential of the matrix is defined by its Taylor series. Applying on , using and integrating by parts, we obtain

 A2⟨→T⟩=∫∞0dttd2→P(t)dt2=[td→P(t)dt]∞0−[→P(t)]∞0=→P(0), (23)

where we have used the fact that goes exponentially to zero when . From this we obtain that . Taking the last component of this vector equation and using , we find that

 ⟨T⟩=k+n−1(A−2)n−1,0=k+n−1n−1∑i=0A−1n−1,iA−1i,0 (24)

is proportional to the scalar product of the last row of and its first column.

Let us first apply this formula to the simplest situation, namely when all transition rates are equal to 1. In this case, the entries of are equal to on the lower and upper diagonals, namely . They are equal to on the main diagonal, with the exception of . One can verify that the inverse of is given by

 A−1ij=max(i,j)−n,0≤i,j≤n−1. (25)

We therefore have and , and the following result for ,

 ⟨T⟩=n−1∑i=0(n−i)=n(n+1)2. (26)

In the completely general case with arbitrary rates, the matrix takes the following form

 (27)

Because the column sums of are all zero except the last one which is , the last row of is constant and equal to . Beside, the first column of is somewhat more complicated and given by

 A−1i,0=−1k+in−1−i∑ℓ=0k−i+1…k−i+ℓk+i+1…k+i+ℓ,i=0,1,…,n−1, (28)

where, by convention, the term is set to 1. We then obtain

 ⟨T⟩=n−1∑i=01k+in−1−i∑ℓ=0k−i+1…k−i+ℓk+i+1…k+i+ℓ, (29)

which is equivalent to (14) upon the interchange of the two summations.

### 5.3 Testing another example: the 3-step enzymatic reaction

To validate the above recipes, let us apply them to a slightly more complicated (3-step) enzymatic reaction shown in Fig.6.

Figure 6. Extended MM reaction where the catalytic reaction is reversible.

The 3-step reaction is more realistic than the traditional 2-step MM reaction of Fig.2. Indeed, the last transition of the MM scheme (rate in Fig.2) mixes two elementary reactions: the catalysis sensu-stricto and the dissociation of the product from the enzyme. From a chemical viewpoint, the catalytic reaction has no obvious reason to be micro-irreversible. Instead, irreversibility can be understood as the consequence of the very low concentration of the product in the medium preventing it to rebind to the enzyme. This is true in vitro when measuring initial reaction rates because no product molecules are added in the reaction mixture. This is also generally true in vivo because the products are immediately removed by sequestration or by subsequent reactions of which they are the substrates, so that their steady state concentration remains negligible in the cell. Whatever the method used, the rate corresponding to the scheme of Fig.6 is the following function of the substrate concentration

 k=kckpka[S]kpkc+kpkd+kdk−c+(kp+kc+k−c)ka[S]. (30)

The most direct methods to obtain this result are listed below.

#### 5.3.1 The King and Altman method

The first order enzyme cycle corresponding to Fig.6 is represented in Fig.7.

Figure 7. The first order cycle of the reaction of Fig.6, whose drawing is a prerequisite for using the King and Altman procedure.

The turnover rate of a single-enzyme corresponds to the reaction rate and is

 k=kpPEP, (31)

where is given by the graphical method of King and Altman.

can be calculated by hand by replacing every graph by the product of rates corresponding to the arrows, but the result can be more safely obtained using an algorithm such as the KAPattern algorithm of [19], very useful for more complex networks.

#### 5.3.2 The sum of direct conversion times

 1k=1kp+1kckpk−c+kp+1ka[S]kckpk−c+kpkd+kckpk−c+kp. (32)

#### 5.3.3 Markovian modeling of a random walk

We obtain by this method

 1k=1ka[S]+1kc+1kp+kdka[S]kc+k−ckckp+kdk−cka[S]kckp. (33)

Acknowledgement P.R. is Senior Research Associate of the Belgian Fonds National de la Recherche Scientifique (FRS-FNRS).

## References

• [1] D. Michel, Biochimie 91, 933 (2009)
• [2] S. Cha, J. Biol. Chem. 243, 820 (1968)
• [3] J. Ninio, In Accuracy in Molecular Processes, Kirkwood. T.B.L., R. Rosenberger, and D. J. Galas, eds., pp. 291-328 (London, Chapman & Hall, 1986)
• [4] J. Ninio, Proc. Nat. Acad. Sci. USA 84, 663 (1987)
• [5] L. Michaelis, M. Menten, Biochemistry Zeitung 49, 333 (1913)
• [6] J.-B. Biot, Mem. Acad. Sci. 15, 93 (1838)
• [7] S. Dhatt, K. Bhattacharyya, J. Math. Chem. 51, 1467 (2013).
• [8] G.E. Briggs, J. B. Haldane, Biochem. J. 19, 338 (1925)
• [9] E.L. King, C.A. Altman, J. Phys. Chem. 60, 1375 (1956)
• [10] H. Qian, Biophys. J. 95, 10 (2008)
• [11] J.R. Fisher, V.D. Hoagland Jr, Adv. Biol. Med. Phys. 12, 163 (1968)
• [12] D.G. Knorre, E.G. Malygin, Dokl. Akad. Nauk SSSR 207, 1391 (1972)
• [13] E.G. Malygin, G.A. Hattman, J. Theor. Biol. 242, 627 (2006)
• [14] H.P. Lu, L. Xun, X.S. Xie, Science 282, 1877 (1998)
• [15] P. Le Doussal, Phys. Rev. Let. 62, 3097 (1989)
• [16] Y. Zhou, J.E. Pearson, A. Auerbach, Biophys. J. 89, 3680 (2005)
• [17] E.A. Codling, M.J. Plank, S. Benhamou, J. R. Soc. Interface 5, 813 (2008)
• [18] H. Qian, L.M. Bishop, Int. J. Mol. Sci. 11, 3472 (2010)
• [19] F. Qi, R.K. Dash, Y. Han, D.A. Beard, BMC Bioinformatics doi: 10.1186/1471-2105-10-238 (2009)
You are adding the first comment!
How to quickly get a good reply:
• Give credit where it’s due by listing out the positive aspects of a paper before getting into which changes should be made.
• Be specific in your critique, and provide supporting evidence with appropriate references to substantiate general statements.
• Your comment should inspire ideas to flow and help the author improves the paper.

The better we are at sharing our knowledge with each other, the faster we move forward.
The feedback must be of minimum 40 characters and the title a minimum of 5 characters


text:
# Thermodynamics of a bar, specific heat

I have a problem and I don't understand how the book solves it. It says I have a bar such that $$F=aT^2(L-L_0)$$ where $F$ is the force or tension of the bar, $T$ is the temperature, and $L$ the longitude. $L_0$ is the longitude when $F=0$. It says that $C_{L_0}=bT$ and it asks me about the general function $C_L(L,T)$, being $C_L$ the specific heat at constant $L$. The book starts solving it with this expression: $$\left(\frac{\partial C_L}{\partial L} \right)_T=-T\left(\frac{\partial^2 F}{\partial T^2}\right)_L$$ From there, I know how to go on, but I have no idea where that comes from. I have tried to get that out of the generalised Mayer relation but if that's the way, I can't do it.

-
@tpg2114 Yes, it was a typo –  MyUserIsThis Feb 1 '13 at 20:00
I don't have time for a full answer, but look at question 17 on theory.phy.umist.ac.uk/~judith/stat_therm/node109.html It seems to be doing exactly what you are doing. –  tpg2114 Feb 1 '13 at 20:09

Recall first that the definition of $C_L$ is $$C_L = \left(\frac{\partial U}{\partial T}\right)_L$$ The first law of thermo for the bar reads $$dU = T dS + F dL$$ Taking $S=S(L, T)$ gives $$dS = \left(\frac{\partial S}{\partial T}\right)_L dT + \left(\frac{\partial S}{\partial L}\right)_T dL$$ Combining these two equations gives $$dU = T\left(\frac{\partial S}{\partial T}\right)_L dT + \left[T\left(\frac{\partial S}{\partial L}\right)_T +F\right]dL$$ From which we see that $$\left(\frac{\partial U}{\partial L}\right)_T = T\left(\frac{\partial S}{\partial L}\right)_T +F$$ On the other hand, one has the the following Maxwell relation (I'll leave it to you to derive it, but I can show you how if you want): $$\left(\frac{\partial S}{\partial L}\right)_T = -\left(\frac{\partial F}{\partial T}\right)_L$$ So plugging this into the last equation gives $$\left(\frac{\partial U}{\partial L}\right)_T = -T\left(\frac{\partial F}{\partial T}\right)_L +F$$ Taking the partial of both sides with respect to $T$, noting that partial derivatives commute, and then using the definition of $C_L$ gives precisely the equation you want! Let me know if you want more detail!


text:
# PartBundleHandle¶

class PartBundleHandle

Bases: ReferenceCount

This is a trivial class returned by PartBundleNode::get_bundle(). Its purpose is to hold the actual PartBundle pointer contained within the PartBundleNode, so that scene graph flatten operations can safely combine or duplicate PartBundles as necessary without affecting high-level bundle operations.

The high-level Actor class defined in direct/src/actor, for instance, will store a list of PartBundleHandles instead of on actual PartBundles, so that it will be immune to changes from these flatten operations.

Inheritance diagram

PartBundleHandle(PartBundle *bundle)
PartBundleHandle(PartBundleHandle const&) = default
PartBundle *get_bundle(void)

Returns the actual PartBundle embedded within the handle.

void set_bundle(PartBundle *bundle)

Changes the actual PartBundle embedded within the handle.


text:
# Manipulating BVars

The most important aspect of the usability of this library is allowing you to seamlessly manipulate BVar s as as if they were just as, without requiring you as the user to be able to recognize or acknowledge the difference. Here are some techniques to that end.

Remember, a BVar s a is a BVar containing an a --- it's an a that, when used, keeps track of and propagates your gradient.

## Typeclass Interface

BVars have Num, Fractional, Floating, Eq, and Ord instances. These instances are basically "lifted" to the BVar itself, so if you have a BVar s Double, you can use (*), sqrt, (>), etc. on it exactly as if it were just a Double.

## Constant Values

If we don't care about a value's gradient, we can use auto:

auto :: a -> BVar s a

auto x basically gives you a BVar that contains just x alone. Useful for using with functions that expect BVars, but you just have a specific value you want to use.

## Coercible

If a and b are Coercible, then so are BVar s a and BVar s b, using the coerceVar function. This is useful for "unwrapping" and "wrapping" BVars of newtypes:

newtype MyInt = MyInt Int

getMyInt :: BVar s MyInt -> BVar s Int
getMyInt = coerceVar

## Accessing Contents

The following techniques can be used to access values inside BVars:

### Traversable Containers

One that we saw earlier was sequenceVar, which we used to turn a BVar containing a list into a list of BVars:

sequenceVar :: (Backprop a, Reifies s W)
=> BVar s [a]
-> [BVar s a]

If you have a BVar containing a list, you can get a list of BVars of all of that list's elements. (sequenceVar actually works on all Traversable instances, not just lists) This is very useful when combined with -XViewPatterns, as seen earlier.

### Records and Fields

In practice, a lot of usage involves functions involving contents of records or data types containing fields. The previous example, involving a simple ANN, demonstrates this:

data Net = N { _nWeights1 :: L 20 100
, _nBias1    :: R 20
, _nWeights2 :: L  5  20
, _nBias2    :: R  5
}
deriving (Show, Generic)

instance Backprop Net       -- can be automatically defined

To compute the result of this network (ran on an R 100, a 100-vector) and get the output R 5, we need do a matrix multiplication by the _nWeights1 field, add the result to the _nBias1 field...basically, the result is a function of linear algebra and related operations on the input and all of the contents of the Net data type. However, you can't directly use _nWeights, since it takes a Net, not BVar s Net. And you also can't directly pattern match on the N constructor.

There are two main options for this: the lens interface, and the higher-kinded data interface.

#### Lens Interface

The most straightforward way to do this is the lens-based interface, using viewVar or ^^..

If we make lenses for Net using the lens or microlens-th packages:

makeLenses ''Net

or make them manually:

nBias1' :: Functor f => (R 20 -> f (R 20)) -> Net -> f Net
nBias1' f n = (\b -> n { _nBias1 = b }) <$> f (_nBias1 n)  then ^. from the lens or microlens packages lets you retrieve a field from a Net: (^. nWeights1) :: Net -> L 20 100 (^. nBias1 ) :: Net -> R 20 (^. nWeights2) :: Net -> L 5 20 (^. nBias2 ) :: Net -> R 5  And, ^^. from backprop (also aliased as viewVar) lets you do the same thing from a BVar s Net (a BVar containing your Net): (^^. nWeights1) :: BVar s Net -> BVar s (L 20 100) (^^. nBias1 ) :: BVar s Net -> BVar s (R 20) (^^. nWeights2) :: BVar s Net -> BVar s (L 5 20) (^^. nBias2 ) :: BVar s Net -> BVar s (R 5)  With our lenses and ^^., we can write our network running function. This time, I'll include the type! runNet :: Reifies s W => BVar s Net -> BVar s (R 100) -> BVar s (R 5) runNet net x = z where -- run first layer y = logistic$ (net ^^. nWeights1) #> x + (net ^^. nBias1)
-- run second layer
z = logistic $(net ^^. nWeights2) #> y + (net ^^. nBias2) logistic :: Floating a => a -> a logistic x = 1 / (1 + exp (-x))  Note that we are using versions of #> lifted for BVars, from the hmatrix-backprop library: (#>) :: BVar s (L m n) -> BVar s (R n) -> BVar s (R m)  #### Higher-Kinded Data Interface Using the lens based interface, you can't directly pattern match and construct fields. To allow for directly pattern matching, there's another interface option involving the "Higher-Kinded Data" techniques described in this article. If we had a type-family (that can be re-used for all of your data types): type family HKD f a where HKD Identity a = a HKD f a = f a  We can define Net instead as: data Met' f = M { _mWeights1 :: HKD f (L 20 100) , _mBias1 :: HKD f (R 20) , _mWeights2 :: HKD f (L 5 20) , _mBias2 :: HKD f (R 5) } deriving Generic  Then our original type is: type Met = Met' Identity deriving instance Show Met instance Backprop Met  Met is the same as Net in every way -- it can be pattern matched on to get the L 20 100, etc. (the Identity disappears): getMetBias1 :: Met -> R 20 getMetBias1 (M _ b _ _) = b  The benefit of this is that we can now directly pattern match on a BVar s Met to get the internal fields as BVars using splitBV as a view pattern (or the BV pattern synonym): runMet :: Reifies s W => BVar s Met -> BVar s (R 100) -> BVar s (R 5) runMet (splitBV -> M w1 b1 w2 b2) x = z where -- run first layer y = logistic$ w1 #> x + b1
-- run second layer
z = logistic \$ w2 #> y + b2

Now, the M w1 b1 w2 b2 pattern can be used to deconstruct both "normal" Mets, as well as a BVar s Met (with splitBV or BV).

Note that this HKD access method is potentially less performant than lens access (by about 10-20%).

### Potential or Many Fields

Some values "may" or "may not" have values of a given field. An example would include the nth item in a list or vector, or the Just of a Maybe.

For these, the lens-based (prism-based/traversal-based) interface is the main way to access partial fields. You can use (^^?) or previewVar with any Traversal:

(^?)  ::        a -> Traversal' a b -> Maybe         b
(^^?) :: BVar s a -> Traversal' a b -> Maybe (BVar s b)

If the value in the BVar "has" that field, then you'll get a Just with the BVar of that field's contents. If it doesn't, you'll get a Nothing.

You can use this with any prism or traversal, like using _head to get the first item in a list if it exists.

If you have a type that might contain many values of a field (like a tree or list), you can use (^^..) or toListOfVar, which works on any Traversal:

(^..)  ::        a -> Traversal' a b -> [       b]
(^^..) :: BVar s a -> Traversal' a b -> [BVar s b]

This can be used to implement sequenceVar, actually:

sequenceVar :: BVar s [a] -> [BVar s a]
sequenceVar xs = xs ^^.. traverse

### Tuples

The T2 pattern synonym is provided, which allow you to pattern match on a BVar s (a, b) to get a BVar s a and BVar s b. The T3 pattern is also provided, which does the same thing for three-tuples.

Note that T2 and T2 are bidirectional pattern synonyms, and can be used to construct as well as deconstruct.

## Combining BVars

The following techniques can be used to "combine" BVars:

### Foldable Containers

The "opposite" of sequenceVar is collectVar, which takes a foldable container of BVars and returns a BVar containing that foldable container of contents:

collectVar :: (Backprop a, Foldable t, Functor t, Reifies s W)
=> t (BVar s a)
-> BVar s (t a)

### Constructors

Sometimes you would like to combine a bunch of BVars into a BVar of specific container or data type.

#### isoVar

The simplest way to do this is using the isoVar, isoVar2, etc. family of functions:

isoVar2
:: (Backprop a, Backprop b, Backprop c, Reifies s W)
=> (a -> b -> c)
-> (c -> (a, b))
-> BVar s a
-> BVar s b
-> BVar s c

So if we had a type like:

data DoubleInt = DI Double Int

We can combine a Double and Int into a DoubleInt using isoVar2:

isoVar2 DI (\(DI x y) -> (x,y))
:: Reifies s W
=> BVar s Double
-> BVar s Int
-> BVar s DoubleInt

#### Higher-Kinded Data Interface

You can also use the "Higher Kinded Data" interface, as well. For our Met type above, you can use joinBV, or the BV pattern synonym:

makeMet :: Reifies s W
=> BVar s (L 20 100)
-> BVar s (R 20)
-> BVar s (L  5  20)
-> BVar s (R  5)
-> BVar s Met
makeMet w1 b1 w2 b2 = joinBV (M w1 b1 w2 b2)

### Modifying fields

If you just want to "set" a specific field, you can use the lens-based interface with (.~~) or setVar. For example, if we wanted to set the _nWeights2 field of a Net to a new matrix, we can do:

myNet & nWeights2 .~~ newMatrix

or

setVar nWeights2
:: Reifies s W
=> BVar s (L 20 5)
-> BVar s Net
-> BVar s Net

You can also use (%~~) or overVar to apply a function to a specific inside your value.

## Prelude Modules

Finally, the Prelude.Backprop module has a lot of your normal Prelude functions "lifted" to work on BVars of values. For many situations, these aren't necessary, and normal Prelude functions will work just fine on BVars of values (like (.)). However, it does have some convenient functions, like minimum, foldl', fmap, toList, fromIntegral, realToFrac, etc. lifted to work on BVars. This module is meant to be imported qualified.

# Moving On

Now that you know all about BVars, you really can just jump into the haddocks and start writing programs. The next section of this documentation is more details about the Backprop typeclass.


text:
1. ## Help with Cos(x^2)dx

integral of [cos(t^2)dt] on the interval [0,3x^2]

2. Originally Posted by Enigma
integral of [cos(t^2)dt] on the interval [0,3x^2]
$\frac{d}{dx}\int_a^{f(x)}g(t)dt=g(f(x))\cdot{f'(x) }$

So

$\frac{d}{dx}\int_0^{3x^2}\cos\left(t^2\right)=\cos \left(\left(3x^2\right)^2\right)\cdot\left(3x^2\ri ght)'=6x\cos\left(9x^4\right)$

3. Originally Posted by Mathstud28
$\frac{d}{dx}\int_a^{f(x)}g(t)dt=g(f(x))\cdot{f'(x) }$

So

$\frac{d}{dx}\int_0^{3x^2}\cos\left(t^2\right)=\cos \left(\left(3x^2\right)^2\right)\cdot\left(3x^2\ri ght)'=6x\cos\left(9x^4\right)$
How does that help the OP, you have replaced one tricky integral with another, or are you answering what you think they meant to ask, then tell us.

CB

4. Originally Posted by Enigma
integral of [cos(t^2)dt] on the interval [0,3x^2]
Please post the entire question (which I suspect is something like find the derivative of $\int_0^{3x^2} \cos (t^2) \, dt$. Correct ....? In which case you're barking up the wrong tree by trying to first integrate to get an expression to differentiate. The integral has no elementary closed form solution. The correct approach is shown in post #2 but you might want clarification ....).


text:
# IntegerComparator.iso¶

IntegerComparator.iso(isometry, q_input, q_ancillas_for_output, q_ancillas_zero=None, q_ancillas_dirty=None)

Attach an arbitrary isometry from m to n qubits to a circuit. In particular, this allows to attach arbitrary unitaries on n qubits (m=n) or to prepare any state on n qubits (m=0). The decomposition used here was introduced by Iten et al. in https://arxiv.org/abs/1501.06911.

Parameters
• isometry (ndarray) – an isometry from m to n qubits, i.e., a (complex) ndarray of dimension 2^n×2^m with orthonormal columns (given in the computational basis specified by the order of the ancillas and the input qubits, where the ancillas are considered to be more significant than the input qubits.).

• q_input (QuantumRegister|list[Qubit]) – list of m qubits where the input to the isometry is fed in (empty list for state preparation).

• q_ancillas_for_output (QuantumRegister|list[Qubit]) – list of n-m ancilla qubits that are used for the output of the isometry and which are assumed to start in the zero state. The qubits are listed with increasing significance.

• q_ancillas_zero (QuantumRegister|list[Qubit]) – list of ancilla qubits which are assumed to start in the zero state. Default is q_ancillas_zero = None.

• q_ancillas_dirty (QuantumRegister|list[Qubit]) – list of ancilla qubits which can start in an arbitrary state. Default is q_ancillas_dirty = None.

Returns

the isometry is attached to the quantum circuit.

Return type

QuantumCircuit

Raises

QiskitError – if the array is not an isometry of the correct size corresponding to the provided number of qubits.


text:
# Why can't I use OmegaPrime to find the Limit of Prime[n]? [duplicate]

What are the limits of the Prime-functions?

What is so special about Prime?

which gave an answer for earlier versions of Mathematica. Yet when I try to input either OmegaPrime or OmegaPrimePi, and then hit enter, I don't get any numbers. I have tried using N[OmegaPrime] to force a number. It's as if the functions have been removed in version 9.0 . And someone mentioned using PrimeOmega, so I tried that and N[PrimeOmega]. I would also like to know if version 10.0 has a higher Prime[n] so I can decide on whether to upgrade.

## marked as duplicate by ilian, dr.blochwave, Szabolcs, MarcoB, C. E.Sep 14 '15 at 17:18

• OmegaPrime never existed in any version of Mathematica; you misunderstood Artes's statement. This number was found by him using a divide-and-conquer method. It is not a value tabulated in Mathematica itself but depends on the implementation of Prime. – Oleksandr R. Sep 14 '15 at 16:08
• Thanks, but since the question has been marked as a duplicate, it is not possible to add an answer any more. It doesn't matter about the points. Actually, I was unsure about whether your question concerned OmegaPrime specifically, or the limits of Prime more generally. I don't know if the latter have been changed for Mathematica 10 (although I suspect not, given Daniel Lichtblau's remarks), but if the limitations are your main concern, the other thread seems to cover this topic well enough and your question can legitimately be considered a duplicate. – Oleksandr R. Sep 17 '15 at 22:12


text:
# Tag Info

0

This gauge invariant vector potential increases without bound as long as there exists a static electric field. Indeed, even when the electric field is removed, there appears to be no mechanism by which the gauge invariant vector potential disappears. Static electric field has zero transversal component; entire field is longitudinal. The unbounded ...

0

From the point of view of electromagnetism I can see it the following non-mathematical way. $curl$ or $rot$ differential operators calculates magnitude of "vorticity" of the field, i.e. how much it is "spinning" or changing in rotation. Now, "vorticity" of the "vortex" is how much this "vortex" spinning again. Take, for example, long spring and connect its ...

1

It's funny that all the answers so far forgot the simple and elegant following criterion : quantum mechanics appears when $$\dfrac{\hbar\omega}{k_{B}T} > 1$$ with $\hbar\approx6,63.10^{-34}\text{J}\cdot\text{s}$ the Planck constant and $k_{B}\approx1,38.10^{-23}\text{J}\cdot\text{K}^{-1}$ the Boltzmann constant, $\omega$ and $T$ being the (angular) ...

10

Weinberg is right. The issue here is with the usual interpretation of the wavefunction as an amplitude density. This implies being able to localize the particle in an arbitrarily small region. However, it is not possible to localize photons (or any massless particles with spin, for that matter). The reason for this is the careful definition of what ...

5

Wave function for $N$ particles is a scalar function of $3N$ spatial coordinates. Wave function for $N$ photons, if named so at all, should thus also be a scalar function of $3N$ spatial coordinates. EM field, on the other hand, is a vector function of 3 spatial coordinates. Any chosen wave function is non-unique; there are many different wave functions, ...

4

I believe Weinberg is trying to make a distinction between two viewpoints of quantum particles, one historical (although we still use it when thinking about and teaching non-relativistic quantum mechanics) and one modern. In non-relativistic quantum mechanics, we typically start by assuming the existence of "particles" familiar to us from classical ...

3

The integral and differential versions are equivalent, so it sounds like your text simply doesn't know how to use the differential version in as general a way as your text knows how to use the integral version. For instance, you do not need to have partial derivatives to define the divergence and/or curl, but if you have the partial derivatives, then there ...

1

Dirac delta is the most common distribution in physics. It is defined by an equation: $\int \limits_{-\infty}^\infty \delta(x) f(x) = f(0)$ One could say that this could be "intuitively: a function, which is $\infty$ at $0$, and $0$ everywhere else, but this makes no sense, since such integral would be $0$ (not $f(0)$), as integral over the set of zero ...

0

Since you speak about point charge, let us check the Gauss law (to start with something well known)? $\nabla \cdot E = \frac{\rho}{\epsilon_0}$ We know that divergence has something to do with flow across some closed surface (sphere surface is the best) around the $\rho$ - the same in integral form is: $\oint\limits_{\delta\Omega} E \cdot dS = ... -2 using V.E=p/e0 in integral form that is gauss law you get your first answer E going to zero as r go to infinity. 4 You are correct that the vanishing of the field does not follow from Lorentz' force law and Maxwell's equations alone. An additional physical argument is needed: If you didn't have$E\to 0$as$r\to\infty$, you would have non-vanishing force$F = qE \neq 0$at infinity. That is physically non-sensical because it would mean that a charge influences charges ... 18 Maxwellian electrodynamics fails when quantum mechanical phenomena are involved, in the same way that Newtonian mechanics needs to be replaced in that regime by quantum mechanics. Maxwell's equations don't really "fail", as there is still an equivalent version in QM, it's just the mechanics itself that changes. Let me elaborate on that one for a bit. In ... 2 Anna V is wrong when she says Maxwell's equations are inconsistent with black body radiation. In quantum mechanics, even if you ignore radiation there is a charge density which you can calculate (in principle) from Schroedinger's Equation. In a warm body, this charge density is fluctuating by random thermal motion. If you track the time evolution of the ... 3 Classical electromagnetic waves emerge from the underlying quantum electrodynamic description in a smooth and consistent manner. The quantum framework means that the classical waves are built out of photons, and the only time one has to worry about more detail than what Maxwell's equations provide is at the level of particle physics and wherever quantization ... 0 Whenever electric field or polarization changes in time, the displacement current is present. If electric current in wire that makes up the inductor changes in time, electric field will change as well and there will be displacement current. 0 If you move a magnet, you create an electrical field around the magnet perpendicular to its direction of motion. As the magnet accelerates, the electrical field evolves, and generates a magnetic field. I don't know the specifics, but I'm guessing that if you spin the magnet, this magnetic field will act counter to the spin of the magnet, and slow it down. 0 It is easy to show that the differential and integral forms of Maxwell's equations are equivalent using Gauss's and Stokes's theorems. Correct, they are equivalent (assume no GR, and no QM) in the sense that if the integral versions hold for any surface/loop then the differential versions hold for any point, and if the differential versions hold for every ... 1 Did physicists immediately realize Newtonian mechanics was incorrect after special relativity was published? Of course not. Physicists did not immediately realize that Einstein's description of electromagnetism (the second part of his 1905 paper on special relativity) was correct after special relativity was published. I can't think of a single ... 2 There are two questions.. 1. What is the concept of magnetic monopole here? 2. Why Maxwell's eqns remain unmodified? They are not elementary particles as anticipated by P.M.Dirac. But the concept comes from the non-zero divergence of magnetization field. In electrostatics when you have$\nabla\cdot \mathbf{P}\$ (polarization vector) not equal to zero, you ...

0

The term has the dimension of the current density and may be non zero in absence of electric current. It completes the possible sources of the magnetic field.

Top 50 recent answers are included