text:
# Reference Space¶

This notebook contains example code demonstrating the use of the StructureTree and ReferenceSpace classes. These classes provide methods for interacting with the 3d spaces to which Allen Institute data and atlases are registered.

Unlike the AllenSDK cache classes, StructureTree and ReferenceSpace operate entirely in memory. We recommend using json files to store text and nrrd files to store volumetric images.

## Constructing a StructureTree¶

A StructureTree object is a wrapper around a structure graph - a list of dictionaries documenting brain structures and their containment relationships. To build a structure tree, you will first need to obtain a structure graph.

For a list of atlases and corresponding structure graph ids, see here.

In [1]:
from allensdk.api.queries.ontologies_api import OntologiesApi
from allensdk.core.structure_tree import StructureTree

oapi = OntologiesApi()
structure_graph = oapi.get_structures_with_sets([1])  # 1 is the id of the adult mouse structure graph

# This removes some unused fields returned by the query
structure_graph = StructureTree.clean_structures(structure_graph)

tree = StructureTree(structure_graph)

In [2]:
# now let's take a look at a structure
tree.get_structures_by_name(['Dorsal auditory area'])

Out[2]:
[{'acronym': u'AUDd',
'graph_id': 1,
'graph_order': 122,
'id': 1011,
'name': u'Dorsal auditory area',
'rgb_triplet': [1, 147, 153],
'structure_id_path': [997, 8, 567, 688, 695, 315, 247, 1011],
'structure_set_ids': [112905828, 184527634, 114512891, 12, 167587189]}]

The fields are:

* acronym: a shortened name for the structure
* rgb_triplet: each structure is assigned a consistent color for visualizations
* graph_id: the structure graph to which this structure belongs
* graph_order: each structure is assigned a consistent position in the flattened graph
* id: a unique integer identifier
* name: the full name of the structure
* structure_id_path: traces a path from the root node of the tree to this structure
* structure_set_ids: the structure belongs to these predefined groups

## Using a StructureTree¶

In [3]:
# get a structure's parent
tree.parents([1011])

Out[3]:
[{'acronym': u'AUD',
'graph_id': 1,
'graph_order': 121,
'id': 247,
'name': u'Auditory areas',
'rgb_triplet': [1, 147, 153],
'structure_id_path': [997, 8, 567, 688, 695, 315, 247],
'structure_set_ids': [112905828, 184527634, 3, 12, 114512891]}]
In [4]:
# get a dictionary mapping structure ids to names

name_map = tree.get_name_map()
name_map[247]

Out[4]:
u'Auditory areas'
In [5]:
# ask whether one structure is contained within another

strida = 385
stridb = 247

is_desc = '' if tree.structure_descends_from(385, 247) else ' not'

print( '{0} is{1} in {2}'.format(name_map[strida], is_desc, name_map[stridb]) )

Primary visual area is not in Auditory areas

In [6]:
# build a custom map that looks up acronyms by ids
# the syntax here is just a pair of node-wise functions.
# The first one returns keys while the second one returns values

acronym_map = tree.value_map(lambda x: x['id'], lambda y: y['acronym'])
print( acronym_map[385] )

VISp

This code snippet will download and store a nrrd file containing the Allen Common Coordinate Framework annotation. We have requested an annotation with 25-micron isometric spacing. The orientation of this space is:

* Anterior -> Posterior
* Superior -> Inferior
* Left -> Right

This is the no-frills way to download an annotation volume. See the mouse connectivity examples if you want to properly cache the downloaded data.

In [7]:
import os
import nrrd
from allensdk.api.queries.mouse_connectivity_api import MouseConnectivityApi
from allensdk.config.manifest import Manifest

# the annotation download writes a file, so we will need somwhere to put it
annotation_dir = 'annotation'
Manifest.safe_mkdir(annotation_dir)

annotation_path = os.path.join(annotation_dir, 'annotation.nrrd')

# this is a string which contains the name of the latest ccf version
annotation_version = MouseConnectivityApi.CCF_VERSION_DEFAULT

mcapi = MouseConnectivityApi()

2017-10-18 10:31:52,237 allensdk.api.api.retrieve_file_over_http INFO     Downloading URL: http://download.alleninstitute.org/informatics-archive/current-release/mouse_ccf/annotation/ccf_2017/annotation_25.nrrd

## Constructing a ReferenceSpace¶

In [8]:
from allensdk.core.reference_space import ReferenceSpace

# build a reference space from a StructureTree and annotation volume, the third argument is
# the resolution of the space in microns
rsp = ReferenceSpace(tree, annotation, [25, 25, 25])

## Using a ReferenceSpace¶

The simplest use of a Reference space is to build binary indicator masks for structures or groups of structures.

In [9]:
import matplotlib.pyplot as plt
%matplotlib inline

# A complete mask for one structure

# view in coronal section
fig, ax = plt.subplots(figsize=(10, 10))

Out[9]:
<matplotlib.image.AxesImage at 0x7f8aa098c2d0>

What if you want a mask for a whole collection of ontologically disparate structures? Just pass more structure ids to make_structure_masks:

In [10]:
# This gets all of the structures targeted by the Allen Brain Observatory project
brain_observatory_structures = rsp.structure_tree.get_structures_by_set_id([514166994])
brain_observatory_ids = [st['id'] for st in brain_observatory_structures]

# view in horizontal section
fig, ax = plt.subplots(figsize=(10, 10))

Out[10]:
<matplotlib.image.AxesImage at 0x7f8a9a4e1b50>

You can also make and store a number of structure_masks at once:

In [11]:
import functools

# Define a wrapper function that will control the mask generation.
# This one checks for a nrrd file in the specified base directory
# and builds/writes the mask only if one does not exist

# many_structure_masks is a generator - nothing has actrually been run yet

# consume the resulting iterator to make and write the masks

os.listdir(annotation_dir)

made mask for structure 385.

Out[11]:
['annotation.nrrd', 'structure_385.nrrd', 'structure_1097.nrrd']

#### Removing unassigned structures¶

A structure graph may contain structures that are not used in a particular reference space. Having these around can complicate use of the reference space, so we generally want to remove them.

We'll try this using "Somatosensory areas, layer 6a" as a test case. In the 2016 ccf space, this structure is unused in favor of finer distinctions (e.g. "Primary somatosensory area, barrel field, layer 6a").

In [12]:
# Double-check the voxel counts
no_voxel_id = rsp.structure_tree.get_structures_by_name(['Somatosensory areas, layer 6a'])[0]['id']
print( 'voxel count for structure {0}: {1}'.format(no_voxel_id, rsp.total_voxel_map[no_voxel_id]) )

# remove unassigned structures from the ReferenceSpace's StructureTree
rsp.remove_unassigned()

# check the structure tree
no_voxel_id in rsp.structure_tree.node_ids()

voxel count for structure 12997: 0

Out[12]:
False

#### View a slice from the annotation¶

In [13]:
import numpy as np

fig, ax = plt.subplots(figsize=(10, 10))
plt.imshow(rsp.get_slice_image(1, 5000), interpolation='none')

Out[13]:
<matplotlib.image.AxesImage at 0x7f8a9016cf10>

#### Downsample the space¶

If you want an annotation at a resolution we don't provide, you can make one with the downsample method.

In [14]:
import warnings

target_resolution = [75, 75, 75]

# in some versions of scipy, scipy.ndimage.zoom raises a helpful but distracting
# warning about the method used to truncate integers.
warnings.simplefilter('ignore')

sf_rsp = rsp.downsample(target_resolution)

# re-enable warnings
warnings.simplefilter('default')

print( rsp.annotation.shape )
print( sf_rsp.annotation.shape )

(528, 320, 456)
(176, 107, 152)

Now view the downsampled space:

In [15]:
fig, ax = plt.subplots(figsize=(10, 10))
plt.imshow(sf_rsp.get_slice_image(1, 5000), interpolation='none')

Out[15]:
<matplotlib.image.AxesImage at 0x7f8a900a9ad0>


text:
opennmt.encoders.rnn_encoder module¶

Define RNN-based encoders.

class opennmt.encoders.rnn_encoder.RNNEncoder(num_layers, num_units, cell_class=None, dropout=0.0, residual_connections=False)[source]

Base class for RNN encoders.

__init__(num_layers, num_units, cell_class=None, dropout=0.0, residual_connections=False)[source]

Common constructor to save parameters.

encode(inputs, sequence_length=None, mode='train')[source]

Encodes an input sequence.

Parameters: inputs – The inputs to encode of shape $$[B, T, ...]$$. sequence_length – The length of each input with shape $$[B]$$. mode – A tf.estimator.ModeKeys mode. A tuple (outputs, state, sequence_length).
class opennmt.encoders.rnn_encoder.UnidirectionalRNNEncoder(num_layers, num_units, cell_class=None, dropout=0.3, residual_connections=False)[source]

A simple RNN encoder.

__init__(num_layers, num_units, cell_class=None, dropout=0.3, residual_connections=False)[source]

Initializes the parameters of the encoder.

Parameters: num_layers – The number of layers. num_units – The number of units in each layer. cell_class – The inner cell class or a callable taking num_units as argument and returning a cell. Defaults to a LSTM cell. dropout – The probability to drop units in each layer output. residual_connections – If True, each layer input will be added to its output.
encode(inputs, sequence_length=None, mode='train')[source]

Encodes an input sequence.

Parameters: inputs – The inputs to encode of shape $$[B, T, ...]$$. sequence_length – The length of each input with shape $$[B]$$. mode – A tf.estimator.ModeKeys mode. A tuple (outputs, state, sequence_length).
class opennmt.encoders.rnn_encoder.BidirectionalRNNEncoder(num_layers, num_units, reducer=, cell_class=None, dropout=0.3, residual_connections=False)[source]

An encoder that encodes an input sequence in both directions.

__init__(num_layers, num_units, reducer=, cell_class=None, dropout=0.3, residual_connections=False)[source]

Initializes the parameters of the encoder.

Parameters: num_layers – The number of layers. num_units – The number of units in each layer. reducer – A opennmt.layers.reducer.Reducer instance to merge bidirectional state and outputs. cell_class – The inner cell class or a callable taking num_units as argument and returning a cell. Defaults to a LSTM cell. dropout – The probability to drop units in each layer output. residual_connections – If True, each layer input will be added to its output. ValueError – when using opennmt.layers.reducer.ConcatReducer and num_units is not divisible by 2.
encode(inputs, sequence_length=None, mode='train')[source]

Encodes an input sequence.

Parameters: inputs – The inputs to encode of shape $$[B, T, ...]$$. sequence_length – The length of each input with shape $$[B]$$. mode – A tf.estimator.ModeKeys mode. A tuple (outputs, state, sequence_length).
class opennmt.encoders.rnn_encoder.RNMTPlusEncoder(num_layers=6, num_units=1024, cell_class=None, dropout=0.3)[source]

The RNMT+ encoder described in https://arxiv.org/abs/1804.09849.

__init__(num_layers=6, num_units=1024, cell_class=None, dropout=0.3)[source]

Initializes the parameters of the encoder.

Parameters: num_layers – The number of layers. num_units – The number of units in each RNN layer and the final output. cell_class – The inner cell class or a callable taking num_units as argument and returning a cell. Defaults to a layer normalized LSTM cell. For efficiency, consider using the standard tf.nn.rnn_cell.LSTMCell instead. dropout – The probability to drop units in each layer output.
encode(inputs, sequence_length=None, mode='train')[source]

Encodes an input sequence.

Parameters: inputs – The inputs to encode of shape $$[B, T, ...]$$. sequence_length – The length of each input with shape $$[B]$$. mode – A tf.estimator.ModeKeys mode. A tuple (outputs, state, sequence_length).
class opennmt.encoders.rnn_encoder.GoogleRNNEncoder(num_layers, num_units, dropout=0.3)[source]

The RNN encoder used in GNMT as described in https://arxiv.org/abs/1609.08144.

__init__(num_layers, num_units, dropout=0.3)[source]

Initializes the parameters of the encoder.

Parameters: num_layers – The number of layers. num_units – The number of units in each layer. dropout – The probability to drop units in each layer output. ValueError – if num_layers < 2.
encode(inputs, sequence_length=None, mode='train')[source]

Encodes an input sequence.

Parameters: inputs – The inputs to encode of shape $$[B, T, ...]$$. sequence_length – The length of each input with shape $$[B]$$. mode – A tf.estimator.ModeKeys mode. A tuple (outputs, state, sequence_length).
class opennmt.encoders.rnn_encoder.PyramidalRNNEncoder(num_layers, num_units, reduction_factor=2, cell_class=None, dropout=0.3)[source]

An encoder that reduces the time dimension after each bidirectional layer.

__init__(num_layers, num_units, reduction_factor=2, cell_class=None, dropout=0.3)[source]

Initializes the parameters of the encoder.

Parameters: num_layers – The number of layers. num_units – The number of units in each layer. reduction_factor – The time reduction factor. cell_class – The inner cell class or a callable taking num_units as argument and returning a cell. Defaults to a LSTM cell. dropout – The probability to drop units in each layer output.
encode(inputs, sequence_length=None, mode='train')[source]

Encodes an input sequence.

Parameters: inputs – The inputs to encode of shape $$[B, T, ...]$$. sequence_length – The length of each input with shape $$[B]$$. mode – A tf.estimator.ModeKeys mode. A tuple (outputs, state, sequence_length).
class opennmt.encoders.rnn_encoder.RNNEncoderV2(num_layers, num_units, bidirectional=False, residual_connections=False, dropout=0.3, reducer=, cell_class=None, **kwargs)[source]

A RNN sequence encoder.

Note

TensorFlow 2.0 version.

__init__(num_layers, num_units, bidirectional=False, residual_connections=False, dropout=0.3, reducer=, cell_class=None, **kwargs)[source]

Initializes the parameters of the encoder.

Parameters: num_layers – The number of layers. num_units – The number of units in each layer. bidirectional – Use a bidirectional RNN. residual_connections – If True, each layer input will be added to its output. reducer – A opennmt.layers.reducer.Reducer instance to merge bidirectional state and outputs. dropout – The probability to drop units in each layer output. cell_class – The inner cell class or a callable taking num_units as argument and returning a cell. Defaults to a LSTM cell. **kwargs – Additional layer arguments.
call(inputs, sequence_length=None, training=None)[source]

Encodes an input sequence.

Parameters: inputs – The inputs to encode of shape $$[B, T, ...]$$. sequence_length – The length of each input with shape $$[B]$$. training – Run in training mode. A tuple (outputs, state, sequence_length).
class opennmt.encoders.rnn_encoder.GNMTEncoder(num_layers, num_units, dropout=0.3)[source]

The RNN encoder used in GNMT as described in https://arxiv.org/abs/1609.08144.

Note

TensorFlow 2.0 version.

__init__(num_layers, num_units, dropout=0.3)[source]

Initializes the parameters of the encoder.

Parameters: num_layers – The number of layers. num_units – The number of units in each layer. dropout – The probability to drop units in each layer output. ValueError – if num_layers < 2.

format: plain


text:
HP Prime: Area of a Fan-Shaped Field (Baseball Field)
01-11-2014, 11:04 PM
Post: #1
 Eddie W. Shore Senior Member Posts: 1,384 Joined: Dec 2013
HP Prime: Area of a Fan-Shaped Field (Baseball Field)
Given, lines of various length from a single vertex. The angles between the lines are known.

FANAREA(list of lengths, list of angles in degrees)

The result is a list of two elements.
First element: area of the field
Second element: list: length of the connecting lines

Example:
AT&T Park
Dimensions from Clem's Blog:
http://www.andrewclem.com/Baseball/ATTPark.html

Angles measured with a protractor. So, realistically, my estimate of area is rough.

L1:={339,382,404,399,421,365,309}
L2:={30,6,9,20,9,16}
FANAREA(L1,L2) returns
{109337.870804, {191.1175010192, 46.6352856001, 63.1995292625,
144.030366611, 83.1849883392, 108.96879942}}

Area of the field: approximately 109,337.871

Note: CHAR(10) gives a line break in a string.

Code:
  // Declare Subs SUB1(); SUB2(); EXPORT FANAREA(L1,L2); BEGIN // 2014-01-11 EWS // Area of a field // lines from vertex w/angles LOCAL I,T:=0,L3:=L2; // Degree HAngle:=1; // Validate  IF SIZE(L1)≠SIZE(L2)+1 THEN MSGBOX("Error: Wrong"+CHAR(10) +"Size"+CHAR(10) +"L2≠L1+1"); KILL; END; // Calculation FOR I FROM 1 TO SIZE(L2) DO L3(I):=SUB1(L1(I),L1(I+1),L2(I)); T:=T+SUB2(L1(I),L1(I+1),L3(I)); END; MSGBOX("Area: "+T); RETURN {T, L3}; END; // Law of Cosines SUB1(A,B,C) BEGIN RETURN √(A^2+B^2-2*A*B*COS(C)); END; //Heron's Formula SUB2(A,B,C) BEGIN LOCAL S:=(A+B+C)/2; RETURN √(S*(S-A)*(S-B)*(S-C)); END;

Blog Entry: http://edspi31415.blogspot.com/2014/01/h...field.html
 « Next Oldest | Next Newest »

 Messages In This Thread HP Prime: Area of a Fan-Shaped Field (Baseball Field) - Eddie W. Shore - 01-11-2014 11:04 PM

User(s) browsing this thread: 1 Guest(s)


text:
# A stone is dropped from the top of a cliff

A stone is dropped from the top of a cliff. It is seen to hit the ground below after 3.30 s. How high is the cliff?

## Answers and Replies

Related Classical Physics News on Phys.org
SGT
Use the equations of motion:
$$h = v_0 t + \frac{1}{2}gt^2$$
Where $$v_0$$ is the initial velocity (=0) and g is the acceleration due to gravity.

ZapperZ
Staff Emeritus
Science Advisor
Education Advisor


text:
I want to try adding shadows to a 3D XNA game. I've set up some testing environment with one light and one camera. However, I'm running into artifacts with my approach.

I'm using the shader code from http://pastebin.com/zXi0hmsU to render the final result and http://pastebin.com/rY4Gcj9N to create the shadow maps. The code is pretty straight forward and involves production of the depthmap from the light point of view, then projecting it into the camera space and checking for occlusions.

However, from most angles I am getting pretty ugly results

The scene consists of some simple cubes (constructed by hand, facing outside, backface is culled), one light (shadow map shown in top left corner - looks okay) and one camera.

My RenderTarget for the shadow maps is initialized by

int shadowMapSize = 512;
DepthFormat.Depth24Stencil8);
GraphicsDevice.Clear(Color.White);
GraphicsDevice.DepthStencilState = DepthStencilState.Default;

Afterwards, the CreateShadowMap effect is applied, followed by the LambertWithShadows effect. Finally, the shadow map is drawn using a SpriteBatch.

Rest of the code consists of simply providing the correct values to the shaders. If necessary, I can provide it at well.

This is typical problem called shadow map acne. It is caused because of the projected pixel of the shadow map(depth) is bigger than pixel on the screen (eq. cannot represent depth correctly).

There are plenty of solutions to this. First most easy is bias (i see it in your code, so that is not the problem). And second easy solution is shadow map in bigger resolution, it is really more than typical to have shadowmaps in resolution 2048x2048 on current hw. (EDIT: thats not true, i've wrote that when i was working on movie rendering. In game development, you want to keep you shadow map as small as possible)

Some resources to study more advanced techniques.

edit:

• I have some more materials on this topic in work, if you are interested i will share it too. – Notabene Mar 31 '11 at 19:16
• The main problem with big resolutions is that in the end game I have about 3-4 lights which are undirected => I will have to use cubic shadow maps there, which results in 24 shadowmaps. If you have additional materials, I would really appretiate your effort of sharing it with me :-) – Etan Mar 31 '11 at 21:46
• I am interested at the least if that matters :) – James Mar 31 '11 at 21:48
• @Etan. Yeah omni directional lights are real pain if talkin about shadows. (i know something about it :) gamedev.stackexchange.com/questions/6203/…). Try to use dual paraboloid maps. Or if you like cubemaps, try to save some space by frustum-camera_frustum intersection culling for every face/render. You propably won't need shadow for all directions all the time (especially in exteriors) – Notabene Mar 31 '11 at 22:28
• @Etan @James I added some more stuff for you. Both is worth reading if you are interested on this topic. – Notabene Apr 2 '11 at 19:37


text:
# [luatex] How to color unicode combinging characters.

Philipp Stephani st_philipp at yahoo.de
Fri Mar 18 03:23:01 CET 2011

```Am 18.03.2011 02:39, schrieb Khaled Hosny:
> On Thu, Mar 17, 2011 at 10:25:11PM +0200, Simo Ojala wrote:
>>
>> Hi,
>>
>> I am really just taking my first steps in TeX world, so forgive me
>> problem and I have read and been told that LuaTeX might be able to
>> solve this kind of stuff. So thats why I try to ask this here,
>> hopefully found the right place to post this kind of problem...
>>
>> I am trying to create some ancient hebrew inflection charts and the
>> problem is to be able to paint vowels (and other diacritics) without
>> changing color of the consonants they are combined with. (The vowels
>> are unicode combining characters which are positioned according to
>> and combined with consonants.) I already have got some suggestions
>> that I could do some thing like this:
>>
>> \textcolor{red}{a}\textcolor{blue}{b} % where 'a' represents a
>> consonant and 'b' a vowel
>>
>> However this leads to situation where the characters are not
>> actually combined, but just placed separately to the document. That


text:
Solve the equation by using logarithms

The equation is

$64(12)^{8x} = 195$

the steps I have done so far.

• $12^{8x} = 195/64$
• $8x \cdot \ln(12) = \ln(195/64)$
• $8x = (\ln(195/64))/(\ln(12))$

not sure how to divide $8x$ to get $x$ by itself for the final answer with the ln's

-
Wait a minute --- you've done all the log stuff, now you're down to $8x=A$, and you can't solve that for $x$? –  Gerry Myerson Dec 4 '12 at 23:36
@GerryMyerson that is correct. I took a break from math for about 8 months and I know you divide 8 on both sides, but the ln's are confusing me. –  Tyler Zika Dec 4 '12 at 23:37
Don't let them confuse you! Dividing by $8$ is dividing by $8$, no matter what the other side of the equation looks like. What would you do if it were $8x=93/42$? –  Gerry Myerson Dec 4 '12 at 23:38
@GerryMyerson x = 8(93/42)? –  Tyler Zika Dec 4 '12 at 23:40
@GerryMyerson oh its x = 93/336 –  Tyler Zika Dec 4 '12 at 23:43

when you divide $8x = (\ln(195/64))/\ln(12)$ you get $x = (\ln(195/64))/(\ln(12)(8))$. The 8 only affects the bottom denominator of equation when you divide a fraction. thank you @GerryMyerson
It's better to write $x=\frac{\ln(195/64)}{8\ln(12)}$ using the code $x=\frac{\ln(195/64)}{8\ln(12)}$. See MathJax basic tutorial and quick reference. –  Américo Tavares Dec 5 '12 at 0:15


text:
In [2]:
height <- c(58,59,60,61,62,63,64,65,66, 67, 68, 69, 70, 71, 72)
weight <- c(115,117,120,123,126,129,132,135,139, 142, 146, 150, 154, 159, 164)

In [3]:
htwtmatrix = matrix(c(height,weight),15,2) # what do 15 and 2 refer to?

In [4]:
print(htwtmatrix)
dim(htwtmatrix)
is.array(htwtmatrix)
# even its a matrix it will return TRUE, because matrix also a type of array in 2 dimentional

      [,1] [,2]
[1,]   58  115
[2,]   59  117
[3,]   60  120
[4,]   61  123
[5,]   62  126
[6,]   63  129
[7,]   64  132
[8,]   65  135
[9,]   66  139
[10,]   67  142
[11,]   68  146
[12,]   69  150
[13,]   70  154
[14,]   71  159
[15,]   72  164

1. 15
2. 2
TRUE
In [5]:
# to assign names for each column first convert it into a dataframe
htwtdata = data.frame(htwtmatrix)  # as.dataframe is also works well here
names(htwtdata) = c("height", "weight")
# here we used names() function to assign the names for our dataframe
names(htwtdata)  # here we are extracting the names , names function can be used to set or get the names

1. 'height'
2. 'weight'
In [ ]:
# Let us see how R operates on matrices, and how that compares to data frames
htwtmatrix * 2  # multiplying with 2 gives us result of multiplication on each value
htwtmatrix[, 1]/12  # convert height in inches to feet
mean(htwtmatrix[, 2])  # find mean of weight

In [7]:
dim(htwtdata)
nrow(htwtdata)
str(htwtdata)
summary(htwtdata)

1. 15
2. 2
15
'data.frame':	15 obs. of  2 variables:
$height: num 58 59 60 61 62 63 64 65 66 67 ...$ weight: num  115 117 120 123 126 129 132 135 139 142 ...

     height         weight
Min.   :58.0   Min.   :115.0
1st Qu.:61.5   1st Qu.:124.5
Median :65.0   Median :135.0
Mean   :65.0   Mean   :136.7
3rd Qu.:68.5   3rd Qu.:148.0
Max.   :72.0   Max.   :164.0
In [8]:
htwtdata[,2]*703/htwtdata[,1]^2

1. 24.032401902497
2. 23.6285550129273
3. 23.4333333333333
4. 23.2381080354743
5. 23.0431841831426
6. 22.848828420257
7. 22.6552734375
8. 22.4627218934911
9. 22.4327364554637
10. 22.2379149030965
11. 22.1967993079585
12. 22.1487082545684
13. 22.0942857142857
14. 22.1735766712954
15. 22.2399691358025
In [9]:
# How would you get R to give you the height and weight of the 8th student in the
# data set? The 8th and 10th student?
names(htwtdata)
htwtdata[8,1]  # 8th student height
htwtdata[8,2]  #1 0th student height
htwtdata[10,1]  # 10th student height
htwtdata[10,2]  # 10th student weight

1. 'height'
2. 'weight'
65
135
67
142
heightweight
58 115
59 117
60 120
61 123
62 126
63 129
64 132
65 135
66 139
67 142

# Loops¶

## If/else statements¶

In R, one can write a conditional statement as follows:

ifelse(condition on data, true value returned, false returned)

The above expression reads: if condition on the data is true, then do the true value assigned; otherwise execute the "false value."

In [10]:
ifelse(3 > 4, x <- 5, x <- 6)
print(x)

ifelse(4 > 3, x <- 5, x <- 6)
print(x)

6
[1] 6

5
[1] 5

### Usage of operators like & & , | | , &, |¶

In [11]:
hmean =  mean(htwtdata$height) wmean = mean(htwtdata$weight)
?cat
cat("mean height=",hmean,"\n","mean weight=",wmean)

mean height= 65
mean weight= 136.7333

The operators && and || are often used to denote multiple conditions in an if statement. Whereas &(and) and |(or) apply element-wise to vectors, && and || apply to vectors of length one, and only evaluate their second argument in the sequence if necessary. Thus it is important to remember which logical operator to use in which situation.

In [12]:
ifelse( hmean > 61 && wmean > 120, x <- 5, x <- 6) # multiple conditions in an if statement

5
In [13]:
htwt_cat<-ifelse (height>=70 | weight>159, "high", "low") # apply element-wise to vectors
print(htwt_cat)
is.vector(htwt_cat)

 [1] "low"  "low"  "low"  "low"  "low"  "low"  "low"  "low"  "low"  "low"
[11] "low"  "low"  "high" "high" "high"

TRUE
In [14]:
#htwtdata1<-head(htwtdata,6)
cbind(htwtdata[c(1:3,c(13:15)),],htwt_cat[c(1:3,c(13:15))])
#print(htwtdata1[1:3])

heightweighthtwt_cat[c(1:3, c(13:15))]
158 115 low
259 117 low
360 120 low
1370 154 high
1471 159 high
1572 164 high
In [15]:
htwt_cat[1:6]

1. 'low'
2. 'low'
3. 'low'
4. 'low'
5. 'low'
6. 'low'
In [16]:
htwt_cat <- ifelse(height > 67 || weight > 150, "high", "low")
htwt_cat
# Notice that in the above ifelse statement only the first element in the series was computed.
htwt_cat <- ifelse(height > 57 || weight > 110, "high", "low")
htwt_cat

'low'
'high'
In [17]:
#This can also be extended to include multiple conditions.  Suppose we have the following data:

final_score<- c(39, 51, 60, 65, 72, 78, 79, 83, 85, 85, 87, 89, 91, 95, 96, 97, 100, 100)

passfail<-ifelse(final_score>=60, "pass", "fail")
passfail

1. 'fail'
2. 'fail'
3. 'pass'
4. 'pass'
5. 'pass'
6. 'pass'
7. 'pass'
8. 'pass'
9. 'pass'
10. 'pass'
11. 'pass'
12. 'pass'
13. 'pass'
14. 'pass'
15. 'pass'
16. 'pass'
17. 'pass'
18. 'pass'

# Suppose we want to create a variable called grades that is assigned as follows:¶

"F" if final_score <60

"D" if 60≤final_score<70

"C" if 70≤final_score<80

"B" if 80≤final_score<90

"A" if 90≤final_score

### Nested ifelse Statements¶

We can use a "nested" ifelse command as follows:

In [18]:
grade <- ifelse(final_score < 60, "F", ifelse(final_score < 70, "D", ifelse(final_score <
80, "C", ifelse(final_score < 90, "B", "A"))))

1. 'F'
2. 'F'
3. 'D'
4. 'D'
5. 'C'
6. 'C'
7. 'C'
8. 'B'
9. 'B'
10. 'B'
11. 'B'
12. 'B'
13. 'A'
14. 'A'
15. 'A'
16. 'A'
17. 'A'
18. 'A'

The logic by which this will assign grades is depicted in the figure below.

#if we want to resize the image we can use the below code

### Repetitive Execution: "for" loops, "repeat" and "while"¶

syntax of for loop is:

for (name in expr_1) expr_2

here name is the loop variable, expr_1 is a vector expression, (often a sequence like 1:20), and expr_2 is often a grouped expression with its sub-expressions written in terms of the dummy name. expr_2 is repeatedly evaluated as name ranges through the values in the vector result of expr_1.

In [19]:
# let's take airquality dataset which is the Daily air quality measurements in
# New York, May to September 1973. for the details use
?airquality

In [20]:
# we want to figure out which days were good air quality days (1) or bad air
# quality (0), based on a cutoff of ozone levels above 60ppb.
numdays <- nrow(airquality)
print(numdays)

[1] 153

In [21]:
# creates an object which will store the vector
goodair <- numeric(numdays)
print(goodair)

  [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[38] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[75] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[112] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
[149] 0 0 0 0 0

for(i in 1:numdays)
if (airquality$Ozone[i] > 60) goodair[i] = 0 else goodair[i] = 1  ## (Notice that we have an if statement here within a for loop.)¶ In [ ]: #Does the command above work? Why/why not? #Let's check the Ozone variable. What do you notice below? airquality$Ozone

In [23]:
# When there are missing values, many operations in R fail. One way to get around
# this is to create a new data frame that deletes all the rows corresponding to
# observations with missing rows. This can be done by means of the command
# 'na.omit'
airqualfull = na.omit(airquality)

In [24]:
dim(airqualfull)
dim(airquality)

1. 111
2. 6
1. 153
2. 6
In [25]:
#Now let's try doing this again with the data with the complete cases.
numdays = nrow(airqualfull)
numdays
print(numdays)

111
[1] 111

In [26]:
goodair = numeric(numdays)       # initialize the vector

In [27]:
for(i in 1:numdays)

if (airqualfull$Ozone[i] >60) goodair[i] = 0 else goodair[i] = 1  In [28]: goodair  1. 1 2. 1 3. 1 4. 1 5. 1 6. 1 7. 1 8. 1 9. 1 10. 1 11. 1 12. 1 13. 1 14. 1 15. 1 16. 1 17. 1 18. 1 19. 1 20. 1 21. 1 22. 1 23. 0 24. 1 25. 1 26. 0 27. 1 28. 1 29. 1 30. 1 31. 1 32. 1 33. 1 34. 0 35. 1 36. 1 37. 0 38. 1 39. 0 40. 0 41. 0 42. 0 43. 1 44. 1 45. 1 46. 1 47. 1 48. 0 49. 0 50. 0 51. 1 52. 0 53. 0 54. 1 55. 1 56. 0 57. 1 58. 0 59. 1 60. 1 61. 1 62. 1 63. 0 64. 0 65. 0 66. 1 67. 1 68. 0 69. 1 70. 1 71. 1 72. 1 73. 1 74. 1 75. 1 76. 1 77. 0 78. 0 79. 0 80. 0 81. 0 82. 0 83. 0 84. 0 85. 0 86. 0 87. 1 88. 1 89. 1 90. 1 91. 1 92. 1 93. 1 94. 1 95. 1 96. 1 97. 1 98. 1 99. 1 100. 1 101. 1 102. 1 103. 1 104. 1 105. 1 106. 1 107. 1 108. 1 109. 1 110. 1 111. 1 In [29]: # At this point we might be interested in which days were the ones with good air # quality. The 'which' command returns a set of indices corresponding to the # condition specified. We can then use the indices to find the day of the month # this corresponds to which(goodair == 1) ## notice the double "=" signs!  1. 1 2. 2 3. 3 4. 4 5. 5 6. 6 7. 7 8. 8 9. 9 10. 10 11. 11 12. 12 13. 13 14. 14 15. 15 16. 16 17. 17 18. 18 19. 19 20. 20 21. 21 22. 22 23. 24 24. 25 25. 27 26. 28 27. 29 28. 30 29. 31 30. 32 31. 33 32. 35 33. 36 34. 38 35. 43 36. 44 37. 45 38. 46 39. 47 40. 51 41. 54 42. 55 43. 57 44. 59 45. 60 46. 61 47. 62 48. 66 49. 67 50. 69 51. 70 52. 71 53. 72 54. 73 55. 74 56. 75 57. 76 58. 87 59. 88 60. 89 61. 90 62. 91 63. 92 64. 93 65. 94 66. 95 67. 96 68. 97 69. 98 70. 99 71. 100 72. 101 73. 102 74. 103 75. 104 76. 105 77. 106 78. 107 79. 108 80. 109 81. 110 82. 111 In [30]: goodindices <- which(goodair == 1) airqualfull[goodindices,]  OzoneSolar.RWindTempMonthDay 141 190 7.467 5 1 236 118 8.072 5 2 312 149 12.674 5 3 418 313 11.562 5 4 723 299 8.665 5 7 819 99 13.859 5 8 9 8 19 20.161 5 9 1216 256 9.769 5 12 1311 290 9.266 5 13 1414 274 10.968 5 14 1518 65 13.258 5 15 1614 334 11.564 5 16 1734 307 12.066 5 17 18 6 78 18.457 5 18 1930 322 11.568 5 19 2011 44 9.762 5 20 21 1 8 9.759 5 21 2211 320 16.673 5 22 23 4 25 9.761 5 23 2432 92 12.061 5 24 2823 13 12.067 5 28 2945 252 14.981 5 29 3137 279 7.476 5 31 3829 127 9.782 6 7 4139 323 11.587 6 10 4423 148 8.082 6 13 4721 191 14.977 6 16 4837 284 20.772 6 17 4920 37 9.265 6 18 5012 120 11.573 6 19 ..................... 11131 244 10.978 8 19 11244 190 10.378 8 20 11321 259 15.577 8 21 114 9 36 14.372 8 22 11645 212 9.779 8 24 12847 95 7.487 9 5 12932 92 15.584 9 6 13020 252 10.980 9 7 13123 220 10.378 9 8 13221 230 10.975 9 9 13324 259 9.773 9 10 13444 236 14.981 9 11 13521 259 15.576 9 12 13628 238 6.377 9 13 137 9 24 10.971 9 14 13813 112 11.571 9 15 13946 237 6.978 9 16 14018 224 13.867 9 17 14113 27 10.376 9 18 14224 238 10.368 9 19 14316 201 8.082 9 20 14413 238 12.664 9 21 14523 14 9.271 9 22 14636 139 10.381 9 23 147 7 49 10.369 9 24 14814 20 16.663 9 25 14930 193 6.970 9 26 15114 191 14.375 9 28 15218 131 8.076 9 29 15320 223 11.568 9 30 Suppose we want to define a day with good quality air as one with ozone levels below 60ppb, and temperatures less than 80 degrees F. Write an R loop to do this, and output the resulting subset of the data to a file called goodquality.txt. (Hint: use an ifelse() statement inside the for loop.) In [31]: airquality$Temp

1. 67
2. 72
3. 74
4. 62
5. 56
6. 66
7. 65
8. 59
9. 61
10. 69
11. 74
12. 69
13. 66
14. 68
15. 58
16. 64
17. 66
18. 57
19. 68
20. 62
21. 59
22. 73
23. 61
24. 61
25. 57
26. 58
27. 57
28. 67
29. 81
30. 79
31. 76
32. 78
33. 74
34. 67
35. 84
36. 85
37. 79
38. 82
39. 87
40. 90
41. 87
42. 93
43. 92
44. 82
45. 80
46. 79
47. 77
48. 72
49. 65
50. 73
51. 76
52. 77
53. 76
54. 76
55. 76
56. 75
57. 78
58. 73
59. 80
60. 77
61. 83
62. 84
63. 85
64. 81
65. 84
66. 83
67. 83
68. 88
69. 92
70. 92
71. 89
72. 82
73. 73
74. 81
75. 91
76. 80
77. 81
78. 82
79. 84
80. 87
81. 85
82. 74
83. 81
84. 82
85. 86
86. 85
87. 82
88. 86
89. 88
90. 86
91. 83
92. 81
93. 81
94. 81
95. 82
96. 86
97. 85
98. 87
99. 89
100. 90
101. 90
102. 92
103. 86
104. 86
105. 82
106. 80
107. 79
108. 77
109. 79
110. 76
111. 78
112. 78
113. 77
114. 72
115. 75
116. 79
117. 81
118. 86
119. 88
120. 97
121. 94
122. 96
123. 94
124. 91
125. 92
126. 93
127. 93
128. 87
129. 84
130. 80
131. 78
132. 75
133. 73
134. 81
135. 76
136. 77
137. 71
138. 71
139. 78
140. 67
141. 76
142. 68
143. 82
144. 64
145. 71
146. 81
147. 69
148. 63
149. 70
150. 77
151. 75
152. 76
153. 68
for(i in 1:numdays1)
ifelse(airquality$Ozone[i] <60 & airquality$Temp<80,goodair1[i] = 1,goodair1[i] = 0)
#here it's not working because of "=" sign , let's change to different assignment operator <-

In [32]:
for(i in 1:numdays)
ifelse(airquality$Ozone[i] <60 && airquality$Temp<80,goodair[i] <- 1,goodair[i] <- 0)

In [33]:
goodindices1 <-  which(goodair == 1)
#airquality[goodindices1,]
print(goodindices1)

 [1]   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19
[20]  20  21  22  23  24  25  27  28  29  31  32  33  35  36  38  41  43  44  45
[39]  46  47  48  49  50  51  54  55  57  59  60  61  63  64  67  72  73  74  75
[58]  76  77  78  82  87  88  90  92  93  94  95  97 102 103 104 105 107 108 109
[77] 110 111

In [34]:
airquality[goodindices1,]

OzoneSolar.RWindTempMonthDay
141 190 7.467 5 1
236 118 8.072 5 2
312 149 12.674 5 3
418 313 11.562 5 4
5NA NA 14.356 5 5
628 NA 14.966 5 6
723 299 8.665 5 7
819 99 13.859 5 8
9 8 19 20.161 5 9
10NA 194 8.669 5 10
11 7 NA 6.974 5 11
1216 256 9.769 5 12
1311 290 9.266 5 13
1414 274 10.968 5 14
1518 65 13.258 5 15
1614 334 11.564 5 16
1734 307 12.066 5 17
18 6 78 18.457 5 18
1930 322 11.568 5 19
2011 44 9.762 5 20
21 1 8 9.759 5 21
2211 320 16.673 5 22
23 4 25 9.761 5 23
2432 92 12.061 5 24
25NA 66 16.657 5 25
27NA NA 8.057 5 27
2823 13 12.067 5 28
2945 252 14.981 5 29
3137 279 7.476 5 31
32NA 286 8.678 6 1
.....................
60NA 31 14.977 6 29
61NA 138 8.083 6 30
6349 248 9.285 7 2
6432 236 9.281 7 3
6740 314 10.983 7 6
72NA 139 8.682 7 11
7310 264 14.373 7 12
7427 175 14.981 7 13
75NA 291 14.991 7 14
76 7 48 14.380 7 15
7748 260 6.981 7 16
7835 274 10.382 7 17
8216 7 6.974 7 21
8720 81 8.682 7 26
8852 82 12.086 7 27
9050 275 7.486 7 29
9259 254 9.281 7 31
9339 83 6.981 8 1
94 9 24 13.881 8 2
9516 77 7.482 8 3
9735 NA 7.485 8 5
102NA 222 8.692 8 10
103NA 137 11.586 8 11
10444 192 11.586 8 12
10528 273 11.582 8 13
107NA 64 11.579 8 15
10822 71 10.377 8 16
10959 51 6.379 8 17
11023 115 7.476 8 18
11131 244 10.978 8 19
In [35]:
#export and save the result into working directory with file name as goodquality.txt
write.table(airquality[goodindices1,], "goodquality.txt", sep=",")

In [36]:
# check whether the file exported into working directory
list.files()

1. 'Data Science Process.pdf'
2. 'goodquality.txt'
4. 'sphweb_Stats.ipynb'
In [37]:
#open the file and check the data
file.edit('goodquality.txt')

### To open a pdf file from working directory using package from bioconductor ( general topic)¶

Use the biocLite.R script to install Bioconductor packages.
To install core packages, type the following in an R command window:

source("https://bioconductor.org/biocLite.R")
biocLite("Biobase")
#to install packages from bioconductor
#try http:// if https:// URLs are not supported

In [38]:
library(Biobase)
openPDF("Data Science Process.pdf")

Loading required package: BiocGenerics

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
clusterExport, clusterMap, parApply, parCapply, parLapply,
parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

The following objects are masked from 'package:base':

anyDuplicated, append, as.data.frame, cbind, colnames, do.call,
duplicated, eval, evalq, Filter, Find, get, grep, grepl, intersect,
is.unsorted, lapply, lengths, Map, mapply, match, mget, order,
paste, pmax, pmax.int, pmin, pmin.int, Position, rank, rbind,
Reduce, rownames, sapply, setdiff, sort, table, tapply, union,
unique, unsplit

Welcome to Bioconductor

Vignettes contain introductory material; view with
'browseVignettes()'. To cite Bioconductor, see
'citation("Biobase")', and for packages 'citation("pkgname")'.

TRUE

### While Statements & REPEAT¶

Similar to a loop function, the while statement can be used to perform an operation while a given condition is true. For example:

In [39]:
z <- 0

while (z < 5) {

z <- z + 2

print(z)

}

[1] 2
[1] 4
[1] 6

In the above while statement we initiate z to have a value of 0. We then state that as long as z is less than 5 we will continue to perform the following loop operation z<-z+2. Thus we have

z <- 0+2  ##Initially z is 0, but after the first iteration of the loop the value of z is 2

z <- 2+2  ## After the second iteration the value of z is 4

z <- 4+2  ## After the third iteration the value of z is 6

The while statement stops here because now z is now bigger than 5.

### repeat exercies¶

In [40]:
#Another option for looping is the repeat function. An example follows:
i<-1

repeat{

print(i)

if( i == 15) break

i<-i+1

}

[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
[1] 6
[1] 7
[1] 8
[1] 9
[1] 10
[1] 11
[1] 12
[1] 13
[1] 14
[1] 15

In [41]:
x <- 1
repeat{
print(x)
x <- x+1
if (x == 6){
break
}

}

[1] 1
[1] 2
[1] 3
[1] 4
[1] 5

In [42]:
# For the first exercise, write a repeat{} loop that prints all the even numbers
# from 2 <U+0096> 10, via incrementing the variable, <U+0093>i <- 0<U+0093>.
i <- 0
repeat {
i <- i + 2
print(i)
if (i == 10)
break
}

[1] 2
[1] 4
[1] 6
[1] 8
[1] 10

# Using the following variables:¶

msg <- c('Hello')
i <- 1

Write a repeat{} loop that breaks off the incrementation of, i, after 5 loops, andz prints msg at every increment.

In [43]:
msg <- c("Hello")
i <- 1

repeat {
i <- i + 1
print(msg)
if (i == 5) {break}
}

[1] "Hello"
[1] "Hello"
[1] "Hello"
[1] "Hello"

In [44]:
msg <- c('Hello')
i <- 1
repeat{
print(msg)
i <- i +1
if (i == 5)break
}

[1] "Hello"
[1] "Hello"
[1] "Hello"
[1] "Hello"

### while exercises¶

In [45]:
#With, i <- 1, write a while() loop that prints the odd numbers from 1 through 7.
i <- 1
while(i<=7){
print(i)
i <- i +2
}

[1] 1
[1] 3
[1] 5
[1] 7

In [46]:
#Write a while() loop that increments the variable, “i“, 6 times, and prints “msg” at every iteration.
i <- 1
while(i<=6){
print(msg)
i <- i +1
}

[1] "Hello"
[1] "Hello"
[1] "Hello"
[1] "Hello"
[1] "Hello"
[1] "Hello"

### for loop exercises¶

#### examples:¶

for(i in 1:4) {
print("variable"[i])
}

In [53]:
a <- c(15,23,78,45,124,82,75)
for (i in 1:4){
print(a[i])
}

[1] 15
[1] 23
[1] 78
[1] 45

for(i in seq("variable")) {
print(i)
}

In [54]:
for (i in seq(a)){
print(i)
}

[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
[1] 6
[1] 7

for(i in seq_along("variable")) {
print("variable"[i])
}

In [55]:
for (i in seq_along(a)){
print(a[i])
}

[1] 15
[1] 23
[1] 78
[1] 45
[1] 124
[1] 82
[1] 75

for(letter in "variable") {
print(letter)

In [60]:
a <- "Last Checkpoint: 16 hours ago (unsaved changes)"
for (letter in 2){
print(letter)
}

[1] 2

In [ ]:
# Create a vector filled with random normal values
u1 <- rnorm(30)
print("This loop calculates the square of the first 10 elements of vector u1")

# Initialize usq
usq <- 0

for(i in 1:10) {
# i-th element of u1 squared into i-th position of usq
usq[i] <- u1[i]*u1[i]
print(usq[i])
}

print(i)


text:
# The Wrecked Rectangle

Geometry Level 4

A mathematician has a rectangle of length 5, width 4. His physicist friend phones him up with a problem involving this rectangle, but the sides have been scaled down by a factor of $$\sqrt { 10 }$$. The physicist asks the mathematician to determine the area of the rectangle, for her to use in her calculations.

The mathematician does the calculation, but decides to test the physicist and gives his answer in the form:

$\sqrt { x\sqrt { y\sqrt { x\sqrt { y\sqrt { x\sqrt { y\sqrt { x... } } } } } } }.$

where $$x$$ and $$y$$ are positive integers.

What is the sum of all possible values of x and y that the mathematician could have given to the physicist?

×


text:
## goformit100 2 years ago A surveyor measures the distance across a straight river by the following method: Starting directly across from a tree on the opposite bank, she walks 100 m along the riverbank to establish a baseline. Then she sights across to the tree. The angle from her baseline to the tree is 35.0°. How wide is the river?

1. goformit100

WTH ,You copy+paste !!!

4. terenzreignz

I will kill myself if I'm ever asked to do this mentally... or maybe I'll kill the instructor :P JK

5. goformit100

@Eyad Sir Sir Vector is among the weakest chapter of mine

@terenzreignz will do it ?

7. terenzreignz

Who needs vectors? |dw:1367154306851:dw|

8. goformit100

ok

Use Trig .

10. terenzreignz

The surveyor starts here...|dw:1367154405038:dw|

11. goformit100

ok

12. terenzreignz

Moves 100 metres.... So that the angle to the tree is 35 degrees|dw:1367154463542:dw|

13. terenzreignz

So... finding that question marked value should be a cinch... :)

14. terenzreignz

Still blanked? $\Large \tan(35^o)=\frac{?}{100}$

15. goformit100

ok its easy for me now I can do it now :) Thanks

16. terenzreignz

Awesome :)


text:
# How to show that det(A)≤1?

Let $A = (a_{ij})_n$ where $a_{ij} \ge 0$ for $i,j=1,2,\ldots,n$ and $\sum_{j=1}^n a_{ij} \le 1$ for $i = 1,2,\ldots,n$.
Show that $|\det(A)| \le 1$.

Should I use the definition of matrix:

$$\det(A)=\sum \textrm{sgn}(\sigma)a_{1,\sigma(1)}a_{2,\sigma(2)}...a_{n,\sigma(n)}$$

I don't understand what is $a_{i,\sigma(i)}$ ? Where $i=1,2, \ldots,n$. Or is there another way to solve it?

You can prove that by induction on the dimension $n$ of the matrix. It is clearly true for $n = 1$.

Now assume that $n > 1$ and the statement is true for all matrices of dimension $(n-1, n-1)$. Using the Laplace formula, you have $$\det(A) = \sum_{j=1}^n a_{1j} \det(A_j)$$ where $A_1, ..., A_n$ are submatrices of the dimension $(n-1, n-1)$ which have the same properties as $A$: All entries are positive and the row sums are less or equal to one, so $|\det(A_j)| \le 1$ for $j=1,..., n$.

Then $$|\det(A)| \le \sum_{j=1}^n a_{1j} |\det(A_j)| \le \sum_{j=1}^n a_{1j} \le 1$$

• But how can we take |det(Aj)|≤1 directly? It should has more explaination. – Sokserey Man Dec 4 '15 at 7:20
• @SoksereyMan: It is a proof by "mathematical induction". $A_j$ is a "smaller" matrix with the same properties, therefore you can assume the statement to be true for $A_j$. – Martin R Dec 4 '15 at 7:52
• @Martin R: Nice ! This seems to work for the permanent too, which in this case is clearly larger than the absolute value of the determinant. – Orest Bucicovschi Dec 4 '15 at 9:49
• @SoksereyMan Do you or do you not need to use Leibniz' formula? – BCLC Dec 4 '15 at 11:22

Here is the sneaky approach:

First note, we can decide whether we want the column-sums or the row-sums to be $\leq 1$, since we can of course transpose our matrix. I want the column-sums to be $\leq 1$.

The $1$-norm $\| \cdot \|_1$ on $\mathbb C^n$ induces via

$$\| A \| := \sup_{x \neq 0} \frac{\|Ax\|_1}{\|x\|_1}$$

the column-sum norm on the $n \times n$-matrices. The assumption is precisely $\|A\| \leq 1$ then.

For any $x \in \mathbb C^n$ we have $\|Ax\|_1 \leq \|A\|\|x\|_1 \leq \|x\|_1$. This holds in particular for any eigenvector of $A$, which shows that any (possibly complex) eigenvalue $\lambda$ of $A$ satisfies $|\lambda| \leq 1$. This shows the assertion, since the determinant is obtained as the product of all eigenvalues.

We also have a geometric reason: The edges of the unit cubes are mapped into the unit cube, hence any convex combination of them is mapped into the unit cube. This shows $A[0,1]^n \subset [0,1]^n$. Since the determinant is geometrically defined to be the volume of the image of the unit cube, we immediately get the desired result.

Correct. Use Leibniz formula for determinants. See here for an example.

As for the a's (from the link above, formatting mine):

Here the sum is computed over all permutations σ of the set {1, 2, ..., n}. A permutation is a function that reorders this set of integers. The value in the ith position after the reordering σ is denoted $σ_i$. For example, for n = 3, the original sequence 1, 2, 3 might be reordered to σ = [2, 3, 1], with $σ_1 = 2, σ_2 = 3$, and $σ_3 = 1$.

• Maybe it's hard for me to understand because I learned very little about it. – Sokserey Man Dec 4 '15 at 6:28

Just take modulus the determinant expression you wrote. Note each term on the right under sum can be bounded by using G.M. $\le$ A.M.

• Wouldn't that require that $\sum_{j=1}^n a_{j\sigma(j)} \le 1$ ? Can one conclude that from $\sum_{j=1}^n a_{ij} \le 1$ ? – Martin R Dec 4 '15 at 7:14
• Is that would. Actually I didn't notice ur ans. – Mahbub Alam Dec 4 '15 at 7:15


text:
# The Sum of All the Natural Numbers from 200 to 600 (Both Inclusive) Which Are Neither Divisible by 8 Nor by 12 Is: - Mathematics

MCQ

The sum of all the natural numbers from 200 to 600 (both inclusive) which are neither divisible by 8 nor by 12 is:

• 1, 23, 968

• 1, 33, 068

• 1, 33, 268

• 1, 87, 332

#### Solution

1, 33, 268

Explanation:

Sum of no. from 200 to 600

a = 200, d = 1, n = 600 - 200 + 1 = 401

"S"_401=401/2[200+600]....{"S"_"n"="n"/2("a"+"l")}

=401/2(800)=401xx400

⇒ 160400

Sum of numbers divisible by both 8 or 12

= n (8) + n (12) − n (LCM of 8 and 12)

Sum of numbers divisible by 8

=51/2[200+600]=51xx400=20400

Sum of numbers divisible by 12

=34/2(204+600)=17xx804=13668

Sum of numbers divisible by 24  .....(LCM of 8 and 12)

=17/2(216+600)=17xx408=6936

Sum of numbers divisible by 8 or 12

= 20400 + 13668 − 6936 = 27132

Sum of numbers neither divisible by 8 nor 12

= 160400 − 27132 = 133268

Concept: HCF and LCM (Entrance Exam)
Is there an error in this question or solution?


text:
# Math Help - 3 Advanced Linear Algebra Proofs

1. ## 3 Advanced Linear Algebra Proofs

I am so bad at proofs.

1) Prove that if S is a subset of a vector space V, then span(S) equals the intersection of all subspaces of V that contain S.

Ok, so from the Theorem, I know that since S is a subset of V, the span of S is a subspace of V.
The theorem states that a subspace containing S must also contain the span of S, but not the other way around. This is where I get stuck.

2) Prove that a subset W of a vector space V is a subspace of V if and only if span(W)=W.

If I wanted to show right to left, what can I conclude from the fact that span(W)=W? Or should I show it by contraposition?

3) Let S1 and S2 be subsets of a vector space V. Prove that span(S1 intersect S2) is a subset of span(S1) intersect span(S2).

I don't even know where to start on this one..

I know that this theorem can be used to help prove at least the first one.
Theorem: The span of any subset S of a vector space V is a subspace of V. Moreover, any subspace of V that contains S must also contain the span of S.

2. 1) Suppose $S\subset W\subset V$ is a subspace. Then by definition, W is closed under addition, scalar multiplication. Then in particular, all linear combinations of vectors in S are in W... Also note S is contained in span(S).

2) What is the definition of the span? It's the set of all linear combinations of the vectors, no? Then what can we say about sums? Scalar multiples?

3) Let $x\in span(S_1\cap S_2)$. Then x is some linear combination of vectors in $S_1\cap S_2$, so in particular is a linear combination of vectors in S_1 and a linear combination of vectors in S_2...


text:
# Noparse

#### topsquark

##### Well-known member
MHB Math Helper
I have a question about how to use "noparse." I stole the code from one of MarkFL's recent posts. Here's what I am trying to do, but it's not supposed to carry out the line commands. I don't know why it isn't working.

$$f(x)=\begin{cases}1 & x\in\mathbb{Q}\\ 0 & x\notin\mathbb{Q} \\ \end{cases}$$

-Dan

#### MarkFL

Staff member
Re: noparse

I actually tried to use the noparse tags in that post, but ran into the same problem, so being pressed for time, I simply went with the code tags.

#### Jameson

Staff member
Re: noparse

I have a question about how to use "noparse." I stole the code from one of MarkFL's recent posts. Here's what I am trying to do, but it's not supposed to carry out the line commands. I don't know why it isn't working.

$$f(x)=\begin{cases}1 & x\in\mathbb{Q}\\ 0 & x\notin\mathbb{Q} \\ \end{cases}$$

-Dan
This is strange. The noparse tag actually works as you can see here:
$$x^2$$

For some reason though this code on its own with no dollar signs renders Latex. I have no idea why.
Code:
\begin{cases}1 & x\in\mathbb{Q}\\ 0 & x\notin\mathbb{Q} \\ \end{cases}

#### Klaas van Aarsen

##### MHB Seeker
Staff member
Re: noparse

vBulletin always executes the begin{cases} latex environment directive, regardless what's around it.
You don't even need [tex] markers to make it work.

MHB Math Helper
Thanks all.

-Dan


text:
# 1.2 Appendix a

This appendix contains outline proofs and derivations for the theorems and formulas given in early part of Chapter: The Scaling Function and Scaling Coefficients, Wavelet and Wavelet Coefficients . They are not intended to be completeor formal, but they should be sufficient to understand the ideas behind why a result is true and to give some insight into its interpretation aswell as to indicate assumptions and restrictions.

Proof 1 The conditions given by [link] and [link] can be derived by integrating both sides of

$\phi \left(x\right)=\sum _{n}h\left(n\right)\phantom{\rule{0.277778em}{0ex}}\sqrt{M}\phantom{\rule{0.166667em}{0ex}}\phi \left(M\phantom{\rule{0.166667em}{0ex}}x-n\right)$

and making the change of variables $y=Mx$

$\int \phi \left(x\right)\phantom{\rule{0.166667em}{0ex}}dx=\sum _{n}h\left(n\right)\int \sqrt{M}\phantom{\rule{0.166667em}{0ex}}\phi \left(Mx-n\right)\phantom{\rule{0.166667em}{0ex}}dx$

and noting the integral is independent of translation which gives

$=\sum _{n}h\left(n\right)\phantom{\rule{0.166667em}{0ex}}\sqrt{M}\phantom{\rule{0.166667em}{0ex}}\int \phi \left(y\right)\frac{1}{M}\phantom{\rule{0.166667em}{0ex}}dy.$

With no further requirements other than $\phi \in {L}^{1}$ to allow the sum and integral interchange and $\int \phi \left(x\right)\phantom{\rule{0.166667em}{0ex}}dx\ne 0$ , this gives [link] as

$\sum _{n}h\left(n\right)=\sqrt{M}$

and for $M=2$ gives [link] . Note this does not assume orthogonality nor any specific normalization of $\phi \left(t\right)$ and does not even assume $M$ is an integer.

This is the most basic necessary condition for the existence of $\phi \left(t\right)$ and it has the fewest assumptions or restrictions.

Proof 2 The conditions in [link] and [link] are a down-sampled orthogonality of translates by $M$ of the coefficients which results from the orthogonality of translates of the scaling function given by

$\int \phi \left(x\right)\phantom{\rule{0.166667em}{0ex}}\phi \left(x-m\right)\phantom{\rule{0.166667em}{0ex}}dx=E\phantom{\rule{0.166667em}{0ex}}\delta \left(m\right)$

$\int \left[\sum _{n},h,\left(n\right),\phantom{\rule{0.166667em}{0ex}},\sqrt{M},\phantom{\rule{0.166667em}{0ex}},\phi ,\left(Mx-n\right)\right]\left[\sum _{k},h,\left(k\right),\phantom{\rule{0.166667em}{0ex}},\sqrt{M},\phantom{\rule{0.166667em}{0ex}},\phi ,\left(Mx-Mm-k\right)\right]\phantom{\rule{0.166667em}{0ex}}dx=E\phantom{\rule{0.166667em}{0ex}}\delta \left(m\right)$

which, after reordering and a change of variable $y=M\phantom{\rule{0.166667em}{0ex}}x$ , gives

$\sum _{n}\sum _{k}h\left(n\right)\phantom{\rule{0.166667em}{0ex}}h\left(k\right)\int \phi \left(y-n\right)\phantom{\rule{0.166667em}{0ex}}\phi \left(y-Mm-k\right)\phantom{\rule{0.166667em}{0ex}}dy=E\phantom{\rule{0.166667em}{0ex}}\delta \left(m\right).$

Using the orthogonality in [link] gives our result

$\sum _{n}h\left(n\right)\phantom{\rule{0.166667em}{0ex}}h\left(n-Mm\right)\phantom{\rule{0.277778em}{0ex}}=\phantom{\rule{0.277778em}{0ex}}\delta \left(m\right)$

in [link] and [link] . This result requires the orthogonality condition [link] , $M$ must be an integer, and any non-zero normalization $E$ may be used.

Proof 3 (Corollary 2) The result that

$\sum _{n}h\left(2n\right)=\sum _{n}h\left(2n+1\right)=1/\sqrt{2}$

$\sum _{n}h\left(M\phantom{\rule{0.166667em}{0ex}}n\right)=\sum _{n}h\left(M\phantom{\rule{0.166667em}{0ex}}n+k\right)=1/\sqrt{M}$

is obtained by breaking [link] for $M=2$ into the sum of the even and odd coefficients.

$\sum _{n}h\left(n\right)=\sum _{k}h\left(2k\right)+\sum _{k}h\left(2k+1\right)={K}_{0}+{K}_{1}=\sqrt{2}.$

Next we use [link] and sum over $n$ to give

$\sum _{n}\sum _{k}h\left(k+2n\right)h\left(k\right)=1$

which we then split into even and odd sums and reorder to give:

$\begin{array}{}\sum _{n}\left[\sum _{k},h,\left(2k+2n\right),h,\left(2k\right),+,\sum _{k},h,\left(2k+1+2n\right),h,\left(2k+1\right)\right]& =\sum _{k}\left[\sum _{n},h,\left(2k+2n\right)\right]h\left(2k\right)+\sum _{k}\left[\sum _{n},h,\left(2k+1+2n\right)\right]h\left(2k+1\right)& =\sum _{k}{K}_{0}h\left(2k\right)+\sum _{k}{K}_{1}h\left(2k+1\right)={K}_{0}^{2}+{K}_{1}^{2}=1.\end{array}$

Solving [link] and [link] simultaneously gives ${K}_{0}={K}_{1}=1/\sqrt{2}$ and our result [link] or [link] for $M=2$ .

If the same approach is taken with [link] and [link] for $M=3$ , we have

$\sum _{n}x\left(n\right)=\sum _{n}x\left(3n\right)+\sum _{n}x\left(3n+1\right)+\sum _{n}x\left(3n+2\right)=\sqrt{3}$

which, in terms of the partial sums ${K}_{i}$ , is

$\sum _{n}x\left(n\right)={K}_{0}+{K}_{1}+{K}_{2}=\sqrt{3}.$

${K}_{0}^{2}+{K}_{1}^{2}+{K}_{2}^{2}=1.$

Equation [link] and [link] are simultaneously true if and only if ${K}_{0}={K}_{1}={K}_{2}=1/\sqrt{3}$ . This process is valid for any integer $M$ and any non-zero normalization.

Proof 3 If the support of $\phi \left(x\right)$ is $\left[0,N-1\right]$ , from the basic recursion equation with support of $h\left(n\right)$ assumed as $\left[{N}_{1},{N}_{2}\right]$ we have

$\phi \left(x\right)=\sum _{n={N}_{1}}^{{N}_{2}}h\left(n\right)\phantom{\rule{0.277778em}{0ex}}\sqrt{2}\phantom{\rule{0.166667em}{0ex}}\phi \left(2x-n\right)$

where the support of the right hand side of [link] is $\left[{N}_{1}/2,\left(N-1+{N}_{2}\right)/2\right)$ . Since the support of both sides of [link] must be the same, the limits on the sum, or, the limits on the indices of the non zero $h\left(n\right)$ are such that ${N}_{1}=0$ and ${N}_{2}=N$ , therefore, the support of $h\left(n\right)$ is $\left[0,N-1\right]$ .

Proof 4 First define the autocorrelation function

$a\left(t\right)=\int \phi \left(x\right)\phantom{\rule{0.166667em}{0ex}}\phi \left(x-t\right)\phantom{\rule{0.166667em}{0ex}}dx$

and the power spectrum

$A\left(\omega \right)=\int a\left(t\right)\phantom{\rule{0.166667em}{0ex}}{e}^{-j\omega t}\phantom{\rule{0.166667em}{0ex}}dt=\int \int \phi \left(x\right)\phantom{\rule{0.166667em}{0ex}}\phi \left(x-t\right)\phantom{\rule{0.166667em}{0ex}}dx\phantom{\rule{0.277778em}{0ex}}\phantom{\rule{0.166667em}{0ex}}{e}^{-j\omega t}\phantom{\rule{0.166667em}{0ex}}dt$

which after changing variables, $y=x-t$ , and reordering operations gives

Leo Robinson's definition
how is equilibrium defined in financial markets?
the concept of it
DALOM
Country A has export sales 20 billion, government purchases 1000billion, business investment is 50 billion, imports are 40billion, and consumption spending is 2000billin. What is the dollar value of GDP ?
what is determination of national income?
economic growth
Rukaiya
stock of capital
Rukaiya
we're RBI keep money with them
Anil
Y =C+l
Favour
evaluate the success affirmative action as one of south Africa's redress method
what is market equilibrium
it is a situation in which the supply of an item is exactly equal to it dd .
Ssmith
inder wat condition shld a firm stop production in both short n lungrun ?
Ssmith
what is 2nd degree price discrimination?
Ssmith
what is quantity
Tettey
what is quantity2
An indefinite amount of something.
explorer
what is demand
in ordinary sense demand means desire
Khalid
demand in economics means both willingness as well as the ability to purchase a commodity by paying a price an also its actuall purchase
Khalid
Khalid
demand refers to the various quantity of goods and services that consumers are willing and able to purchase at a particular period of time all other things been equal
Dela
The amount of a good or service that consumers are willing to buy at a particular price.
explorer
what is cost pull inflation?
oru
what is utility
oru
what is cost pull inflation?
oru
demand is economic principle referring to a consumer's desire and willingness to pay a price for a specific or service..
Babakura
utility is the among of certisfaction driving from using a comundity
Anas
pull cost of inflation hight population unemployment to some of The country members poor government system
Anas
what is a buffer scheme
Lukong
state the second law of demand and supply
state the law of diminishing marginal utility
Rukundo
mention and explain two Bank I financial institutions and two non baking financial institutions
wat is demand pull inflation
Demand-pull inflation is asserted to arise when aggregate demandin an economy outpaces aggregate supply. It involvesinflation rising as real gross domestic product rises and unemployment falls, as the economy moves along the Phillips curve.
kevin
Perfectly elastic demand
this is a form of demand where goods are demanded at a constant price
Rukundo
what inelastic demanding
Koire
demand of any good demanded more after a certain period. if a commodity prices may high and scarcity of that resources.
Anil
cannot demand more
Anil
what is cross-elasticity of demand
cross elasticity of demand is an economic concept that measures the responsiveness in the quantity demand of one good when a change in price takes place in other good
Mallekha
this is responsiveness quantity demanded keeping other factors constant
Rukundo
what economic growth
conditions of perfect market
CONDITIONS OF PERFECT MARKET: 1. Perfect competition(PC): no increasing returns, many buyers and sellers, all are price takers, not prices makers. 2. Perfect Information (PI): buyers and sellers know all they need to know about what they are buying and selling to make the right decisions.
Mallekha
3. Complete Markets(CM): no externalities or public goods, no transactions costs, "thick" markets.
Mallekha
nice contributor
Mohammed
A numerous downsized market that does not meet standards.
LaTasha
A Perfect Market is a numerous downsized market that does not meet standards.
LaTasha
what is a market
is place where buyers and sellers met together for the purpose of buying and selling of good and services
Babakura
what's the easiest and fastest way to the synthesize AgNP?
China
Cied
types of nano material
I start with an easy one. carbon nanotubes woven into a long filament like a string
Porter
many many of nanotubes
Porter
what is the k.e before it land
Yasmin
what is the function of carbon nanotubes?
Cesar
what is nanomaterials and their applications of sensors.
what is nano technology
what is system testing?
preparation of nanomaterial
Yes, Nanotechnology has a very fast field of applications and their is always something new to do with it...
what is system testing
what is the application of nanotechnology?
Stotaw
In this morden time nanotechnology used in many field . 1-Electronics-manufacturad IC ,RAM,MRAM,solar panel etc 2-Helth and Medical-Nanomedicine,Drug Dilivery for cancer treatment etc 3- Atomobile -MEMS, Coating on car etc. and may other field for details you can check at Google
Azam
anybody can imagine what will be happen after 100 years from now in nano tech world
Prasenjit
after 100 year this will be not nanotechnology maybe this technology name will be change . maybe aftet 100 year . we work on electron lable practically about its properties and behaviour by the different instruments
Azam
name doesn't matter , whatever it will be change... I'm taking about effect on circumstances of the microscopic world
Prasenjit
how hard could it be to apply nanotechnology against viral infections such HIV or Ebola?
Damian
silver nanoparticles could handle the job?
Damian
not now but maybe in future only AgNP maybe any other nanomaterials
Azam
can nanotechnology change the direction of the face of the world
At high concentrations (>0.01 M), the relation between absorptivity coefficient and absorbance is no longer linear. This is due to the electrostatic interactions between the quantum dots in close proximity. If the concentration of the solution is high, another effect that is seen is the scattering of light from the large number of quantum dots. This assumption only works at low concentrations of the analyte. Presence of stray light.
the Beer law works very well for dilute solutions but fails for very high concentrations. why?
in a comparison of the stages of meiosis to the stage of mitosis, which stages are unique to meiosis and which stages have the same event in botg meiosis and mitosis
Researchers demonstrated that the hippocampus functions in memory processing by creating lesions in the hippocampi of rats, which resulted in ________.
The formulation of new memories is sometimes called ________, and the process of bringing up old memories is called ________.
Got questions? Join the online conversation and get instant answers!


text:
# Acceleration of a pulley system [closed]

The figure above shows a pulley system consisting of 3 masses ($$m_1$$, $$m_2$$ and $$m_3$$), a homogeneous wheel (radius R, mass M) and 2 massless pulleyes which are connected by a massless rope. Mass $$m_1$$ is sliding on an inclined surface (inclination angle $$\alpha$$) and mass $$m_3$$ is sliding on a horizontal surface. Assume that there are no slipping and considered frictionless, and pulley 1 and pulley 2 are massless.

Assuming that $$m_1 = m_3 = m$$ and $$m_2 = M = 2m$$, determine the accelerations of the masses $$m_1, m_2$$ and $$m_3$$.

I've tried to answer this question with the results:

• acceleration of $$m_1 : \ddot{x}_1 = g \sin \alpha_1 - {T_1 \over m}$$
• acceleration of $$m_2 : \ddot{x}_2 = {T_2 \over m} - g$$
• acceleration of $$m_3 : \ddot{x}_3 = {T_3 \over m}$$

But since $$T_1, T_2$$ and $$T_3$$ are not given, my answers are wrong. Anyone can help me? I would highly appreciate it.

• $$m_1\ddot{x}_1 = T_1-m_1g\sin\alpha_1$$
• $$m_2\ddot{x}_2 = -2T_2+m_2g$$
• $$m_3\ddot{x}_3 = T_3$$
• $${1\over 2}MR^2\ddot{\varphi}=-T_3R+T_2R$$
• $$\ddot{x}_3 = \ddot{\varphi}R$$
• $$-\ddot{x}_1+2\ddot{x}_2-\ddot{x}_3 = 0$$
• Note that you haven't yet taken into account the mass of the wheel. $T_1$, $T_2$ and $T_3$ are not independent of each other. See if these comments help move you forward a bit. Also be aware that this is not a homework help site, so you are likely to get hints and questions directed back at you rather than answers. – garyp Jul 28 '16 at 16:43
• Welcome to Physics Stack Exchange! Please note that Physics.StackExchange is not a homework help site. Please see this Meta post on asking homework questions and this Meta post for “check my work” problems. – garyp Jul 28 '16 at 16:45
• To me, this homework-like question 1) asls about a specific physics concept, and 2) shows some effort to work through the problem. Thus, I vote it to leave open. – peterh - Reinstate Monica Jul 28 '16 at 18:36
• @peterh : Yes the Qn shows some effort to work through the problem, but it is not asking a conceptual question. The Qns asked are (1) what to do next and (2) check my answers. – sammy gerbil Jul 30 '16 at 17:15

You don't have all equations, and one is not correct. The usual assumption in these problems are:

1. There is no friction.
2. Ropes are glued to pulleys.

• From 1. it follows that $T_1=T_2$
• You forgot, that $m_2$ is acted on by $T_2$ twice: ${\ddot{x}_2} = {\frac{2T_2}{m_2} -g}$.
• $T_3=T_2+N$, where N is force which rotates the big wheel.
• ${\ddot{\beta}} = {\frac{NR}{I}}$, where $I=MR^2/2$.
• ${\ddot{\beta}} = {\ddot{x}_3}/R$.

With all these additional equations, you should be able to find all the accelerations. However, pay attention to directions - they depend on your initial choice of signs of $g$ and $T$.

• please check my revision, but I still don't know how to replace the $Ts$. And $m_2= 2m$ that's why the $2s$ canceled – hello Jul 28 '16 at 17:56
• I don't see in your revision that you have put $T_1=T_2$. – Emil Jul 29 '16 at 13:47
• Okay, can you check if my calculations are right... $\ddot{x}_1 = gsin\alpha_1+{\ddot{x}_2\over 2gm_1}$, $\ddot{x}_2 = g-{2\over m_2}(m_3\ddot{x}_3-Mg)$, and $\ddot{x}_3 = {m_3\ddot{x}_3\over Mg}$ – hello Jul 29 '16 at 14:58
• I cannot, this is not homework help site. I can help you with understanding of the problem, but I cannot solve the problem for you. Come on, you have not so much to finish. In your last revision, you have wrote 6 equations in the end. When you add $T_1=T_2$ there will be seven. And so it happens that you have seven unknowns - $T_1, T_2, T_3, \ddot{x}_1, \ddot{x}_2, \ddot{x}_3$ and $\ddot{\phi}$. So the solution is near :) UPD: in your last comment there is something strange - $\ddot{x}_3$ equation doesn't look good. – Emil Jul 29 '16 at 15:05
• @hello : As explained, this is not a homework help site. We do not check your answers. – sammy gerbil Jul 30 '16 at 17:11


text:
# zbMATH — the first resource for mathematics

The multiplicative anomaly for determinants revisited; locality. (English) Zbl 1246.47012
The paper deals with the multiplicative anomaly of $$\zeta$$-determinants. The authors review the construction and properties of logarithms of elliptic operators and prove that the expression $$L(A,B) := \log(AB) - \log(A) - \log(B)$$ is a finite sum of commutators of zero order classical pseudodifferential operators. Basic properties of weighted traces are also reviewed and it is proved that the canonical and weighted traces as well as the noncommutative residue commute with differentiation on differentiable families of operators with constant order.
Moreover, for two admissible pseudodifferential operators $$A$$ and $$B$$ (acting on smooth sections of a certain vector bundle and) having non negative orders, the authors prove that the weighted trace of $$L(A,B)$$ is a local expression as a finite sum of noncommutative residues, which only depends on the first $$n$$ homogeneous components of the symbols of $$A$$ and $$B$$. In addition, an explicit local expression for the weighted traces of $$L(A,B)$$ is derived. This allows the authors to derive an explicit local formula for the multiplicative anomaly of $$\zeta$$-determinants.
Throughout the text, detailed interconnections are drawn with several known results.
##### MSC:
 47G30 Pseudodifferential operators 11M36 Selberg zeta functions and regularized determinants; applications to spectral theory, Dirichlet series, Eisenstein series, etc. (explicit formulas) 35R01 PDEs on manifolds 58J40 Pseudodifferential and Fourier integral operators on manifolds
Full Text:
##### References:
 [1] J. L. Brylinski and E. Getzler, The homology of algebras of pseudodifferential symbols and non commutative residues. $$K$$-theory , 1 (1987), pp 385-403. · Zbl 0646.58026 · doi:10.1007/BF00539624 [2] J. Brüning and M. Lesch, On the eta-invariant of certain nonlocal boundary value problems. Duke Math. J. 96 , no. 2 (1999), pp 425-468. · Zbl 0956.58014 · doi:10.1215/S0012-7094-99-09613-8 [3] A. Cardona and C. Ducourtioux and J. -P. Magnot and S. Paycha, Weighted traces on algebras of pseudo-differential operators and geometry on loop groups. Infinite dimensional analysis, quantum probability and related topics , Vol 5, no. 4 (2002), pp 503-540. · Zbl 1134.58303 · doi:10.1142/S021902570200095X [4] C. Ducourtioux, Weighted traces on pseudodifferential operators and associated determinants, PhD thesis, Clermont-Ferrand (2001). [5] N. Dunford and J. Schwartz, Linear Operators III: Spectral operators ; Wiley Classics Library 1971. · Zbl 0243.47001 [6] D. Freed, The geometry of loop groups. J. Diff. Geom. 28 (1988), pp 223-276. · Zbl 0619.58003 [7] B. V. Fedosov and F. Golse and E. Leichtnam and E. Schrohe, The noncommutative residue for manifolds with boundary. J. Funct. Anal. . 142 (1996), pp 1-31. · Zbl 0877.58005 · doi:10.1006/jfan.1996.0142 [8] L. Friedlander, Determinants and elliptic operators. PhD Thesis, Dept. Math. MIT 1989. · Zbl 0759.58043 · doi:10.1016/0022-1236(92)90099-5 [9] L. Friedlander and V. Guillemin, Determinants of zeroth order operators. J. Differential Geom. 78 (2008), no. 1, pp 1-12. · Zbl 1140.58017 · euclid:jdg/1197320601 [10] V. Guillemin, A new proof of Weyl’s formula on the asymptotic distribution of eigenvalues. Adv. Math. 55 (1985), pp 131-160. · Zbl 0559.58025 · doi:10.1016/0001-8708(85)90018-0 [11] V. Guillemin, Residue traces for certain algebras of Fourier integral operators. J. Funct. Anal. 115 , no. 2, (1993), pp 391-417. · Zbl 0791.35162 · doi:10.1006/jfan.1993.1096 [12] V. Guillemin, Gauged Lagrangian distributions. Adv. Math. 102 , no. 2 (1996), pp 184-201. · Zbl 0803.58052 · doi:10.1006/aima.1993.1064 [13] E. Hille, Methods in classical and functional analysis . Addison-Wesley Publishing Company, 1973. · Zbl 0223.46001 [14] N. Higham, Functions of a matrix. Theory and Computation . Cambridge University Press 2008. · Zbl 1167.15001 · doi:10.1137/1.9780898717778 [15] M. Kontsevich and S. Vishik, Geometry of determinants of elliptic operators. Func. Anal. on the Eve of the XXI century, Vol I, Progress in Mathematics 131 (1994), pp 173-197; \otherterm Determinants of elliptic pseudodifferential operators . Max Planck Preprint (1994). · Zbl 0920.58061 [16] Ch. Kassel, Le résidu non commutatif [d’après Wodzicki]. Sém. Bourbaki 708 (1989). [17] M. Lesch, On the non commutative residue for pseudodifferential operators with log-polyhomogeneous symbols. Ann. Global Anal. Geom. 17 (1998), pp 151-187. · Zbl 0920.58047 · doi:10.1023/A:1006504318696 [18] J. -M. Lescure and S.Paycha, Traces on pseudodifferential operators and associated determinants. Proc. Lond. Math. Soc. (3) 94 no. 3 (2007), pp 772-812. · Zbl 1193.58018 · doi:10.1112/plms/pdm004 [19] R. Melrose and V. Nistor, Homology of pseudodifferential operators I. Manifolds with boundary, funct-an/9606005, june 1999. [20] L. Maniccia and E. Schrohe and J.Seiler, Uniqueness of the Kontsevich-Vishik trace. Proc. Amer. Math. Soc. 136 , no. 2 (2008), pp 747-752. · Zbl 1132.58018 · doi:10.1090/S0002-9939-07-09168-X [21] K. Okikiolu, The Campbell-Hausdorff theorem for elliptic operators and a related trace formula. Duke. Math. Journ. 79 (1995), pp 687-722. · Zbl 0854.35137 · doi:10.1215/S0012-7094-95-07918-6 [22] K. Okikiolu, The multiplicative anomaly for determinants of elliptic oprators. Duke Math. Journ. 79 (1995), pp 722-749. · Zbl 0851.58048 · doi:10.1215/S0012-7094-95-07919-8 [23] S. Paycha, Renormalised traces as a looking glass into infinite-dimensional geometry. Infin. Dimens. Anal. Quantum Probab. Relat. Top. 4 , no. 2 (2001), pp 221-266. · Zbl 1039.58022 · doi:10.1142/S0219025701000486 [24] S. Paycha and S. Scott, A Laurent expansion for regularised integrals of holomorphic symbols. Geom. Funct. Anal. 17 no. 2 (2007), pp 491-536. · Zbl 1125.58009 · doi:10.1007/s00039-007-0597-8 [25] S. Paycha and S. Rosenberg, Traces and characteristic classes in loop groups. Infinite dimensional Groups and Manifolds, Ed. T. Wurzbacher, I.R.M.A. Lectures in Mathematical and Theoretical Physics 5 , de Gruyter , (2004), pp 185-212. · Zbl 1064.58023 [26] R. Ponge, Spectral asymmetry, zeta functions and the noncommutative residue. Internat. J. Math. 17 no. 9 (2006), pp 1065-1090. · Zbl 1127.58030 · doi:10.1142/S0129167X06003825 [27] R. Ponge, Traces on pseudodifferential operators and sums of commutators. J. Anal. Math. 110 (2010), pp 1-30. · Zbl 1194.58029 · doi:10.1007/s11854-010-0001-8 [28] D. B. Ray and I. M. Singer, R-torsion and the Laplacian on Riemannian manifolds. Adv. Math. 7 (1971), pp 145-210. · Zbl 0239.58014 · doi:10.1016/0001-8708(71)90045-4 [29] S. Scott, The residue determinant. Commun. Part. Diff. Eqn.s 30 no. 4-6 (2005), pp 483-507. · Zbl 1236.58037 · doi:10.1081/PDE-200050102 [30] R. T. Seeley, Complex powers of an elliptic operator, Singular integrals. Proc. Symp. Pure Math.,Chicago, Amer. Math. Soc. Providence (1966), pp 288-307. · Zbl 0159.15504 [31] M. Shubin, Pseudodifferential operators and spectral theory . Springer Verlag 1987. · Zbl 0616.47040 [32] M. Wodzicki, Local invariants of spectral asymmetry. Invent. math. 75 (1984), pp 143-178. · Zbl 0538.58038 · doi:10.1007/BF01403095 · eudml:143093 [33] M. Wodzicki, Non commutative residue. Chapter I. Fundamentals. Lecture Notes in Math. Springer Verlag 1289 (1987), pp 320-399. · Zbl 0649.58033 · doi:10.1007/BFb0078372 [34] M. Wodzicki, Spectral asymmetry and noncommutative residue (in Russian) Thesis, (former) Steklov Institute, Sov. Acad. Sci. Moscow 1984. · Zbl 0538.58038 [35] M. Wodzicki, Commentary, in Hermann Weyl’s selected papers (in Russian), edited by V.I. Arnold and A.N. Parshin, Nauka Moscow, 1985.
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. It attempts to reflect the references listed in the original paper as accurately as possible without claiming the completeness or perfect precision of the matching.


text:
# What is a solution to the differential equation sqrtx+sqrtydy/dx with y(1)=4?

Jul 25, 2016

${x}^{\frac{3}{2}} + {y}^{\frac{3}{2}} = 9$.

#### Explanation:

Rewriting the Diff. Eqn. as, $\sqrt{x} \mathrm{dx} + \sqrt{y} \mathrm{dy} = 0$, we notice that it is a Separable Variable type Diff. Eqn.

To find its General Soln. , we integrate term-wise , i.e.,

$\int \sqrt{x} \mathrm{dx} + \int \sqrt{y} \mathrm{dy} = C$

$\therefore {x}^{\frac{3}{2}} / \left(\frac{3}{2}\right) + {y}^{\frac{3}{2}} / \left(\frac{3}{2}\right) = C$. or,

${x}^{\frac{3}{2}} + {y}^{\frac{3}{2}} = \frac{3}{2} \cdot C \ldots \ldots . \left(1\right)$

To determine $C$, we use the given cond. - called The Initial Cond. - that $y \left(1\right) = 4$, meaning, when $x = 1 , y = 4$.

Sub.ing in $\left(1\right)$, we get, $1 + {4}^{\frac{3}{2}} = \frac{3}{2} \cdot C \Rightarrow \frac{3}{2} \cdot C = 9$

Sub.ing $\frac{3}{2} \cdot C = 9$ in $\left(1\right)$, we get the complete Soln. - called The

Particular Soln. as ${x}^{\frac{3}{2}} + {y}^{\frac{3}{2}} = 9$.


text:
# MATLAB: Help with finding a numerical answer using Ode45

MATLABode45

I have the equation
m*D2y +dc*Dy + sk*y = A*sin (omega t)
and I need to have numerical values to use. I'm trying to use ode45 ,but I keep hitting the error
Error using odearguments (line 93) @(T,Y)[Y(2);-150/1000*Y(1)-150/1000*Y+8*PI*SIN(5*T)/1000] returns a vector of length 3, but the length of initial conditions vector is 2. The vector returned by @(T,Y)[Y(2);-150/1000*Y(1)-150/1000*Y+8*PI*SIN(5*T)/1000] and the initial conditions vector must have the same number of elements.
I feel like i am missing something simple but i haven't figured it out yet. Can anyone show me the process of getting numerical answers, not just a symbolic answer.
My code is:
f = @(t, y) [y(2); -150/1000*y(1) - 150/1000*y + 8*pi*sin(5*t)/1000];[xa, ya] = ode45(f, [0 50], [ 0 0 ]);
plot(xa, ya)

f = @(t, y) [y(2); (-150/1000*y(2) - 150/1000*y(1) + 8*pi*sin(5*t)/1000)];[xa, ya] = ode45(f, [0 50], [0 0]);


text:
## Müller, Jan-Steffen

Compute Distance To:
 Author ID: muller.jan-steffen.1 Published as: Müller, J.; Müller, Jan; Müller, Jan-Steffen; Müller, J.-S. more...less Homepage: https://www.math.uni-sb.de/ag/fuchs/Menupkte/Arbeitsgruppe/jan.html
 Documents Indexed: 16 Publications since 2015 Co-Authors: 5 Co-Authors with 8 Joint Publications 143 Co-Co-Authors
all top 5

### Co-Authors

 2 single-authored 8 Fuchs, Martin 4 Bildhauer, Michael 3 Tietz, Christian 1 Gerlach-Mena, Pablo José 1 Giannakoglou, Kyriakos C. 1 Grothaus, Martin 1 Ikemoto, Yusuke 1 Kumai, R. 1 Magoulas, N. 1 Moriwaki, T. 1 Nonnenmacher, Andreas 1 Othmer, Carsten 1 Papoutsis-Kiachagias, Evangelos M. 1 Weickert, Joachim 1 Yoneyama, N. 1 Zhong, Xiao
all top 5

### Serials

 2 Journal of Mathematical Sciences (New York) 1 Classical and Quantum Gravity 1 Computers and Fluids 1 Annali di Matematica Pura ed Applicata. Serie Quarta 1 Nonlinear Analysis. Theory, Methods & Applications. Series A: Theory and Methods 1 Calculus of Variations and Partial Differential Equations 1 St. Petersburg Mathematical Journal 1 Annales Academiae Scientiarum Fennicae. Mathematica 1 Journal of Mathematical Fluid Mechanics 1 Acta Mathematica Scientia. Series B. (English Edition) 1 Mediterranean Journal of Mathematics 1 Complex Variables and Elliptic Equations 1 Science 1 Stochastic and Partial Differential Equations. Analysis and Computations 1 Journal of Elliptic and Parabolic Equations
all top 5

### Fields

 9 Calculus of variations and optimal control; optimization (49-XX) 3 Fluid mechanics (76-XX) 3 Information and communication theory, circuits (94-XX) 2 Real functions (26-XX) 2 Partial differential equations (35-XX) 2 Statistics (62-XX) 1 Functions of a complex variable (30-XX) 1 Ordinary differential equations (34-XX) 1 Functional analysis (46-XX) 1 Convex and discrete geometry (52-XX) 1 Differential geometry (53-XX) 1 Probability theory and stochastic processes (60-XX) 1 Statistical mechanics, structure of matter (82-XX) 1 Relativity and gravitational theory (83-XX) 1 Astronomy and astrophysics (85-XX)

### Citations contained in zbMATH Open

9 Publications have been cited 42 times in 10 Documents Cited by Year
Relativistic tests with lunar laser ranging. Zbl 1382.83021
Hofmann, F.; Müller, J.
2018
Signal recovery via TV-type energies. Zbl 1392.49003
Fuchs, M.; Müller, J.; Tietz, C.
2018
Noise reduction in car aerodynamics using a surrogate objective function and the continuous adjoint method with wall functions. Zbl 1390.76826
Papoutsis-Kiachagias, E. M.; Magoulas, N.; Mueller, J.; Othmer, C.; Giannakoglou, K. C.
2015
A higher order TV-type variational problem related to the denoising and inpainting of images. Zbl 1358.49043
Fuchs, Martin; Müller, Jan
2017
On the solvability in Sobolev spaces and related regularity results for a variant of the TV-image recovery model: the vector-valued case. Zbl 1382.49044
Bildhauer, M.; Fuchs, M.; Müller, J.; Tietz, C.
2016
A remark on denoising of greyscale images using energy densities with varying growth rates. Zbl 1398.49032
Fuchs, M.; Müller, J.
2018
A density result for Sobolev functions and functions of higher order bounded variation with additional integrability constraints. Zbl 1379.46029
Müller, Jan-Steffen
2016
Crystallization and vitrification of electrons in a glass-forming charge liquid. Zbl 1404.82075
Sasaki, S.; Hashimoto, K.; Kobayashi, R.; Itoh, K.; Iguchi, S.; Nishio, Y.; Ikemoto, Y.; Moriwaki, T.; Yoneyama, N.; Watanabe, M.; Ueda, A.; Mori, H.; Kobayashi, K.; Kumai, R.; Murakami, Y.; Müller, J.; Sasaki, T.
2017
Existence and regularity for stationary incompressible flows with dissipative potentials of linear growth. Zbl 1404.76011
Bildhauer, M.; Fuchs, M.; Müller, J.
2018
Relativistic tests with lunar laser ranging. Zbl 1382.83021
Hofmann, F.; Müller, J.
2018
Signal recovery via TV-type energies. Zbl 1392.49003
Fuchs, M.; Müller, J.; Tietz, C.
2018
A remark on denoising of greyscale images using energy densities with varying growth rates. Zbl 1398.49032
Fuchs, M.; Müller, J.
2018
Existence and regularity for stationary incompressible flows with dissipative potentials of linear growth. Zbl 1404.76011
Bildhauer, M.; Fuchs, M.; Müller, J.
2018
A higher order TV-type variational problem related to the denoising and inpainting of images. Zbl 1358.49043
Fuchs, Martin; Müller, Jan
2017
Crystallization and vitrification of electrons in a glass-forming charge liquid. Zbl 1404.82075
Sasaki, S.; Hashimoto, K.; Kobayashi, R.; Itoh, K.; Iguchi, S.; Nishio, Y.; Ikemoto, Y.; Moriwaki, T.; Yoneyama, N.; Watanabe, M.; Ueda, A.; Mori, H.; Kobayashi, K.; Kumai, R.; Murakami, Y.; Müller, J.; Sasaki, T.
2017
On the solvability in Sobolev spaces and related regularity results for a variant of the TV-image recovery model: the vector-valued case. Zbl 1382.49044
Bildhauer, M.; Fuchs, M.; Müller, J.; Tietz, C.
2016
A density result for Sobolev functions and functions of higher order bounded variation with additional integrability constraints. Zbl 1379.46029
Müller, Jan-Steffen
2016
Noise reduction in car aerodynamics using a surrogate objective function and the continuous adjoint method with wall functions. Zbl 1390.76826
Papoutsis-Kiachagias, E. M.; Magoulas, N.; Mueller, J.; Othmer, C.; Giannakoglou, K. C.
2015
all top 5

### Cited by 7 Authors

 7 Müller, Jan-Steffen 6 Fuchs, Martin 3 Bildhauer, Michael 2 Tietz, Christian 1 Hagerty, Adrian 1 Weickert, Joachim 1 Zhong, Xiao
all top 5

### Cited in 8 Serials

 3 Journal of Mathematical Sciences (New York) 1 Annali di Matematica Pura ed Applicata. Serie Quarta 1 Nonlinear Analysis. Theory, Methods & Applications. Series A: Theory and Methods 1 Calculus of Variations and Partial Differential Equations 1 Journal of Mathematical Fluid Mechanics 1 Acta Mathematica Scientia. Series B. (English Edition) 1 Complex Variables and Elliptic Equations 1 Journal of Elliptic and Parabolic Equations
all top 5

### Cited in 6 Fields

 9 Calculus of variations and optimal control; optimization (49-XX) 4 Information and communication theory, circuits (94-XX) 2 Partial differential equations (35-XX) 2 Statistics (62-XX) 2 Fluid mechanics (76-XX) 1 Computer science (68-XX)