text:
You can submit your questions regarding Theano, Blocks and Fuel, and the class project, as well as general revision questions in the lead-up to the exam, on this page.

## 63 thoughts on “Questions and answers”

1. When I am trying to follow this instruction, installing the data set, I do not know what do you mean “in order for Fuel to know where to look for its data, the data_path configuration variable has to be set inside ~/.fuelrc. It’s expected to be a sequence of paths separated by an OS-specific delimiter (: for Linux and OSX, ; for Windows):

# ~/.fuelrc
data_path: “/first/path/to/my/data:/second/path/to/my/data”

should i create a file called .fuelrc and have this content on that file?

Like

2. Then I followed this :”cd $HOME mkdir fuel_data # Create a directory in which Fuel can store its data echo “data_path: \”$HOME/fuel_data\”” > ~/.fuelrc # Create the Fuel configuration file
cd fuel_data # Go to the data directory” I do not why i can not use fuel-download command. It seems that I did not install fuel successfully, is there a way to uninstall fuel?

Like

3. Florian Bordes says:

Like

• bartvanmerrienboer says:

Just to clarify: The Fuel scripts are only in ~/.local/bin if you’re not using Anaconda; otherwise the file is most likely in ~/anaconda2/bin or ~/anaconda3/bin.

Secondly, fuel-download will always download the file to the current working directory. Likewise, fuel-convert will read and write files to the current working directory by default. The data path in ~/.fuelrc is used is when you load the dataset in Python (e.g. train = DogsVsCats(('train',))), so you still need to set it.

Like

• Florian Bordes says:

Thanks for the explanation, I have a question about the hd5 file. I am using fuel-convert and after 40% I got a file of 4.3Gb So, I suppose the final file will be bigger than 10Gb, is it normal ? Isn’t it a way to reduce that file ? (Maybe using another datatype for the numpy array ?)

Like

• bartvanmerrienboer says:

Yes, the final file is about 16GB. There’s no easy way to reduce that file size, the images are already stored using unsigned 8-bit integers, which is the smallest data type possible. The reason it’s so big compared to the original files is that the data is stored without compression, while the original files were JPEG files. (You could store the data in JPEG, but you would have to decompress each batch of images during training, which could be slow.) If you don’t have 16GB of memory, don’t worry. HDF5 is pretty good at reading things from disk for large files and caching intelligently.

Liked by 1 person

4. I do not why I get this error when I use fuel-download
home/2014/dchen53/fuel_data/dogs_vs_cats.train.zip: 99% [] ETA: 0:00:01 2.3/home/2014/dchen53/fuel_data/dogs_vs_cats.train.zip: 99% [] ETA: 0:00:00 2.3 MiB/s
Traceback (most recent call last):
r = requests.get(url, stream=True)
File “/home/2014/dchen53/anaconda2/lib/python2.7/site-packages/requests/api.py”, line 69, in get
return request(‘get’, url, params=params, **kwargs)
File “/home/2014/dchen53/anaconda2/lib/python2.7/site-packages/requests/api.py”, line 50, in request
response = session.request(method=method, url=url, **kwargs)
File “/home/2014/dchen53/anaconda2/lib/python2.7/site-packages/requests/sessions.py”, line 468, in request
resp = self.send(prep, **send_kwargs)
File “/home/2014/dchen53/anaconda2/lib/python2.7/site-packages/requests/sessions.py”, line 597, in send
history = [resp for resp in gen] if allow_redirects else []
File “/home/2014/dchen53/anaconda2/lib/python2.7/site-packages/requests/sessions.py”, line 195, in resolve_redirects
File “/home/2014/dchen53/anaconda2/lib/python2.7/site-packages/requests/sessions.py”, line 576, in send
File “/home/2014/dchen53/anaconda2/lib/python2.7/site-packages/requests/adapters.py”, line 433, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: EOF occurred in violation of protocol (_ssl.c:590)

Like

• bartvanmerrienboer says:

There seems to be a problem with your SSL configuration. Did you try updating or reinstalling openssl using e.g. conda update openssl or conda install -f openssl?

Liked by 1 person

• Thanks, my computer runs out of memory, and with the new server you give me, I do not have the issue

Like

5. https://obilaniu6266h16.wordpress.com/2016/02/04/einstein-summation-in-numpy/

I don’t know if he’s posted it somewhere, but Olexa’s post on numpy’s einsum is excellent. Einsum is a really general way to do linear algebra things, where you only have to think about the dimensions of the matrices you have, and specify that in a string.

Not sure if this picture will show up, but it shows how it allows you to implement forward prop and backprop in less than a dozen lines.

Like

6. I do not know why I get this error when i am doing the blocks tutorial

import blocks

from blocks.bricks import bn
Traceback (most recent call last):
File “”, line 1, in
File “/home2/ift6ed05/anaconda2/lib/python2.7/site-packages/blocks/bricks/init.py”, line 3, in
from .bn import (BatchNormalization, SpatialBatchNormalization,
File “/home2/ift6ed05/anaconda2/lib/python2.7/site-packages/blocks/bricks/bn.py”, line 7, in
from theano.tensor.nnet import bn
ImportError: cannot import name bn

Like

• I fixed my problem by updating theano to developer version

Like

7. On Hades, I encountered this message after trying to use GPUs with theano :

WARNING (theano.tensor.blas): Failed to import scipy.linalg.blas, and Theano flag blas.ldflags is empty. Falling back on slower implementations for dot(matrix, vector), dot(vector, matrix) and dot(vector, vector) (libquadmath.so.0: cannot open shared object file: No such file or directory)

I didn’t do anything to THEANO’s setting and ran the code after import the module using “module add theano” on the cluster.

Like

8. Hello, Bart, you sent us an email about moving our dog_cats dataset to common folder, I followed this instruction: But get this error:
I do not know why:
from fuel.datasets.dogs_vs_cats import DogsVsCats
Traceback (most recent call last):
File “”, line 1, in
File “/home2/ift6ed05/anaconda2/lib/python2.7/site-packages/fuel/init.py”, line 2, in
from fuel.config_parser import config # noqa
File “/home2/ift6ed05/anaconda2/lib/python2.7/site-packages/fuel/config_parser.py”, line 209, in
File “/home2/ift6ed05/anaconda2/lib/python2.7/site-packages/fuel/config_parser.py”, line 129, in load_yaml
AttributeError: ‘str’ object has no attribute ‘items’
Here is my .fuelrc content: data_path:”/home2/ift6ed05/fuel_data”:”/home2/COMMON”
Here is my .bashrc content:
export PATH=”/home2/ift6ed05/anaconda2/bin:$PATH” export PATH=”$PATH:$HOME/ffmpeg-2.8.6/bin” export FUEL_DATA_PATH=/home/COMMON:$HOME/fuel_data
And I did source .bashrc after adding this line.

Like

• And if I run this command,
I get similar error:
Traceback (most recent call last):
File “/home2/ift6ed05/anaconda2/lib/python2.7/site-packages/setuptools-19.6.2-py2.7.egg/pkg_resources/init.py”, line 547, in load_entry_point
File “/home2/ift6ed05/anaconda2/lib/python2.7/site-packages/setuptools-19.6.2-py2.7.egg/pkg_resources/init.py”, line 2719, in load_entry_point
File “/home2/ift6ed05/anaconda2/lib/python2.7/site-packages/setuptools-19.6.2-py2.7.egg/pkg_resources/init.py”, line 2379, in load
File “/home2/ift6ed05/anaconda2/lib/python2.7/site-packages/setuptools-19.6.2-py2.7.egg/pkg_resources/init.py”, line 2385, in resolve
File “/home2/ift6ed05/anaconda2/lib/python2.7/site-packages/fuel/init.py”, line 2, in
from fuel.config_parser import config # noqa
File “/home2/ift6ed05/anaconda2/lib/python2.7/site-packages/fuel/config_parser.py”, line 209, in
File “/home2/ift6ed05/anaconda2/lib/python2.7/site-packages/fuel/config_parser.py”, line 129, in load_yaml
AttributeError: ‘str’ object has no attribute ‘items’

Like

• Florian Bordes says:

I think it’s :
export FUEL_DATA_PATH=/home2/COMMON
instead of /home/COMMON, the repository /home/COMMON doesn’t exist.
Or if you want to use the fuelrc file, it’s:
data_path: “/home2/COMMON:/home2/ift6ed05/fuel_data”

Like

• After I changed to home2, I have the same error.

Like

• bartvanmerrienboer says:

I missed this comment earlier, but in case you still have the same error: It seems to say there is something wrong with your .fuelrc file. It should contain something like data_path: /home2/COMMON but instead it seems to contain just a string.

Like

• Hello, Bart, it still has the same problem, I reinstalled ananconda, fuel, blocks, it has solved the problem , but sadly I am downloading the fuel data on my home folder. Wishing it does not give much trouble.

Like

9. Just wondering if there is a technique which can resume from one program when my computer is suddenly shut down.

Like

• bartvanmerrienboer says:

This is called checkpointing, and there are many different ways it can be achieved at varying degrees. With neural network training, you generally just want to make sure that you store your parameters every N steps, so that you can resume training from those parameters when things go wrong. Blocks implements this using the Checkpoint extension, which will allow you to resume training easily.

Like

10. I encountered this problem when trying to get data from a server stream.

In one notebook I set up a minimalistic server as follows:

from fuel.datasets.dogs_vs_cats import DogsVsCats
from fuel.streams import DataStream
from fuel.schemes import ShuffledScheme
train = DogsVsCats(('train',), subset=slice(0, 20000))
stream = DataStream(train,
iteration_scheme=ShuffledScheme(train.num_examples, 128))

from fuel.server import start_server

start_server(stream)

Then in another notebook I initiate an instance of Serverstream and try to get one batch from the server as follows:

from fuel.streams import ServerDataStream
data_stream = ServerDataStream(('image_features','target'),False)
iterator = data_stream.get_epoch_iterator()
one_batch = next(iterator)

which then returns this error :

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-6-82a2181a96af> in <module>()
2 data_stream = ServerDataStream(('image_features','target'),False)
3 iterator = data_stream.get_epoch_iterator()
----> 4 one_batch = next(iterator)

/Users/patricklau/anaconda3/lib/python3.5/site-packages/fuel/iterator.py in __next__(self)
30             data = self.data_stream.get_data(next(self.request_iterator))
31         else:
---> 32             data = self.data_stream.get_data()
33         if self.as_dict:
34             return dict(zip(self.data_stream.sources, data))

/Users/patricklau/anaconda3/lib/python3.5/site-packages/fuel/streams.py in get_data(self, request)
231         if not self.connected:
232             self.connect()
--> 233         data = recv_arrays(self.socket)
234         return tuple(data)
235

/Users/patricklau/anaconda3/lib/python3.5/site-packages/fuel/server.py in recv_arrays(socket)
73         data = socket.recv()
74         buf = buffer_(data)
---> 75         array = numpy.frombuffer(buf, dtype=numpy.dtype(header['descr']))

ValueError: cannot create an OBJECT array from memory buffer

Like

• bartvanmerrienboer says:

Judging from the error, you are trying to use the server to send object arrays i.e. NumPy arrays that contain Python objects instead of sending an n-dimensional tensor.

You will need to crop the images to be of the same size, so that you can send a single NumPy array with the shape (batch, channel, height, width) instead of sending a list of arrays where height and width are different, which is what you’re currently trying to do.

Like

11. How do you preview a reply comment before posting it?

Like

12. Just wondering should we use the test set to do predictions, as we have no labeled data for the test set, how do we know the accuracy?

Like

13. Is anyone training a feed-forward neural network with Batch Normalization? If so, what are your strategies to learn the validation-time mean and variance: Compute over full training set, or a random subset?

Also, is anyone training a neural network with many BN layers? If so, how do you efficiently manufacture all of the “partial” neural networks (Input-to-BN1, Input-to-BN2, Input-to-BN3, …) and efficiently learn the validation-time mean and variance for each BN layer one after the other? Or are there other strategies to bypass this annoyance?

Like

14. I have a qustion about mini batch training, if my training set is smaller than my validation set ,like training set is 5000, validation set is 45000, should I do mini batch on the validation set too, otherwise I am facing memory issue.

Like

15. I don’t want to put the question on one of the lectures from way back, so I will put it here.

This question is about the initialization methodology proposed by Glorot and Bengio (2010) and its application in the context of convolutional networks.

In the paper, it was suggested to initialize each layer of an mlp with sqrt(6)/(sqrt(n_i + n_(i+1)), where n_i is the number of units in the current layer and n_(i+1) the number of units in the next layer.

How would we adapt it to conv nets ? In one of the deep learning tutorials with theano the initialization was implemented as

n_i = num input feature maps * filter height * filter width
n_(i+1) = num output feature maps * filter height * filter width / pooling_size

Can someone explain where these numbers come from? It is not immediately obvious how to interpret a convolutional layer as an mlp layer in order to understand the initialization. First there is the issue of number of dimensions, then it is that of converting a conv net to a mlp .

Liked by 1 person

• This confused me too, but I think I found clarity by looking at Caffe’s source code.

This blog post (http://andyljones.tumblr.com/post/110998971763/an-explanation-of-xavier-initialization) talks about Xavier/Glorot initialization, and links to Caffe’s implementation here (https://github.com/BVLC/caffe/blob/737ea5e936821b5c69f9c3952d72693ae5843370/include/caffe/filler.hpp#L129-143)

Therein, we learn from the comments at lines 137-140 that:

It fills the incoming matrix by randomly sampling uniform data from [-scale, scale] where scale = sqrt(3 / fan_in) where fan_in is the number of input nodes. You should make sure the input blob has shape (num, a, b, c) where a x b x c = fan_in.

Like

• I don’t see how he makes it any clearer about the application in conv nets. In a convolutional network, what we think of as one sample (an image) is not one sample when the conv net is thought of as an mlp, otherwise we would take

n_in = num input feature maps * num image row * num image column

If we think of an image as many samples, each of which a local window the size of the filter (3 x 3, say), then we still leave

n_out = num output feature maps * num filter row * num filter column / pool size

unexplained. The formula above is essentially saying that we are looking at the convolution operation as mapping from R^(n_in) to R^(n_out), only that is not true.

Take a simple example where the incoming feature maps are just the three channels of the original image. Assume there are only two output feature maps and we focus on W_1, a 2 x 2 filter that maps to the first output feature map.

n_in = num input feature maps * num image row * num image column

tells us that we are grouping the three 2×2 windows from the input channels as one sample and this gets mapped to 1 pixel in the output feature map.

I just don’t see how we could explain n_out.

Like

• The formulas you give identify:
1. The total number of inputs that contribute to any single output; This is called the fan-in.
2. The total number of outputs to which any single input contributed; This is called the fan-out.

Visualize a tensor of size (#InputMaps, Height, Width) with all elements = +1.0, as if generated by numpy.ones(). Also visualize a convolution filter of size (#OutputMaps, #InputMaps, FHeight, FWidth), whose every filter tap is also = +1.0.

If you perform the convolution, you will find that the output tensor is not an array of +1.0’s of size approximately (#OutputMaps, Height, Width). Instead, every entry will be equal to #InputMaps * FHeight * FWidth. Because every filter-tap-by-image-pixel product is +1.0*+1.0 = +1.0, that proves that a large number of pixels contributed to this output. This number is called the fan-in, and that’s why fan-in is calculated as part of the computation of the normalization constant.

A similar logic applies to the reverse direction in which gradients flow. We’re now interested in fan-out instead of fan-in, and there’s the additional complexity of pooling, which cuts down the effective number of outputs to which a single output is connected (the definition of fan-out).

The square roots in the formulas relates to the behaviour of a sum of independent variables. Going back to the convolution filter of size (#OutputMaps, #InputMaps, FHeight, FWidth) above, imagine that instead of every filter tap and image pixel being = +1.0, you have 50% chance of being +1.0 and 50% chance of being -1.0. The variance of the sum of N independent random variables is the sum of the variances, so its standard deviation (the expected magnitude of the sum) will be the square root of that. The “gain” of the filter in the forward direction will thus be on the order of the square root of fan-in. The same sort of logic applies to the reverse direction and fan-out.

Alternatively, you can view the computation of a filter’s output as having random walk behaviour (https://en.wikipedia.org/wiki/Random_walk). The filter-tap-by-image-pixel products from my example above are +1 or -1 with 50% probability each, and the sequential accumulation of partial products constitutes a random walk. Given that it’s a random walk, the expected distance from 0.0 (and thus, the magnitude of the activation) will be on the order of $\sqrt{n}$ after $n$ partial product accumulations. Therefore, after fan_in accumulations, the filter’s expected “gain” is proportional to sqrt(fan_in), and the normalization constant is the inverse of that. sqrt(2.0/(fan_in + fan_out)) is a compromise normalization constant between the forward and backwards directions.

Like

16. Another convolutional network related question: in most of the literature we follow a convolution operation by a non-linear activation function and then a downsample operation. However, in theano’s deep learning tutorial it is actually implemented as a convolution->downsample->tanh sequence. Does it make any difference whether we downsample or apply non-linear activation first ? In this case it seems like the theano tutorial implemented the conv layer incorrectly. But it begs the question of why the literature always construct a conv layer by stacking convolution->non-linear activation -> downsample sequences. Also, it doesn’t seem like there is theoretical justification to favour one way over the other, does it ?

Like

• If the pooling is a max-pooling layer and the non-linearity is monotonically increasing (ReLU, tanh, sigmoid and numerous others are), then the pooling and non-linearity layers can commute, because the locally maximal pre-activation before the non-linearity will correspond to a locally maximal activation after it.

So if either order is equivalent, the decision is purely computational. Doing a (2,2) max-pooling and then applying a monotonically-increasing non-linearity costs (2*2) = 4x less in non-linearity evaluations than doing the reverse, yet they produce bitwise-identical results.

The bad news: This doesn’t apply to avg-pooling. The good news: I can’t think of a single non-monotonically-increasing non-linearity in use.

Like

17. I am wondering if we could use pertained network like VGG NET something like that to train our model?

Like

18. assyatrofimov says:

April Fools joke from Kaggle I believe:

Liked by 2 people

19. In class, I had proposed for the Voice Synthesis project that instead of directly generating the waveform, and thus having to deal with continuity issues, that one could try modulating a bank of sinusoids. Yoshua grokked what I had suggested and wrote it down on the board, but afterwards I came up with an improvement. If we always require two signals of each frequency, one phase-offset by 90 degrees from the other, then by an appropriate choice of amplitudes of each one may always synthesize an arbitrary phase shift, without an explicit phase parameter. I summarize this in my blog post here:

https://obilaniu6266h16.wordpress.com/2016/04/07/idea-for-continuous-voice-modulation-in-the-voice-synthesis-project/

Like

20. Part of the reason why I constructed my dataset with inpainted 256×256 images, yet use a 192×192 input, is to allow some wiggle room to rotate and translate without black patches appearing.

But on the other hand, an argument can be made that these black patches should stay, because your neural network should learn to be robust to junk at the very border. It might be useful to fill that black area with random noise for that very reason.

Like

21. Jonathan Pilault says:

Why is L2 Regularization equivalent to a Gaussian prior?

Like

• Jonathan says:

Why is L2 Regularization equivalent to a Gaussian prior?

Like

I’m gonna start by the definition of the L2 regularization given in the book (p231).
The L2 regularization means to use instead of $J(w;X,y)$ an other cost function which is : $\tilde{J}(w;X,y)=J(w;X,y)+\frac{\alpha}{2} w^Tw$

Now let’s see what means taken a Gaussian prior over the parameters when you update them:
You have done your training on the input X , and you want to find better parameters w knowing those inputs, If you do a MAP :
You want to maximize over w:
$P(w|X) = \frac{p(X|W)P(W)}{P(X)}$

Which is the same to maximize over w: $log(P(X|w) + log(P(w))$

At this point if you do an identification :
$log(P(x|W)$ is homogeneous to the probability of the inputs given the parameters so it’s homogeneous to the cost function $J(w,X,y)$

$log(P(w))$ is homogeneous to the prior you have over the weights w.
If you have a prior Gaussian over w, for example: $w \sim \mathbb{N}(\frac{I}{\alpha},0)$
$log(P(w))=\frac{\alpha}{2}w^Tw+ Cste$
(you throw away the constant because it doesn’t change anything when you maximize the formula and will be vanish if you derive)

So by using an L2 regularization, we act like you perform a MAP with the Gaussian prior over your weight and you maximize $P(w|X)$ by doing your gradient descent.

Liked by 1 person

• Jonathan says:

Like

22. Jonathan says:

Why is L1 Regularization equivalent to a Laplacian Prior?

Like

• Like for the previous answer :
L1 definition :
$\tilde{J}(w,X,y)=J(w,X,y)+\alpha ||w||_1$

if $w \sim Laplace(0,\frac{1}{\alpha}$

By doing an MAP on $P(w|X)$
You use:
$log(P(w)) = \alpha ||w||_1 + const$

And you find the connection between the 2 interpretations.

Liked by 1 person

• Jonathan says:

I have gotten to the same points as you in the demonstration of L2 being equivalent to a Gaussian prior and L1 being equivalent to a Laplacian prior. The only point that I think is missing is how you get to:
1. $w^Tw \sim \mathbb{N}(\frac{I}{\alpha},0)$
2. $w \sim Laplace(0,\frac{1}{\alpha})$

You just needed to add that for L2:
P(w)=\frac {1}{\sqrt {2\pi}\sigma}e^{-\frac {(w-\mu)^2}{2\sigma^2}}\
logP(w) = c_{1}w^{2} if\ \mu = 0\ which\ is\ the\ case\ when\ w \sim \mathbb{N}(\frac{I}{\alpha},0)

And for L1, it is probably some similar derivation but I don’t know the formula for the LaPlacian distribution

Like

• Jonathan says:

Welll I answered the missing link to go from Normal prior to W^2 above. That was all. Thanks

Like

23. Vincent says:

What is the conditional log-likelihood interpretation of the squared error
loss ?

Like

• You can look at linear regression in a probabilistic fashion, in which the likelihood, $p(y|x)$, is a Gaussian density that is $N(f(x); y, \sigma^2$, where $y$ is the mean and $\sigma^2$ is the variance. If you take the log of the density, then you can get rid of the normalising constant (and the sigma term), in which you get the typical squared error term $(y - f(x))^2$.

Like

24. Jonathan says:

For a neural network, what loss function that makes sense for binary targets can be
interpreted as a minus a conditional log-likelihood ?

Like

25. Jonathan says:

Consider a function f returning a random output given an input state x ∈ X ,
returning a new state x 0 ∈ X , i.e., f outputs a sample from a conditional distribution
Q(x0|x), and its successive application would generate a Monte-Carlo Markov chain.
Let P represent the asymptotic distribution of that chain (and assume it exists), i.e., a
distribution on the space X . What relationship must hold between P and Q?

Liked by 1 person

• The multiple application of Q to generate sample should make converge the set of sample into a set of sample representative of the P distribution, I think.
Or if $Q(x_a|x_{a-1})=Q(x_{a+1}|Q(x_a|x_{a-1}))$ then Q=P

Like

26. Jonathan says:

What is the difference between Sparse coding and Sparse autoencoders?

Liked by 1 person

27. For the 2012 final, question 4: I’m not entirely sure what it’s asking. Is 1) a sparse autoencoder, and 2) a sparse denoising autoencoder? Or is 2 just a denoising autoencoder? In either case, I don’t see how c) corruption level factors into 1 – doesn’t it become a denoising autoencoder as soon as you add noise to the input? Or are we also saying ithat you are adding noise to the target?

In general, for that question I’m not sure about the difference in behaviour between 1) and 2) (unless (c) doesn’t apply to (1) )

Like


text:
+0

# help : missing number

+1
263
2
+8

10,11,12,13,14,15,16,17,18,19,20,21,?,31

Leonardoda  Jun 25, 2017
Sort:

#1
+19344
+2

10,11,12,13,14,15,16,17,18,19,20,21,?,31

Sum of digits is strictly greater than product of digits.

$$10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, \mathbf{30}, 31, \\ 40, 41, 50, 51, 60, 61, 70, 71, 80, 81, 90, 91, 100, 101, \\ 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, \\ 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, \\ 140, 141, 150, 151, 160, 161, 170, \ldots$$

Example:

$$\begin{array}{|r|r|c|r|} \hline & \text{ Sum of digits } && \text{product of digits} \\ \hline 10 & 1+0 = 1 && 1\cdot 0 = 0 \\ & & 1 > 0 & \\\\ 11 & 1+1 = 2 && 1\cdot 1 = 1 \\ & & 2 > 1 & \\\\ 12 & 1+2 = 3 && 1\cdot 2 = 2 \\ & & 3 > 2 & \\ \ldots & && \\ \\ 20 & 2+0 = 2 && 2\cdot 0 = 0 \\ & & 2 > 0 & \\\\ 21 & 2+1 = 3 && 2\cdot 1 = 2 \\ & & 3 > 2 & \\ \ldots & && \\ \\ 30 & 3+0 = 3 && 3\cdot 0 = 0 \\ & & 3 > 0 & \\\\ 31 & 3+1 = 4 && 3\cdot 1 = 3 \\ & & 4 > 3 & \\ \hline \end{array}$$

heureka  Jun 26, 2017
#2
+8
+2

Your solution to answer is great . However i have other solution to this problem :

10+1^0 =11 , 11+1^1=12 , 12 +1^2 =13 , 13+1^3=14 .... we also have 20+2^0=21 ,21+2^1=23, 23+2^3=31

So my answer is 23 . Hope to see your response soon ! Thanks

Leonardoda  Jun 26, 2017

format: plain


text:
# [Tex/LaTex] Nested matrices with aligned columns and rows

arraysmath-mode

I'm trying to represent "matrices" with more than two dimensions, like the Riemann curvature tensor or Christoffel symbols, using nested matrices. I still don't know if this can help working with these objects (and that's not really relevant to this topic anyway), but before judging I'd like to see how it looks on a computer screen.
The idea is to write a vector of matrices for a 3-indices matrix, a matrix of matrices for a 4-indices matrix and so on. This is not difficult in principle:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

$\Gamma^{\sigma}_{\mu \nu} = \begin{pmatrix} \begin{pmatrix} 0 & 0 & 0 \\ 0 & -r & 0 \\ 0 & 0 & -r \sin^2(\vartheta) \end{pmatrix} \\ \begin{pmatrix} 0 & \frac{1}{r} & 0 \\ \frac{1}{r} & 0 & 0 \\ 0 & 0 & - \sin(\vartheta) \cos(\vartheta) \end{pmatrix} \\ \begin{pmatrix} 0 & 0 & \frac{1}{r} \\ 0 & 0 & \frac{1}{\tan(\vartheta)} \\ \frac{1}{r} & \frac{1}{\tan(\vartheta)} & 0 \end{pmatrix} \end{pmatrix}$

\end{document}

but the result looks really ugly:

That's what I wanted, but not how I wanted it. Is there a way to align columns and rows of different matrices? Or, alternatively, is there a way to insert internal parentheses that span through multiple rows in a big matrix with all the components?

You could use the blkarray package:

\documentclass{article}
\usepackage{amsmath}
\usepackage{blkarray}

\begin{document}

$\Gamma^{\sigma}_{\mu \nu} = \left( \begin{blockarray}{ ccc } \begin{block}{( ccc )} 0 & 0 & 0 \\ 0 & -r & 0 \\ 0 & 0 & -r \sin^2(\vartheta) \\ \end{block} \begin{block}{( ccc )} 0 & \frac{1}{r} & 0 \\ \frac{1}{r} & 0 & 0 \\ 0 & 0 & - \sin(\vartheta) \cos(\vartheta) \\ \end{block} \begin{block}{( ccc )} 0 & 0 & \frac{1}{r} \\[1ex] 0 & 0 & \frac{1}{\tan(\vartheta)} \\[1ex] \frac{1}{r} & \frac{1}{\tan(\vartheta)} & 0 \\ \end{block} \end{blockarray} \right)$

\end{document}


text:
# Fourier–Bessel series

Fourier–Bessel series

In mathematics, Fourier–Bessel series are a particular kind of infinite series expansion on a finite interval, based on Bessel functions and as such are part of a large class of expansions based on orthogonal functions. Fourier-Bessel series are used in the solution to partial differential equations, particularly in cylindrical coordinate systems.

The Fourier–Bessel series may be thought of as a Fourier expansion in the ρ coordinate of cylindrical coordinates. Just as the Fourier series is defined for a finite interval and has a counterpart, the continuous Fourier transform over an infinite interval, so the Fourier–Bessel series has a counterpart over an infinite interval, namely the Hankel transform

Because Bessel functions are orthogonal with respect to a weight function $x$ on the interval [0, "b"] they can be expanded in a Fourier–Bessel series defined by:

:$f\left(x\right) sim sum_\left\{n=0\right\}^infty c_n J_alpha\left(lambda_n x/b\right),$

where $lambda_n$ is the "n"th zero of $J_alpha\left(x\right)$ (i.e. $J_alpha\left(lambda_n\right)=0$). From the orthogonality relationship:

:$int_0^1 J_alpha\left(x lambda_m\right),J_alpha\left(x lambda_n\right),x,dx= frac\left\{delta_\left\{mn\left\{2\right\} \left[J_\left\{alpha+1\right\}\left(lambda_n\right)\right] ^2$

the coefficients are given by

:$c_n =frac\left\{int_\left\{0\right\}^b J_alpha\left(lambda_n x/b\right),f\left(x\right) ,x,dx \right\}\left\{int_\left\{0\right\}^b x J_alpha^2 \left(lambda_n x/b\right) dx\right\}=frac\left\{langle f, J_alpha\left(lambda_n x/b\right) angle\right\}\left\{|J_alpha\left(lambda_n x/b\right)|^2\right\}.$

The lower integral may be evaluated, yielding:

:$c_n =frac\left\{int_\left\{0\right\}^b J_alpha\left(lambda_n x/b\right),f\left(x\right) ,x,dx \right\}\left\{b^2 J_\left\{alphapm 1\right\}^2 \left(lambda_n\right)/2\right\}$

where the plus or minus sign is equally valid.

ee also

*orthogonal
*Generalized Fourier series

References

*

* Fourier–Bessel series applied to Acoustic Field analysis on [http://www.trinnov.com/research.php#concept Trinnov Audio's research page]

Wikimedia Foundation. 2010.

### Look at other dictionaries:

• Bessel function — In mathematics, Bessel functions, first defined by the mathematician Daniel Bernoulli and generalized by Friedrich Bessel, are canonical solutions y(x) of Bessel s differential equation: for an arbitrary real or complex number α (the order of the …   Wikipedia

• Fourier transform — Fourier transforms Continuous Fourier transform Fourier series Discrete Fourier transform Discrete time Fourier transform Related transforms The Fourier transform is a mathematical operation that decomposes a function into its constituent… …   Wikipedia

• BESSEL (FONCTIONS DE) — Les fonctions de Bessel jouent un rôle important en mathématiques appliquées et en physique mathématique. Elles interviennent aussi bien dans des problèmes de conduction de la chaleur que dans des problèmes de diffraction, acoustique, ou… …   Encyclopédie Universelle

• Función de Bessel — En matemática, las funciones de Bessel, primero definidas por el matemático Daniel Bernoulli y más tarde generalizadas por Friedrich Bessel, son soluciones canónicas y(x) de la ecuación diferencial de Bessel: (1) donde α es un …   Wikipedia Español

• Generalized Fourier series — In mathematical analysis, many generalizations of Fourier series have proved to be useful.They are all special cases of decompositions over an orthonormal basis of an inner product space.Here we consider that of square integrable functions… …   Wikipedia

• Théorème de Bessel-Parseval-Plancherel — Égalité de Parseval Pour les articles homonymes, voir Parseval. L égalité de Parseval (parfois appelée également Théorème de Parseval ou Identité de Rayleigh) est une formule fondamentale de la théorie des séries de Fourier. On la doit au… …   Wikipédia en Français

• Multiplier (Fourier analysis) — In Fourier analysis, a multiplier operator is a type of linear operator, or transformation of functions. These operators act on a function by altering its Fourier transform. Specifically they multiply the Fourier transform of a function by a… …   Wikipedia

• Serie de Fourier — Una serie de Fourier es una serie infinita que converge puntualmente a una función periódica y continua a trozos(o por partes). Las series de Fourier constituyen la herramienta matemática básica del análisis de Fourier empleado para analizar… …   Wikipedia Español

• List of Fourier analysis topics — This is an alphabetical list of Fourier analysis topics. See also the list of Fourier related transforms, and the list of harmonic analysis topics. Almost periodic function ATS theorem Autocorrelation Autocovariance Banach algebra Bessel function …   Wikipedia

• Hankel transform — Besides the meaning discussed in this article, the Hankel transform may also refer to the determinant of the Hankel matrix of a sequence .In mathematics, the Hankel transform of order nu; of a function f ( r ) is given by::F u(k) = int 0^infty… …   Wikipedia


text:
A million binaries from Gaia eDR3: sample selection and validation of Gaia parallax uncertainties
ABSTRACT We construct from Gaia eDR3 an extensive catalogue of spatially resolved binary stars within ≈1 kpc of the Sun, with projected separations ranging from a few au to 1 pc. We estimate the probability that each pair is a chance alignment empirically, using the Gaia catalogue itself to calculate the rate of chance alignments as a function of observables. The catalogue contains 1.3 (1.1) million binaries with >90 per cent (>99 per cent) probability of being bound, including 16 000 white dwarf – main-sequence (WD + MS) binaries and 1400 WD + WD binaries. We make the full catalogue publicly available, as well as the queries and code to produce it. We then use this sample to calibrate the published Gaia DR3 parallax uncertainties, making use of the binary components’ near-identical parallaxes. We show that these uncertainties are generally reliable for faint stars (G ≳ 18), but are underestimated significantly for brighter stars. The underestimates are generally $\leq30{{\ \rm per\ cent}}$ for isolated sources with well-behaved astrometry, but are larger (up to ∼80 per cent) for apparently well-behaved sources with a companion within ≲4 arcsec, and much larger for sources with poor astrometric fits. We provide an empirical fitting function to inflate published σϖ values for isolated sources. The public more »
Authors:
; ;
Award ID(s):
Publication Date:
NSF-PAR ID:
10293109
Journal Name:
Monthly Notices of the Royal Astronomical Society
Volume:
506
Issue:
2
Page Range or eLocation-ID:
2269 to 2295
ISSN:
0035-8711
National Science Foundation
##### More Like this
1. Abstract We present a search for close, unresolved companions in a subset of spatially resolved Gaia wide binaries containing main-sequence stars within 200 pc of the Sun, utilizing the APOGEE–Gaia Wide Binary Catalog. A catalog of 37 wide binaries was created by selecting pairs of stars with nearly identical Gaia positions, parallaxes, and proper motions, and then confirming candidates to be gravitationally-bound pairs using APOGEE radial velocities. We identify close, unresolved stellar and substellar candidate companions in these multiple systems using (1) the Gaia binary main-sequence and (2) observed periodic radial velocity variations in APOGEE measurements due to the influence of a close substellar-mass companion. The studied wide binary pairs reveal a total of four stellar-mass close companions in four different wide binaries, and four substellar-mass close companion candidates in two wide binaries. The latter are therefore quadruple systems, with one substellar mass companion orbiting each wide binary component in an S-type orbit. Taken at face value, these candidate systems represent an enhancement of an order of magnitude over the expected occurrence rate of ∼2 per cent of stars having substellar companions >2 MJup within ∼100 day orbits; we discuss implications and possible explanations for this result. Finally, we compare chemical differences between the componentsmore »
2. ABSTRACT

We use Gaia EDR3 data to identify stars associated with six classical dwarf spheroidals (dSphs) (Draco, Ursa Minor, Sextans, Sculptor, Fornax, Carina) at their outermost radii, beyond their nominal King stellar limiting radius. For all of the dSphs examined, we find radial velocity matches with stars residing beyond the King limiting radius and with ${\gt}50{{\ \rm per\ cent}}$ astrometric probability (four in Draco, two in Ursa Minor, eight in Sextans, two in Sculptor, 12 in Fornax, and five in Carina), indicating that these stars are associated with their respective dSphs at high probability. We compare the positions of our candidate ‘extra-tidal’ stars with the orbital tracks of the galaxies, and identify stars, both with and without radial velocity matches, that are consistent with lying along the orbital track of the satellites. However, given the small number of candidate stars, we cannot make any conclusive statements about the significance of these spatially correlated stars. Cross matching with publicly available catalogues of RR Lyrae, we find one RR Lyrae candidate with ${\gt}50{{\ \rm per\ cent}}$ astrometric probability outside the limiting radius in each of Sculptor and Fornax, two such candidates in Draco, nine in Ursa Minor, seven in Sextans, and zeromore »

3. Abstract

White dwarf (WD) stars evolve simply and predictably, making them reliable age indicators. However, self-consistent validation of the methods for determining WD total ages has yet to be widely performed. This work uses 1565 wide (>100 au) WD+WD binaries and 24 new triples containing at least two WDs to test the accuracy and validity of WD total age determinations. For these 1589 wide double WD binaries and triples, we derive the total age of each WD using photometric data from all-sky surveys, in conjunction with Gaia parallaxes and current hydrogen atmosphere WD models. Ignoring the initial-to-final mass relation and considering only WD cooling ages, we find that roughly 21%–36% of the more massive WDs in a system have a shorter cooling age. Since more massive WDs should be born as more massive main-sequence stars, we interpret this unphysical disagreement as evidence of prior mergers or the presence of an unresolved companion, suggesting that roughly 21%–36% of wide WD+WD binaries were once triples. Among the 423 wide WD+WD pairs that pass high-fidelity cuts, we find that 25% total age uncertainties are generally appropriate for WDs with masses >0.63Mand temperatures <12,000 K and provide suggested inflation factors for age uncertainties formore »

4. ABSTRACT We report the result of searching for globular clusters (GCs) around 55 Milky Way (MW) satellite dwarf galaxies within the distance of 450 kpc from the Galactic Centre except for the Large and Small Magellanic Clouds and the Sagittarius dwarf. For each dwarf, we analyse the stellar distribution of sources in Gaia DR2, selected by magnitude, proper motion, and source morphology. Using the kernel density estimation of stellar number counts, we identify 11 possible GC candidates. Cross-matched with existing imaging data, all 11 objects are known either GCs or galaxies and only Fornax GC 1–6 among them are associated with the targeted dwarf galaxy. Using simulated GCs, we calculate the GC detection limit $M_{\rm V}^{\rm lim}$ that spans the range from $M_{\rm V}^{\rm lim}\sim -7$ for distant dwarfs to $M_{\rm V}^{\rm lim}\sim 0$ for nearby systems. Assuming a Gaussian GC luminosity function, we compute that the completeness of the GC search is above 90 per cent for most dwarf galaxies. We construct the 90 per cent credible intervals/upper limits on the GC specific frequency SN of the MW dwarf galaxies: 12 < SN < 47 for Fornax, SN < 20 for the dwarfs with −12 < MV < −10, SNmore »
5. ABSTRACT

We measure star-spot filling fractions for 240 stars in the Pleiades and M67 open star clusters using APOGEE high-resolution H-band spectra. For this work, we developed a modified spectroscopic pipeline which solves for star-spot filling fraction and star-spot temperature contrast. We exclude binary stars, finding that the large majority of binaries in these clusters (80 per cent) can be identified from Gaia DR3 and APOGEE criteria – important for field star applications. Our data agree well with independent activity proxies, indicating that this technique recovers real star-spot signals. In the Pleiades, filling fractions saturate at a mean level of 0.248 ± 0.005 for active stars with a decline at slower rotation; we present fitting functions as a function of Rossby number. In M67, we recover low mean filling fractions of 0.030 ± 0.008 and 0.003 ± 0.002 for main sequence GK stars and evolved red giants, respectively, confirming that the technique does not produce spurious spot signals in inactive stars. Star-spots also modify the derived spectroscopic effective temperatures and convective overturn time-scales. Effective temperatures for active stars are offset from inactive ones by −109 ± 11 K, in agreement with the Pecaut & Mamajek empirical scale. Star-spot filling fractions at the level measured in active stars changes their inferred overturn time-scale,more »


text:
Arectemieryf0

2022-07-20

Not seeing steps between factoring fractions
I'm looking to solve the limit of the following error function as s goes to 0, but I'm failing on factoring things out. My calculator (TI-89) gives me a nice form I can use, but I cannot manipulate things quite right. Can anyone point out what I'm doing wrong/missing?
The function starts as
$sE\left(s\right)=\frac{s}{{s}^{2}}\left[1-\frac{K\left({K}_{1}s+{K}_{2}\right)}{T{s}^{2}+\left(K{K}_{1}+1\right)s+K{K}_{2}}\right]$
I multiplied so as to combine the two fractions:
$\frac{1}{s}\cdot \frac{Ts+K{K}_{1}+1+\frac{K{K}_{2}}{s}}{Ts+K{K}_{1}+1+\frac{K{K}_{2}}{s}}$
And I'm left with
$\frac{Ts+K{K}_{1}+1+\frac{K{K}_{2}}{s}-K{K}_{1}s-K{K}_{2}}{T{s}^{2}+\left(K{K}_{1}+1\right)s+K{K}_{2}}$
Unfortunately, I can't figure how to simplify out the numerator.
The calculator states the answer is
$\frac{Ts+1}{T{s}^{2}+\left(K{K}_{1}+1\right)s+K{K}_{2}}$
I can deal with that, as the limit will simply be $\frac{1}{K{K}_{2}}$. But what are the steps in between? I don't know how to get rid of the $K{K}_{x}$ terms in the numerator as I need to.

lelapem

Expert

I believe your mistake is somewhere in how you combined the fractions initially. Here's what the simplification should look like:
$\begin{array}{rl}sE\left(s\right)& =\frac{s}{{s}^{2}}\left[1-\frac{K\left({K}_{1}s+{K}_{2}\right)}{T{s}^{2}+\left(K{K}_{1}+1\right)s+K{K}_{2}}\right]\\ & =\frac{1}{s}-\frac{K\left({K}_{1}s+{K}_{2}\right)}{s\left(T{s}^{2}+\left(K{K}_{1}+1\right)s+K{K}_{2}\right)}\\ & =\frac{T{s}^{2}+\left(K{K}_{1}+1\right)s+K{K}_{2}-K\left({K}_{1}s+{K}_{2}\right)}{s\left(T{s}^{2}+\left(K{K}_{1}+1\right)s+K{K}_{2}\right)}\\ & =\frac{T{s}^{2}+s}{s\left(T{s}^{2}+\left(K{K}_{1}+1\right)s+K{K}_{2}\right)}\\ & =\frac{Ts+1}{T{s}^{2}+\left(K{K}_{1}+1\right)s+K{K}_{2}}\end{array}$

Do you have a similar question?


text:
# Does $S \ge 0$ follow from Callen's thermodynamic postulates?

In his textbook, Thermodynamics and an Introduction to Thermostatistics, H. B. Callen introduces entropy by the following four postulates:

Postulate I. There exist particular states (called equilibrium states) of simple systems that, macroscopically, are characterized completely by the internal energy $$U$$, the volume $$V$$, and the mole numbers $$N_1, N_2, \dotsc, N_r$$ of the chemical components.

Postulate II. There exists a function (called the entropy $$S$$) of the extensive parameters of any composite system, defined for all equilibrium states and having the following property: The values assumed by the extensive parameters in the absence of an internal constraint are those that maximize the entropy over the manifold of constrained equilibrium states.

Postulate III. The entropy of a composite system is additive over the constituent subsystems. The entropy is continuous and differentiable and is a monotonically increasing function of the energy.

Postulate IV. The entropy of any system vanishes in the state for which $$(\partial U/\partial S)_{V,N_1,\dotsc,N_r} = 0 \quad \textit{(that is, at the zero of temperature)}$$

From Postulate III follows that $$S$$ is homogeneous first-order, that $$(\partial S/\partial U)_{V,N_1,\dotsc, N_r} > 0$$ (hence $$T \ge 0$$), and that $$U$$ is a single-valued, continuous, and differentiable function of $$S, V, N_1, \dotsc, N_r$$. Postulate IV implies that $$S$$ has a uniquely defined zero. (This does not mean that there is a unique zero-entropy equilibrium state, but that, unlike $$U$$, one cannot redefine $$S$$ by addition of a constant.)

Now, in the context of statistical mechanics $$S$$ is certainly a nonnegative function, but I wonder if $$S \ge 0$$ also follows directly from the above postulates?

I can see that if one also has that $$S$$ is a strictly concave function of $$U$$ then postulates III and IV would imply $$S \ge 0$$, but I don't see how such concavity would follow from the postulates, so that might be a red herring.

If I'm not mistaken, Callen pulls a fast one and redefines some terms at the end of Chapter 1, so that all equilibrium states now have $$d^2 S < 0$$ (bolding mine):

By straightforward differentiation, we computer the extrema of the total entropy function, and then, on the basis of the sign of the second derivative, we classify these extrema as minima, maxima, or as horizontal inflections. In an appropriate physical terminology we first find the equilibrium states and we then classify them on the basis of stability. It should be noted that in the adoption of this conventional terminology we augment our previous definition of equilibrium; that which was previously termed equilibrium is now termed stable equilibrium, whereas unstable equilibrium states are newly defined in terms of extrema other than maxima.

In other words, Callen's final definition of "equilibrium states" now includes stability, which implies that $$d^2 S < 0$$. In other words, the entropy function is concave, as you wanted it to be.

• Correct me if I am wrong, but I take this to mean only that $S$ is concave about stable equilibria. It does not say anything about general concavity of $S$, which is what is relevant to the question (specifically w.r.t. $U$).
– ummg
Nov 8, 2021 at 20:11
• @ummg: Are you concerned about non-equilibrium states, or about unstable equilibrium states? If the former, then I think Postulate II rules that out, since $S$ is only defined for equilibrium states. If the latter, then my reading of the paragraph I quoted is that he's saying that "we're redefining what we meant by 'equilibrium states' and restricting our consideration to 'stable equilibrium states'." But it's possible I'm misreading him. Nov 8, 2021 at 20:22
• I'm concerned about the global properties of $S(U, V, N_1 \dotsc, N_r)$, not the local properties about any particular constrained equilibrium. Since you seem to have access to the book, take a look at Figure 4.1. I am wondering wether it follows from the postulates that this surface is restricted to the half-space $S \ge 0$.
– ummg
Nov 8, 2021 at 20:36
• Indeed, if $S$ was concave everywhere there would be no need to distinguish stable from unstable equilibria.
– ummg
Nov 8, 2021 at 20:40
• Looking ahead in the book, it seems like we will indeed allow for regions of convex $S(U, V, N_1, \dotsc, N_r)$, which will give rise to the existence of different phases. So, while I can see your point, at a semantic level, about the part you quote, I do not think Callen means to imply that $S(U, V, N_1, \dotsc, N_r)$ is concave everywhere. But I haven't actually got that far in the book yet, so I could be misunderstanding something.
– ummg
Nov 8, 2021 at 22:27

Let me start with a side remark. I think that, in analogy with the existence of a minimum for the energy, Callen's Postulate IV should be stated as

The entropy of any system is a constant in the state for which $$(\partial U/\partial S)_{V,N_1,\dotsc,N_r} = 0 \quad \textit{(that is, at the zero of temperature)}$$.

Then, exactly for the same reasons as for the energy, it is convenient to take zero such a constant as well as the energy minimum.

In any case,

• from Postulate III, the homogeneity of degree 1 of the entropy follows;
• from the homogeneity and Postulate II, the concavity of the entropy as a function of its variables follows. A discussion about this point is in the chapter on the stability of equilibrium.

Therefore, the hypersurface $$(\partial U/\partial S)_{V,N_1,\dotsc,N_r} = 0$$ must be the border of the convex domain of the entropy function. By the last part of Postulate II, it follows that $$S \geq 0$$.


text:
How to solve the diophantine equation $2(x+y)=xy+9$?

The following diophantine equation came up in the past paper of a Mathematics competition that I am doing soon: $$2(x+y)=xy+9.$$

Although I know that the solution is $(1,7)$, I am unsure as of how to reach this result. Clearly, the product $xy$ must be odd since $2(x+y)$ must be even, however beyond that, I am unable to see anything else that I can do to solve the problem. I have also tried using the AM-GM inequality, however, it did not simplify the problem much:$$(x+y)+(x-xy+y)\le(\frac{(x+y)+(x+y-xy)}{2})^2.$$ Any help would be greatly be appreciated.

$2(x+y) = xy +9 \implies 2x - xy = 9 - 2y \implies x = \frac{9-2y}{2-y} = \frac{2y-9}{y-2} = 2 - \frac{5}{y-2}$.

If $x$ is an integer, then $\frac{5}{y-2}$ is also an integer. This will tell you what $y$ can be, then what $x$ can be. Trying these out will give you the solution $y=7, x=1$ and the solution $y=3,x=-3$, which then will give you four solutions, since you can switch $x,y$ (it doesn't change the equation) and get more solutions.

• I would done in this way(+1) – lab bhattacharjee Apr 9 '17 at 13:11
• @labbhattacharjee thank you – Teresa Lisbon Apr 9 '17 at 13:15
• There are three other solutions... – Pedro A Apr 9 '17 at 14:35
• @Hamsteriffic Answer edited. – Teresa Lisbon Apr 9 '17 at 17:38

We need to solve $$xy-2(x+y)+4=-5$$ or $$(x-2)(y-2)=-5$$ and it remains to solve the following systems.

$x-2=1$ and $y-2=-5$;

$x-2=-1$ and $y-2=5$;

$x-2=5$ and $y-2=-1$ and

$x-2=-5$ and $y-2=1$,

which gives the answer: $\{(1,7),(7,1), (3,-3),(-3,3)\}$.

• Glad to see a more proper answer than the one favorited by the asker. Not to say that one is bad or anything, but yours most clearly and completely answers the question. – AmateurMathPirate Aug 24 '17 at 13:05
• @AmateurMathGuy It happens often enough in our forum. Thank you for your interest! – Michael Rozenberg Aug 24 '17 at 13:10


text:
# Run-down of a wheel as a func. of time from full speed to standstill.

1. Jul 18, 2013

### Mamed

1. The problem statement, all variables and given/known data
Hello

I need to find a an equation that describes the rundown of a wheel as function of the time.
The wheel is running at an constant speed and is then disconnected and runs down to standstill.

We know what the angular velocity of the wheel is at time 0, Wm. We know the inertia, J. with this we can calculate the kinetic energy in the wheel at time 0 as

E = J * Wm^2 / 2

Now we also now the Friction losses in kW at the constant speed, Pfr at time 0.

What i want to know is how to combine these. I know that the frictional losses are subtracted somehow from the kinetic energy but i down now where to start.

Any help appreciated.

2. Jul 18, 2013

### TSny

Hello. Can you determine the torque due to friction from the initial frictional power loss, Pfr, and the initial angular speed ωm?

3. Jul 19, 2013

### Mamed

Yes these two things are know and given. The wheel is running at the grid network of 50Hz and at that speed Pfr is known and constant.

I think that the friction losses are decreased with the angular frequency to the power of 2 or 3 but i am not really sure on this.

Ie

Pfr(w) = Pfr0 * w^3

4. Jul 19, 2013

### TSny

This equation is inconsistent with dimensions. Maybe it should be written P = bωn where b is a constant and the exponent n is 2 or 3. You should be able to write the constant b in terms of the initial frictional power loss Po and the initial rate of spin ωo.

It looks like this will require some calculus in order to determine how ω changes with time. Do you see how to relate P and E using a derivative?

5. Jul 23, 2013

### Mamed

Sorry its more $P_{fr} = P_{fr_0} (\frac{w}{w_0})^3$

If we look at newtons second equation we have

$\frac{}{} J * \frac{dw}{dt} + kw = 0$

it gives that

$\frac{dw}{dt} + \frac{k}{J}w = 0$

if we set the solution as $w * e^{(k*t /J )}$ we get

$\frac{d}{dt}w * e^{(k*t /J )} + \frac{k}{J}w * e^{(k*t /J )} = 0$

solving this for $w * e^{(k*t /J )}$ we will have an solution as

$w(t) = w(0) * e^{(k*t /J )}$ but i dont know how i should link $k$ and $Pfr$.

All i want is to graf w(t), that is that the speed is decreasing with time due to friction losses.

6. Jul 23, 2013

### TSny

OK, so we can write $P_{fr} = P_{fr_0} (\frac{w}{w_0})^3 = aw^3$ where $a = \frac{P_{fr_0}}{w_0^3}$

How did you get the torque $\tau$ to be $kw$? The magnitude of the torque is related to the power as $P_{fr} = \tau w$. Use $P_{fr} = aw^3$ to discover how the torque depends on $w$.

7. Jul 25, 2013

### Mamed

Ok if we do that we will get an equation a standard solution that looks something like

$\frac{d\omega}{dt} = -a\omega^3$ -> $\frac{d\omega}{\omega^3} = -adt$

$\omega(t) = \frac{1}{\sqrt{2at + C_1}}$ where $C_1 = \omega(0) = 1/w_0$

And if i plot this as a fuction of time i will get a rolldown time of seconds while it should take minutes. So i looked at the dimensions of the newtons equation and they are not the same :/ should there be another term to make sure that they are the same dimensions?

KR

8. Jul 25, 2013

### TSny

The frictional power is the rate at which the energy is decreasing due to friction: $P = -dE/dt$.

What differential equation do you get if you substitute $P = aw^3$ and $E = \frac{1}{2} J w^2$?

9. Jul 25, 2013

### Mamed

Ok so $dE/dt + P = 0$ as $dE/dt$ has dimension Joule/s which is the same as Watt.

So what we will have is

$\frac{d\omega^2J}{dt2} + a\omega^3 = 0$

(not sure if im doing the next step correct or not) but if we take away one $\omega$ on each side we will get

$\frac{d\omega}{dt}*\frac{J}{2} + a\omega^2 = 0$

and if we solve this we will get

$\omega(t) = \frac{\omega_0}{2*P_{fr0}/J\omega_0 + 1}$

am i doing this correctly?

10. Jul 25, 2013

### TSny

Careful with the factors of 2. Note that $\frac{d}{dt}\omega^2 = 2\omega\frac{d\omega}{dt}$. So, $\frac{dE}{dt} = \frac{1}{2}J\frac{d}{dt}\omega^2 = J\omega\frac{d\omega}{dt}$.

After you set up $P = -\frac{dE}{dt}$, separate variables and integrate to find $\omega(t)$.

[Note that your result $\omega(t) = \frac{\omega_0}{2*P_{fr0}/J\omega_0 + 1}$ doesn't make sense because your right hand side doesn't depend on time. You know that $\omega$ should decrease with time.]

11. Jul 25, 2013

### Mamed

Sorry forgot the $t$ there in the nominator. There is supposed to be a $t$ there like this.

$\omega(t) = \frac{\omega_0}{2*P_{fr0}*t/J\omega_0 + 1}$

12. Jul 25, 2013

### TSny

OK. After correcting for the factor of 2, I think there's still an error in part of your expression where you have the ratio $P_{fr0}*t/J\omega_0$. Check to make sure you have the correct exponent on the $\omega_0$ here.

13. Jul 26, 2013

### Mamed

Ok this is how i have reasoned when looking at this.

$\frac{dE}{dt} + P = 0$

we know how the equation is set up

$E = \frac{J\omega^2}{2}; P = \frac{P_{fr0}}{\omega_0^3}*\omega^3 → a * \omega^3$

we replace E and P with their dependency of $\omega$ and cross out one $\omega$ on each side, it is this step that im am hesitant on whether you can really do this

$\frac{J}{2}\frac{d\omega^2}{dt} + a*\omega^3 = 0 → \frac{J}{2}\frac{d\omega^{2→1}}{dt} + a*\omega^{3→2} = 0 → \frac{J}{2}\frac{d\omega}{dt} + a*\omega^2 = 0$

simplify a bit

$\frac{d\omega}{dt} + \frac{2*a}{J}*\omega^2 = 0$ call $\frac{2*a}{J}$ for $\alpha$

$\frac{d\omega}{dt} + \alpha*\omega^2 = 0$

move over to the other side

$\frac{d\omega}{dt} = -\alpha*\omega^2$

$\frac{d\omega}{\omega^2} = -\alpha*dt$

integrate

$∫\omega^{-2}d\omega = -\alpha*∫dt$

$-\omega^{-1} = -\alpha*t + C$

change singes

$+\omega^{-1} = +\alpha*t - C$

$\omega(t) = \frac{1}{\alpha*t - C}$

where we find the constant

$\omega(0) = \omega_0$

$\omega(0) = \frac{1}{0 - C} → C = -1/\omega_0$

giving us

$\omega(t) = \frac{1}{\alpha*t 1/\omega_0}$

if we multiply with \omega_0 / \omega_0 on both sides we will have

$\omega(t) = \frac{1}{\alpha*t + 1/\omega_0} * \frac{\omega_0}{\omega_0}$

$\omega(t) = \frac{\omega_0}{\omega_0\alpha*t + 1}$

if we substitute the $\alpha$ with what is has been then we will get

$$\omega(t) = \frac{\omega_0}{\frac{2P_{fr0}*t}{J*\omega_0} + 1}$$

the problem is that with

$P_{fr0} = 170 000 watt$
$w_0 = \pi * 50$ ( 4 pole machine)
$J = 4000 kgm^2$
$t = seconds$

we will get a decrease that is too fast. The slowdown should take around one hour when it takes minutes. If however we put the power in kW instead of W then rate is much closer to the reality though in this case it more the other way around as it takes 2x longer.

14. Jul 26, 2013

### TSny

As noted earlier, $\frac{d}{dt} \omega^2 = 2\omega \frac{d\omega}{dt}$. So $\frac{d}{dt}(\frac{1}{2}J\omega^2) = J\omega \frac{d\omega}{dt}$. (The 2's have cancelled.)

Then, $$\alpha = \frac{a}{J} = \frac{P_{0fr}}{J \omega_0^3}$$ Note that $\omega_0$ is raised to the third power here.

When you substitute this into $\omega(t) = \frac{\omega_0}{\omega_0 \alpha t +1}$, you end up with $$\omega(t) = \frac{\omega_0}{\frac{P_{0fr}}{J \omega_0^2}t +1}$$

So, you have the square of $\omega_0$ in the denominator.


text:
# List iterator not incrementable

## Recommended Posts

Hi, I have a little problem in my game which randomly pops up, so it seems. I get a Debug Assertion Failed error claiming that my list iterator is not incrementable. The call stack brings me to a simple piece of code:
std::list<Buff*>::iterator i = lstBuffs.begin();

while(i != lstBuffs.end())
{
if((*i)->GetTimeLeft() == 0 && (*i)->GetDuration() > 0)
{
delete (*i);
i = lstBuffs.erase(i);
}
else
{
i++;
}
}

I don't see how the iterator could not increment. If the iterator should reach the end of the list then the loop should break. If the last element gets erased the iterator should get the same value as lstBuffs.end() and the loop should break. So I'm guessing that the iterator getting incremented is somehow corrupt. So the question is, why is this happening?

##### Share on other sites
Is it possible for any of those function calls to modify the list you're iterating? For instance, if the Update call removes the object from the list it would invalidate the iterator.

##### Share on other sites
Thanks for the reply. Good point, but too bad that's not the case.

I just noticed however that I don't get any error if I don't call list::clear(). This happens outside the function I posted before. I don't understand why it makes a difference, after a call to clear the list should be empty and the loop should not start at all, but this seems not to be the case.

##### Share on other sites
So I did some more debugging, I am certain this problem only occurs if I call lstBuffs.clear(). The weird thing is that at the time this error occurs the debugger shows me the list is empty. However if I check for an empty list using lstBuffs.empty() before I run the function I still get the same error.

##### Share on other sites
Turns out you were right Zipster, function inside a function inside another function called the clear function, totally missed that. Thanks again.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
627701
• Total Posts
2978704

• 21
• 14
• 12
• 10
• 12


text:
# Converting an input string to a list of sub lists with numbers

I am learning Python 3. One thing I am doing to get some repetition is going through checkio. It is a website with coding exercises. One of the exercises gives an input string as follows:

str_to_nbrs("(2,2),(6,2),(2,6)")

str_to_nbrs("(3,7),(6,10),(9,7)")

I need the output of this code to produce a list of sub lists with the pairs of numbers so I can put them into variables to use for calculations.

This exercise actually has to do with x and y coordinates and circles. I am not sure why this input was in the form of a string. But, it gives me a chance to learn how to use the tools to convert a string like this to numbers that I can use in mathematical processes.

I figured out how to accomplish what I need. I am relatively new to Python 3. But, from what I have seen already, it is a well-thought-out and efficient language. I would bet there is a better way to do it with less code.

Please note that I added the big obvious comments to explain what the code is doing. They are not part of my regular coding style.

One more thing: I am still trying to come up with a convention for variable names. I have started lists with "l_". I try to give things meaningful names, but also try to keep them relatively short. I know "l_work" isn't a good name. But, I just wanted to finish that section of code, and used that...err...unimaginative name.

import re

# str_to_nbrs("(2,2),(6,2),(2,6)")

def str_to_nbrs(data):
print("String input:")
print(data)
print()
new_data = re.sub(r"\(","",data)
new_data = new_data + ","

print("Remove left parenthesis and add a comma a the end for split method:")
print(new_data)
print()

l_data = new_data.split("),")
l_data.pop()
print("Reformatted string data in a list:")
print(l_data)
print()

l_work = []
l_nbrs = []
l_all = []

for i in l_data:
l_work = i.split(",")
for j in l_work:
l_nbrs.append(int(j))
l_all.append(l_nbrs)
l_nbrs = []
print("Integers in sub lists:")
print(l_all)
print()
print("---------------------")
print()

str_to_nbrs("(2,2),(6,2),(2,6)")
str_to_nbrs("(3,7),(6,10),(9,7)")

re.sub(r"\(","",data) is not a very good use of regular expressions. You could have more easily achieved the same result with data.replace("(", "").

But since you are already using regular expressions, why not use them to do more:

>>> re.findall(r'\d+,\d+', "(2,2),(6,2),(2,6)")
['2,2', '6,2', '2,6']

This regular expression finds all digits (\d) (allows also multiple digits using +), which are separated only by a comma. Since different pairs also have parenthesis around them, this just gives you a list of the pairs.

By adding parenthesis around the digits, this captures each of them and splits each pair:

>>> re.findall(r'(\d+),(\d+)', "(2,2),(6,2),(2,6)")
[('2', '2'), ('6', '2'), ('2', '6')]

Now all that is left to do is convert them to integers and put it in a function:

def str_to_nbrs(data):
return [list(map(int, p)) for p in re.findall(r'(\d+),(\d+)', data)]

• Yes - string.replace(). I was looking at the TutorialsPoint RegExp page. I should have looked at the String page. I had no idea that re.findall() existed. I need to look at the Python 3 Documentation more. I bookmarked the RegExp page at section 6.2. I am still learning where to go for reference/documentation. The official Python Documentation is so big. But, I need to learn to find things there. – Gina Aug 22 '18 at 20:55
• @gina try devdocs.io/python~3.6 – hjpotter92 Aug 23 '18 at 21:03

The Abstract Syntax Trees module is perfect for converting string literals into python values, such as lists and tuples. Specifically, the ast.literal_eval() method in AST Helpers.

def str_to_nbrs(data):
return ast.literal_eval("[" + data + "]")

>>> str_to_nbrs("(2,2),(6,2),(2,6)")

[(2, 2), (6, 2), (2, 6)]

Surrounding the string "(2,2),(6,2),(2,6)" with [ and ] characters will turn it into the literal string for a list, which is necessary to ensure the result is a nested list of tuples.

ast.literal_eval("[(2,2),(6,2),(2,6)]")  # [(2,2),(6,2),(2,6)]  list of tuples
ast.literal_eval("(2,2),(6,2),(2,6)")    # ((2,2),(6,2),(2,6))  tuple of tuples
ast.literal_eval("[(2,2)]")              # [(2,2)]              list of 1 tuple
ast.literal_eval("(2,2)")                # (2,2)                Oops! Not a tuple of tuples!

Note: You can surround the string with with ( ), but "((2,2))" still evaluates as the tuple (2,2). You need the trailing comma "((2,2),)" in order to convert to the nested tuple of exactly 1 tuple: ((2,2),)

Note: Using ast.literal_eval() is about 4 times slower than Graipher's method, but it handles general python literals, including strings, and dictionaries in addition to lists of tuples. With great power comes reduced speed.

(Excluding what Graipher has already mentioned)

You can use slices to get selected portions of lists. Consider l_data. After .split()-ing, you use .pop() to get rid of the last element.

l_data = new_data.split("),")
l_data.pop()

You can split the data and get rid of the last element in one statement, using the slice [:-1]. The slice :-1 translates to "all elements excluding the last one".

l_data = new_data.split("),")[:-1]

The statement l_work = [] is unnecessary. l_work = i.split(",") will overwrite the initialized list.

Initializing l_nbrs = [] outside your loop is unnecessary, and requires that you reinitialize it at the end of the loop. Instead, move it inside the loop, at the top:

for i in l_data:
l_work = i.split(",")
l_nbrs = []            # Initialized here
for j in l_work:
l_nbrs.append(int(j))
l_all.append(l_nbrs)

This is referred to lately as keeping your code DRY (Don't Repeat Yourself), in contrast to WET (Write Everything Twice) code.

List comprehension is a powerful tool. The inner loop can be replaced with the following single statement:

    l_nbrs = [ int(j) for j in l_work ]

Once you understand that, the code can be reduced further by avoiding the single use l_work and l_nbrs variables::

for i in l_data:
l_all.append( [ int(j) for j in i.split(",") ] )


text:
Public Group

# random number?

This topic is 3600 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

How can I get a random number, specificly a random number between two numbers in C++? I've learnt you need the rand() or rand_s() function(The latter is better isnt it?) though I don't really know how to work with it even less how to get a random number between two numbers with it... If anyone could help me out with this I'd be grateful. Thanks.

##### Share on other sites
Why don't you try Googling and reading the material on random number generation in C++?

Also, to have a random number between a set range, you need to do a few mathematical operations. It's not complicated if you think about it. Or look it up online to see the basic formulas.

##### Share on other sites
Here is the pseudocode. it will look something like this:
if (rand() % 2 == 0){   // do this}else{   // do that}

##### Share on other sites
I usually do something like this
srand((unsigned)time(0));      randomNumber1 = (rand()%10)+1;
for random numbers between 1 and 10 but like oler1s said just google it and you get quite a few good reads on them

##### Share on other sites
Use the modulo and then offset the outcome, such as:
Let's say you want a "random" number between 13 and 78.

srand(time(0)); // initialize randomizer

int r = rand(); // pick a random number
r = r % 66; // limit that number to between 0 and 65
r += 13; // this will offset it by 13, giving you some number between 13 and 78

##### Share on other sites
I've gone ahead and looked into the subject a bit, so rand() isn't the best method to get random numbers? Will this method give me problems in the long run? I require random numbers for simple stuff such as a damage range for attacks, a probability to hit target etc..

##### Share on other sites
cause noone said it yet.
call srand(time(0)); ONCE in you code when you want to initalize the random number sequence (ie the top of main)

then call rand() to get your random numbers.
You can also get a good random distribution between two numbers with:

float range = highNum - lowNum;
float num = ((float)rand() / (float)RAND_MAX) * range + lowNum;

##### Share on other sites
Quote:
 Original post by AntonymI've gone ahead and looked into the subject a bit, so rand() isn't the best method to get random numbers? Will this method give me problems in the long run? I require random numbers for simple stuff such as a damage range for attacks, a probability to hit target etc..

for a thing like damage or probability you're a better shot with computing it based on some data rather than random'ing, random() isn't that much random as you think. Set srand(time(0)) as I said before, put it at the beginning of your main or whatever so it initializes the randomizer based on current time, this will give you less chance on the numbers repeating.

##### Share on other sites
Note that using modulus (%) can have bad consequences based on the underlying implementation of rand(). Many implementations use an LCG or other similar type of pseudo-random generator, which may result in a low order of "randomness" in the lower bits of the value, so that naively taking the modulus of the result can be bad. (For instance, many LCG implementations will return alternately even/odd results, so that the final results of a mod operation will also alternate even and odd). Even higher order PRNGs frequently exhibit a low amount of randomness in the lower order bits.

A better way is to normalize the result before scaling to a range. rand() returns a value in the range [0..RAND_MAX), so casting the result to a double and dividing by RAND_MAX+1 returns a number in the range [0,1) (ie, approaching 1 but never actually reaching 1) which you can then scale and truncate into any desired integral range, [Low, High]:

double d=(double)rand() / ((double)RAND_MAX + 1.0);
int roll=(int)(Low + d*(High-Low));

You can also bit-shift the result of rand() a few places before taking the modulus, although this can reduce the period of the sequence, or amount of time before the values repeat themselves.

##### Share on other sites
Quote:
 Original post by AntonymI've learnt you need the rand() or rand_s() function(The latter is better isnt it?)

Not really; it's Microsoft-specific.

There's nothing magical about any of the formulas you're being given here. The function gives you a random number across a specific range, and you do math in order to map that into the range that you want. If you Think(TM), you can figure these kinds of things out for yourself.

1. 1
2. 2
3. 3
Rutin
18
4. 4
JoeJ
14
5. 5

• 14
• 9
• 23
• 9
• 32
• ### Forum Statistics

• Total Topics
632623
• Total Posts
3007504
• ### Who's Online (See full list)

There are no registered users currently online

×


text:
[.net] moving a form by dragging in the client area

This topic is 5169 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

how would one go about moving a form by dragging the mouse in the client area of said form in c#? what i am looking for is the same behavior as when the user clicks and drags the form around by the caption bar. i've done this in other langages, but i'm still learning the .NET way. thanks in advance! EDIT: i should add that i have tried to add the difference between the current and previous mouse position, but i can see tearing artifacts when it moves, and it doesn't "keep up" with the mouse. [Edited by - krez on August 26, 2005 7:15:26 AM]

Share on other sites
http://www.yoraispage.com/articles/20040903.asp

The trick is quite simple, handle the WM_NCHITTEST message (look it up in MSDN, basically Windows uses it to know in which area of the control you clicked) to make Windows believe that the client region is the caption bar region.

You have to use interop for that, since .NET (at least 1.1) doesn't expose messages relative to the non-client (NC) area.

Hope it helps,
jods

Share on other sites
Instead of tracking the difference between current and previous positions, just determine an offset to apply (during a MouseMove event) at the MouseDown event. The following works fine (for me at least [smile])
    private int offsetx=-1, offsety=-1;    private void MainForm_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)    {        if((e.Button&System.Windows.Forms.MouseButtons.Left)!=0)        {           offsetx = Location.X-MousePosition.X;           offsety = Location.Y-MousePosition.Y;        }    }    private void MainForm_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)    {        if((e.Button&System.Windows.Forms.MouseButtons.Left)!=0)        Location = new Point(offsetx+MousePosition.X, offsety+MousePosition.Y);    }

This however won't capture any drags from within children. If this is necessary you may need to capture the non-client area Win32 messages, but keep in mind this could cause things like buttons not being clickable.

Share on other sites
bah, it was a typo that i overlooked repeatedly.

thanks anyway though!

• Game Developer Survey

We are looking for qualified game developers to participate in a 10-minute online survey. Qualified participants will be offered a \$15 incentive for your time and insights. Click here to start!

• 11
• 15
• 21
• 26
• 11


text:
# Diffusion of size bidisperse spheres in dense granular shear flow

Author(s)
H. Xiao, J. Zheng, R. Cai, Y. Zhao
Publisher
American Physical Society
Source
Physical Review E
Keywords
Diffusion, Granular Flows, Granular segregation
Year
2019

Diffusion is an important particle behavior in granular flow. Although granular diffusion has been studied for decades, the diffusion of size bidisperse particles has not been well understood. In this paper, discrete element method simulations with the Lees-Edwards boundary condition are performed to quantify the relation between the diffusion coefficient (D) and flow parameters for size bidisperse spheres in dense granular flow. The influences of the shear rate (˙γ), the solids fraction (f), and the diameter ratio (DLS) of particles on diffusion are studied. The effects of the friction coefficient (μ) and the restitution coefficient (e) are also investigated. The results indicate that while small particles diffuse faster than large particles in a binary system the volume weighted average diffusion coefficient is proportional to the shear rate and the square of the volume weighted average particle diameter, d2, and it is inversely proportional to the solids fraction. The quantified relation is given as D=kd˙γd2, where kd=0.0186/f, and this relation is not sensitive to the diameter ratio for DLS3. The diffusion coefficient is not sensitive to the friction coefficient except for the extreme condition where μ<0.1, and it is also not sensitive to the restitution coefficient between 0.3 and 0.9.

Keywords: Diffusion, Granular flows, Granular segregation,


text:
# What is a Polynomial?

An expression that represents a quantity in mathematical form is called a polynomial.

## Introduction

The meaning of the polynomial is derived from two words “Poly” and “Nomial”.

1. The prefix “Poly” means many.
2. The word “Nomial” means a term.

The meaning of a Polynomial is many terms as per the meanings of both words.

A quantity can be expressed by only a single expression in mathematics, but it is not possible to write every quantity in a single mathematical expression. In that case, two or more expressions are connected to form another mathematical expression by the operations like addition, subtraction and combination of both. An expression can be formed by either one or more connected expressions but every expression that represents an indeterminate quantity is called a polynomial.

d

### Single expression

In mathematics, a quantity is expressed in mathematical form by multiplying a coefficient with either one or product of more variables having exponents. The quantity in mathematical form is called a mathematical expression.

For example, the quantity $10$ is expressed mathematically by multiplying a numerical coefficient $5$ with the product of square of a variable $x$ and an indeterminate $y$.

$10 \,=\, 5x^2y$

The quantity $10$ is written mathematically as $5x^2y$ and the quantity in mathematical form $5x^2y$ is called a mathematical expression.

### Connecting many expressions

The quantities can be expressed in a single mathematical expression in some cases but it is not possible in the remaining cases. Hence, either two or more mathematical expressions are connected by the mathematical operations like addition or subtraction or combination of both.

For example, the quantity $13$ cannot be expressed in mathematical form by a single expression. Hence, it can be expressed by connecting two expressions $x^2$ and $3y$ by a plus sign.

$13 \,=\, x^2+3y$

The quantity $-3$ cannot be written in mathematical form by a single expression but it can be obtained by connecting the expression $x^2$ with another $3xy$ by a minus sign and another expression $7$ by a plus sign.

$-3 \,=\, x^3-3xy+7$

In this case, the quantities $13$ and $-3$ are expressed in mathematical form as $x^2+3y$ and $x^3-3xy+7$ respectively.

In this case, $x = 2$ and $y = 3$.

Latest Math Topics
Apr 18, 2022
Apr 14, 2022
Mar 18, 2022
Latest Math Problems
Apr 06, 2022

A best free mathematics education website for students, teachers and researchers.

###### Maths Topics

Learn each topic of the mathematics easily with understandable proofs and visual animation graphics.

###### Maths Problems

Learn how to solve the maths problems in different methods with understandable steps.

Learn solutions

###### Subscribe us

You can get the latest updates from us by following to our official page of Math Doubts in one of your favourite social media sites.

Copyright © 2012 - 2021 Math Doubts, All Rights Reserved