text:
# R for Biophysical Chemists

This page is a work in progress, in support of Chem 728, Physical Biochemistry, offered by Craig Martin in Spring 2021 at the University of Massachusetts Amherst. It is offered to highlight the narrow set of features in R that are important for concepts developed in this course.

Quick navigation: Basics, Functions, Curve Fitting, Plotting, Importing Data, Files

The R Project for Statistical Computing (or just R) is freely available on essentially all platforms. It is command line driven, but can do complex analyses and create beautiful output. Start by downloading (from a local server) the version of R for your computer. The introduction below will tell us how to manipulate data, create functions, fit data to functions, import data from a file, plot the data and function, and output the plot to a file.

[ Note that you can instead download an alternative commercial program, RStudio (the free version works well: RStudio Desktop – Open Source Edition), that provides an integrated environment for R. The command environment, plots, and other optional things can all be viewed in different parts of one window (I may use this in class for easier sharing of the one window). All of the commands are identical, but some commands are also available from a conventional menu. ]

## Basic Information

File locations. Mostly, we’ll want to read data from a text file, and we’ll want to export data, plots, and sessions to files. The first concept is the working directory. By default, R will set your “root” directory as the working directory. To find out what that current “path” is, type the following at the command line (followed by return): getwd(). The result might be something like /Users/janedoe”

To set your desktop as the working directory, use setwd(“~/Desktop”), (where ~ refers to your default “root” directory, /Users/janedoe), above. To make sure you are in the right place, list.files() will list all of the files in R’s current directory. Finally, although not essential, avoid spaces or special characters in file names [note that setting the working directory is a menu option in RStudio: Session > Set Working directory].

Objects. Data are placed into vector objects, as in any programming language. For example, the following creates objects that contain data:

t <- 0:20
y <- exp(-t/2)

The first command above creates an integer series 0, 1, 2, … 20 and loads it into a new variable t (to generate a series 1.1, 1.2, … 2.4, 2.5 use seq(1.1, 2.5, 0.1)). The second command creates an exponential decay series from the series data in the object t and loads it into y. Note that these expressions can also be written in the more traditional formalism: t = 0:20 and y = exp(-t/2), but we’ll try and keep to the more readable R formalism.

t and y are now “vectors” (a series of values, also known as lists or arrays in other languages). Think of a column of data in Excel as a vector (indeed, we’ll learn below how to read an Excel data column into an R (vector) variable).

The command line. One very useful thing to know is that recent commands are stored and can be retrieved by use of the up arrow key. Bring back a previous command, edit it, and then hit return to execute the edited command.

Quick navigation: Basics, Functions, Curve Fitting, Plotting, Importing Data, Files

## User functions in R

In this course, we will fit data to mechanistic models that are represented mathematically. We don’t want to use a canned (black box) function; we want to use our own function, corresponding to a mechanistic model we are testing. To define a more general exponential decay function in R, we could use:

myExpDecay <- function(texpt, ampl, tau, shft) (shft +(ampl*(exp(-texpt/tau))))

In this function definition, the first parameter in the first set of parentheses is experimental time (our x-value), while the remaining are the function parameters amplitude (ampl), lifetime (tau), and baseline offset (shft). Within the second set of parentheses is the function definition, which follows simple algebraic logic using the given parameters. After defining the function, you can then use:

ExpData <- myExpDecay(t, 5.0, 4.2, 10.0)

Since t is a vector, ExpData will now be a similar vector, but with the exponential decay data loaded into corresponding positions in the vector.

ExpData <- myExpDecay(t,5.0,8.0,10.0) + rnorm(21,mean=0,sd=0.2)

In this case, we use our function, along with the built-in function rnorm to generate “normally distributed” random numbers, to generate “data” with fictitious noise. We’ll learn about plot(x,y) in a minute, but to see how this works, type the following (remember that we defined t above):

plot(t, ExpData)

You should see a scatter plot of of 21 data points, following an exponential decay. We’re now ready to use myExpDecay both to generate some “experimental” data and to fit that data using nonlinear least squares regression.

Quick navigation: Basics, Functions, Curve Fitting, Plotting, Importing Data, Files

## Plotting

Plotting data. There are various plotting “packages” available in R. One of the more feature-rich is ggplot2, but it requires installation and has a steep learning curve. The following describes the use of the primary plotting tool available in the basic install – plot(x,y).

For a simple plot of decay vs time from the above data (remember that we defined t above), use:

plot(t, ExpData)

This should give you a plot as shown here. Remember that t and ExpData are the equal length vectors we defined above.

There are many (optional) options for this command. For example, the above defaults to plotting symbols for each data point.

Plotting curves. To instead plot connected points (with no symbols), use the line type option in the above: plot(t, ExpData, type=”l”))

The R function lines works just like plot, but ADDS a line connecting points to the most recent plot. We can, for example, use our (previously defined above) function to add the theoretical (“noiseless”) curve as a dashed line (see “line type” below):

lines(t,myExpDecay(t,5.0,8.0,10.0),lty=”dashed”)

Or we can ADD the best fit curve to the plot:

lines(t,myExpDecay(t, 4.63, 6.99, 10.34))

Note that you can similarly ADD data points to an existing plot

points(t, ExpDataMore, col=”blue”)

For advice on how to control axes, annotate plots, and more see our intermediate plotting in R, or for more, see this introduction and this reference.

There are many web sites that give you tips on advanced graphics options. You can plot two different sets of data using the same x-axis, but different y-axis scales.

Error Bars. We can ADD error bars to a plot using a more generic tool for drawing arrows.

arrows(x, y-sdev, x, y+sdev, length=0.05, angle=90, code=3)

Residuals. A plot of residuals (observed – best fit predicted, at each point) is valuable to look for systematic deviation. To plot residuals easily (in a new graph):

plot(t, residuals(model), main=”Residuals”, ylab=”Residuals (predicted-experiment”))

When to use bar charts? As an aside, a word about two type of plots that might interest us: bar charts and x,y plots. Bar charts should only be used for data in which the x axis is “quantized” – categories, etc. x,y scatter plots should be used when the x-axis represents a continuous function. For example, you may have measured a time course at 1, 2, 3, 4, 5 … min. Even though these are discrete values, the reaction continued (smoothly) between 1 and 2 min, etc. Bar charts are never appropriate for these data.

Output plots to PDF. To write a plot to a file, you need to 1) open an output “device,” 2) execute the plot command(s), and 3) close the device – as in the example below, where we open the “pdf device” for output.

pdf(“myPlot.pdf”)
plot(t, ExpData)
dev.off()

In place of the single plot command, you can include a series of commands, line by line (for example, adding theoretical or best-fit curves, as above). Just be sure to end them with dev.off(), which writes the final result to the current working directory. Complete documentation for the PDF command can be found at RDocumentation.

[ Note that in RStudio, you can generate a plot, add to it, etc, and when you have it the way you want, you can then save it to PDF or Image (PNG) via Plots > Save as Image/PDF. Previous plots can be cycled through using the forward and backward arrow in the mini menu. ]

There are similar commands for writing to other formats: postscript(“myPlot.ps”), svg(“myPlot.svg”), png(“myPlot.png”), and more. However, note that Powerpoint, Illustrator, and many other programs can insert PDF files, and this is strongly preferred over PNG, as

• the graphics will scale nicely
• the output will have no “jagged edges”
• you can edit the graph in Illustrator

If you must use a bitmapped image, PNG is much better suited to this type of graphics than is JPG.

If you want to edit your file in Illustrator (or Inkscape), some of the plotting point objects might look like letters instead of circles, squares, etc. To avoid this problem use:

pdf(“myPlot.pdf”, useDingbats=FALSE)

Quick navigation: Basics, Functions, Curve Fitting, Plotting, Importing Data, Files

## Importing Data

To import data from a file, there are several options. We’ll use the “data frame” formalism that includes multiple data vectors in one frame. Think of a single column in Excel as one such data vector, and an entire table as the data frame.

The above command will take text data, such as that generated by an instrument or exported from Excel in CSV format (not native Excel), and read the data into a “data.frame” object (to read data directly from Excel files, see this tutorial). A more general command below uses sep= to specify that the data are “comma delimited”:

Columns in this table will have default headings V1, V2, etc. If the first line of your data file has heading information, then use

Now the columns will adopt the names supplied in the first line. Simply type the name of the object (in this case, “dataFrameH”, at the command line and you will get a print out of the data (be careful if your data set is large!). Example output (the first 5 lines) is

t decay x.square
1 0.0 1.000 0.0
2 0.5 0.779 0.3
3 1.0 0.607 1.0
4 1.5 0.472 2.3
5 2.0 0.368 4.0

The very first column (1, 2, 3, 4, 5) is not in the data; it’s just row counters. The vector t is 0.0, 0.5, 1.0, …; the vector decay is 1.000, 0.779, 0.607, …

[ Note that in RStudio, you can import data via the menu File > Import Data Set ]

We can extract vectors by name, as in:

exptime <- dataFrameH$t expdecay <- dataFrameH$decay

where $t and$decay specify those named vectors from our data.frame. The embedded vectors can also be used directly, as in

plot(dataFrameH$t, dataFrameH$decay)

A more object-oriented, and easier to read version of the same command is:

with(dataFrameH, plot(t, decay))

On a related note, should you want to write data to a CSV file, first it is easiest to put your data into a data.frame, using (include as many vectors as you like):

dfexport <- data.frame(t, ExpData)

To write that to a file:

write.csv(dfexport,”~/FileName.csv”, row.names = FALSE)

Quick navigation: Basics, Functions, Curve Fitting, Plotting, Importing Data, Files

## More on files, scripts, sessions

Saving and Reloading a Working Session. After importing data and setting some things up, might not want to have to re-do all of that. Therefore, you can save multiple “objects” (variables, functions, etc) generated during your session to a single file (specify as many as you like!), and then come back later and re-load those objects.

save(exptime, expdecay, dataFrameH, myExpDecay, file=”myWork.rda”)

You can then quit R, and come back, re-open R and use

and begin using exptime, expdecay, dataFrameH, myExpDecay, etc. Remember that in your second session, you need be in (see “setwd” above) your original working directory. To see a list of loaded objects, use the command ls()

[ Note that in RStudio, you can load and save sessions under the Session menu ]

Running scripts. Instead of typing, and re-typing commands, you can run a set of commands (a script) from a simple text file. Just place a series of commands in a file (saved as a text file, not a Word document, etc, and saved in your working directory). Use your favorite text editor – I recommend BBEdit (free version is fine) for Macs or Notepad for Windows. Then to run the entire script, simply enter the following in R:

source(“scriptFile.txt”)

In the same way that you can direct plotting output to a file, you can also direct screen (textual) output to a file. Simply precede those commands with:

sink(“output.txt”, append=FALSE, split=TRUE)

Now all output that would go to your screen will be directed to that file (text, not graphics). append=TRUE adds to the end of an existing file. split=TRUE sends output both to the file and to the screen. To stop future output from going to the file and return to the screen, use:

sink()

Quick navigation: Basics, Functions, Curve Fitting, Plotting, Importing Data, Files


text:
# Are all the asymptotic symmetries always infinite dimensional?

We know that the asymptotic symmetry of AdS$_3$ is the Virasoro symmetry, which is infinite dimensional. For flat spacetimes, the BMS group is also infinite dimensional. So are all the asymptotic symmetries always infinite dimensional? Can someone point out some reference that talks about this? Thank you!

• It's not a stupid question. – JamalS Oct 21 '17 at 1:07

This is not the case. For example, the asymptotic symmetries of asymptotically d+1 dimensional AdS spacetime with standard Dirichlet boundary conditions for $$d\geq 3$$ form the $$SO(d,2)$$ group which is finite dimensional. In general the asymptotic symmetry group strongly depends on the boundary conditions imposed.

format: plain


text:
# Bug#225833: 225833: letter vs A4 in TeX

Florent Rougon <f.rougon@free.fr> wrote:

> Ross Boylan <ross@biostat.ucsf.edu> wrote:
>
>> Anyway, the BOTTOM LINE with the current Debian setup seems to be that
>> if you want to specify page size explicitly, and have that respected
>> by all post-processing tools, you need to use
>> \usepackage[dvips,xxxx]{geometry}, where xxx is the papersize.
>> Apparently xxx can either be "paper=letterpaper" or just
>> "letterpaper".
>
> Even if this works _now_, I think advising users to pass the "dvips"
> option no matter which driver they are using is 1) ugly 2) bound to lead
> to problems later. I'd rather tell them to specify the driver they are
> actually using.

Well, either that, or let geometry choose a working default.  Atsuhito's
analysis made me think that such a default in fact exists.  I looked at
the code of geometry.sty, and I found that geometry does not really care
for the pdftex or vtex options: It detects properly pdftex in PDF mode
or vtex in two of its modes, and sets its internal driver variables
accordingly.  Moreover, there's no difference between the dvips and
dvipdfm specials.

In other words, we have this matrix of actually used driver specials
(dvips <=> dvipdfm):

\  driver
\  option:    dvips     pdftex     vtex     none
-\
\--\
driver  \-\
used      \_______________________________________
|
DVI mode   |   dvips      none      none     none
|
PDF mode   |   pdftex    pdftex     pdftex   pdftex
|
vtex       |   vtex      vtex       vtex     vtex

In other words: It always uses the right driver with pdfTeX in PDF mode
or vtex, with (pdf)TeX in DVI mode, however, it does nothing unless you
specificy "dvips" (or "dvipdfm").  It seems to assume that one might
want to use some other driver (which do exist), and that this driver
will stop working if dvips-type specials are present.

If this is the case, it might make sense for upstream geometry to not
make dvips the default in DVI mode, but I question whether a
distribution like TeX Live or Debian shouldn't choose dvips as the
default for DVI mode in a configuration file.  Users who want to use
other drivers can always remove the configuration setting.

I just tried it with dvilj6, and it seems to work even with dvips-type
specials in the DVI file (and it did the best it could, creating a a5
file that could be printed on our A4 laserjet).  dvilj says: "dvilj:
warning: Invalid keyword or value in \special - <papersize> ignored", so
this seems safe.  I don't have the energy to try many more, in
particular since

Taking this together, I think there *is* a bug, and that is that we do
not have a sensible default set of \special commands in DVI files.  It
could be fixed by simply doing

-%%\ExecuteOptions{a4paper,dvips}
+\ExecuteOptions{dvips}

in geometry.cfg (moving this file below /etc).

Regards, Frank
--
Dr. Frank Küster
Single Molecule Spectroscopy, Protein Folding @ Inst. f. Biochemie, Univ. Zürich
Debian Developer (teTeX/TeXLive)


text:
## iop360 Group Title find the equations of three tangent lines to the graph of y = 4x^3 -40x^2 + 125x - 126 which pass through point (1, -1) (but not on the curve) one year ago one year ago

1. iop360 Group Title

$y = 4x^3 -40x^2 + 125x -126$

2. allank Group Title

Cool question. I'd start by calculating the first derivative of y which will give me the slope of the lines we are looking for.

3. allank Group Title

Can you take it from here?

4. iop360 Group Title

yea

5. allank Group Title

Great. Good luck. :)

6. iop360 Group Title

thanks

7. allank Group Title

You're welcome :)

8. iop360 Group Title

i get $y' = 12x^2 - 80x +125$ what now

9. iop360 Group Title

im supposed to get 3 slopes

10. iop360 Group Title

factor right?

11. iop360 Group Title

$y = (2x-5)(6x-25)$

12. iop360 Group Title

y prime i mean

13. iop360 Group Title

slopes so far are 5/2, 25/6, and...?

14. allank Group Title

Just a sec iop360...

15. iop360 Group Title

actually is that even right?

16. iop360 Group Title

ok

17. allank Group Title

Now, what we want to do is first get the positions where the tangents touch the curve...

18. allank Group Title

Think about it...how would we do that?

19. allank Group Title

Hint: Simultaneous equations.

20. iop360 Group Title

so use m = m with one m representing the first derivative i just calculated and the other m representing rise/run

21. iop360 Group Title

equate the two and solve for x?

22. allank Group Title

Sorry for taking forever to reply...

23. iop360 Group Title

$\frac{ (4x^3 - 40x^2 +125x -126) - (-1) }{ x-1 }= 12x^2 -80x + 125$

24. iop360 Group Title

its alright

25. allank Group Title

Okay, we have the gradient: m = 12x^2-80x+125 and we have a point (1,-1). I'm thinking we can use the general form of an equation of a line: y-y1 = m(x-x1) where y1 and x1 are -1 and 1 respectively, and m is the gradient. I'm not sure whether that will work. Lemme try....

26. iop360 Group Title

we would have to find m first

27. allank Group Title

True. Trying something different...

28. iop360 Group Title

i think i found the slopes, tell me what you have too slope = 0, 5/2, 4

29. allank Group Title

Well, I have used a different method, where I first determine the positions where the tangents touch the curve. Want to finish off and compare answers?

30. iop360 Group Title

ok

31. iop360 Group Title

you mean now find the line equations?

32. allank Group Title

Yep.

33. iop360 Group Title

k

34. iop360 Group Title

y = -1 y = (5/2)x - (7/2) y = 4x - 5

35. iop360 Group Title

doesnt seem right when i graph it...

36. iop360 Group Title

hopefully u have a better one

37. allank Group Title

Well, I've graphed yours and It seems okay. :) My equation is giving me imaginary solutions -_-

38. iop360 Group Title

u graphed mine?

39. allank Group Title

Yep.

40. iop360 Group Title

it doesnt look tangent to the curve

41. allank Group Title

Plotting on a calculator?

42. iop360 Group Title

yes

43. iop360 Group Title

they just all intersect together and dont touch the curve

44. allank Group Title

Darn. Okay, maybe I'm just sleepy to notice that on a computer grapher...so wanna see my method? Though it may not lead to an answer...

45. iop360 Group Title

sure

46. iop360 Group Title

perhaps i should bump this

47. allank Group Title

Okay, so we have the slope m = 12x^2-80x+125. Remember that the value of m depends on the x value on the curve.... Knowing the point (1,-1) , the equation of the tangent(s) will be y+1 = m(x-1) Plugging in m: y = m(x-1)-1 y = (12x^2-80x+125)(x-1) -1 y = 12x^3 - 80x^2 +125x - 12x^2 + 80x -125 - 1 y = 12x^3 - 92x^2 + 205x - 126 (equation 1) So, we have an equation that depends on the very same x value on the curve as the original equation: y = 4x^3 -40x^2 + 125x - 126 (equation 2) Two nice simultaneous equations that will give the x values on the curve where the tangents touch the curve: y = 12x^3 - 92x^2 + 205x - 126 (equation 1) y = 4x^3 -40x^2 + 125x - 126 (equation 2)

48. allank Group Title

I hope I've done the math right. Subtracting the second from the first eliminates y and the 126. y = 12x^3 - 92x^2 + 205x - 126 (equation 1) y = 4x^3 -40x^2 + 125x - 126 (equation 2) 0 = 8x^3 +52x^2 + 330x And solving for x gives x=0 and two other imaginary solutions. *sigh*

49. iop360 Group Title

i see

50. allank Group Title

Do bump @iop360. I'll sleep on it and in case you haven't gotten a valid response by the time I'm awake, I will post the solution.

51. iop360 Group Title

alright

52. iop360 Group Title

ill leave this question open

53. iop360 Group Title

thanks for helping

54. iop360 Group Title

hey, i got the question right! if you want to know how, the values for x i found (0, (5/2), and 4) were actually the x coordinates of the tangents so i plugged these values in the original equation to get their respective y values after that i used each (x,y) coordinates of the three tangents with the given point in the question (1,-1) in the rise/run formula to get the slope for each line

55. iop360 Group Title

plug in the found slopes in point-slope formula and it should be right

56. allank Group Title

Nice. Good job! :)


text:
## Operator Overloading

Operators play an important role in computer programming. By using it, you can change the behavior of an operator based on the types of its arguments.

Operator overloading (less commonly known as ad-hoc polymorphism) is a specific case of polymorphism (part of the OO nature of the language) in which some or all operators like += or == are treated as polymorphic functions and as such have different behaviors depending on the types of its arguments. Operator overloading is usually only syntactic sugar. It can easily be emulated using function calls.

Consider this operation:

add (a,multiply (b,c))

Using operator overloading permits a more concise way of writing it, like this:

a + b * c

(Assuming the * operator has higher precedence than +.)

Operator overloading can provide more than an aesthetic benefit, since the language allows operators to be invoked implicitly in some circumstances. Problems, and critics, to the use of operator overloading arise because it allows programmers to give operators completely free functionality, without an imposition of coherency that permits to consistently satisfy user/reader expectations. Usage of the << operator is an example of this problem.

// The expression
a << 1;

Will return twice the value of a if a is an integer variable, but if  a is an output stream instead this will write "1" to it. Because operator overloading allows the programmer to change the usual semantics of an operator, it is usually considered good practice to use operator overloading with care.

To overload an operator is to provide it with a new meaning for user-defined types. This is done in the same fashion as defining a function. The basic syntax follows (where @ represents a valid operator):

return_type operator@ (parameter_list)
{
// ... definition
}

Not all operators may be overloaded, new operators cannot be created, and the precedence, associativity or arity of operators cannot be changed (for example  ! cannot be overloaded as a binary operator). Most operators may be overloaded as either a member function or non-member function, some, however, must be defined as member functions. Operators should only be overloaded where their use would be natural and unambiguous, and they should perform as expected. For example, overloading + to add two complex numbers is a good use, whereas overloading * to push an object onto a vector would not be considered good style.

 Note: Operator overloading should only be utilized when the meaning of the overloaded operator's operation is unambiguous and practical for the underlying type and where it would offer a significant notational brevity over appropriately named function calls.

A simple Message Header

// sample of Operator Overloading#include <string>class PlMessageHeader{    std::string m_ThreadSender;    std::string m_ThreadReceiver;    //return true if the messages are equal, false otherwise    inline bool operator == (const PlMessageHeader &b) const    {        return ( (b.m_ThreadSender==m_ThreadSender) &&                (b.m_ThreadReceiver==m_ThreadReceiver) );    }    //return true if the message is for name    inline bool isFor (const std::string &name) const    {        return (m_ThreadReceiver==name);    }    //return true if the message is for name    inline bool isFor (const char *name) const    {        return (m_ThreadReceiver==name);// since name type is std::string, it becomes unsafe if name == NULL    }};
 Note: The use of the inline keyword in the example above is technically redundant, as functions defined within a class definition like this are implicitly inline.

#### Operators as member functions

Aside from the operators which must be members, operators may be overloaded as member or non-member functions. The choice of whether or not to overload as a member is up to the programmer. Operators are generally overloaded as members when they:

1. change the left-hand operand, or
2. require direct access to the non-public parts of an object.

When an operator is defined as a member, the number of explicit parameters is reduced by one, as the calling object is implicitly supplied as an operand. Thus, binary operators take one explicit parameter and unary operators none. In the case of binary operators, the left hand operand is the calling object, and no type coercion will be done upon it. This is in contrast to non-member operators, where the left hand operand may be coerced.

// binary operator as member function    //Vector2D Vector2D::operator+(const Vector2D& right)const [...]    // binary operator as non-member function    //Vector2D operator+(const Vector2D& left, const Vector2D& right)[...]    // binary operator as non-member function with 2 arguments     //friend Vector2D operator+(const Vector2D& left, const Vector2D& right) [...]    // unary operator as member function    //Vector2D Vector2D::operator-()const {...}    // unary operator as non-member function[...]    //Vector2D operator-(const Vector2D& vec) [...]

#### Overloadable operators

##### Arithmetic operators
• + (addition)
• - (subtraction)
• * (multiplication)
• / (division)
• % (modulus)

As binary operators, these involve two arguments which do not have to be the same type. These operators may be defined as member or non-member functions. An example illustrating overloading for the addition of a 2D mathematical vector type follows.

Vector2D Vector2D::operator+(const Vector2D& right){    Vector2D result;    result.set_x(x() + right.x());    result.set_y(y() + right.y());    return result;}

It is good style to only overload these operators to perform their customary arithmetic operation. Because operator has been overloaded as member function, it can access private fields.

##### Bitwise operators
• ^ (XOR)
• | (OR)
• & (AND)
• ~ (complement)
• << (shift left, insertion to stream)
• >> (shift right, extraction from stream)

All of the bitwise operators are binary, except complement, which is unary. It should be noted that these operators have a lower precedence than the arithmetic operators, so if ^ were to be overloaded for exponentiation, x ^ y + z may not work as intended. Of special mention are the shift operators, << and >>. These have been overloaded in the standard library for interaction with streams. When overloading these operators to work with streams the rules below should be followed:

1. overload << and >> as friends (so that it can access the private variables with the stream be passed in by references
2. (input/output modifies the stream, and copying is not allowed)
3. the operator should return a reference to the stream it receives (to allow chaining, cout << 3 << 4 << 5)
An example using a 2D vector
friend ostream& operator<<(ostream& out, const Vector2D& vec) // output{    out << "(" << vec.x() << ", " << vec.y() << ")";    return out;}friend istream& operator>>(istream& in, Vector2D& vec) // input{    double x, y;    // skip opening paranthesis    in.ignore(1);    // read x    in >> x;    vec.set_x(x);    // skip delimiter    in.ignore(2);    // read y    in >> y;    vec.set_y(y);    // skip closing paranthesis    in.ignore(1);    return in;}
##### Assignment operator

The assignment operator, =must be a member function, and is given default behavior for user-defined classes by the compiler, performing an assignment of every member using its assignment operator. This behavior is generally acceptable for simple classes which only contain variables. However, where a class contains references or pointers to outside resources, the assignment operator should be overloaded (as general rule, whenever a destructor and copy constructor are needed so is the assignment operator), otherwise, for example, two strings would share the same buffer and changing one would change the other.

In this case, an assignment operator should perform two duties:

1. clean up the old contents of the object
2. copy the resources of the other object

For classes which contain raw pointers, before doing the assignment, the assignment operator should check for self-assignment, which generally will not work (as when the old contents of the object are erased, they cannot be copied to refill the object). Self assignment is generally a sign of a coding error, and thus for classes without raw pointers, this check is often omitted, as while the action is wasteful of cpu cycles, it has no other effect on the code.

Example
class BuggyRawPointer { // example of super-common mistake    T *m_ptr;    public:    BuggyRawPointer(T *ptr) : m_ptr(ptr) {}    BuggyRawPointer& operator=(BuggyRawPointer const &rhs) {        delete m_ptr; // free resource; // Problem here!        m_ptr = 0;        m_ptr = rhs.m_ptr;        return *this;    };};BuggyRawPointer x(new T);x = x; // We might expect this to keep x the same. This sets x.m_ptr == 0. Oops!// The above problem can be fixed like so:class WithRawPointer2 {    T *m_ptr;    public:    WithRawPointer2(T *ptr) : m_ptr(ptr) {}    WithRawPointer2& operator=(WithRawPointer2 const &rhs) {        if (this != &rhs) {            delete m_ptr; // free resource;            m_ptr = 0;            m_ptr = rhs.m_ptr;        }        return *this;    };};WithRawPointer2 x2(new T);x2 = x2; // x2.m_ptr unchanged.

Another common use of overloading the assignment operator is to declare the overload in the private part of the class and not define it. Thus any code which attempts to do an assignment will fail on two accounts, first by referencing a private member function and second fail to link by not having a valid definition. This is done for classes where copying is to be prevented, and generally done with the addition of a privately declared copy constructor

Example
class DoNotCopyOrAssign {    public:        DoNotCopyOrAssign() {};    private:        DoNotCopyOrAssign(DoNotCopyOrAssign const&);        DoNotCopyOrAssign &operator=(DoNotCopyOrAssign const &);};class MyClass : public DoNotCopyOrAssign {    public:        MyClass();};MyClass x, y;x = y; // Fails to compile due to private assignment operator;MyClass z(x); // Fails to compile due to private copy constructor.
##### Relational operators
• == (equality)
• != (inequality)
• > (greater-than)
• < (less-than)
• >= (greater-than-or-equal-to)
• <= (less-than-or-equal-to)

All relational operators are binary, and should return either true or false. Generally, all six operators can be based off a comparison function, or each other, although this is never done automatically (e.g. overloading > will not automatically overload  < to give the opposite). There are, however, some templates defined in the header <utility>; if this header is included, then it suffices to just overload operator == and operator <, and the other operators will be provided by the STL.

##### Logical operators
• ! (NOT)
• && (AND)
• || (OR)

The logical operators AND are used when evaluating two expressions to obtain a single relational result.The operator corresponds to the boolean logical operation AND, which yields true if operands are true, and false otherwise.The following panel shows the result of operator evaluating the expression.

The ! operator is unary, && and || are binary. It should be noted that in normal use, && and || have "short-circuit" behavior, where the right operand may not be evaluated, depending on the left operand. When overloaded, these operators get function call precedence, and this short circuit behavior is lost. It is best to leave these operators alone.

Example
bool Function1();bool Function2();Function1() && Function2();

If the result of Function1() is false, then Function2() is not called.

MyBool Function3();MyBool Function4();bool operator&&(MyBool const &, MyBool const &);Function3() && Function4()

Both Function3() and Function4() will be called no matter what the result of the call is to Function3(). This is a waste of CPU processing, and worse, it could have surprising unintended consequences compared to the expected "short-circuit" behavior of the default operators. Consider:

extern MyObject * ObjectPointer;bool Function1() { return ObjectPointer != null; }bool Function2() { return ObjectPointer->MyMethod(); }MyBool Function3() { return ObjectPointer != null; }MyBool Function4() { return ObjectPointer->MyMethod(); }bool operator&&(MyBool const &, MyBool const &);Function1() && Function2(); // Does not execute Function2() when pointer is nullFunction3() && Function4(); // Executes Function4() when pointer is null
##### Compound assignment operators
• += (addition-assignment)
• -= (subtraction-assignment)
• *= (multiplication-assignment)
• /= (division-assignment)
• %= (modulus-assignment)
• &= (AND-assignment)
• |= (OR-assignment)
• ^= (XOR-assignment)
• <<= (shift-left-assignment)
• >>= (shift-right-assignment)

Compound assignment operators should be overloaded as member functions, as they change the left-hand operand. Like all other operators (except basic assignment), compound assignment operators must be explicitly defined, they will not be automatically (e.g. overloading = and + will not automatically overload +=). A compound assignment operator should work as expected: A @= B should be equivalent to A = A @ B. An example of += for a two-dimensional mathematical vector type follows.

Vector2D& Vector2D::operator+=(const Vector2D& right){    this->x += right.x;    this->y += right.y;    return *this;}
##### Increment and decrement operators
• ++ (increment)
• -- (decrement)

Increment and decrement have two forms, prefix (++i) and postfix (i++). To differentiate, the postfix version takes a dummy integer. Increment and decrement operators are most often member functions, as they generally need access to the private member data in the class. The prefix version in general should return a reference to the changed object. The postfix version should just return a copy of the original value. In a perfect world, A += 1, A = A + 1, A++, ++A should all leave A with the same value.

Example
SomeValue& SomeValue::operator++() // prefix{    ++data;    return *this;}SomeValue SomeValue::operator++(int unused) // postfix{    SomeValue result = *this;    ++data;    return result;}

Often one operator is defined in terms of the other for ease in maintenance, especially if the function call is complex.

SomeValue SomeValue::operator++(int unused) // postfix{    SomeValue result = *this;    ++(*this); // call SomeValue::operator++()    return result;}
##### Subscript operator

The subscript operator, [ ], is a binary operator which must be a member function (hence it takes only one explicit parameter, the index). The subscript operator is not limited to taking an integral index. For instance, the index for the subscript operator for the std::map template is the same as the type of the key, so it may be a string etc. The subscript operator is generally overloaded twice; as a non-constant function (for when elements are altered), and as a constant function (for when elements are only accessed).

##### Function call operator

The function call operator, ( ), is generally overloaded to create objects which behave like functions, or for classes that have a primary operation. The function call operator must be a member function, but has no other restrictions - it may be overloaded with any number of parameters of any type, and may return any type. A class may also have several definitions for the function call operator.

##### Address of, Reference, and Pointer operators

These three operators, operator &(), operator *() and operator ->() can be overloaded. In general these operators are only overloaded for smart pointers, or classes which attempt to mimic the behavior of a raw pointer. The pointer operator, operator->() has the additional requirement that the result of the call to that operator, must return a pointer, or a class with an overloaded operator ->(). In general A == *&A should be true.

Note that overloading operator& invokes undefined behavior:

ISO/IEC 14882:2003, Section 5.3.1
The address of an object of incomplete type can be taken, but if the complete type of that object is a class type that declares operator&() as a member function, then the behavior is undefined (and no diagnostic is required).
Example
class T {    public:        const memberFunction() const;};// forward declarationclass DullSmartReference;class DullSmartPointer {    private:        T *m_ptr;    public:        DullSmartPointer(T *rhs) : m_ptr(rhs) {};        DullSmartReference operator*() const {            return DullSmartReference(*m_ptr);        }        T *operator->() const {            return m_ptr;        }};class DullSmartReference {    private:        T *m_ptr;    public:        DullSmartReference (T &rhs) : m_ptr(&rhs) {}        DullSmartPointer operator&() const {            return DullSmartPointer(m_ptr);        }        // conversion operator        operator T() { return *m_ptr; }};DullSmartPointer dsp(new T);dsp->memberFunction(); // calls T::memberFunctionT t;DullSmartReference dsr(t);dsp = &dsr;t = dsr; // calls the conversion operator

These are extremely simplified examples designed to show how the operators can be overloaded and not the full details of a SmartPointer or SmartReference class. In general you won't want to overload all three of these operators in the same class.

##### Comma operator

The comma operator ,() , can be overloaded. The language comma operator has left to right precedence, the operator ,() has function call precedence, so be aware that overloading the comma operator has many pitfalls.

Example
MyClass operator,(MyClass const &, MyClass const &);MyClass Function1();MyClass Function2();MyClass x = Function1(), Function2();

For non overloaded comma operator, the order of execution will be Function1(), Function2(); With the overloaded comma operator, the compiler can call either Function1(), or Function2() first.

##### Member Reference operators

The two member access operators, operator->() and operator->*() can be overloaded. The most common use of overloading these operators is with defining expression template classes, which is not a common programming technique. Clearly by overloading these operators you can create some very unmaintainable code so overload these operators only with great care.

When the -> operator is applied to a pointer value of type (T *), the language dereferences the pointer and applies the . member access operator (so x->m is equivalent to (*x).m). However, when the -> operator is applied to a class instance, it is called as a unary postfix operator; it is expected to return a value to which the -> operator can again be applied. Typically, this will be a value of type (T *), as in the example under Address of, Reference, and Pointer operators above, but can also be a class instance with operator->() defined; the language will call operator->() as many times as necessary until it arrives at a value of type (T *).

##### Memory management operators
• new (allocate memory for object)
• new[ ] (allocate memory for array)
• delete (deallocate memory for object)
• delete[ ] (deallocate memory for array)

The memory management operators can be overloaded to customize allocation and deallocation (e.g. to insert pertinent memory headers). They should behave as expected, new should return a pointer to a newly allocated object on the heap, delete should deallocate memory, ignoring a NULL argument. To overload new, several rules must be followed:

• new must be a member function
• the return type must be void*
• the first explicit parameter must be a size_t value

To overload delete there are also conditions:

• delete must be a member function (and cannot be virtual)
• the return type must be void
• there are only two forms available for the parameter list, and only one of the forms may appear in a class:
• void*
• void*, size_t
##### Conversion operators

Conversion operators enable objects of a class to be either implicitly (coercion) or explicitly (casting) converted to another type. Conversion operators must be member functions, and should not change the object which is being converted, so should be flagged as constant functions. The basic syntax of a conversion operator declaration, and declaration for an int-conversion operator follows.

operator ''type''() const; // const is not necessary, but is good styleoperator int() const;

Notice that the function is declared without a return-type, which can easily be inferred from the type of conversion. Including the return type in the function header for a conversion operator is a syntax error.

 double operator double() const; // error - return type included

#### Operators which cannot be overloaded

• ?: (conditional)
• . (member selection)
• .* (member selection with pointer-to-member)
• :: (scope resolution)
• sizeof (object size information)
• typeid (object type information)
• static_cast (casting operator)
• const_cast (casting operator)
• reinterpret_cast (casting operator)
• dynamic_cast (casting operator)

To understand the reasons why the language doesn't permit these operators to be overloaded, read "Why can't I overload dot, ::, sizeof, etc.?" at the Bjarne Stroustrup's C++ Style and Technique FAQ ( http://www.stroustrup.com/bs_faq2.html#overload-dot ).

Source: Wikibooks, https://en.wikibooks.org/wiki/C%2B%2B_Programming/Operators/Operator_Overloading
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License.

Last modified: Tuesday, August 31, 2021, 11:40 AM


text:
Compute the probability of Practical Significance (ps), which can be conceptualized as a unidirectional equivalence test. It returns the probability that effect is above a given threshold corresponding to a negligible effect in the median's direction. Mathematically, it is defined as the proportion of the posterior distribution of the median sign above the threshold.

## Usage

p_significance(x, ...)

# S3 method for numeric
p_significance(x, threshold = "default", ...)

# S3 method for stanreg
p_significance(
x,
threshold = "default",
effects = c("fixed", "random", "all"),
component = c("location", "all", "conditional", "smooth_terms", "sigma",
"distributional", "auxiliary"),
parameters = NULL,
verbose = TRUE,
...
)

# S3 method for brmsfit
p_significance(
x,
threshold = "default",
effects = c("fixed", "random", "all"),
component = c("conditional", "zi", "zero_inflated", "all"),
parameters = NULL,
verbose = TRUE,
...
)

## Arguments

x

Vector representing a posterior distribution. Can also be a stanreg or brmsfit model.

...

Currently not used.

threshold

The threshold value that separates significant from negligible effect. If "default", the range is set to 0.1 if input is a vector, and based on rope_range() if a Bayesian model is provided.

effects

Should results for fixed effects, random effects or both be returned? Only applies to mixed models. May be abbreviated.

component

Should results for all parameters, parameters for the conditional model or the zero-inflated part of the model be returned? May be abbreviated. Only applies to brms-models.

parameters

Regular expression pattern that describes the parameters that should be returned. Meta-parameters (like lp__ or prior_) are filtered by default, so only parameters that typically appear in the summary() are returned. Use parameters to select specific parameters for the output.

verbose

Toggle off warnings.

## Value

Values between 0 and 1 corresponding to the probability of practical significance (ps).

## Details

p_significance() returns the proportion of a probability distribution (x) that is outside a certain range (the negligible effect, or ROPE, see argument threshold). If there are values of the distribution both below and above the ROPE, p_significance() returns the higher probability of a value being outside the ROPE. Typically, this value should be larger than 0.5 to indicate practical significance. However, if the range of the negligible effect is rather large compared to the range of the probability distribution x, p_significance() will be less than 0.5, which indicates no clear practical significance.

## Note

There is also a plot()-method implemented in the see-package.

## Examples

library(bayestestR)

# Simulate a posterior distribution of mean 1 and SD 1
# ----------------------------------------------------
posterior <- rnorm(1000, mean = 1, sd = 1)
p_significance(posterior)
#> Practical Significance (threshold: 0.10): 0.80

# Simulate a dataframe of posterior distributions
# -----------------------------------------------
df <- data.frame(replicate(4, rnorm(100)))
p_significance(df)
#> Practical Significance (threshold: 0.10)
#>
#> Parameter |   ps
#> ----------------
#> X1        | 0.51
#> X2        | 0.55
#> X3        | 0.47
#> X4        | 0.47
# \dontrun{
# rstanarm models
# -----------------------------------------------
if (require("rstanarm")) {
model <- rstanarm::stan_glm(mpg ~ wt + cyl,
data = mtcars,
chains = 2, refresh = 0
)
p_significance(model)
}
#> Practical Significance (threshold: 0.60)
#>
#> Parameter   |   ps
#> ------------------
#> (Intercept) | 1.00
#> wt          | 1.00
#> cyl         | 0.98
# }


text:
# Items tagged with functionsfunctions Tagged Items Feed

### How to assign a number explicitly?...

June 22 2010
0 2

Hi friends,

It is a simple question but I got confused... The best way to explain the problem is the example below (I modified my example to make it more clear and easier):

gCount := 1;

hCount := 5;

dCount := 10;

lineCounter := 1;

for k to gCount do

for i to hCount do

for j to dCount do

### How to create For (do) loop in maple 13.02 in a de...

June 05 2010
0 1

Hello everyone,

I want to create a loop in descending order like this: for i from 100 by -0.01 to 0 do ....

I wrote functions trying this logical solution but nothing, please help, it's very important to me to get the answer as soon as possible.

Steve

### 9 functions 9 unknown variables strange answer...

May 25 2010
0 3
Hallo, I have 9 functions and 9 unknown variables. I want to solve these 9 variables. I tried this by defining al the 9 functions and the known variables in maple and the 'solve({Fx1,Fx2....Fxn},{N1,N2.....Nn})' commando. I get an answer but I don't understand what it means: {Fb = 825., Fc = -675., Fd = -2025.-3.Fm, Fe = -2025.-3.Fm, Fj = 1200.+2.Fm, Fk = -2.Fm-1350., Fl = Fm, Fm = Fm, Fr = 250.}. I don't know what they mean with 'Fd = -2025.-3.Fm.' Tanx, Olivier

### Point Plot in Maple...

May 25 2010
0 1

I am trying to add a point to an existing 2d plot, I understand how to plot functions and points but I can't seem to combine them into a single plot.  I am new to maple and still getting use to the functionality.  Any suggestions will be appreciated.

### Sumfunctions of power series ...

May 19 2010
0 10

with convert and FormalPowerSeries one can find power series of some functions. WIth the function int one can sum / make integrals of expressions.

I am new to Maple and have tried finding the sum function of the product of two power series :

in both cases sum of n from 0 to infinity

how to program Maple to find the sum function of f(x), g(x)
and g(x)*(f(x) ?

### ODEs & Maple: graduate-level textbook ...

May 18 2010
0 1

Dear All,

I am looking for a textbook which could be used as a supplementary text for a graduate-level course on ODEs and Dynamical Systems. Ideally, such textbook would feaure numerous examples in Maple, mostly symbolic but with some numerical as well, illustrating certain more advanced topics in the theory of ODEs. Such topics could include stability theory with Lyapunov functions, stable and unstable manifolds, hyperbolic theory, center manifolds and nonlinear stability, periodic orbits and limit cycles, Poincare-Bendixcon theory and phase spaces.

May 09 2010
0 11

On 4th May I submitted Ploting 10 functions to plot mentioning codes with with Mapple.

BR and thanks

mathstudentdk

### differential equation...

May 05 2010
0 1

How can I solve the following differential equations  by using Maple functions and boundary conditions in a parametrical manner(obtaining x)?

### Ploting 10 functions with Mapple...

May 04 2010
0 3
What Mapple code for ploting these ten functions ?

Plot these functions. I need urgwent help with these functions :

A=\sum_{n=[1,infinity]}(3n^{2}+7n+1)^{-n}

B=\sum_{n=[1,infinity]}(-1)^{n}(3n^{2}+7n-1)/(3n^{5}+4n+1)

C=\sum_{n=[1,infinity]}(-1)^{n}(n^{2}+n-1)/(3n^{2}+n)

D=\sum_{n=[1,infinity]}sin((phi/2n)+n(phi))

IF n is uneven E=\sum_{n=[1,infinity]}a=(2/n)

IF n is nevenF=\sum_{n=[1,infinity]}a=(-1/n)

G=\sum_{n=[1,infinity]}(n^{-4)}

H=\sum_{n=[1,100]}(1/3)n^{-3}+\sum_{n=[1,100]}n^{-4}

1. For n = 5 plot I=\int e^{\frac{1}{(1+exp((n(2-x))}}

### 'accessing data' of 3D plot ?...

May 04 2010
0 1
Testing a numerical implementation I want to access data, which are
suggested as maximal errors through plotting (with care) to examine
that in more detail (so plotting is considered just a help)

For univariate functions I am aware how to look into data pairs for
the command plot.

My function is bivariate and real valued.

P:= plot3d( f(x,y), ...) lets me save the result and

op(P);
op(1,P);
arr:=op(3, %);

arr; Arr:=convert(%, Matrix);
plots[matrixplot](Arr, axes=boxed);

### a contour integral...

April 29 2010
0 2

Hi,

I try to calculate a contour integral(in fact it is the contour integral defined in the principle argument theorem) with a function that was given in my earlier entry here

y:=2.0;W:=(2^(z+3/2)*Pi)/(GAMMA(-z/2)*GAMMA(1/2-z/2)):V:=1.0;
f:=1+((abs(V))^2/W^2)*(CylinderD(z,y)^2)*(CylinderD(z,-y)^2-CylinderD(z,y)^2);

I try to use this f in this contour integral as:

phi:=t→exp(I*t);

g:=(diff(f(phi(t)),t)/f(phi(t))) * diff(phi(t),t);

here I give f  (z)/f(z) is g. And

### pde system...

April 26 2010
0 5

I have a set of PDEs & I tried to solve it. First of all I defined some functions as:
H := (diff(a(t, y), t))/a(t, y), Hy := (diff(a(t, y), y))/a(t, y), H1 := diff(H(t, y), t), a1 := diff(a(t, y), t), a2 := diff(a1, t), Hy1 := diff(Hy(t, y), y), ay1 := diff(a(t, y), y), ay2 := diff(ay1, y), n1 := diff(n(t, y), t), n2 := diff(n1, t), ny1 := diff(n(t, y), y), ny2 := diff(ny1, y), pef := -2*n(t, y)^2*Hy1-3*n(t, y)^2*Hy^2-n(t, y)*ny2-2*n(t, y)*Hy*ny1-2*H(t, y)*n1/n(t, y), ρef := 3*n(t, y)^2*Hy1+6*n(t, y)^2*Hy^2, ωef := pef/ρef,

### Assigning and disconnecting the relation between t...

April 20 2010
0 3
Hi every body I have two functions which are aold(x) and anew(x). I am using them to update a function as: For example: aold:=x-> x^2; for i from1 to 5 do anew:=x->aold(x)+x; aold(x):=anew; end do; But it does not work because it cause loop in assigning the function. Also, if I unassign the aold(x) as aold(x):='aold(x)', also anew(x) got unassigned automatically. I am looking for a way to assign anew(x) as anew(x)=aold(x) and after that disconnect the relation between the two functions. Thanks Hamidreza.

### How to integrate...

April 16 2010
0 6

I need to find value of integrals ratio:

int(f2(t),t=0..5.5)/int(f1(t),t=0..5.5),

where the functions f1(t), f2(t) are result of numerical solution of differential equations system:

> restart; with(plots):
> sys:=diff(f1(t),t)=piecewise(t<=4,3*exp(-2*t),-1),
diff(f2(t),t)=sin(t):
init:= f1(0)=1, f2(0)=1:
> F:=dsolve({sys,init}, {f1(t), f2(t)}, numeric);
> Result:=odeplot(F, [[t,f1(t)],[t,f2(t)]], 0..5.5):
> display(Result);

### get coefficients with frontend and "wildcards"...

April 09 2010
0 4

Hi there!

Suppose I have an expression

Expr:=a*f(x[0],...) + b*f(x[1],...) + c*f(x[2],...),  `

where the ellipses represent (different) functions of x[0]..x[2]. I'd like to use frontend to get the coefficients a, b, c corresponding to x[0], x[1] and x[2]. If the function f only has one argument, that's peanuts:

 First 7 8 9 10 11 12 13 Last Page 9 of 43


text:
# Relative Singular Homology

1. Feb 20, 2008

### eastside00_99

Let X be a topological space and let y be a point in X. Denote H'_n(X) be the reduced homology of X and Denote H_n(X,y) the relative homology of X and the one point space {y}.

Prove: H'_n(X) is isomorphic to H_n(X,y).

I have proven that it is true for n>0. But, for n=0, I get H_n(X) isomorphic to H_n(X,y) and since the reduced homology of X is H_n(X) mod integers, I have run into a contradiction. Wikipedia gives my result as a property of relative homology, but my teacher has something different. (Note H_n(X)=H'_n(X) for n>0).

Help?!??!

2. Feb 20, 2008

### Hurkyl

Staff Emeritus
Hrm. When I worked it out, I got the exact sequence

$$0 \to \mathbb{Z} \to H_0(X) \to H_0(X, y) \to 0.$$

Incidentally, note talk page for that wikipedia article. I'm going to edit the wikipedia page to remove confusion.

Last edited: Feb 20, 2008
3. Feb 20, 2008

### eastside00_99

Yeah, I got that exact sequence. But, somehow I wealsed to get the wrong, wikipedia answer, so I probably need to re-check my work! Thanks.

4. Feb 20, 2008

### eastside00_99

ok got it: just use the first isomorphism theorem and that H'_0(X)=H_0(X) modulo integers.

Last edited: Feb 21, 2008
5. Feb 21, 2008

### Hurkyl

Staff Emeritus
Just to make sure -- there are a lot of ways the integers can be mapped into an abelian group. You have to make sure you actually have the same subgroup for the kernel in both!

e.g. the kernel of Z --> Z/2 and Z --> Z/4 are both abelian groups isomorphic to the integers.

6. Feb 21, 2008

### eastside00_99

Actually should it just be

$$H_1(X,y) \to \mathbb{Z} \to H_0(X) \to H_0(X, y) \to 0.$$

If not how did you get the zero?

7. Feb 21, 2008

### eastside00_99

$$0 \to H_1(X) \to H_1(X,y) \to \mathbb{Z} \to H_0(X) \to H_0(X, y) \to 0.$$

So, I am still stuck. No matter how you word it, it boils down to the map from H_1(X) to H_1(X,y) being surjective and the map from H_0(X) to H_0(X,y) being injective. No matter what you need those facts and so I think you have to go the chain complexes and look at how the relative homology and the differential of the chain C_n(X)/C_n(y) are defined. We do know that

C_m(y) iso C_n(y) iso Integers for all m,n>=0. This surely must tell you something about the differential but I have no idea what.

8. Feb 21, 2008

### Hurkyl

Staff Emeritus
I was half-thinking cohomology and had some of the arrows reversed.

Those can't both be true; otherwise the sequence wouldn't be exact at Z.

Anyways, there is a direct description of $H_0(\cdot)$; doesn't it allow you to conclude that $H_0(y) \to H_0(X)$ is monic?

Last edited: Feb 21, 2008
9. Feb 22, 2008

### eastside00_99

Ok, I got it:

$$0 \to H_1(X) \to H_1(X,y) \to \mathbb{Z} \to H_0(X)=C_0(X) \to H_0(X, y)=C_0(X)/C_0(y)=C_0(X)/\mathbb{Z} \to 0.$$

So, right away we have H'_0(X)=H_0(X) module integers = H(X,y). Furthermore, we know that the kernal of the map from is C_0(y) = integers which implies the map from the integers to H_0(X) is injective which implies the image of the map from H_1(X,y) to the integers is 0 which implies we have the exact sequence

$$0 \to H_1(X) \to H_1(X,y) \to 0$$

i.e., H'_1(X) iso to H_1(X,y). the proof for n>1 is trivial.

10. Feb 23, 2008

### Hurkyl

Staff Emeritus
Again, I'd like to point out that "H_0(X) modulo integers" is not well-defined -- for most groups, there are lots of ways to map Z into it. For example, for appropriate choices of a map Z -> Z, each the following sequences are exact:

$$0 \to \mathbb{Z} \to \mathbb{Z} \to 0$$
$$0 \to \mathbb{Z} \to \mathbb{Z} \to \mathbb{Z} / 2 \to 0$$
$$0 \to \mathbb{Z} \to \mathbb{Z} \to \mathbb{Z} / 3 \to 0$$
...

and for most choices of the map Z -> Q, the following sequence is not exact:

$$0 \to \mathbb{Z} \to \mathbb{Q} \xrightarrow{\pi} \mathbb{Q} / \mathbb{Z} \to 0$$

(in fact, it's usually not even a complex!) ($\mathbb{Z}$ is an honest to goodness subgroup of $\mathbb{Q}$, so $\mathbb{Q} / \mathbb{Z}$ makes sense. The map $\mathbb{Q} \xrightarrow{\pi} \mathbb{Q} / \mathbb{Z}$ in the above sequence is the projection map. Other maps could fit there, though!)

So, the fact that you have two exact sequences

$$0 \to \mathbb{Z} \to H_0(X) \to H_0(X, y) \to 0$$

$$0 \to \mathbb{Z} \to H_0(X) \to H'_0(X) \to 0$$

does not imply that you have an isomorphism $H_0(X, y) \cong H'_0(X)$.

Last edited: Feb 23, 2008
11. Feb 23, 2008

### eastside00_99

I agree with you the fact that H_0(X,y) iso H'_0(X) is trivially done by observation--i.e.

H_0(X,y)=C(X)/Z and H_0(X)=C(X) and H'_0(X)=H_0(X)/Z.

12. Feb 23, 2008

### Hurkyl

Staff Emeritus
I'm saying exactly the opposite.

I'm saying:
(1) You cannot conclude H_0(X,y) is isomorphic from H'_0(X) given just the information you presented.

(2) The expressions C(X)/Z and H_0(X)/Z aren't even well defined. It's like writing 0/0 in ordinary arithmetic!

Quotient groups G/H are defined for when H is a subgroup of G. Z is not a subgroup of H_0(X). Z is isomorphic to (many) subgroups of H_0(X); if you pick a specific map $f:\mathbb{Z} \to H_0(X)$, then you can talk about the group $H_0(X) / \im f$. But if you pick another map $g:\mathbb{Z} \to H_0(X)$, then it is possible that $H_0(X) / \mathrm{im\ } f \not\cong H_0(X) / \mathrm{im\ } g$.

Last edited: Feb 23, 2008
13. Feb 23, 2008

### eastside00_99

Yes, yes, all that is true. So, lets concentrate on (2) because that is were the confusion is.

Theorem: H_0(X) = Z + Z + .... +Z (n direct sums of copies of Z where n is the number of connected components of X), and H'_0(X) = H_0(X)/Z (i.e. n-1 direct sums of copies of Z where n is the number of connected components of X).

So, in this way, H_0(X)/Z is well-defined.

Now, consider a point y in X, C_n({y}) is the free abelian group generated by all continuous functions of the form f:delta^n --> {y} where delta^n is the standard n-simplex. In other words C_n({y}) is the free abelian group with one generator. In other words, C_n({y}) iso Z.

So, we have a canonical isomorphism

H_0(X,y)=C_0(X)/C_0(y) = H_0(X)/C_0(y) iso H'_0(X)

as H_0(X) iso n direct sums of Z and C_0(y) iso Z; n direct sums of Z modulo Z iso n-1 direct sums of Z iso H'_0(X).

14. Feb 23, 2008

### Hurkyl

Staff Emeritus
Not really; you've not produced any sort of quotient group. If you chose a specific copy of Z, then you will have a well-defined quotient group H_0(X)/Z -- but that goes back to what I've been saying the whole time: you have to specify the map Z --> H_0(X) before H_0(X)/Z makes sense!

You have not shown that.

Let's assume you are right in saying that $H_0(X, y) \cong H_0(X) / \mathop{\mathrm{image}} \left(C_0(y) \to H_0(X))$, where $C_0(y) \to H_0(X)$ is the map induced by the chain map induced by the inclusion $y \to X$.

You have not shown just what that image is. Suppose that X is path connected, so that $H_0(X) \cong \mathbb{Z}$. What if the map $C_0(y) \to H_0(X)$ is isomorphic to the "multiplication by 2" map $\mathbb{Z} \xrightarrow{\cdot 2} \mathbb{Z}$? In that case, we'd have $H_0(X, y) \cong \mathbb{Z} / 2$. What if it's the zero map? Then we'd have $H_0(X, y) \cong \mathbb{Z}$. Neither of those are isomorphic to $H'_0(X)$.

Last edited: Feb 23, 2008
15. Feb 25, 2008

### eastside00_99

You're right!

I don't think you can prove it this way unless I am missing something. I think you have to show there is a chain homotopy equivalence from the augmented chain complex of C(X) to the chain complexC(X)/C(y). This will induce a isomorphism in homology. I haven't tried this technique yet.

16. Feb 25, 2008

### Hurkyl

Staff Emeritus
Your basic idea is sound; in order to apply it, you simply need to figure out exactly what the map C_0(y) --> H_0(X) is. (and that shouldn't be too difficult)

17. Feb 26, 2008

### WWGD

Hi:

Hope not to distract too much from 00_99's question. Just a general question
on relative homology. Unfortunately, I haven't done much more than simplicial
homology for a while.

I am reading Griffiths and Harris' book:

Given complexes (K*,d) and (J*,d) (with std. meaning: a complex is

a seq. of Abelian groups with a differential d such that d^2=0 ), such

that (K*,d) is a subcomplex of (J*,d) , i.e, for all non-neg. integer p,

all groups J^p<K^p , for all Abelian groups K^p in (K*,d).

Then G&H define the quotient complex :

K*/J* , with "the obvious differential" . What is this "obvious

differential"?.

Now, the only actual case I can think of is that of simplicial

homology, and relative homology, with A<B , where A is a simplicial

subcomplex of B . Then a relative cycle c_p is given

by

C_p(A/B)=C_p(A)/C_p(B)= (by Abelianness)

C_p(A)-C_p(B) (A/B is just meant to stand for A relative to B,

not a topological quotient.)

[c_p]=c_p(+)C_p-1(B) , i.e. just the coset rep. of c_p in the quotient

where C_p-1 is the group of (p-1)-chain maps in B.

And the relative differential d_r s:

d_r([c_p])=d(c_p)(+)C_(p-1)(B)

with d the differential of the original complex.

Is this the generalized formular for relative homology groups, differentials, etc. ?

Thanks.

18. Feb 26, 2008

### Hurkyl

Staff Emeritus
A map of complexes, by definition, commutes with the differential. So if you have a map $f : A^\cdot \to B^\cdot$, then you have commutative squares

$$\begin{array}{ccc} A^n & \xrightarrow{d} & A^{n-1} \\ {}^{{}_f}\!\!\!\downarrow & & {}^{{}_f}\!\!\!\downarrow \\ B^n & \xrightarrow{d} & B^{n-1} \\ \end{array}$$

i.e. for any element $a \in A^n$, f(da) = df(a)

In particular, if A is a subcomplex of B, then this applies to the inclusion $A \to B$ and also to the projection $B \to B/A$. (i.e. if denotes the equivalence class of b, then $d = [db]$)

Last edited: Feb 26, 2008


text:
Journal article Open Access

# Immigration and the Canadian Earnings Distribution in the First Half of the Twentieth Century

Green, Alan G.; Green, David A.

### DCAT Export

<?xml version='1.0' encoding='utf-8'?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:adms="http://www.w3.org/ns/adms#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:dctype="http://purl.org/dc/dcmitype/" xmlns:dcat="http://www.w3.org/ns/dcat#" xmlns:duv="http://www.w3.org/ns/duv#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:frapo="http://purl.org/cerif/frapo/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:gsp="http://www.opengis.net/ont/geosparql#" xmlns:locn="http://www.w3.org/ns/locn#" xmlns:org="http://www.w3.org/ns/org#" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:prov="http://www.w3.org/ns/prov#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:schema="http://schema.org/" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:vcard="http://www.w3.org/2006/vcard/ns#" xmlns:wdrs="http://www.w3.org/2007/05/powder-s#">
<rdf:type rdf:resource="http://www.w3.org/ns/dcat#Dataset"/>
<dct:type rdf:resource="http://purl.org/dc/dcmitype/Text"/>
<dct:identifier rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI">https://zenodo.org/record/895711</dct:identifier>
<foaf:page rdf:resource="https://zenodo.org/record/895711"/>
<dct:creator>
<rdf:Description>
<rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
<foaf:name>Green, Alan G.</foaf:name>
<foaf:givenName>Alan G.</foaf:givenName>
<foaf:familyName>Green</foaf:familyName>
</rdf:Description>
</dct:creator>
<dct:creator>
<rdf:Description>
<rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Agent"/>
<foaf:name>Green, David A.</foaf:name>
<foaf:givenName>David A.</foaf:givenName>
<foaf:familyName>Green</foaf:familyName>
</rdf:Description>
</dct:creator>
<dct:title>Immigration and the Canadian Earnings Distribution in the First Half of the Twentieth Century</dct:title>
<dct:publisher>
<foaf:Agent>
<foaf:name>Zenodo</foaf:name>
</foaf:Agent>
</dct:publisher>
<dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#gYear">2016</dct:issued>
<dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#date">2016-05-18</dct:issued>
<owl:sameAs rdf:resource="https://zenodo.org/record/895711"/>
<skos:notation rdf:datatype="http://www.w3.org/2001/XMLSchema#anyURI">https://zenodo.org/record/895711</skos:notation>
<owl:sameAs rdf:resource="https://doi.org/10.1017/s0022050716000541"/>
<dct:description>We use newly available micro data samples from the 1911, 1921, 1931 and 1941 Canadian Censuses to investigate the impact of immigration on the Canadian earnings distribution in the rst half of the 20th Century. We show that earnings inequality increased dramatically between 1911 and 1941, with most of the change occurring in the 1920s. This coincided with two of largest immigration decades in Canadian history (the 1910s and 1920s) and then the smallest immigration decade (1930s). We nd, however, that immigration was not a prime cause of the increase in inequality in these years. The relative lack of eect arose for three reasons. 1) in the laissez-faire immigration policy before WWI, immigrants self-selected to have an occupational distribution that was similar to that of the native born; 2) in the 1920s, when immigration policy brought in a large number of farm labourers, immigrants adjusted geographically and occupationally after arrival to again end up with an occupational distribution similar to that of the native born; 3) general equilibrium adjustments in the economy helped mitigate the eects of occupation-specic immigrant supply shocks.</dct:description>
<dct:accessRights rdf:resource="http://publications.europa.eu/resource/authority/access-right/PUBLIC"/>
<dct:accessRights>
<rdfs:label>Open Access</rdfs:label>
</dct:RightsStatement>
</dct:accessRights>
<dcat:distribution>
<dcat:Distribution>
<dcat:accessURL rdf:resource="https://zenodo.org/record/895711"/>
</dcat:Distribution>
</dcat:distribution>
<dcat:distribution>
<dcat:Distribution>
<dcat:accessURL>https://doi.org/10.1017/s0022050716000541</dcat:accessURL>
<dcat:byteSize>559725</dcat:byteSize>
<dcat:mediaType>application/pdf</dcat:mediaType>
</dcat:Distribution>
</dcat:distribution>
</rdf:Description>
</rdf:RDF>

696
125
views


text:
# Practice Test

 A) 9 B) 8 C) 7 D) 6

Correct option is A

Explanation :
$1!+2!+3!=1+2+6=9;4!=24;5!=120$$âˆ´$ $n!$ is divided by $12$ for $n>3$. $âˆ´$Required remainder is 9
Don't just read through questions. Boost your exam performance with innovative tools @PREXAM.
Practice → Test → Error Improvement → Gauranteed 5-10% boost in your current score.

SIMILAR QUESTIONS

Q. If x and y are digits such as 17 ! 3556xy4280960000,then x+y equals

Q. Let P(n) be a statement and let P(n) =P(n+1) for all natural number n, then P(n) is true

Q. Which of the following is true

PRACTICE OTHER SUBJECTS ALSO

Chemistry
Physics
Maths


text:
# Elementary charge

Main Article
Discussion
Related Articles  [?]
Bibliography  [?]
Citable Version  [?]

This editable, developed Main Article is subject to a disclaimer.

The term elementary charge, designated e, refers to the magnitude of the electrical charge both on an electron and on a proton. It was first measured by Robert Millikan in 1909 using his famous oil drop experiment. e is regarded as a fundamental physical constant and the current internationally agreed upon value from CODATA stands at:[1]

e = (1.602 176 487 ± 0.000 000 040) x 10-19 coulombs.

As the proton carries a positive charge, the magnitude of its charge is designated +e, whereas the magnitude of the charge on the electron, which carries a negative charge, is designated -e.

Historically the name comes from a period of time before quarks were discovered when e was thought to be the smallest electric charge existing in nature. The discovery of quarks in 1974 showed for the first time that this was not correct and currently the smallest known electric charge is ${\displaystyle e/3}$ (⅓ e), possessed by down quarks. The term elementary charge when referring to an electron charge is therefore scientifically a misnomer. However a property of quarks called confinement means that at low energies quarks are bound into colourless, multiple quark states which have charges that are integer multiples of e and only at high energies, such as top quark decay, do the fractional charges become evident. Thus e is still the smallest electrical charge that will be typically encountered outside the field of particle physics. Current literature continues to refer to e as the elementary charge although it is now also often—and more properly—referred to as the magnitude of the electron charge.[2]

Strictly, at the hierarchical subatomic level of nucleons (protons and neutrons) and electrons, and particles emitted by the nucleus in radioactive processes (e.g., positrons), electrical charge comes in whole units of e, the electron (or proton) charge. Positively charged atoms or compounds carry one or more protons than the number of electrons, and so carry one or more units of +e. Likewise negatively charged atoms or compounds carry one or more electrons than the number of protons, so carry one or more unit of -e. Neutrons, as their name suggests, carry no charge, and therefore are electrically neutral.

## Notes

1. Elementary charge. The NIST reference on constants, units and uncertainty. National Institute of Standards and Technology. Retrieved on 2011-03-28.
2. Particle Data Group W.-M. Yao et al. (2006). "The Review of Particle Physics". Journal of Physics G 33: 1. Table of Physical Constants


text:
×

# SSPLD- Editorial

Setter-Trung Nguyen
Tester- Misha Chorniy
Editorialist- Abhishek Pandey

HARD

# PRE-REQUISITES:

Fast Walsh Hadmard Transformation (Some knowledge about concepts of FFT etc. may aid in understanding), Dynamic Programming with Bitmasking

This editorial will assume you have a knowledge of the pre-requisites.

# PROBLEM:

You are to count number of "$S$ Semi Palindromic" numbers which are less than ${10}^{K}$. A non-negative number is called $S$ Semi Palindrome if its digits can be re-arranged to give a palindromic number.

# QUICK EXPLANATION:

Let $A[i][mask]$ be the matrix of transition where $i$ represents the remainder $\%S$ and $mask$ represent a $XOR-SUM$ of digits as- $XorSum={2}^{d_0}\oplus{2}^{d_1}.....\oplus{2}^{d_k}$. Our answer is $\sum_{i=1}^{K} {A}^{i}$ $-$ but it will count leading zeroes! However, we can easily remove count of leading zeroes if we also store the state $\sum_{i=1}^{K-1} {A}^{i}$. Say matrices $Ans1[][]=\sum_{i=1}^{K} {A}^{i}$ and $Ans2[][]=\sum_{i=1}^{i=K-1} {A}^{i}$. Our final answer will be $(Ans=\sum_{d_i=0}^{9}Ans1[0][{2}^{d_i}]-Ans2[0][({2}^{d_i})\oplus ({2}^{0})])$

# EXPLANATION:

First, lets make a transition matrix, which is initially initialized to hold answer for $K=1$ (i.e. single digit numbers). Hence, the initial state of our transition matrix is-

for (int i=0; i<10; i++) A[i%s][1<< i]=1;

The meaning of $A[i][mask]$ is All numbers, which leave a remainder i when $\%S$ and have the given mask. Note that, mask here is calculated by $Mask={2}^{d_0}\oplus{2}^{d_1}.....\oplus{2}^{d_k}$. This helps in easy semi-palindrome detection, as digits can have values only from $0-9$ and if he do a $xor$ of $\large {2}^{d_i}$, then a semi-palindrome must have mask which is either a power of $2$ , or $0$. Power of $2$ represents a single digit occurring odd number of times (middle digit) while rest occurs even number of times, and a $0$ represents that every digit occurs in multiples of $2$ which makes it possible to re-arrange the number to make it a palindrome.

Our $A[][]$ holds answer for $K=1$ currently. To answer the query, we need $\sum_{i=1}^{K} {A}^{i}$ where ${A}^{i}$ will store answer for numbers of length $i$. This process will also, however, count numbers with leading $0s$ which is undesirable. To compensate for that, we will need the state value of $\sum_{i=1}^{K-1} {A}^{i}$.

But how to find these in first place?

We will be using two tricks.

The first one is Fast Walsh Hadmard Transformation of our transformation matrix $A$ , so that we can compute things faster.

The second one is how we will calculate the polynomials.

Say we have the following values-

• Matrix $T$=$\sum_{i=1}^{P} {A}^{i}$
• Matrix $U$=${A}^{P}$

We need to find $\sum_{i=1}^{2P} {A}^{i}$ from it. What to do?

It turns out to be pretty simple!

We can reformulate $({A}^{2p}+{A}^{2P-1}....{A}^{P+1})+{A}^{P}.....+A$ as-

${A}^{P}({A}^{P}+{A}^{P-1}+....+A)+{A}^{P}+{A}^{P-1}+.....+A$

Which is equivalent to, in terms of our matrices, $UT+T$.

Now, remember that we need $\sum_{i=1}^{K} {A}^{i}$ AND $\sum_{i=1}^{K-1} {A}^{i}$. Hence, lets find upto $\sum_{i=1}^{K-1} {A}^{i}$ using the above logarithmic method. The answer for $\sum_{i=1}^{K} {A}^{i}$ can be easily obtained by multiplying with, and adding $A$ once more to $\sum_{i=1}^{K-1} {A}^{i}$.

Suppose matrix $B$ holds the value of ${A}^{K}$ (equivalent to matrix $U$ of my example.) , matrix $D$ stores values of answering summation, and matrix $A$ holds the value of polynomial, (equivalent to matrix $T$ of my example).
So, our code should look somewhat like this-

for(int i=0;i< s;i++) Fast-Walsh Transform(A[i]); int lim=k-1; while (lim) { if (lim&1) { Multiply_Matrices(D, B, s, r); //s passed to calculate %s Add_Matrices(D, A, s); } for (int i=0; i<s; i++) for (int j=0; j<N; j++) Duplicate[i][j]=A[i][j]; Multiply_Matrices(A, B, s, r); //r is needed in multiplication process. Explained in bonus section. Add_Matrices(A, Duplicate, s); Multiply_Matrices(B, B, s, r); lim>>=1; r<<=1; }

We are almost done!

We have the answer of $\sum_{i=1}^{K-1} {A}^{i}$ stored in matrix $D$. Lets make another matrix $F$ to store the answer for $\sum_{i=1}^{K} {A}^{i}$. Any guesses about $F$ till now?

A=Restore_Original(A);//The transition matrix which stored answer for K=1 length. FWT_Transform_Matrix(A); Multiply_Matrices(D, A, F, s, r);//Multiply D and A, store in F. Add_Matrices(F, A, s);

We are just two steps away from the final answer!

Our first task is to reverse the transformation which we did for faster multiplication and computation of required answer. We have $D=\sum_{i=1}^{K-1} FWT({A}^{i})$ and $F=\sum_{i=1}^{K} FWT({A}^{i})$.

Our next step is to calculate the inverse of this FWT transformation. Once we calculate the inverse, our answer will be of form-

ans=f[0][0]-d[0][1<<0];//Separately for digit 0 for (int i=0; i<=9; i++) ans+=F[0][1<< i]-D[0][(1<< i)^(1<<0)];//For rest of digits from '1'-'9'

Recall that $mask$ must be either $0$ or a ${2}^{i}$. Now, why F[0][1<< i]-D[0][(1<< i)^1] ? The exact reasoning will be clear only when you get acquainted with transition matrices- but I can try giving an intuition on why its right.

We know that matrix $D$ has answer till length $K-1$. One interpretation goes this way. In numbers of length $K-1$ we have some unpaired number (as ${2}^{i}$) and another unpaired $0$. When we added another digit at $MSB$ to get the ans for numbers till length $K$, the $0$ got paired. So naturally, what will that number be? (Please see, this isnt intended to be an "Absolute Mathematical Reasoning" but merely a rough intuition to kind of help get the logic. People are always advised to explore the topic and get the real mathematical reasoning).

The exact definition of functions Multiply_Matrix, Add_Matrix and another way of dealing with number of leading zeroes is discussed in bonus section.

# SOLUTION:

$Setter$ $Solution's$ $Time$ $Complexity-$ $O(2^{10} * S * log(K) * (S + log(2^{10})))$
$Editorial$ $Solution's$ $Time$ $Complexity-$ $O({2}^{10}* {S}^{2} *LogK * log({2}^{10}) )$

# CHEF VIJJU'S CORNER:

View Content

2. Multiply_Matrix Function

View Content

3. Another way of bypassing leading $0's$

View Content
This question is marked "community wiki".

14.8k11856
accept rate: 18%

19.6k349497539

 0 Actually, The complexity is $O(2^{10} * S * log(K) * (S + log(2^{10})))$. answered 18 Apr, 12:33 7★chemthan 191●3 accept rate: 12%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×1,312
×330
×302
×194
×34
×34
×7


text:
HomeEnglishClass 11PhysicsChapterCircular Motion

A simple pendulum of length l ...

# A simple pendulum of length l and bob of mass m is displaced from its equilibrium position O to a position P so that hight of P above O is h . If is then released. What is the tension in the string when the bob passes through the through the equilibrium position O ? Neglect friction. v is the velocity of the bob at O

Step by step solution by experts to help you in doubt clearance & scoring excellent marks in exams.

Updated On: 6-4-2021

Apne doubts clear karein ab Whatsapp par bhi. Try it now.

Watch 1000+ concepts & tricky questions explained!

3.3 K+

100+

Text Solution

m(g+(v^(2))/(l))(2mgh)/(l) mg(1+(h)/(l))mg(1+(2h)/(l))

v^(2)=2gh

 T-mg=(mv^(2))/(l)
 or T=mg+(m(2gh))/(l)
 =mg(1+(2h)/(l))


text:
# In topological groups. Is every neighborhood of $e$ supset of a square of a symmetric neighborhood of $e$?

Let $G$ be a topological group, $U$ is a neighborhood of $e$ which is the unit element of $G$.

My question is does there exist a neighborhood $H \subseteq U$ of $e$ s.t.

1. $H^{-1}=H$
2. $H\cdot H\subseteq U$?

I have tried to found such a $H$ is a subgroup, but in some cases it doesn't work.

-
Yes. Use the continuity of multiplication. Hint: if $V$ contains $e$ then $S := V \cap V^{-1}$ does also and it's symmetric: $S = S^{-1}$. –  KCd Nov 5 '12 at 2:12

Thank to KCd's hint. Let me have a trying.

Proof.

It's harmless to suppose $U$ is open.

Since $G$ is topological group, $\cdot^{-1}[U]$ is open and contains $(e,e)$, hence there is a $A \times B$, in which $A$ and $B$ are both open, contains $(e,e)$ and $\subseteq \cdot^{-1}[U]$. Consequently $V \times V$ is an open neighborhood of $(e,e)$ too, in which $V=(A \cap B) \cap (A \cap B)^{-1}$. Note that $\cdot$ is an open mapping, hence $V \cdot V$ is open. Besides $e \in V \cdot V \subseteq U$ since $(e,e) \in V \times V \subseteq \cdot^{-1}[U]$. Moreover $V^{-1}=V$.

Therefore $V$ satisfies all the conditions required.

$\Box$

-


text:
Tags:
Languages:

# Tag: science

#### Subtle pitfalls of conditional probabilities and the Borel-Kolmogorov paradox

06 Jan 2019 • en 16 min read

It is a non-trivial (and sometimes an ill-posed) task to define conditional probabilities using straightforward formula like $P(B \vert A) = P(A \cap B) / P(A)$. Attempt to gather what I learned myself and taught in the classes.   Read more

#### Our paper in Journal of Theoretical Computer Science

28 Dec 2018 • en 1 min read

Our long paper on posterior agreement was published in J. of TCS   Read more

#### Our ISIT paper accepted

31 Mar 2018 • en 1 min read

Our (together with Joachim Buhmann and Wojciech Szpankowski) submission “Free Energy Asymptotics for Problems With Weak Solution Dependencies” got accepted to this year’s ISIT’18 (International Symposium on Information Theory) in Colorado.   Read more

#### JCSS paper is out!

16 Nov 2017 • en 1 min read

Our JCSS paper (“Robust optimization in the presence of uncertainty: A generic approach”) is out - a nice birthday present btw!   Read more

Want to discuss anything? Comments are welcome via e-mail alexey@gronskiy.com, Telegram @agronskiy or any other social media.

Go to top


text:
Role of kalman filter prior, the 'right' prior?

We can solve the Riccati equation and get the steady state priors for a Kalman filter.

So why are people still allowed to have any prior they want? They can solve Riccati equation ex-ante and use the steady state prior as the initial value, and reach steady state at time 0 rather than time infinity. And this is the only 'right' prior any rational individual would use.

I understand this is a philosophical question, any comment is welcome.


text:
# Tag Info

### Fastest way showing the limit exists without finding the limit?

Write your formulas in a matrix form: $$\begin{bmatrix}a_n\\b_n\end{bmatrix} = \begin{bmatrix}1&1\\r&1\end{bmatrix}\begin{bmatrix}a_{n-1}\\b_{n-1}\end{bmatrix}$$ i.e. $$w_n=Aw_{n-1}$$ ...
• 2,800
Accepted

### Does there exist $x$, $y \in \mathbb{N}$ such that $x^2 − y^2 = 19$

Notice that $19$ is prime. because of this, one of $x-y$ and $x+y$ must be $1$, and the other $19$. Therefore, if we solve the system $x-y = 1, x+y=19$, we can find a solution to this problem. You ...
• 226
Accepted

Accepted

### Does proper contraction on Hilbert space necessarily lead to convergence in norm to zero?

Let $\{a_n\}$ be a sequence of positive real numbers that increases to $1$, with the property that the sequence of products $$a_1,\ a_1a_2,\ a_1a_2a_3,\ a_1a_2a_3a_4,\ \ldots$$ converges to a ...
• 50.5k
Accepted

### Prove that $f(x)=x^2$ is a contraction on each interval in $[0,0.5]$

Remark that $$|f(x)-f(y)| = |(x+y)(x-y)| \leq (|x|+|y|)|x-y| < 2a |x-y|$$ if $x$, $y \in [0,a]$. Now $2a<1$ by assumption.
• 34k
Accepted

### an example of a complete space $X$ and a such mapping $T$ without fixed points & Show that if $X$ is compact then such $T$ has a unique fixed point.

Hint for (a): Apply the Mean Value Theorem to that function you were given. Hint for (b): Since $d(T(x),T(T(x))) < d(x, T(x))$ if $x\ne T(x)$, you must have $\inf d(x,T(x))=0$. (You should ...
• 86.6k
Accepted

### Using connectedness to prove surjectivity...

Let $(x,y)\in\mathbb R^2$ and let $$g: u \mapsto x - f\left(y-f(u)\right)$$ \begin{align} \left|g(u) - g(v)\right|& = \left|x-f(y-f(u)) - x + f(y-f(v))\right|\\ &= \left|f(y-f(u))-f(y-f(v))\...
• 6,068

### Fastest way showing the limit exists without finding the limit?

Again, not sure if this satisfies your criteria, but if we let $f : [0,\infty) \to \mathbb{R}$ by $$f(z) = \frac{r+z}{1+z}$$ then $f$ is decreasing, $0\leq f \leq r$, and $c_{n+1} = f(c_n)$. So if ...
• 145k
Accepted

### prove there is no integer solution to x^2 -6 = 0 by contradiction

Assume an integer solution $x$ such that $x^2 = 6$ exists. An integer is either odd or even. The square of odd $x$ is odd (whereas $6$ is even), so $x$ must be even. Let $x = 2k$, where $k$ is an ...
• 26.1k
Accepted

• 15.3k

### Continuous function from set to proper subset is a contraction

Let $f:[0,1]\to [0,1)$ be given by $f(x)=\frac12\sqrt{x}$. Then the ratio $|f(x)-f(0)|/|x-0|$ grows without bound as $x\to0$.
• 59.5k

### Contraction, doubt on definition

Here they call it a 'contractive mapping', which I think makes no difference with the word 'contraction'. Well, you do not necessarily have fixed points.
• 7,279
Accepted

### Solve differential equation via successive approximations (contraction mapping principle)

Contractractivity on a rectangular domain To apply the fixed-point theorem one needs to fix a domain for the ODE and determine the Lipschitz constant there. In the most simple case the domain is ...
• 114k
You should have gotten a plot like this which gives a visible idea of convergence for $|t|\le 0.5$. Let's consider the interval $|x-1|<1$ in state space in the proof construction of the Picard ...


text:
Register FAQ Calendar Mark Forums Read

 Global Atheist Convention Forum All discussions regarding the AFA's Global Atheist Conventions

#1
7th July 2011, 07:39 AM
 Praxis Here come the drums, here come the drums! Join Date: Jun 2009 Location: Melbourne Posts: 7,327

This thread is for discussions, hints, tips, etc. about accommodation in Melbourne for the GAC2012.

We would ask that you don't hijack the thread or steer it off the rails if you can possibly help it as it will provide a useful resource for people and it would be great if we could keep it for the intended topic.

Thanks everyone

************************************************** **

For starters, here are some useful links:

http://melbournehotelmap.com/convention-center.html

http://www.budgetstay.com.au/

http://www.wotif.com/hotels/cheap-ac...melbourne.html (not sure this will be much use so far in advance but maybe worth a look anyway)

http://www.hotel.com.au/my/Hotels-Ne...bition-Centre/
__________________
I've never been very good at knowing "my place". Well actually I have, it's just never been where you want it to be.
#2
7th July 2011, 11:42 AM
 Podblack AFA Member Join Date: Jan 2009 Location: Perth Posts: 1,220
Re: GAC2012 Accommodation Discussion

• Best Western Atlantis Hotel at 300 Spencer St. Was okay - for $100 it got me a room with no view, basic empty bar fridge, little couch and desk with a chair. For a place to crash, it was good, and a walk down the road from the venue (with the addition that it was nearly exactly on top of the Southern Cross trainstation and the place to get the SkyBus to the airport - hop, zoom, home). Didn't see a place for food and nothing in terms of a menu, so I suspect you'd have to go out and forage if you were so inclined. Basic foraging is easy with one of those 24hr deli things across the road and I got chocolate to get me through the night. • Quality Hotel Batman's Hill on Collins at 623 Collins St. TINY little room, pretty much a triangle on the edge of the building. Had a stand-in bath/shower though. Little desk, wouldn't be able to squeeze in anyone besides myself (whereas one could probably sneak in another person to snooze on the couch at the Atlantis one). Super Bedsaver Deal 2 nights minimum stay, for$90 a day was what I got. No bar fridge, nothing else besides desk, bed, bathroom, which was fine for essentially just a place to crash near the venue. Buffet breakfast was nice though, on the mezzanine level.
• Hilton South Wharf. Right on top of the venue. Lovely. Great way to walk out the front door and be IN the convention centre. It is a Hilton, and therefore you're getting Hilton rates, et al.
• Futher afield (but on the tram lines) - I try to stay at www.drummondapartments.com.au when in Melbourne and it's a lovely area. But would be more for those who don't mind the trek.
#3
7th July 2011, 01:42 PM
 Darwinsbulldog AFA Member Join Date: Jan 2009 Location: Perth Posts: 19,013
Re: GAC2012 Accommodation Discussion

The Melbourne Metro or Melbourne Central YHA's are great for folks on a budget. A private room with on-suite is far cheaper than most hotels and there is a better service and atmosphere. DB and partner are staying at the Metro -unit One of course!
__________________
Just stick to the idea that science tests falsifiable hypotheses to destruction.
#4
7th July 2011, 03:10 PM
 Voltairine There was cheese Join Date: Apr 2011 Location: A pale blue dot Posts: 3,132
Re: GAC2012 Accommodation Discussion

It may seem like this thread was begun prematurely but already the Travelodge Southbank, which some attendees stayed at last year, appears to be fully booked for that weekend.
__________________
...
What, indeed, is an atheist? He is one who destroys delusions which are harmful to humanity in order to lead men back to nature, to reality, to reason. Baron d'Holbach

_____

If we go back to the beginnings of things, we shall always find that ignorance and fear created the gods; that imagination, rapture and deception embellished them; that weakness worships them; that custom spares them; and that tyranny favours them in order to profit from the blindness of men. Baron d'Holbach
#5
7th July 2011, 03:41 PM
 Praxis Here come the drums, here come the drums! Join Date: Jun 2009 Location: Melbourne Posts: 7,327
Re: GAC2012 Accommodation Discussion

Quote:
 Voltairine said It may seem like this thread was begun prematurely but already the Travelodge Southbank, which some attendees stayed at last year, appears to be fully booked for that weekend.
This is true!

The GAC also coincides with the last weekend of the Victorian school holidays (and possibly NSW?) and Easter.

So if you need to book accommodation for the weekend, it is strongly recommended you get in as soon as you can!
__________________
I've never been very good at knowing "my place". Well actually I have, it's just never been where you want it to be.
#6
7th July 2011, 07:00 PM
 Voltairine There was cheese Join Date: Apr 2011 Location: A pale blue dot Posts: 3,132
Re: GAC2012 Accommodation Discussion

(Not that I'm overplanning this or anything but... )

On the MCEC website, it mentions that the Saturday session ends at 5pm and the dinner starts at 7pm. If this is the case, this might influence the choice of hotel (i.e. distance from the MCEC in order slip back to change for the dinner) for those going to both.

Is this so?
__________________
...
What, indeed, is an atheist? He is one who destroys delusions which are harmful to humanity in order to lead men back to nature, to reality, to reason. Baron d'Holbach

_____

If we go back to the beginnings of things, we shall always find that ignorance and fear created the gods; that imagination, rapture and deception embellished them; that weakness worships them; that custom spares them; and that tyranny favours them in order to profit from the blindness of men. Baron d'Holbach
#7
7th July 2011, 09:44 PM
 Lord Blackadder Minister for Religious Genocide Super Moderator Join Date: Mar 2010 Location: Melbourne: a small village on Mars just outside the capital city, Wibble Posts: 5,971
Re: GAC2012 Accommodation Discussion

Quote:
 Voltairine said (Not that I'm overplanning this or anything but... ) On the MCEC website, it mentions that the Saturday session ends at 5pm and the dinner starts at 7pm. If this is the case, this might influence the choice of hotel (i.e. distance from the MCEC in order slip back to change for the dinner) for those going to both. Is this so?
Jeff's Shed (or MCEC for you out of towners) is within very reasonable walking distance from the CBD. There are also three tram routes and two train stations nearby. As long as you are not staying too far out of town, you should be okay.
__________________
If atheism were true, why do cats have pretty stripes on them?
#8
7th July 2011, 10:42 PM
 Podblack AFA Member Join Date: Jan 2009 Location: Perth Posts: 1,220
Re: GAC2012 Accommodation Discussion

I think this was raised last year and it was suggested that using the cloakroom facilities might be useful if people wanted to put on a nicer jacket, or have a better blouse to slip on at the end of the day. I found the cloakroom around the back of the venue, really quite close to all the entry doors. There's lots of toilet facilities around the venue where if you felt you were REALLY pressed, you could change and then just cool your heels with a coffee until it all started.

Really, the way tables were organised to seat people ahead of time and when it started, I don't think it was a rush at all. People mingled a bit, the entertainment started after the food was served and was timed well - even (at the very worst) if you missed your entree, there was so much happening on the night, it didn't matter.

People had mixed dress standards (ranging from the most little black cocktail dress to the usual pair of jeans and an atheist slogan t-shirt). No one cared if you had your shirt from earlier in the day on. Just two minutes with the Chasers' talking about the 'Satan Bus Campaign' was worth it.

I should point out, I'm the kind of person who keeps a little toiletries bag in her desk with a change of top, little bottle of perfume, hairbrush, clips, nicer heels and lipstick so I don't have to go home at the end of the day and return in four hours time to do parent-teacher interviews and it's exactly the same situation. Just pop on a new jacket, wear better shoes that day than usual, put in some nicer earrings and reapply lipstick and you'd be fine. ESPECIALLY if you're a guy, nice earrings on a guy are cute.

[Admission - last time I was in Melbourne, I visited the venue specifically to check out where the powerpoints were for recharging a laptop during the breaks! And I found a prayer room around the corner of the Security office near the cloakroom, which amused me no end.]

Last edited by Podblack; 7th July 2011 at 10:48 PM. Reason: bit more clarification
#9
8th July 2011, 12:37 AM
 Antipotheosis Junior Member Join Date: Mar 2010 Posts: 8
Re: GAC2012 Accommodation Discussion

Assuming that I get everything in order, I may have an empty couch that someone can crash on for free. It's not an open offer yet though... watch this space...

 in West Brunswick...
#10
8th July 2011, 08:05 AM
 Praxis Here come the drums, here come the drums! Join Date: Jun 2009 Location: Melbourne Posts: 7,327
Re: GAC2012 Accommodation Discussion

Quote:
 Antipotheosis said Assuming that I get everything in order, I may have an empty couch that someone can crash on for free. It's not an open offer yet though... watch this space...  in West Brunswick...
Hey!! How are you? Great to see you Hope all is well in Antipotheosis land.
__________________
I've never been very good at knowing "my place". Well actually I have, it's just never been where you want it to be.

 Bookmarks


text:
# Question #97e4c

Jan 26, 2018

#### Answer:

$\text{MgO}$ is the empirical formula.

#### Explanation:

$\text{mol of Mg" = "4.9 g" /"24 g/mol" = "0.2 mol}$

$\text{mol of O" = "3.2 g"/"16 g/mol" = "0.2 mol}$

So the mole ratio is

$0.2 : 0.2 = 1 : 1$

Therefore, $\text{Mg"_1"O"_1 = "MgO}$ is the empirical formula.


text:
# Definition of subobject

In the definition of subobject there is an equivalence relation defined on monomorphisms into a fixed codomain.

My question is that how do we know that the collection of monomorphisms into a fixed codomain is a set?

Is it obvious? or Is it because we can define equivalence relation not only on a set but a class? I don't know.

• We don't, it's not obvious, and we're defining the equivalence relation on a class. This issue crops up already in $\text{Set}$. . – Qiaochu Yuan Jun 3 '14 at 5:18
An example of a category which is not well-powered is the partial order $V \cup \{\infty\}$, where $V$ is some Grothendieck universe and $\infty$ is some new element with $x \leq \infty$ for all $x \in V$.


text:
# SPECTROSCOPY AND RELAXATION KINETICS OF MATRIX ISOLATED CH/D RADICALS

Please use this identifier to cite or link to this item: http://hdl.handle.net/1811/19979

Files Size Format View
2000-WI-06.jpg 125.6Kb JPEG image

 Title: SPECTROSCOPY AND RELAXATION KINETICS OF MATRIX ISOLATED CH/D RADICALS Creators: Burroughs, Amy; Heaven, M. C. Issue Date: 2000 Publisher: Ohio State University Abstract: We have investigated the properties of matrix isolated CD and present a comparison with earlier studies of the CH radical. The CH/D radicals were formed by the microwave dissociation of methane. The products were trapped in solid Ar or Kr at 12 K and investigated using laser excitation and dispersed fluorescence techniques. The $B^{2}\Sigma - X^{2}\Pi$ and $A^{2}\Delta - X^{2}\Pi - B\rightarrow A$ nonradiative transfer. Fluorescence was not detected from CD(B), v = 0, as the the $B\rightarrow A$ transfer process was much faster than radiative decay for this isotope. Difference in the $B\rightarrow A$ energy gaps are responsible for the large difference in the transfer rates of the two isotopes. Excitation spectra yield evidence that CH/D(B) rotates in solid Ar and Kr matrices. Low frequency structure in the B-X(0,0) absorption band changed considerably on H/D isotopic substitution while it was relatively insensitive to the replacement of the matrix material. Absorption spectra for the A-X transition did not show evidence for rotation in the matrix, but it is likely that optical selection rules prevent the observation of rotational structure in this instance. Vibrational relaxation of CH/D(B) is faster for heavier isotope, indicating that vibration to rotation energy transfer is the dominant relaxation mechanism. Description: Work by the National Science Foundation Author Institution: Department of Chemistry of Chemistry, Emory University URI: http://hdl.handle.net/1811/19979 Other Identifiers: 2000-WI-06