text:
Documentation

# recursiveOE

Create System object for online parameter estimation of Output-Error polynomial model

## Syntax

obj = recursiveOE
obj = recursiveOE(Orders)
obj = recursiveOE(Orders,B0,F0)
obj = recursiveOE(___,Name,Value)

## Description

Use recursiveOE command for parameter estimation with real-time data. If all data necessary for estimation is available at once, and you are estimating a time-invariant model, use the offline estimation command, oe.

obj = recursiveOE creates a System object™ for online parameter estimation of a default single-input-single output (SISO) Output-Error model structure. The default model structure has polynomials of order 1 and initial polynomial coefficient values eps.

After creating the object, use the step command to update model parameter estimates using recursive estimation algorithms and real-time data.

obj = recursiveOE(Orders) specifies the polynomial orders of the Output-Error model to be estimated.

obj = recursiveOE(Orders,B0,F0) specifies the polynomial orders and initial values of the polynomial coefficients. Specify initial values to potentially avoid local minima during estimation. If the initial values are small compared to the default InitialParameterCovariance property value, and you have confidence in your initial values, also specify a smaller InitialParameterCovariance.

obj = recursiveOE(___,Name,Value) specifies additional attributes of the Output-Error model structure and recursive estimation algorithm using one or more Name,Value pair arguments.

## Object Description

recursiveOE creates a System object for online parameter estimation of SISO Output-Error polynomial models using a recursive estimation algorithm.

A System object is a specialized MATLAB® object designed specifically for implementing and simulating dynamic systems with inputs that change over time. System objects use internal states to store past behavior, which is used in the next computational step.

After you create a System object, you use commands to process data or obtain information from or about the object. System objects use a minimum of two commands to process data — a constructor to create the object and the step command to update object parameters using real-time data. This separation of declaration from execution lets you create multiple, persistent, reusable objects, each with different settings.

You can use the following commands with the online estimation System objects in System Identification Toolbox™:

CommandDescription
step

Update model parameter estimates using recursive estimation algorithms and real-time data.

step puts the object into a locked state. In a locked state, you cannot change any nontunable properties or input specifications, such as model order, data type, or estimation algorithm. During execution, you can only change tunable properties.

release

Unlock the System object. Use this command to enable setting of nontunable parameters.

reset

Reset the internal states of a locked System object to the initial values, and leave the object locked.

clone

Create another System object with the same object property values.

Do not create additional objects using syntax obj2 = obj. Any changes made to the properties of the new object created this way (obj2) also change the properties of the original object (obj).

isLocked

Query locked status for input attributes and nontunable properties of the System object.

Use the recursiveOE command to create an online estimation System object. Then estimate the Output-Error polynomial model parameters (B and F) and output using the step command with incoming input and output data, u and y.

[B,F,EstimatedOutput] = step(obj,y,u)

For recursiveOE object properties, see Properties.

## Examples

collapse all

Create a System object for online parameter estimation of a Output-Error polynomial model using recursive estimation algorithms.

obj = recursiveOE;

The Output-Error model has a default structure with polynomials of order 1 and initial polynomial coefficient values, eps.

Load the estimation data. In this example, use a static data set for illustration.

load iddata1 z1;
output = z1.y;
input = z1.u;

Estimate Output-Error model parameters online using step.

for i = 1:numel(input)
[B,F,EstimatedOutput] = step(obj,output(i),input(i));
end

View the current estimated values of polynomial F coefficients.

obj.F
ans = 1×2

1.0000   -0.7618

View the current covariance estimate of the parameters.

obj.ParameterCovariance
ans = 2×2

0.0024    0.0002
0.0002    0.0001

View the current estimated output.

EstimatedOutput
EstimatedOutput = -4.1866

Specify Output-Error polynomial model orders and delays.

nb = 1;
nf = 2;
nk = 1;

Create a System object for online estimation of Output-Error polynomial model with the specified orders and delays.

obj = recursiveOE([nb nf nk]);

Specify Output-Error polynomial model orders and delays.

nb = 1;
nf = 2;
nk = 1;

Create a System object for online estimation of Output-Error model with known initial polynomial coefficients.

B0 = [0 1];
F0 = [1 0.7 0.8];
obj = recursiveOE([nb nf nk],B0,F0);

Specify the initial parameter covariance.

obj.InitialParameterCovariance = 0.1;

InitialParameterCovariance represents the uncertainty in your guess for the initial parameters. Typically, the default InitialParameterCovariance (10000) is too large relative to the parameter values. This results in initial guesses being given less importance during estimation. If you have confidence in the initial parameter guesses, specify a smaller initial parameter covariance.

Create a System object that uses the unnormalized gradient algorithm for online parameter estimation of an Output-Error model.

obj = recursiveOE([1 2 1],'EstimationMethod','Gradient');

## Input Arguments

collapse all

Model orders and delays of a Output-Error polynomial model , specified as a 1-by-3 vector of integers, [nb nf nk].

• nb — Order of the polynomial B(q) + 1, specified as a positive integer.

• nf — Order of the polynomial F(q), specified as a nonnegative integer.

• nk — Input-output delay, specified as a positive integer. nk is number of input samples that occur before the input affects the output. nk is expressed as fixed leading zeros of the B polynomial.

Initial value of polynomial coefficients, specified as row vectors of real values with elements in order of ascending powers of q-1.

• B0 — Initial guess for the coefficients of the polynomial B(q), specified as a 1-by-(nb+nk) vector with nk leading zeros.

• F0 — Initial guess for the coefficients of the polynomial F(q), specified as a 1-by-(nf+1) vector with 1 as the first element.

The coefficients in F0 must define a stable discrete-time polynomial with roots within a unit disk. For example,

F0 = [1 0.5 0.5];
all(abs(roots(F0))<1)
ans =

1

Specifying as [], uses the default value of eps for the polynomial coefficients.

### Note

If the initial parameter values are much smaller than InitialParameterCovariance, these initial values are given less importance during estimation. Specify a smaller initial parameter covariance if you have high confidence in the initial parameter values. This statement applies only for infinite-history estimation. Finite-history estimation does not use InitialParameterCovariance.

### Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Use Name,Value arguments to specify writable properties of recursiveOE System object during object creation. For example, obj = recursiveOE([1 2 1],'EstimationMethod','Gradient') creates a System object to estimate a Output-Error polynomial model using the 'Gradient' recursive estimation algorithm.

## Properties

recursiveOE System object properties consist of read-only and writable properties. The writable properties are tunable and nontunable properties. The nontunable properties cannot be changed when the object is locked, that is, after you use the step command.

Use Name,Value arguments to specify writable properties of recursiveOE objects during object creation. After object creation, use dot notation to modify the tunable properties.

obj = recursiveOE;
obj.ForgettingFactor = 0.99;

B

Estimated coefficients of polynomial B(q), returned as a vector of real values specified in order of ascending powers of q-1.

B is a read-only property and is initially empty after you create the object. It is populated after you use the step command for online parameter estimation.

F

Estimated coefficients of polynomial F(q), returned as a vector of real values specified in order of ascending powers of q-1.

F is a read-only property and is initially empty after you create the object. It is populated after you use the step command for online parameter estimation.

InitialB

Initial values for the coefficients of polynomial B(q) of order nb-1, specified as a row vector of length nb+nk, with nk leading zeros. nk is the input-output delay. Specify the coefficients in order of ascending powers of q-1.

If the initial guesses are much smaller than the default InitialParameterCovariance, 10000, the initial guesses are given less importance during estimation. In that case, specify a smaller initial parameter covariance.

InitialB is a tunable property. You can change it when the object is in a locked state.

Default: [0 eps]

InitialF

Initial values for the coefficients of polynomial F(q) of order nf, specified as a row vector of length nf+1, with 1 as the first element. Specify the coefficients in order of ascending powers of q-1.

The coefficients in InitialF must define a stable discrete-time polynomial with roots within a unit circle. For example,

InitialF = [1 0.9 0.8];
all(abs(roots(InitialF))<1)
ans =

1

If the initial guesses are much smaller than the default InitialParameterCovariance, 10000, the initial guesses are given less importance during estimation. In that case, specify a smaller initial parameter covariance.

InitialF is a tunable property. You can change it when the object is in a locked state.

Default: [1 eps]

InitialOutputs

Initial values of the measured outputs buffer in finite-history estimation, specified as 0 or as a (W+nf)-by-1 vector, where W is the window length and nf is the order of the polynomial F(q) that you specify when constructing the object.

The InitialOutputs property provides a means of controlling the initial behavior of the algorithm.

When InitialOutputs is set to 0, the object populates the buffer with zeros.

If the initial buffer is set to 0 or does not contain enough information, you see a warning message during the initial phase of your estimation. The warning should clear after a few cycles. The number of cycles it takes for sufficient information to be buffered depends upon the order of your polynomials and your input delays. If the warning persists, you should evaluate the content of your signals.

Specify InitialOutputs only when History is Finite.

InitialOutputs is a tunable property. You can change InitialOutputs when the object is in a locked state.

Default: 0

InitialInputs

Initial values of the inputs in the finite history window, specified as 0 or as a (W+nb+nk-1)-by-1 vector, where W is the window length. nb is the vector of B(q) polynomial orders and nk is vector of input delays that you specify when constructing the recursiveOE object.

The InitialInputs property provides a means of controlling the initial behavior of the algorithm.

When the InitialInputs is set to 0, the object populates the buffer with zeros.

If the initial buffer is set to 0 or does not contain enough information, you see a warning message during the initial phase of your estimation. The warning should clear after a few cycles. The number of cycles it takes for sufficient information to be buffered depends upon the order of your polynomials and your input delays. If the warning persists, you should evaluate the content of your signals.

Specify InitialInputs only when History is Finite.

InitialInputs is a tunable property. You can change InitialInputs when the object is in a locked state.

Default: 0

ParameterCovariance

Estimated covariance P of the parameters, returned as an N-by-N symmetric positive-definite matrix. N is the number of parameters to be estimated. The software computes P assuming that the residuals (difference between estimated and measured outputs) are white noise, and the variance of these residuals is 1.

ParameterCovariance is applicable only when EstimationMethod is 'ForgettingFactor' or 'KalmanFilter' or when History is Finite.

The interpretation of P depends on your settings for the History and EstimationMethod properties.

• If History is Infinite, then your EstimationMethod selection results in one of the following:

• 'ForgettingFactor' — (R2/2)P is approximately equal to the covariance matrix of the estimated parameters, where R2 is the true variance of the residuals.

• 'KalmanFilter'R2P is the covariance matrix of the estimated parameters, and R1 /R2 is the covariance matrix of the parameter changes. Here, R1 is the covariance matrix that you specify in ProcessNoiseCovariance.

• If History is Finite (sliding-window estimation) — R2P is the covariance of the estimated parameters. The sliding-window algorithm does not use this covariance in the parameter-estimation process. However, the algorithm does compute the covariance for output so that you can use it for statistical evaluation.

ParameterCovariance is a read-only property and is initially empty after you create the object. It is populated after you use the step command for online parameter estimation.

InitialParameterCovariance

Covariance of the initial parameter estimates, specified as one of the following:

• Real positive scalar, α — Covariance matrix is an N-by-N diagonal matrix, with α as the diagonal elements. N is the number of parameters to be estimated.

• Vector of real positive scalars, [α1,...,αN] — Covariance matrix is an N-by-N diagonal matrix, with [α1,...,αN] as the diagonal elements.

• N-by-N symmetric positive-definite matrix.

InitialParameterCovariance represents the uncertainty in the initial parameter estimates. For large values of InitialParameterCovariance, less importance is placed on the initial parameter values and more on the measured data during beginning of estimation using step.

Use only when EstimationMethod is 'ForgettingFactor' or 'KalmanFilter'.

InitialParameterCovariance is a tunable property. You can change it when the object is in a locked state.

Default: 10000

EstimationMethod

Recursive estimation algorithm used for online estimation of model parameters, specified as one of the following values:

• 'ForgettingFactor' — Algorithm used for parameter estimation

• 'KalmanFilter' — Algorithm used for parameter estimation

• 'NormalizedGradient' — Algorithm used for parameter estimation

• 'Gradient' — Unnormalized gradient algorithm used for parameter estimation

Forgetting factor and Kalman filter algorithms are more computationally intensive than gradient and unnormalized gradient methods. However, they have better convergence properties. For information about these algorithms, see Recursive Algorithms for Online Parameter Estimation.

These methods all use an infinite data history, and are available only when History is 'Infinite'.

EstimationMethod is a nontunable property. You cannot change it during execution, that is, after the object is locked using the step command.

Default: Forgetting Factor

ForgettingFactor

Forgetting factor, λ, relevant for parameter estimation, specified as a scalar in the range (0,1].

Suppose that the system remains approximately constant over T0 samples. You can choose λ such that:

${T}_{0}=\frac{1}{1-\lambda }$

• Setting λ = 1 corresponds to “no forgetting” and estimating constant coefficients.

• Setting λ < 1 implies that past measurements are less significant for parameter estimation and can be “forgotten”. Set λ < 1 to estimate time-varying coefficients.

Typical choices of λ are in the range [0.98 0.995].

Use only when EstimationMethod is 'ForgettingFactor'.

ForgettingFactor is a tunable property. You can change it when the object is in a locked state.

Default: 1

EnableAdapation

Enable or disable parameter estimation, specified as one of the following:

• true or 1— The step command estimates the parameter values for that time step and updates the parameter values.

• false or 0 — The step command does not update the parameters for that time step and instead outputs the last estimated value. You can use this option when your system enters a mode where the parameter values do not vary with time.

### Note

If you set EnableAdapation to false, you must still execute the step command. Do not skip step to keep parameter values constant, because parameter estimation depends on current and past I/O measurements. step ensures past I/O data is stored, even when it does not update the parameters.

EnableAdapation is a tunable property. You can change it when the object is in a locked state.

Default: true

DataType

Floating point precision of parameters, specified as one of the following values:

• 'double' — Double-precision floating point

• 'single' — Single-precision floating point

Setting DataType to 'single' saves memory, but leads to loss of precision. Specify DataType based on the precision required by the target processor where you will deploy generated code.

DataType is a nontunable property. It can only be set during object construction using Name,Value arguments and cannot be changed afterward.

Default: 'double'

ProcessNoiseCovariance

Covariance matrix of parameter variations, specified as one of the following:

• Real nonnegative scalar, α — Covariance matrix is an N-by-N diagonal matrix, with α as the diagonal elements.

• Vector of real nonnegative scalars, [α1,...,αN] — Covariance matrix is an N-by-N diagonal matrix, with [α1,...,αN] as the diagonal elements.

• N-by-N symmetric positive semidefinite matrix.

N is the number of parameters to be estimated.

ProcessNoiseCovariance is applicable when EstimationMethod is 'KalmanFilter'.

Kalman filter algorithm treats the parameters as states of a dynamic system and estimates these parameters using a Kalman filter. ProcessNoiseCovariance is the covariance of the process noise acting on these parameters. Zero values in the noise covariance matrix correspond to estimating constant coefficients. Values larger than 0 correspond to time-varying parameters. Use large values for rapidly changing parameters. However, the larger values result in noisier parameter estimates.

ProcessNoiseCovariance is a tunable property. You can change it when the object is in a locked state.

Default: 0.1

AdaptationGain

Adaptation gain, γ, used in gradient recursive estimation algorithms, specified as a positive scalar.

AdaptationGain is applicable when EstimationMethod is 'Gradient' or 'NormalizedGradient'.

Specify a large value for AdaptationGain when your measurements have a high signal-to-noise ratio.

AdaptationGain is a tunable property. You can change it when the object is in a locked state.

Default: 1

NormalizationBias

Bias in adaptation gain scaling used in the 'NormalizedGradient' method, specified as a nonnegative scalar.

NormalizationBias is applicable when EstimationMethod is 'NormalizedGradient'.

The normalized gradient algorithm divides the adaptation gain at each step by the square of the two-norm of the gradient vector. If the gradient is close to zero, this can cause jumps in the estimated parameters. NormalizationBias is the term introduced in the denominator to prevent these jumps. Increase NormalizationBias if you observe jumps in estimated parameters.

NormalizationBias is a tunable property. You can change it when the object is in a locked state.

Default: eps

History

Data history type defining which type of recursive algorithm you use, specified as:

• 'Infinite' — Use an algorithm that aims to minimize the error between the observed and predicted outputs for all time steps from the beginning of the simulation.

• 'Finite' — Use an algorithm that aims to minimize the error between the observed and predicted outputs for a finite number of past time steps.

Algorithms with infinite history aim to produce parameter estimates that explain all data since the start of the simulation. These algorithms still use a fixed amount of memory that does not grow over time. The object provides multiple algorithms of the 'Infinite' History type. Specifying this option activates the EstimationMethod property with which you specify an algorithm.

Algorithms with finite history aim to produce parameter estimates that explain only a finite number of past data samples. This method is also called sliding-window estimation. The object provides one algorithm of the 'Finite' type. Specifying this option activates the WindowLength property that sizes the window.

For more information on recursive estimation methods, see Recursive Algorithms for Online Parameter Estimation.

History is a nontunable property. It can be set only during object construction using Name,Value arguments and cannot be changed afterward.

Default: 'Infinite'

WindowLength

Window size determining the number of time samples to use for the sliding-window estimation method, specified as a positive integer. Specify WindowLength only when History is Finite.

Choose a window size that balances estimation performance with computational and memory burden. Sizing factors include the number and time variance of the parameters in your model. Always specify Window Length in samples, even if you are using frame-based input processing.

WindowLength must be greater than or equal to the number of estimated parameters.

Suitable window length is independent of whether you are using sample-based or frame-based input processing (see InputProcessing). However, when using frame-based processing, your window length must be greater than or equal to the number of samples (time steps) contained in the frame.

WindowLength is a nontunable property. It can be set only during object construction using Name,Value arguments and cannot be changed afterward.

Default: 200

InputProcessing

Option for sample-based or frame-based input processing, specified as a character vector or string.

• Sample-based processing operates on signals streamed one sample at a time.

• Frame-based processing operates on signals containing samples from multiple time steps. Many machine sensor interfaces package multiple samples and transmit these samples together in frames. Frame-based processing allows you to input this data directly without having to first unpack it.

Your InputProcessing specification impacts the dimensions for the input and output signals when using the step command:

[theta,EstimatedOutput] = step(obj,y,u)

• Sample-based

• y,u, and EstimatedOutput are scalars.

• Frame-based with M samples per frame

• y,u, and EstimatedOutput are M-by-1 vectors.

InputProcessing is a nontunable property. It can be set only during object construction using Name,Value arguments and cannot be changed afterward.

Default: 'Sample-based'

## Output Arguments

collapse all

System object for online parameter estimation of SISO Output-Error polynomial model, returned as a recursiveOE System object. This object is created using the specified model orders and properties. Use step command to estimate the coefficients of the Output-Error model polynomials. You can then access the estimated coefficients and parameter covariance using dot notation. For example, type obj.B to view the estimated B polynomial coefficients.

## More About

collapse all

### Output-Error Model Structure

The general Output-Error model structure is:

$y\left(t\right)=\frac{B\left(q\right)}{F\left(q\right)}u\left(t-{n}_{k}\right)+e\left(t\right)$

The orders of the Output-Error model are:

## Tips

• Starting in R2016b, instead of using the step command to update model parameter estimates, you can call the System object with input arguments, as if it were a function. For example, [B,F,EstimatedOutput] = step(obj,y,u) and [B,F,EstimatedOutput] = obj(y,u) perform equivalent operations.

Get trial now


text:
# Basic understanding of collimating near eye display

#### nikosb

Hi,

I am a mechanical engineer with very basic knowledge of optics. I am working on a project where there is an image at some distance below the eye, approximately 150mm, and I would like to reflect that image as far as possible using a mirror so they eye doesn't have to focus close. Here is an illustration of the system:

The image source measures about 1x1in, and it is located approximately 150mm away from the eye. I ordered a 90 degrees off axis parabolic mirror from Edmund Optics with a EFL of 152.4mm. When I tried to reflect the image as is shown above the virtual image was still very close to the eye, probably at distance of approximately 300mm. I tried increasing the distance between the image and the mirror but the reflection becomes blurry very fast. I thought that if one places an image at the focal point of a concave mirror then the virtual image would be at infinity. What is wrong with the above setup and how could I reflect the image at a large distance (1 or 2m)?

format: plain


text:
# How do I make the first page double sided in a single sided LaTeX document?

How do I make the first page double sided in a single sided LaTeX document?

Is there a way that I can tell LaTeX that I want something on both sides of the first page, but everything after it to be single sided only, without making the whole document double sided and inserting a blank page after every page?

-

## migrated from stackoverflow.comJan 25 '12 at 13:35

This question came from our site for professional and enthusiast programmers.

Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. –  Werner Jan 25 '12 at 14:45

The geometry package allows one to switch your layout mid-document. So, you could set it as twoside for the first two pages, and then switch to the default ("oneside").

Here is a minimal document producing four pages, the first two are twoside, while the last two are not set in twoside mode, as shown by the showframe option to geometry.

\documentclass{article}
\usepackage[showframe]{geometry}% http://ctan.org/pkg/geometry
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\begin{document}
\newgeometry{twoside}% Switch to twoside
\lipsum[1-10]
\restoregeometry% Restore to oneside
\lipsum[11-20]
\end{document}

lipsum was merely used to produce dummy text, Lorem ipsum style.

-


text:
# The Topological G 2 String Asad Naqvi (University of Amsterdam) (in progress) with Jan de Boer and Assaf Shomer hep-th/0506nnn.

## Presentation on theme: "The Topological G 2 String Asad Naqvi (University of Amsterdam) (in progress) with Jan de Boer and Assaf Shomer hep-th/0506nnn."— Presentation transcript:

The Topological G 2 String Asad Naqvi (University of Amsterdam) (in progress) with Jan de Boer and Assaf Shomer hep-th/0506nnn

Introduction and Motivation Topological strings have provided a useful insights into various physical and mathematical questions They are useful toy models of string theories which are still complicated enough to exhibit interesting phyiscal phenomena in a more controlled setting The describe a sector of superstrings and provide exact answers to certain questions concerning BPS quantities Topological Strings Physical Superstrings

Schematics of topological strings Twisting Scalar SUSY Q Q Cohomology Topological Observables Chiral Primaries

Topological strings on CY 3-folds Closed strings:- A-model only depends on the Kahler structure B-model only depends on the Complex structure However the A and B models mix when we couple the closed strings to D branes A-brane action B-branes action depends on complex strucutre depends on Kahler strucutre A and B models have been conjectured to be S-dual

Several authors have found a seven dimensional theory which unifies and extends features of the A and B models. This was one of our motivations to define a twist of string theory on a manifold of G 2 holonomy This may have applications to M-theory compactifications on G 2 manifolds It can improve our understanding of the relation between supersymmetric gauge theories in three and four dimensions.

Outline G 2 manifolds G 2 sigma models (1,1) SUSYExtended symmetry algebra Tricritical Ising model algebra is contained in this extended algebra Topological twist of the G 2 sigma model Relation to Geometry Topological G 2 strings Shatashvili and Vafa 9407025

G 2 manifolds Special holonomy Under this embedding i.e. there is a covariantly constant spinor is a covariantly constant p-form This is non-zero for p=0,3,4 and 7

G 2 sigma models Lets start with a (1,1) sigma model where This model has (1,1) supersymmetry

G-structures and Extended Chiral Algebra Covariantly constant forms Extra holomorphic currents Given a covariantly constant p-form satisfying the current satisfies dim and dimcurrents

On a Kahler manifold, a Kahler form implies the existence of a dimension 1 current and a dimensioncurrent which extend the (1,1) algebra to a (2,2) algebra On Calabi-Yau manifolds, there is a holomorphic 3-form which extends this algebra even more and generates spectral flow Kahler manifolds-an example

Extended G 2 algebra A G 2 holonomy manifold has a covariantly constant 3-form There is also a covariantly constant 4 form which leads to a dimension 2 current X and a dimension 5/2 current M which implies the existence of whereand

OPEs

An important fact is that which means that states of the CFT can be labeled by its tri-critical Ising model weight and its weight in the remainder

Tricritical Ising Model Kac table: Spectrum of conformal primaries Some fusion rules:-

Coulomb gas representation of tri-critical Ising This is a CFT of a scalar field coupled to a background charge Screeners: Screened vertex operators (Felder ‘88)

Conformal blocks and screened vertex operators The fusion rules imply that = =

A BPS bound Highest weight states are annihilated by the positive modes of all the generators. Zero modes of the three dimension two bosonic operators commute when action on highest weight states Highest weight state:- We want to derive some bounds on that come from unitarity.

Consider the three states Matrix of inner products is given by UnitarityEigenvalues > 0

States which saturate the bound will be called chiral primary Notice the definition of chiral primaries involve a non-linear inequality. We will see later that the topological theory keeps only the chiral primary states

Ramond Sector Ramond sector ground states: dim = These states imply the existence of some NS sector states has dimension So preserves and is dim 1 is a candidate for an exactly marginal deformation Shatashvili+Vafa 1994

Moduli Geometrically, the metric moduli are deformations of the metric which preserve the Ricci flatness condition can be written as the square of a first order operator if the manifold supports a covariantly constant spinor We can construct a spinor-valued 1-form It can be shown that math.dg/0311253

large volume Also The OPE The K 0 eigen-value of the this operator should be zero.

Topological Twist Review of the Calabi-Yau twisting Sigma model action:- A-twist scalar 1-form scalar1-form with Effectively, we are adding background gauge field for the U(1) 1-form scalar B-twist

So on a sphere Since On higher genus surfaces, we need 2-2g insertions This effectively adds a background charge for the U(1) part thereby changing its central charge.

Twisting the G 2 sigma model We apply this to the G 2 sigma model The role of will be played by sits purely within the For the G 2 sigma model the role of the U(1) part is played by the tri-critical Ising model

Back to the G 2 twist Effectively, the background charge changes from and c changes as Correlation functions BRST and anti-ghost We can show that This splits as

Projectors As we saw before, a generic state in the theory can be labeled by two qunatum numbers:- h I is the weight of the state under the tri-critical Ising part. For primary fields Define P k to be the projector which projects onto the k th conformal family

The BRST operator that can be written as This squares to zero:- BRST and its Cohomology State Cohomology From the tri-critical fusion rules, we know that Then, by definition

We can solve for c 1 and c 2 upto an irrelevant phase and c 2 =0 implies This is precisely the unitarity bound that we found earlier.

Operator Cohomology A local operator corresponding to the chiral primary states will in general not commute with Q. In fact, only particular conformal blocks of operators will be Q-closed. We can show that the conformal blocks satisfy

G 2 Chiral Ring The unitarity bound implies that there are no singular terms in the OPE, and the leading regular term saturates the bound and so is a chiral primary operator itself. So we have a ring of chiral operators.

An sl(2|1) Subalgebra There exists a subalgebra which is the same as that obeyed by the lowest modes of the N=2 algebra. Define Then, form a closed algebra. A particularly useful relation is which means that correlation functions of Q invariant operators are position independent.

Descent Relations We saw earlier that the moduli are related to the operators A which has dimension (1/2,1/2) Only certain conformal blocks of A are Q-invariant, so it is not obvious if is Q-invariant. We will now show that this is the case. We can then deform the action by

Define We saw earlier which implies Then

Dolbeault Cohomology for G 2 and the chiral BRST Cohomology For a G 2 manifold, forms at each degree can be decomposed in irreducible representations of G 2. Cohomology groups decompose as and depend on the G 2 irrep R only and not on p We can define a sub-complex of the de Rham complex as follows We will next see that this operator maps to our BRST operator Q

BRST Cohomology Geometrically The following table summarizes the L 0 and X 0 eigenvalues of these operators

1 7 + 14 Projection operator onto the 7 when acting on 2 forms is We can repeat this analysis for the two and three forms

Chiral BRST Cohomology with This is exactly the cohomology of the operator Almost trivial since

Differential Complexes

Total BRST Cohomology If we combine the left movers with the right movers, we get a more interesting cohomology Full de Rham cohomology

The metric and B-field moduli should be given by operators of the form with

Correlation Functions Consider three point function of operators On general grounds, we expect this is the third derivative of a prepotential if suitable flat coordinates are used for the moduli space of G 2 metrics.

In fact, the generating function of all our correlation functions is given by

G 2 Special Geometry Define, and In fact, and

Topological G 2 Strings Review of topological strings on Calabi-Yau manifolds: At genus g, we need to insert 2g-2 operators Chiral operators have negative charge So for CY sigma models, there are no interesting correlators at higher genus We need to go to topological strings to get interesting higher genus amplitudes, which means we need to integrate over the moduli space of Riemann surfaces, which is 3g-3 dimensional

The measure on the moduli space of Riemann surfaces is defined by has charge +1 So topological strings on a CY are only interesting in d=3

Back to topological G 2 strings Screened Antighost Charge Charge 2 which is exactly the right value to cancel the background charge of

Conclusions We have constructed a new topological theory in 7 dimensions which captures the geometry of G 2 manifolds Relation to topological M-theory ? D-branes ? Spin 7 ?

Download ppt "The Topological G 2 String Asad Naqvi (University of Amsterdam) (in progress) with Jan de Boer and Assaf Shomer hep-th/0506nnn."

Similar presentations


text:
0 like 0 dislike
Rewrite in simplest radical form square root of x times the fourth root of x. Show each step of your process.

0 like 0 dislike
$$\sqrt[4] {x^3}$$

Step-by-step explanation:

At this point, we can transform the square root into a fourth root by squaring the argument, and bring into the other root:

$$\sqrt x \cdot \sqrt[4] x =\sqrt [4] {x^2} \cdot \sqrt[4] x = \sqrt[4]{x^2\cdot x} = \sqrt[4] {x^3}$$

Alternatively, if you're allowed to use rational exponents, we can convert everything:

$$\sqrt x \cdot \sqrt[4] x = x^{\frac12} \cdot x^\frac14 = x^{\frac12 +\frac14}= x^{\frac24 +\frac14}= x^\frac34 = \sqrt[4] {x^3}$$
by


text:
### SoDumbIam's blog

By SoDumbIam, history, 5 months ago, ,

Can someone tell me how to solve this problem ALIENINV

Thanks!

• +29

 » 5 months ago, # |   +20 When you ask for help with a problem, say what you already came up with (more instructions here).A good first step might be to compute the answer for every leaf. Take a leaf $L$ and root the tree there. For every other vertex $V$, it will be removed before $L$ if and only if the whole subtree of $V$ has values smaller than the value in $L$. Let $s[V]$ be the size of the subtree of $V$. Then, we want $L$ to have the smallest value among $s[V]+1$ vertices (that subtree and vertex $L$ itself), so the probability of $L$ being the smallest is $\frac{1}{s[V]+1}$. Since this is the probability of $V$ being before $L$, you can sum this up to get the expected value of the place of $L$ — because with that probability the place of $L$ is increased by $1$.This is $O(N)$ solution to find an answer for a single leaf. I don't know how hard it is to apply it for non-leaf vertices. Try it and let us know.
•  » » 5 months ago, # ^ |   0 Thanks a lot for your help. I'll keep in mind about the instructions next time. And do you mean $L$ should have the largest value than the whole subtree of $V$? or am I missing something?Thanks!
•  » » » 5 months ago, # ^ |   +6 Yup, the largest.


text:
# Problem: Consider the hypothetical reaction A 2 (g) + B2 (g) → 2AB (g), where the rate law is:The value of the rate constant at 302°C is 2.45 x 10 -4 L/mol•s, and at 508°C the rate constant is 0.891 L/mol•s. What is the activation energy for this reaction? What is the value of the rate constant for this reaction at 375°C?

###### FREE Expert Solution

Recall: The Arrhenius equation gives us the relationship of the rate constant k with temperature and activation energy Ea. The two-point form of the Arrhenius equation is:

We're given:

k1 = 2.45 × 10–4 L/mol•s          T1 = 302 ˚C + 273.15 = 575.15 K

k2 = 0.891 L/mol•s                   T2 = 508°C + 273.15 = 781.15 K

85% (96 ratings)
###### Problem Details

Consider the hypothetical reaction A 2 (g) + B2 (g) → 2AB (g), where the rate law is:

The value of the rate constant at 302°C is 2.45 x 10 -4 L/mol•s, and at 508°C the rate constant is 0.891 L/mol•s. What is the activation energy for this reaction? What is the value of the rate constant for this reaction at 375°C?


text:
# Tetration Forum

You're currently viewing a stripped down version of our content. View the full version with proper formatting.
... what when put to the root of itself is equal to the cube root of 3? Can it be expressed in terms of e? I know this sounds like a bit of a random question but it's something I've always been curious in.

I've calculated that the number is roughly 2.47805268, but I don't think I can calculate a way to express it without learning advanced mathematics (as you can probably tell I'm no mathematician).
Oh, now with the picture I see what you mean.

To get a formula we can use the Lambert W function.
The Lambert W function is the inverse of the function M(x)=x*e^x
and we can express the self root x^(1/x) with help of M:

y = x^(1/x) = exp(-M(-ln(x)))

You can verify this with a bit of calculation.
Then we can obtain the inverse:

exp(-W(-ln(y))) = x

More exactly x can be two values, left and right from e, which correspond to the two branches of W:

$x_L = \exp(-W_0(-\ln(y)))$
$x_R = \exp(-W_{-1}(-\ln(y)))$

So when you want to get the left value - as in your case - you choose x_L and get:
$x_L = \exp(-W_0(-\ln(3^{1/3})))\approx 2.47805268028830$
$x_R$ would be simply 3 again.
Thank you very much for the reply.

So, if you take the Lambert W function out of the equation, what are you left with? As I said I'm no mathematician I'm afraid so I don't fully understand the principle.
(02/15/2011, 03:20 PM)robo37 Wrote: [ -> ]So, if you take the Lambert W function out of the equation, what are you left with? As I said I'm no mathematician I'm afraid so I don't fully understand the principle.

I dont think there might be a closed form solution without the Lambert W function. However if you are after calculating the number, that function really helps as it is available in most computer algebra packages.


text:
# Can't parent the standard FPSController during gameplay

I'm parenting the standard assets FPS controller during play with a simple script. The controller get's parented but also instantly inherits the rotation of the parent. This doesn't happen in Editor mode. This incorrect behavior happens regardless if I move the player with a script or by parenting him with my mouse cursor.

I suspect the error comes from the way the character controller script is set up.

In the FPS controller script the player rotates via mouse movement in the Update function in the following way:

private void Update()
{
RotateView();
}

private void RotateView()
{
m_MouseLook.LookRotation (transform, m_Camera.transform);
}

m_MouseLook get's its rotation from m_Camera.transform. It in turn uses transform.localPosition.

I think it's the use of localposition that causes the strange behavior.

How do I fix it?

I added the script that I used to re-parent the fps controller below:

    public Transform ParentTarget;
public GameObject player;

void OnTriggerEnter(Collider other)
{
player.transform.SetParent(ParentTarget, true);
}

void OnTriggerExit(Collider other)
{
player.transform.parent = null;
}

As I said the script is fairly simple and the same error happens when I re-parent the controller by dragging it with my mouse during play.

If I set worldPositionStays to false then the player is offset and doesn't inherit the parent rotations at all. This isn't what I want.

Here is my scene before the player steps unto the trigger. The red box is the trigger. The blue box is the new parent (the parent is rotated 45 degrees)

Here is the original incorrect behavior. The player is instantly rotated 45 degrees as he steps unto the trigger. This is wrong

Here is the behavior when worldPositionStays is set to false. Rotating the parent has no effect. This is wrong.

The desired behavior is to keep the player rotation, and then change it as the parent is rotating after the re-parenting event. This is what would happen if I re-parented any ordinary GameObject.

It is the character controller mouse look part that is most likely causing all the trouble.

I suspect I have to abandon the re-parenting solution and simply add the transforms to the camera mouse look part of the character controller script.

I would be very grateful is someone more knowledgeable would help me out with achieving this. Hopefully by getting re-parenting to work, since it is simpler, and simplicity is always king. I would settle for help with writing a script to add rotations and positions correctly to the controller.

• You said "I'm parenting the standard assets FPS controller during play with a simple script." Can we see that script? Also, you suspect "the use of localPosition cauces the strange behavior". Can we see how that's being used if you thing it's the problem. – Foggzie Dec 19 '15 at 22:56
• For starters, you never need to call GetComponet<Transform>() since it's a public property of GameObject (player.transform). Also, when changing a parent, use SetParent() because it has the optional worldPositionStays argument: player.transform.SetParent(ParentTarget, true); – Foggzie Dec 20 '15 at 23:47
• So, to try and clarify: You want the player object to become a child of the blue thing, while maintaining the player's look vector, but moving (translating) as the parent rotates? Like standing on a merry go round and keeping your eyes fixed on a stationary object? – Draco18s Dec 21 '15 at 22:37
• So you actually want if player trigger and get re-parented then player has to keep its original rotation and after that it follows the parent rotation respectively? – Hamza Hasan Dec 22 '15 at 7:40
• I'm trying to understand. Why is it absolutely necessary that it be parented? I found the default FPSController script to be too limiting, and thus wrote my own. – Ben BearFish Dec 22 '15 at 16:02

I appreciate that you'd prefer to solve your problem using parenting but the truth is you're going to be fighting Unity more than utilizing its simplicity if you attempt this.

The problem is that MouseLook (which is used by FirstPersonController) stores its own value for rotation and uses that exclusively on the Transform that it owns. This is a problem in combination with how the GameObject hierarchy handles the rotation, scaling, and transforming of parent child relationships. This hierarchical "guidance" along with FirstPersonController's use of MouseLook and its persistent rotation storage causes mathematical complications when re-parenting occurs; it's not impossible to solve but will require hacking together some stupid math.

You're better off with an alternative solution of re-implementing that parental "guidance" and then making minor modifications to the FirstPersonController and MouseLook.

For these files that already exists, I've marked which likes are old, modified, or new.

## MouseLook.cs

First, in MouseLook, we need a way to modify the rotation because it stores its own and forces it upon the Transform that it's working with. We'll need an extra float for rotating on the y axis:

private Quaternion m_CharacterTargetRot; // Old
private Quaternion m_CameraTargetRot; // Old
private float m_extraY; // New

We need to allow it to modify MouseLook's internal rotation in MouseLook.LookRotation():

float yRot = CrossPlatformInputManager.GetAxis("Mouse X") * XSensitivity; // Old
float xRot = CrossPlatformInputManager.GetAxis("Mouse Y") * YSensitivity; // Old

m_CharacterTargetRot *= Quaternion.Euler (0f, yRot + m_extraY, 0f); // Modified
m_extraY = 0.0f; // New
m_CameraTargetRot *= Quaternion.Euler (-xRot, 0f, 0f); // Old

public void AddYRotation(float y) { m_extraY = y; } // New

## FirstPersonController.cs

This simply needs a method to call the new function you just made in MouseLook:

public void AddYRotation(float y) { m_MouseLook.AddYRotation(y); } // New

Now you need a new class to handle the hierarchical "guidance" you would have gotten with parenting:

## Vehicle.cs

using UnityEngine;
using UnityStandardAssets.Characters.FirstPerson;

public class Vehicle : MonoBehaviour
{
public FirstPersonController fps;

private Vector3 m_lastPosition;
private Vector3 m_positionDiff;

private float m_lastYRot;
private float m_yRotDiff;

void Start() {
m_lastPosition = transform.position;
m_lastYRot = transform.rotation.eulerAngles.y;
}

void Update() {

m_positionDiff = transform.position - m_lastPosition;
m_lastPosition = transform.position;

m_yRotDiff = transform.rotation.eulerAngles.y - m_lastYRot;
m_lastYRot = transform.rotation.eulerAngles.y;
}

void LateUpdate() {
if (fps != null) {
fps.transform.position = fps.transform.position + m_positionDiff;
}
}
}

Wrapping this all up, after your modifications and adding the Vehicle to whatever you need (a Train, elevator, sliding platform, that blue bar in your pictures), instead of calling SetParent it will look more like this:

void OnTriggerEnter(Collider other) {
// If these GetComponent calls return null, you're doing something wrong
var veh = ParentTarget.GetComponent<Vehicle>();
veh.fps = player.GetComponent<FirstPersonController>();
}

I think the easiest way to do this would be to update your code so that when the FpsController is added as a parent it is first updated so that its rotation matches the current position of the child object.

I think this should give the effect required but I may be misunderstanding what you are trying to do!

This should be posible with:

transform.Rotate()

http://docs.unity3d.com/400/Documentation/ScriptReference/CharacterController.SimpleMove.html

Here is the quick and dirty way:

 void OnTriggerEnter(Collider other)
{
Quaternion toSubs = ParentTarget.transform.rotation / player.transform.rotation;
player.transform.SetParent(ParentTarget, true);
player.transform.rotation /= toSubs;
}

Since i don't understand majority of the question, i can't provide you an appropiate way.


text:
# Literal Values

This document describes String literals, Numeric literals, NULL values, Hexadecimal literals, Date and time literals, Boolean literals, and Bit-value literals.

## String literals

A string is a sequence of bytes or characters, enclosed within either single quote ' or double quote " characters. For example:

'example string'
"example string"

Quoted strings placed next to each other are concatenated to a single string. The following lines are equivalent:

'a string'
'a' ' ' 'string'
"a" ' ' "string"

If the ANSI_QUOTES SQL MODE is enabled, string literals can be quoted only within single quotation marks because a string quoted within double quotation marks is interpreted as an identifier.

A binary string is a string of bytes. Each binary string has a character set and collation named binary. A non-binary string is a string of characters. It has a character set other than binary and a collation that is compatible with the character set.

For both types of strings, comparisons are based on the numeric values of the string unit. For binary strings, the unit is the byte. For non-binary strings, the unit is the character and some character sets support multibyte characters.

A string literal may have an optional character set introducer and COLLATE clause, to designate it as a string that uses a specific character set and collation. TiDB only supports this in syntax, but does not process it.

[_charset_name]'string' [COLLATE collation_name]

For example:

SELECT _latin1'string';
SELECT _binary'string';
SELECT _utf8'string' COLLATE utf8_bin;

You can use N'literal’ (or n'literal’) to create a string in the national character set. The following statements are equivalent:

SELECT N'some text';
SELECT n'some text';
SELECT _utf8'some text';

Escape characters:

• \0: An ASCII NUL (X'00’) character
• \': A single quote (') character
• \": A double quote (")character
• \b: A backspace character
• \n: A newline (linefeed) character
• \r: A carriage return character
• \t: A tab character
• \z: ASCII 26 (Ctrl + Z)
• \\: A backslash \ character
• \%: A % character
• \_: A _ character

You can use the following ways to include quote characters within a string:

• A ' inside a string quoted with ' may be written as ''.
• A " inside a string quoted with " may be written as "".
• Precede the quote character by an escape character \.
• A ' inside a string quoted with " needs no special treatment, and a " inside a string quoted with ' needs no special treatment either.

## Numeric literals

Numeric literals include integer and DECIMAL literals and floating-point literals.

Integer may include . as a decimal separator. Numbers may be preceded by - or + to indicate a negative or positive value respectively.

Exact-value numeric literals can be represented as 1, .2, 3.4, -5, -6.78, +9.10.

Numeric literals can also be represented in scientific notation, such as 1.2E3, 1.2E-3, -1.2E3, -1.2E-3.

## NULL values

The NULL value means “no data”. NULL can be written in any letter case. A synonym is \N (case sensitive).

Be aware that the NULL value is different from values such as 0 for numeric types or the empty string '' for string types.

Hexadecimal literal values are written using X'val' or 0xval notation, where val contains hexadecimal digits. A leading 0x is case sensitive and cannot be written as 0X.

X'ac12'
X'12AC'
x'ac12'
x'12AC'
0xac12
0x12AC

X'1z' (z is not a hexadecimal legal digit)
0X12AC (0X must be written as 0x)

Hexadecimal literals written using X'val' notation must contain an even number of digits. To avoid the syntax error, pad the value with a leading zero:

mysql> select X'aff';
ERROR 1105 (HY000): line 0 column 13 near ""hex literal: invalid hexadecimal format, must even numbers, but 3 (total length 13)
mysql> select X'0aff';
+---------+
| X'0aff' |
+---------+
|
|
+---------+
1 row in set (0.00 sec)

By default, a hexadecimal literal is a binary string.

To convert a string or a number to a string in hexadecimal format, use the HEX() function:

mysql> SELECT HEX('TiDB');
+-------------+
| HEX('TiDB') |
+-------------+
| 54694442    |
+-------------+
1 row in set (0.01 sec)

mysql> SELECT X'54694442';
+-------------+
| X'54694442' |
+-------------+
| TiDB        |
+-------------+
1 row in set (0.00 sec)

## Date and time literals

Date and time values can be represented in several formats, such as quoted strings or as numbers. When TiDB expects a date, it interprets any of '2015-07-21', '20150721' and 20150721 as a date.

TiDB supports the following formats for date values:

• As a string in either 'YYYY-MM-DD' or 'YY-MM-DD' format. The - delimiter is “relaxed” in syntax. Any punctuation character may be used as the delimiter between date parts. For example, '2017-08-24', '2017&08&24' and '2012@12^31' are equivalent. The only delimiter recognized is the . character, which is treated as a decimal point to separate the integer and fractional parts. The date and time parts can be separated by T other than a space. For example, 2017-8-24 10:42:00 and 2017-8-24T10:42:00 are equivalent.
• As a string with no delimiters in either 'YYYYMMDDHHMMSS' or 'YYMMDDHHMMSS' format. For example, '20170824104520' and '170824104520' are interpreted as '2017-08-24 10:45:20'. But '170824304520' is illegal because the hour part exceeds the legal range.
• As a number in either YYYYMMDDHHMMSS or YYMMDDHHMMSS format, without single quotation marks or double quotation marks. For example, 20170824104520 is interpreted as '2017-08-24 10:45:20'.

A DATETIME or TIMESTAMP value can include a trailing fractional seconds part in up to microseconds (6 digits) precision. The fractional part should always be separated from the rest of the time by a decimal point.

Dates containing two-digit year values are ambiguous. It is recommended to use the four-digit format. TiDB interprets two-digit year values using the following rules:

• Year values in the range of 70-99 are converted to 1970-1999.
• Year values in the range of 00-69 are converted to 2000-2069.

For values specified as strings that include date part delimiters, it is unnecessary to specify two digits for month or day values that are less than 10. '2017-8-4' is the same as '2017-08-04'. Similarly, for values specified as strings that include time part delimiters, it is unnecessary to specify two digits for hour, minute, or second values that are less than 10. '2017-08-24 1:2:3' is the same as '2017-08-24 01:02:03'.

In TiDB, the date or time values specified as numbers are interpreted according their length:

• 6 digits: YYMMDD
• 12 digits: YYMMDDHHMMSS
• 8 digits: YYYYMMDD
• 14 digits: YYYYMMDDHHMMSS

TiDB supports the following formats for time values:

• As a string in 'D HH:MM:SS' format. You can also use one of the following “relaxed” syntaxes: 'HH:MM:SS', 'HH:MM', 'D HH:MM', 'D HH', or 'SS'. Here D represents days and the legal value range is 0-34.
• As a number in 'HHMMSS' format. For example, 231010 is interpreted as '23:10:10'.
• A number in any of the SS, MMSS or HHMMSS format can be treated as time.

The time value can also include a trailing fractional part in up to 6 digits precision. The . character represents the decimal point.

## Boolean literals

The constants TRUE and FALSE evaluate to 1 and 0 respectively, which are not case sensitive.

mysql> SELECT TRUE, true, tRuE, FALSE, FaLsE, false;
+------+------+------+-------+-------+-------+
| TRUE | true | tRuE | FALSE | FaLsE | false |
+------+------+------+-------+-------+-------+
|    1 |    1 |    1 |     0 |     0 |     0 |
+------+------+------+-------+-------+-------+
1 row in set (0.00 sec)

## Bit-value literals

Bit-value literals are written using b'val' or 0bval notation. The val is a binary value written using zeros and ones. A leading 0b is case sensitive and cannot be written as 0B.

Legal bit-value literals:

b'01'
B'01'
0b01

Illegal bit-value literals:

b'2' (2 is not a binary digit; it must be 0 or 1)
0B01 (0B must be written as 0b)

By default, a bit-value literal is a binary string.

Bit values are returned as binary values, which may not display well in the MySQL client. To convert a bit value to printable form, you can use a conversion function such as BIN() or HEX().

CREATE TABLE t (b BIT(8));
INSERT INTO t SET b = b'00010011';
INSERT INTO t SET b = b'1110';
INSERT INTO t SET b = b'100101';

mysql> SELECT b+0, BIN(b), HEX(b) FROM t;
+------+--------+--------+
| b+0  | BIN(b) | HEX(b) |
+------+--------+--------+
|   19 | 10011  | 13     |
|   14 | 1110   | E      |
|   37 | 100101 | 25     |
+------+--------+--------+
3 rows in set (0.00 sec)


text:
# Algorithmic and hyperref packages: strange interaction

I am not sure the bug below has already been reported as I cannot find clear information online. See the MWE: if \usepackage{hyperref} is not commented, the space below the equation is fairly large, way more than when the package is commented. It looks like it is a bad interaction between hyperref and the STATE command of the algorithmic package:

\documentclass{book}
\usepackage{algorithmic}
\usepackage{hyperref}
\begin{document}
\setlength\abovedisplayshortskip{0pt}
\setlength\belowdisplayshortskip{0pt}
\setlength\abovedisplayskip{0pt}
\setlength\belowdisplayskip{0pt}
\begin{algorithmic}
\STATE text text text text text text text text text text text text text
$$\cos\pi=-1$$
\STATE text text text text text text text text text text text text text
\STATE text text text text text text text text text text text text text
$$\cos\pi=-1$$
text text text text text text text text text text text text text
\end{algorithmic}
text text text text text text text text text text text text text
$$\cos\pi=-1$$
text text text text text text text text text text text text text
\end{document}

• A solution by adding: \usepackage{etoolbox} \AfterEndEnvironment{equation}{\vskip-0.5\baselineskip} – M.Ahmadi Oct 6 '19 at 20:21
• @M.Ahmadi Not sure because it affects all equations in the document and only very few of them have an issue. – pluton Oct 7 '19 at 15:19
• usepackage algorithmicx greatly improved algorithmic – M.Ahmadi Oct 7 '19 at 20:48

Changing the

\usepackage{algorithmic}

to

\usepackage{algorithmicx}

OR

\usepackage{algpseudocode}

And \STATE to \State does not create an empty space

The Minimal example:

\documentclass{book}
\usepackage{algorithmicx}
%\usepackage{algpseudocode}
\usepackage{hyperref}

\begin{document}
\setlength\abovedisplayshortskip{0pt}
\setlength\belowdisplayshortskip{0pt}
\setlength\abovedisplayskip{0pt}
\setlength\belowdisplayskip{0pt}
\begin{algorithmic}
\State text text text text text text text text text text text text text
$$\cos\pi=-1$$
\State text text text text text text text text text text text text text
\State text text text text text text text text text text text text text
$$\cos\pi=-1$$
text text text text text text text text text text text text text
\end{algorithmic}
text text text text text text text text text text text text text
$$\cos\pi=-1$$
text text text text text text text text text text text text text
\end{document}

Output:

• Interesting. Then this is a bug to be reported to the algorithmic package maintainer. – pluton Oct 7 '19 at 22:25


text:
# Ex.4.4 Q1 Practical Geometry Solution - NCERT Maths Class 8

Go back to  'Ex.4.4'

## Question

Construct the following quadrilaterals.

(i) Quadrilateral $$DEAR$$

$$DE = 4\,\rm{cm}$$

$$EA = 5\,\rm{cm}$$

$$AR = 4.5\,\rm{cm}$$

$$\angle E = 60^\circ$$

$$\angle A = 90^\circ$$

(ii) Quadrilateral $$TRUE$$

$$TR = 3.5\,\rm{cm}$$

$$RU = 3\,\rm{cm }$$

$$UE = 4\,\rm{cm}$$

$$\angle R = 75^\circ$$

$$\angle U=120^\circ$$

Video Solution
Practical Geometry
Ex 4.4 | Question 4

## Text Solution

What is known?

Measurements of a Quadrilateral ($$3$$ line segments and $$2$$ angles).

What is unknown?

Construction of a Quadrilateral

Reasoning:

As you are aware, we need five measurements to draw a quadrilateral. The given measurements are of three sides and two included angles (Page 58 of Grade 8 NCERT Book)

Steps:

Let us draw a rough diagram with the given measurements to find out whether it is possible to construct a quadrilateral

Let us construct the quadrilateral

Step 1: Draw a line segment $$TR = 3.5\,\rm{cm.}$$

Step 2: With $$R$$ as center construct an angle of  $$75^\circ.$$  With $$R$$ as center and radius $$3\,\rm{cm}$$ draw an arc cutting the ray from $$R$$ at $$U.$$

Step 3: With $$U$$ as center construct an angle of $$120^\circ.$$  With $$U$$ as center and radius $$4\,\rm{cm}$$ draw an arc cutting the ray from $$U$$ at $$E.$$

Step 4: Join $$TE.$$

Step 5: $$TRUE$$ is the required quadrilateral.

Learn from the best math teachers and top your exams

• Live one on one classroom and doubt clearing
• Practice worksheets in and after class for conceptual clarity
• Personalized curriculum to keep up with school


text:
# zbMATH — the first resource for mathematics

On prime ideals and subdirect decompositions of BCK-algebras. (English) Zbl 0636.03061
It is shown that if A is a BCK-algebra which is a lower semilattice with respect to the BCK-order then A is a subdirect product of BCK-chains if and only if A satisfies the identity $$xy\wedge yx=0$$.
Reviewer: M.Pałasiński

##### MSC:
 03G25 Other algebras related to logic


text:
# An ODE problem

Hi all,

I have an ODE of the form

$\frac{d^{3}\psi}{d\xi^{3}}-A\left(\psi+\xi\frac{d\psi}{d\xi}\right)=0,$

where $\psi=C_{1}U(\xi)+C_{2}V(\xi).$

Is there any transformation or inventive manipulation I can use here to obtain an ODE for $\sigma=U(\xi)+V(\xi)$? As this is the quantity I would like to solve for.

Thanks.

## Answers and Replies

Hi !
y''(x)-A(y(x)+x*y'(x))=0
Let t=A*x²/2
Then a first solution is easy to see :
U=exp(t)=exp(A*x²/2)
Let y(x)=f(x)*exp(A*x²/2) and z=x*sqrt(A/2)
leading to an ODE which a solution is erf(z)
V= erf(x*sqrt(A/2))*exp(A*x²/2)


text:
# P2 3.6 Impact forces and 3.7 Car safety

HideShow resource information

Impact forces

Key points and Learning objectives:

When vehicles collide what does the force of the impact depend on?

• When vehicles collide, the force of the impact depends on mass, change of velocity, and the duration of the impact.

How does the impact force depend on the impact time?

• The longer the impact time is, the more the impact force is reduced.

What can we say about the impact forces and the total momentum when two vehicles collide?

• When two vehicles collide they exert equal and opposite forces on each other and their total momentum is unchanged assuming no external forces act.

If we know the impact time we can then work out the impact force so you

## Similar Physics resources:

See all Physics resources »See all Forces and Motion resources »


text:
# C++ libraries for statistical computing

I've got a particular MCMC algorithm which I would like to port to C/C++. Much of the expensive computation is in C already via Cython, but I want to have the whole sampler written in a compiled language so that I can just write wrappers for Python/R/Matlab/whatever.

After poking around I'm leaning towards C++. A couple of relevant libraries I know of are Armadillo (http://arma.sourceforge.net/) and Scythe (http://scythe.wustl.edu/). Both try to emulate some aspects of R/Matlab to ease the learning curve, which I like a lot. Scythe squares a little better with what I want to do I think. In particular, its RNG includes a lot of distributions where Armadillo only has uniform/normal, which is inconvenient. Armadillo seems to be under pretty active development while Scythe saw its last release in 2007.

So what I'm wondering is if anyone has experience with these libraries -- or others I have almost surely missed -- and if so, whether there is anything to recommend one over the others for a statistician very familiar with Python/R/Matlab but less so with compiled languages (not completely ignorant, but not exactly proficient...).

-
(+1) Good question! –  suncoolsu Feb 18 '11 at 4:53

We have spent some time making the wrapping from C++ into R (and back for that matter) a lot easier via our Rcpp package.

And because linear algebra is already such a well-understood and coded-for field, Armadillo, a current, modern, plesant, well-documted, small, templated, ... library was a very natural fit for our first extended wrapper: RcppArmadillo.

This has caught the attention of other MCMC users as well. I gave a one-day work at the U of Rochester business school last summer, and have help another researcher in the MidWest with similar explorations. Give RcppArmadillo a try -- it works well, is actively maintained (new Armadillo release 1.1.4 today, I will make a new RcppArmadillo later) and supported.

And because I just luuv this example so much, here is a quick "fast" version of lm() returning coefficient and std.errors:

extern "C" SEXP fastLm(SEXP ys, SEXP Xs) {

try {
Rcpp::NumericVector yr(ys);                 // creates Rcpp vector
Rcpp::NumericMatrix Xr(Xs);                 // creates Rcpp matrix
int n = Xr.nrow(), k = Xr.ncol();

arma::mat X(Xr.begin(), n, k, false);       // avoids extra copy
arma::colvec y(yr.begin(), yr.size(), false);

arma::colvec coef = arma::solve(X, y);      // fit model y ~ X
arma::colvec res = y - X*coef;              // residuals

double s2 = std::inner_product(res.begin(), res.end(),
res.begin(), double())/(n - k);
// std.errors of coefficients
arma::colvec std_err =
arma::sqrt(s2 * arma::diagvec( arma::pinv(arma::trans(X)*X) ));

return Rcpp::List::create(Rcpp::Named("coefficients") = coef,
Rcpp::Named("stderr")       = std_err,
Rcpp::Named("df")           = n - k);

} catch( std::exception &ex ) {
forward_exception_to_r( ex );
} catch(...) {
::Rf_error( "c++ exception (unknown reason)" );
}
return R_NilValue; // -Wall
}

Lastly, you also get immediate prototyping via inline which may make 'time to code' faster.

-
Thanks Dirk - I had a feeling you'd answer sooner rather than later :). Given that I want code I can call from other software (Python mainly, but Matlab too) perhaps a good workflow would be to prototype in Rcpp/RcppArmadillo and then move to "straight" Armadillo? The syntax, etc looks very similar. –  JMS Feb 18 '11 at 16:13
Hope you found it helpful. –  Dirk Eddelbuettel Feb 18 '11 at 16:16
Re your 2nd question from the edit: Sure. Armadillo depends on little, or in our case, nothing besides R. Rcpp / RcppArmadillo would help you interface and test prototyped code that can be re-used standalone or with a Python and Matlab wrappers you can add later. Conrad may have pointers for something; I don't have any for Python or Matlab. –  Dirk Eddelbuettel Feb 18 '11 at 16:40
Sorry to pull the rug out :) I want the enter key to give a carriage return, but it submits my comment instead. Anyhow, thanks for your help - I've been enjoying myself tinkering and digging back through the Rcpp mailing list all day today. –  JMS Feb 19 '11 at 4:50

I would strongly suggest that you have a look at RCpp and RcppArmadillo packages for R. Basically, you would not need to worry about the wrappers as they are already "included". Furthermore the syntactic sugar is really sweet (pun intended).

As a side remark, I would recommend that you have a look at JAGS, which does MCMC and its source code is in C++.

-
I would like to second this. If you're looking for a fast and easy way to interface compiled code with R, Rcpp with RcppArmadillo is the way to go. Edit: Using Rcpp, you also have access to all the RNGs implmented in the C-code underlying R. –  fabians Feb 18 '11 at 10:05
Thanks for the vote of confidence. I was about to suggest the same ;-) –  Dirk Eddelbuettel Feb 18 '11 at 15:32

Boost Random from the Boost C++ libraries could be a good fit for you. In addition to many types of RNGs, it offers a variety of different distributions to draw from, such as

• Uniform (real)
• Uniform (unit sphere or arbitrary dimension)
• Bernoulli
• Binomial
• Cauchy
• Gamma
• Poisson
• Geometric
• Triangle
• Exponential
• Normal
• Lognormal

In addition, Boost Math complements the above distributions you can sample from with numerous density functions of many distributions. It also has several neat helper functions; just to give you an idea:

students_t dist(5);

cout << "CDF at t = 1 is " << cdf(dist, 1.0) << endl;
cout << "Complement of CDF at t = 1 is " << cdf(complement(dist, 1.0)) << endl;

for(double i = 10; i < 1e10; i *= 10)
{
// Calculate the quantile for a 1 in i chance:
double t = quantile(complement(dist, 1/i));
// Print it out:
cout << "Quantile of students-t with 5 degrees of freedom\n"
"for a 1 in " << i << " chance is " << t << endl;
}

If you decided to use Boost, you also get to use its UBLAS library that features a variety of different matrix types and operations.

-
Thanks for the tip. Boost looks like kind of a big hammer for my little nail, but mature and maintained. –  JMS Feb 18 '11 at 16:25

There are numerous C/C++ libraries out there, most focusing on a particular problem domain of (e.g. PDE solvers). There are two comprehensive libraries I can think of that you may find especially useful because they are written in C but have excellent Python wrappers already written.

1) IMSL C and PyIMSL

2) trilinos and pytrilinos

I have never used trilinos as the functionality is primarily on numerical analysis methods, but I use PyIMSL a lot for statistical work (and in a previous work life I developed the software too).

With respect to RNGs, here are the ones in C and Python in IMSL

## DISCRETE

• random_binomial: Generates pseudorandom binomial numbers from a binomial distribution.
• random_geometric: Generates pseudorandom numbers from a geometric distribution.
• random_hypergeometric: Generates pseudorandom numbers from a hypergeometric distribution.
• random_logarithmic: Generates pseudorandom numbers from a logarithmic distribution.
• random_neg_binomial: Generates pseudorandom numbers from a negative binomial distribution.
• random_poisson: Generates pseudorandom numbers from a Poisson distribution.
• random_uniform_discrete: Generates pseudorandom numbers from a discrete uniform distribution.
• random_general_discrete: Generates pseudorandom numbers from a general discrete distribution using an alias method or optionally a table lookup method.

## UNIVARIATE CONTINUOUS DISTRIBUTIONS

• random_beta: Generates pseudorandom numbers from a beta distribution.
• random_cauchy: Generates pseudorandom numbers from a Cauchy distribution.
• random_chi_squared: Generates pseudorandom numbers from a chi-squared distribution.
• random_exponential: Generates pseudorandom numbers from a standard exponential distribution.
• random_exponential_mix: Generates pseudorandom mixed numbers from a standard exponential distribution.
• random_gamma: Generates pseudorandom numbers from a standard gamma distribution.
• random_lognormal: Generates pseudorandom numbers from a lognormal distribution.
• random_normal: Generates pseudorandom numbers from a standard normal distribution.
• random_stable: Sets up a table to generate pseudorandom numbers from a general discrete distribution.
• random_student_t: Generates pseudorandom numbers from a Student's t distribution.
• random_triangular: Generates pseudorandom numbers from a triangular distribution.
• random_uniform: Generates pseudorandom numbers from a uniform (0, 1) distribution.
• random_von_mises: Generates pseudorandom numbers from a von Mises distribution.
• random_weibull: Generates pseudorandom numbers from a Weibull distribution.
• random_general_continuous: Generates pseudorandom numbers from a general continuous distribution.

## MULTIVARIATE CONTINUOUS DISTRIBUTIONS

• random_normal_multivariate: Generates pseudorandom numbers from a multivariate normal distribution.
• random_orthogonal_matrix: Generates a pseudorandom orthogonal matrix or a correlation matrix.
• random_mvar_from_data: Generates pseudorandom numbers from a multivariate distribution determined from a given sample.
• random_multinomial: Generates pseudorandom numbers from a multinomial distribution.
• random_sphere: Generates pseudorandom points on a unit circle or K-dimensional sphere.
• random_table_twoway: Generates a pseudorandom two-way table.

## ORDER STATISTICS

• random_order_normal: Generates pseudorandom order statistics from a standard normal distribution.
• random_order_uniform: Generates pseudorandom order statistics from a uniform (0, 1) distribution.

## STOCHASTIC PROCESSES

• random_arma: Generates pseudorandom ARMA process numbers.
• random_npp: Generates pseudorandom numbers from a nonhomogeneous Poisson process.

## SAMPLES AND PERMUTATIONS

• random_permutation: Generates a pseudorandom permutation.
• random_sample_indices: Generates a simple pseudorandom sample of indices.
• random_sample: Generates a simple pseudorandom sample from a finite population.

## UTILITY FUNCTIONS

• random_option: Selects the uniform (0, 1) multiplicative congruential pseudorandom number generator.
• random_option_get: Retrieves the uniform (0, 1) multiplicative congruential pseudorandom number generator.
• random_seed_get: Retrieves the current value of the seed used in the IMSL random number generators.
• random_substream_seed_get: Retrieves a seed for the congruential generators that do not do shuffling that will generate random numbers beginning 100,000 numbers farther along.
• random_seed_set: Initializes a random seed for use in the IMSL random number generators.
• random_table_set: Sets the current table used in the shuffled generator.
• random_table_get: Retrieves the current table used in the shuffled generator.
• random_GFSR_table_set: Sets the current table used in the GFSR generator.
• random_GFSR_table_get: Retrieves the current table used in the GFSR generator.
• random_MT32_init: Initializes the 32-bit Mersenne Twister generator using an array.
• random_MT32_table_get: Retrieves the current table used in the 32-bit Mersenne Twister generator.
• random_MT32_table_set: Sets the current table used in the 32-bit Mersenne Twister generator.
• random_MT64_init: Initializes the 64-bit Mersenne Twister generator using an array.
• random_MT64_table_get: Retrieves the current table used in the 64-bit Mersenne Twister generator.
• random_MT64_table_set: Sets the current table used in the 64-bit Mersenne Twister generator.

## LOW-DISCREPANCY SEQUENCE

• faure_next_point: Computes a shuffled Faure sequence.
-


text:
×

# Solvers????

I just noticed that if you post a problem and if you only have to see the number of solvers for it, you can't do that. Also, after solving a question if you have to see the number of solvers for it, you can't do that. This means that you can view the number of solvers only for the questions that you haven't solved or you haven't posted.

Why is this happening????

Note by Anuj Shikarkhane
3 years, 3 months ago

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold
- bulleted- list
• bulleted
• list
1. numbered2. list
1. numbered
2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in $$...$$ or $...$ to ensure proper formatting.
2 \times 3 $$2 \times 3$$
2^{34} $$2^{34}$$
a_{i-1} $$a_{i-1}$$
\frac{2}{3} $$\frac{2}{3}$$
\sqrt{2} $$\sqrt{2}$$
\sum_{i=1}^3 $$\sum_{i=1}^3$$
\sin \theta $$\sin \theta$$
\boxed{123} $$\boxed{123}$$

Sort by:

- 3 years, 3 months ago

This information should be available at the top of the screen when you are viewing the solutions for the problem.

For example,

Imgur

Staff - 3 years, 3 months ago


text:
## Chemistry: Molecular Approach (4th Edition)

The electron configuration of Zinc is $[Ar] 3d^{10} 4s^2$. It has no unpaired electrons, so it is diamagnetic.


text:
1. ## Exponential rate question

"A sick person takes a tablet of mass 500mg whose contents are gradually absorbed into the body. The mass not yet absorbed after t minutes is modelled by the formula 500(e^(-ct)) mg. After 30 minutes only 50mg remains unabsorbed.

a) Find the value of c
b) find the rate at which the contents of the tablet are being absorbed
i) when the person first takes the tablet,
ii) when half of the tablet is absorbed."

I've managed to find c but unsure how to go about the rest of the question. Also, I'm unsure when questions want me to differentiate to find rates as opposed to using the idea that "A quantity Q growing (or decaying) exponentially according the the law Q= ae^(ct) has a rate of growth (or decay equal to c (or -c) times its current value". Thank you for your time, any help will be greatly appreciated.

Edit: I found the derivative as f'(x)=-500c(e^(-ct)), and subbed in zero as x for b) i), but Im an order of magnitude too low at 4.9mg instead of 49.9mg.
Edit: I can find the right values but an order of magnitude too low.

2. Originally Posted by MathsHelpPlz
"A sick person takes a tablet of mass 500mg whose contents are gradually absorbed into the body. The mass not yet absorbed after t minutes is modelled by the formula 500(e^(-ct)) mg. After 30 minutes only 50mg remains unabsorbed.

a) Find the value of c
b) find the rate at which the contents of the tablet are being absorbed
i) when the person first takes the tablet,
ii) when half of the tablet is absorbed."

I've managed to find c but unsure how to go about the rest of the question. Also, I'm unsure when questions want me to differentiate to find rates as opposed to using the idea that "A quantity Q growing (or decaying) exponentially according the the law Q= ae^(ct) has a rate of growth (or decay equal to c (or -c) times its current value". Thank you for your time, any help will be greatly appreciated.
$Q = ae^{ct} \implies \dfrac{dQ}{dt} = ae^{ct} * c = cQ.$

The rule is a result of differentiation.

3. Originally Posted by JeffM
$Q = ae^{ct} \implies \dfrac{dQ}{dt} = ae^{ct} * c = cQ.$

The rule is a result of differentiation.
Ah ok, so would the rate be 'c times the current value' rather than c?

4. Thanks for your explanation of the rule. I understand it now and have got the correct order of magnitude.

5. Originally Posted by MathsHelpPlz
Ah ok, so would the rate be 'c times the current value' rather than c?
It is a rate so your answer will $cQ\ mg\ per\ minute$.

c itself is just a dimensionless constant.

6. Originally Posted by JeffM
It is a rate so your answer will $cQ\ mg\ per\ minute$.

c itself is just a dimensionless constant.
Actually, 'ct' is dimensionless - because it is used as ect.

7. Originally Posted by Subhotosh Khan
Actually, 'ct' is dimensionless - because it is used as ect.
Right you are. Do I have to go to the corner?

8. Originally Posted by JeffM
Right you are. Do I have to go to the corner?
You are already in the corner - who let you out??!!

http://www.freemathhelp.com/forum/th...541#post324541


text:
# Chain Rule

• Apr 4th 2010, 04:03 PM
shootie300
Chain Rule
Using the chain rule on the equation...

Ux = -(lnlx)' I'm supposed to get the force of mortality equation

Ux = (-l'x / lx) I've tried three or four times trying to arrive at this conclusion but can't. Can anyone help me out?
• Apr 4th 2010, 04:31 PM
TKHunny
#1 - There is no way you will be able to express much useful actuarial notation without learning some LaTeX. Even WITH LaTeX, it will be a struggle, but we can get through this one.

#2 - Normally, $l_{x}$ is defined only annually. Its derivative tends to be zero unless you take some time to define it between year ends. If you want to talk differences, $d_{x}$, that's a different story. If you have a continuous $l_{x}$, you'll have to state that.

#3 - You probably mean $\mu_{x}(t)\;=\;-\frac{s_{x}'(t)}{s_{x}(t)}$, where s(t) is the survival function for the year of interest. It is continuous and should have a derivative, except maybe at the year ends.

Where does that leave us?
• Apr 4th 2010, 05:30 PM
shootie300
With force of mortality we can express Ux in terms of logarithms by the following....

Ux = -(lnlx)'

using the chain rule on ^^ I'm supposed to be able to see that it's the same as (-l'x / lx).

where -l'x is the rate of change of mortality of the total population aged x.

and lx = the number of lives which have survived to age x

ux = the rate of change of mortality per surviving person.

this all concerns life tables and survival models, Gompertz in particular
• Apr 4th 2010, 06:13 PM
TKHunny
You seem to be repeating yourself.

If you are using Gompertz, then you should have said so in the first place. Gompertz is continuous throughout the lifetime of your population. This is very useful for a theoretical discussion - not so much for practical applications.

Anyway, if $s(x) = l_{x}$ for any integer value of x, and we define $l_{x}$ between integer values as s(x), we are on our way.

First "l'x" is just a really horrible notation. Let's decide not to use it. The differential notation is far less confusing.

Second, we should decide that the force of mortality is ALWAYS positive, otherwise we get resurrections and that's kind of a mess in the Life Insurance business.

Third, one possible version of Gompertz defines the survival probability as $s(x) = ae^{-bx}$ over some reasonable domain and b > 0 and a > 0.

Fourth, the instantaneous change in survival, then, is the first derivative, $s'(x) = -abe^{-bx}$.

Fifth, the instantaneous rate of change (or maybe the rate of change per unit), is the derivative divided by the function. $\frac{s'(x)}{s(x)} = -b$

Sixth, if we want this to be a force of mortality, we'll have to change the sign. $\mu(x) = b$ This should strike you as particularly interesting. What do you think of a force of mortality that is constant throughout the lifetime of the population? Doesn't fit humans very well, does it?

Seventh, and finally, just as a matter of convenience, we can rewrite it as $\mu(x)\;=\;-\frac{d}{dx}ln(s(x))\;=\;-\frac{d}{dx}ln(l_{x})\;=\;-\frac{s'(x)}{s(x)}$. In this form, we can play like we don't know it's constant.

What say you? Are we getting anywhere?
• Apr 4th 2010, 09:13 PM
shootie300
I see the relation between the two and I know how they are related. it's just my professor asked me to perform the chain rule on -d/dx ln(lx) to get to (-l'x/lx) I know I'm just repeating myself but...

whats my g(x) and f(x) so that I can use to perform chain rule

also s'(x) will always be negative thus neg * neg = positive for Ux, on account of were starting from general population of 100,000 and its always decreasing yr by yr


text:
## The Inversion Method (Generating Random Sequences IV)

In the first post of this series, I discussed how to generate permutations of sequences using the Fisher-Yates method and I explained (although indirectly) how a linear congruential generator works. In a second post, I explained how to generate 2D points uniformly and randomly distributed a triangle, discussing the method of rejection. In a third post, I’ve discussed how to generate points on a sphere.

All these methods have something in common: they are based on the uniform (pseudo)random generator, and they map uniform numbers onto a shape (or move numbers around, in the first case). What if we need another density function than uniform?

We discussed the rejection method here, but in a somewhat cursory fashion. It’s worth discussing (I may in a future post) but its iterative nature is not always suitable, and it’s finicky to get right. No, in this post I’m going to discuss the inversion method that may be easier to get right when the density function considered is playing nice. Let met explain.

Let $f(x)$ be a density function that gives the value for $P(X=x)$ for a random variable $X$. It is a function such that $0 \leqslant f(x) \leqslant 1$ for all $x \in R$ (for some range $R$, which may or may not be the reals $\mathbb{R}$) and such that

$\displaystyle\int_R f(x) dx = 1$

The cumulative density function, $F$ (that is a notation taken by many author where the lowercase letter is the density and the uppercase letter the cumulative density), which is the function yielding $P(X\leqslant x)$, is given by:

$\displaystyle F(x)=\int_{L}^x f(t) dt$

where $L$ is the lower bound (or infimum, or $-\infty$, whatever delimits the range $R$ on the left). The function $F(x)$ is monotone non-decreasing, and it may be invertible, that is, $F^{-1}(F(x))$ may exist and return $x$. If it is invertible, then we can use it to generate a random number drawn with density $f(x)$.

The key observation is that $0 \leqslant F(x) \leqslant 1$ for all $x$, and that, therefore, using $0\leqslant u \leqslant 1$ will allow us to access the whole range $R$ through $F^{-1}(u)$. Drawing $0\leqslant u \leqslant 1$ uniformly will make $F^{-1}(u)$ distributed as $f(x)$!

OK, maybe an illustration will make that clear(er):

On the graph, we have $f$ and $F$, which are our density and cumulative density functions, respectively. (let us say that indeed the curve $F$ is the integral of the curve $f$.) We see that three uniformly spaced numbers on the $y$ axis map, through $F^{-1}(u)$ to very different places on the $x$ axis and that the spaces between the points on the $x$ are spaced non-uniformly. The space between $a'$ and $b'$ is such that $F(b')-F(a')=b-a$!

Let us now see how it would work with a real density function, say, the exponential distribution (the example in [2]).

We have

$f(x)=\lambda e^{-\lambda x}$,

for a distribution parameter $\lambda$ (the “rate parameter”, related to the expectation). The cumulative distribution function is

$F(x)=1- e^{-\lambda x}$.

We compute the inverse:

$y=1- e^{-\lambda x}$

$-y+1=e^{-\lambda x}$

$1-y=e^{-\lambda x}$

$\ln(1-y)=-\lambda x$

$\displaystyle-\frac{\ln(1-y)}{\lambda}=x$

We can now feed a function $F^{-1}$ with a uniform generator on $[0,1]$.

*
* *

In Numerical Recipes [2], we find a rather lengthy, but paradoxically terse, discussion on all kind of generators. In [2], the discussion is minimalist, but outlines a few methods correctly. For some distributions, there are better methods than inverses. Especially when the inverse is analytically troublesome. For example, the ziggurat algorithm, a rejection-based algorithm applicable to monotone-decreasing densities (possibly dealing with symmetries), seems to be a runner-up against more traditional methods.

[1] W. H. Press, S. A. Teukolsky, W. T. Vetterling, B. P. Flanner — Numerical Recipes in C: The Art of Scientific Computing — 3rd ed, Cambridge University Press, 2007

[2] S. M. Ross — Introduction to Probability and Statistics for Engineers and Scientists — 3rd ed, Academic Press, 2004

### 3 Responses to The Inversion Method (Generating Random Sequences IV)

1. […] I’ve discussed permutations, generating uniform random points in a triangle, on a sphere, the inversion method, even recycling expensive random bits. In this entry, I will use the rejection method to generate […]

2. nicole says:

I really like your plot, but for clarity, the CDF is generally described as the cumulative distribution function rather than density, which is reserved for the PDF.

3. […] generation of random numbers with a given distribution (as I’ve discussed quite a while ago here). The case we’ll consider here is a random variable with few possible outcomes, each with […]


text:
# Find an integer $x$ satisfying the congruence:

$$x \equiv \ 1 \pmod3$$ $$x \equiv \ 2 \pmod5$$ $$x \equiv \ 8 \pmod{11}$$

From the first, I have $x=3k+1$, $x=5j+2$ from the second and $x=11l+8$ from the third. Subbing the third into the second I get

$11l+8 \equiv 2 \pmod5$
$l \equiv -6\pmod5$
$l \equiv -1\pmod5$

So $l=5m-1$

Subbing back into the third equation I had, I get
$x=11(5m-1)+8=55m-3$

Thus $x \equiv -3\pmod{55}$.

I was only asked to find any integer x which satisfies the system of congruences, so any of x of that form should work; i.e. $x=52$.

I want to know if this is the smallest such $x$ which would work, or could I have approached the question in a different way and arrived at another answer?

If I'd been asked to find the smallest $x$, or all $x$, I'm not sure if this approach would have worked. Is there a way to confirm that this is the smallest such $x$, or that all $x$ of the form $x \equiv -3\pmod{55}$ are the only $x$ which satisfy the system?

-
–  Lucian Apr 11 '14 at 17:14

Java program for proving this

-
Thanks for the code, that's a useful method of verification, but I'm trying to find a solid method to verify by hand that it is the smallest and all other $x$ of the same form are the only solutions; I was worried that feeling my way through by intuition I'd somehow miss some possible values of $x$. –  user142340 Apr 11 '14 at 17:37
No problem, I didn't know how to do this by hand, but I knew I could contribute with this code and a solution to this particular problem. –  Kristoffer Ryhl Apr 11 '14 at 17:56

$2\!-\!5 = \color{#c00}{-3} = 8\!-\!11\,$ so $\,x\equiv \color{#c00}{-3}\,$ mod $\,5,11\!\iff\! x\equiv -3\equiv 52\pmod{55},\,$ and $\,52\equiv1\pmod 3$

-