text:
## Neural networks fundamentals with Python – MNIST

788

In the fourth article of this short series we will apply our neural network framework to recognise handwritten digits.

# Purpose of this article

The purpose of this article is to take the neural network framework you built in the previous three articles and apply it to an actual machine learning problem. In particular, we will take the MNIST dataset – a dataset that contains images of handwritten digits – and train a neural network to be able to recognise them.

The images we will be working with are like the ones below:

By the time you are done with this article, you will have a neural network that is able to recognise the digit in an image 9 out of 10 times.

# Getting the data

In the world of machine learning, the MNIST dataset is very well-known and it is common to play around with this dataset when you are experimenting with a new machine learning model. Think of it as the “Hello, World!” of machine learning.

For your convenience, I compressed the MNIST dataset it and made it available for download here (direct download link).

After you decompress the data folder, you should get two files:

• mnist_train.csv, a CSV file with 60 000 rows to train the network; and
• mnist_test.csv, a CSV file with 10 000 rows to test the network.

Each row of the file is composed of 785 integers: the first one is a number between 0 and 9, inclusive, and tells you which digit that row is. The remaining 784 integers go from 0 to 255 and represent the greyscale levels of the original image, which was 28 by 28 pixels.

# Creating a new file

Because you are done with implementing the network and are now going to use it, it makes sense to create a new file for this little project, so go ahead and create a mnist.py file next to your file containing the neural network implementation.

# Reading the data in

The first thing we want to do is take a look at the data, so let's go ahead and create a simple function to read it in and build a NumPy array out of the file.

In order to do that, we first use csv to import the data from the CSV file into a list with the rows of the file, and then use NumPy to convert that list of rows into an array. Do this inside the examples/mnist.py file:

import csv
import numpy as np

def load_data(filepath, delimiter=",", dtype=float):
"""Load a numerical numpy array from a file."""

print(f"Loading {filepath}...")
with open(filepath, "r") as f:
data_iterator = csv.reader(f, delimiter=delimiter)
data_list = list(data_iterator)
data = np.asarray(data_list, dtype=dtype)
print("Done.")
return data

We included two extra function arguments, delimiter and dtype, to allow us to further control how csv will read the data in and how NumPy will convert the data into an actual array.

# Basic data inspection

After you are done with implementing that load_data function, go to your Python REPL and take it for a spin:

>>> from mnist import load_data
>>> data = load_data("examples/mnistdata/mnist_test.csv", ",", int)
Loading examples/mnistdata/mnist_test.csv...
Done.
>>> for row in range(28):
...     if not sum(data[0, 28*row:28*(row + 1)]):
...             continue
...     for col in range(28):
...             idx = row*28 + col
...             print("#" if data[0, 1+idx] else " ", end="")
...     print()
...

######
################
################
###########
####
####
####
####
####
####
###
####
####
#####
####
#####
####
#####
#####
####

In the REPL session above, we used our new function to load the test data into an array called data, and then we used a double for loop and some indexing arithmetics (idx = row*28 + col) to print the original 28 by 28 image, which is represented by 784 integers in a row inside data. We printed the very first row, if you change the 0 in data[0, 1+idx] to another integer, you will print another MNIST image.

# Building the network

If we want to create a network that recognises handwritten digits, before being able to train the network we need to actually build one. For this, we will be using the components we built and implemented during the previous articles.

When building a network, two of the most important things you have to do is understand how many inputs the network should accept and how many outputs it should produce.

For our case, we have seen that the MNIST images have 784 values, so that is the number of inputs the network takes.

As for the outputs, we want the network to be able to recognise the correct digit, amongst the ten different digits that exist. For that matter, we will say that the network output will be a column vector with ten integers: the index i in the output will give a measure for how much the network thinks the input image is the digit i. If the network takes x as input and then produces the column vector out

>>> out
array([[0.40814177],
[0.23417614],
[0.55003812],
[0.77545582],
[0.83813274],
[0.05773683],
[0.27620492],
[0.37310017],
[0.47088771],
[0.26011783]])

then we would say that, for the input x, the network recognises the digit 4, because out[4] is the largest element of out. A simple way to compute this is with np.argmax:

>>> np.argmax(out)
4

So, we have established that the network takes 784 inputs and produces 10 outputs, but how many layers does it have? And what should the learning rate of the network be? These configuration parameters are generally the things you have to tweak manually when creating a machine learning model for some task, because unfortunately there is no one-size-fits-all architecture. However, I can let you in on a little secret: for our particular case, here is a network architecture that will work just fine:

import sys, pathlib
# (Ugly) workaround to enable importing from parent folder without too much hassle.
sys.path.append(str(pathlib.Path(__file__).parent.parent))

from nn import NeuralNetwork, Layer, LeakyReLU, MSELoss

layers = [
Layer(784, 16, LeakyReLU()),
Layer(16, 16, LeakyReLU()),
Layer(16, 10, LeakyReLU()),
]
net = NeuralNetwork(layers, MSELoss(), 0.001)

Of course, we cannot forget to import the relevant components from our neural network implementation, which I assumed was in a file named nn.

# Testing the network

Now that we have a network, the first thing we can do is test the network to see what is the accuracy of a fresh network. If everything works out well, we expect the accuracy of this untrained network to be around 10%, which is the accuracy of a model that guesses randomly.

Testing the network is simple: go over each row of the testing data and extract the correct digit of that row and extract the 784 inputs as a column vector (this is very important, we spent the three previous articles making sure that everything would work for input vectors that were columns); feed the 784 inputs to the network; find the largest element in the output vector and compare to the correct digit; count the number of times the network guesses correctly and return the accuracy of the network:

def to_col(x):
return x.reshape((x.size, 1))

def test(net, test_data):
correct = 0
for test_row in test_data:
t = test_row[0]
x = to_col(test_row[1:])
out = net.forward_pass(x)
guess = np.argmax(out)
if t == guess:
correct += 1

return correct/test_data.shape[0]

This is a process that takes anywhere between a couple of seconds and a couple of minutes, depending on your computer, so let us add a print statement that shows, every one thousand iterations, how many iterations we have done:

def test(net, test_data):
correct = 0
for i, test_row in enumerate(test_data):
if not i%1000:
print(i)

t = test_row[0]
x = to_col(test_row[1:])
out = net.forward_pass(x)
guess = np.argmax(out)
if t == guess:
correct += 1

return correct/test_data.shape[0]

if not i%1000 can be read as “if i has no remainder when divided by 1000”, and so it evaluates to True only when i is a multiple of 1000.

# Putting everything together

If we put all the bits and pieces from this article together, and if we use pathlib to make sure we create the correct paths to the data files, this is what we have so far:

import sys, pathlib
# (Ugly) workaround to enable importing from parent folder without too much hassle.
sys.path.append(str(pathlib.Path(__file__).parent.parent))

import csv
import numpy as np
from nn import NeuralNetwork, Layer, LeakyReLU, MSELoss

TRAIN_FILE = pathlib.Path(__file__).parent / "mnistdata/mnist_train.csv"
TEST_FILE = pathlib.Path(__file__).parent / "mnistdata/mnist_test.csv"

def load_data(filepath, delimiter=",", dtype=float):
"""Load a numerical numpy array from a file."""

print(f"Loading {filepath}...")
with open(filepath, "r") as f:
data_iterator = csv.reader(f, delimiter=delimiter)
data_list = list(data_iterator)
data = np.asarray(data_list, dtype=dtype)
print("Done.")
return data

def to_col(x):
return x.reshape((x.size, 1))

def test(net, test_data):
correct = 0
for i, test_row in enumerate(test_data):
if not i%1000:
print(i)

t = test_row[0]
x = to_col(test_row[1:])
out = net.forward_pass(x)
guess = np.argmax(out)
if t == guess:
correct += 1

return correct/test_data.shape[0]

layers = [
Layer(784, 16, LeakyReLU()),
Layer(16, 16, LeakyReLU()),
Layer(16, 10, LeakyReLU()),
]
net = NeuralNetwork(layers, MSELoss(), 0.001)

test_data = load_data(TEST_FILE, ",", int)
print(test(net, test_data))

I ran this code once, and here is what I got:

 > python mnist.py
0.1028

The 0.1028 is 10.28%, which is in line with the accuracy we expected. Now, all there is left to do is train the network.

# Training the network

Training the network is pretty similar to testing it, except that instead of comparing the network output to the correct answer and incrementing a counter for the correct answers, we need to feed the network with the vector we expected the network to output.

## Building the expected output

For each row of the training data, we have information for the digit that the row actually represents, but we need to build the target column vector, the column vector we wish the neural network produced when given that same image as input. If we interpret the outputs of the network as probabilities, with the number in position i of the output representing the probability that the network gives to the input image being an i, we can reverse-engineer that to build the target output for a given image:

>>> digit = 3
>>> t = np.zeros((10, 1))
>>> t[digit] = 1
>>> t
array([[0.],
[0.],
[0.],
[1.],
[0.],
[0.],
[0.],
[0.],
[0.],
[0.]])

## Implementing training

Now that we know how to build the target column vector, we can implement our train function:

def train(net, train_data):
# Precompute all target vectors.
ts = {}
for t in range(10):
tv = np.zeros((10, 1))
tv[t] = 1
ts[t] = tv

for i, train_row in enumerate(train_data):
if not i%1000:
print(i)

t = ts[train_row[0]]
x = to_col(train_row[1:])
net.train(x, t)

## Adding training to the script

Now that we have all the functions that we need, we can actually refactor our code ever so slightly to perform the network creation, testing, training and re-testing only if our script is executed directly. In order to do so, we just need the following code after all our function definitions:

if __name__ == "__main__":
layers = [
Layer(784, 16, LeakyReLU()),
Layer(16, 16, LeakyReLU()),
Layer(16, 10, LeakyReLU()),
]
net = NeuralNetwork(layers, MSELoss(), 0.001)

test_data = load_data(TEST_FILE, delimiter=",", dtype=int)
accuracy = test(net, test_data)
print(f"Accuracy is {100*accuracy:.2f}%")     # Expected to be around 10%

train_data = load_data(TRAIN_FILE, delimiter=",", dtype=int)
train(net, train_data)

accuracy = test(net, test_data)
print(f"Accuracy is {100*accuracy:.2f}%")

The code above prints the accuracy as a percentage (because we multiplied by 100) with two decimal places (with the :.2f inside the f-string), but other than that we just loaded the train_data in the same way we loaded the test_data array before, and we just call the train function.

I ran this code, and here is the output I obtained (after removing the intermediate prints from the test and train functions that are there just to ensure the functions are running):

 > python mnist.py
Loading mnistdata/mnist_test.csv...
Done.
Accuracy is 10.10%
Loading mnistdata/mnist_train.csv...
Done.
Accuracy is 91.94%

The exact numbers you get will probably be different, but you should get something around 10% before training the network and around 90% after training the network, provided you used the same network setup (number of layers, respective input and output sizes, respective activation functions, loss function and learning rate).

# Code & next steps

You can find all the code for this series in this GitHub repository and the code that corresponds to the end of this article is available under the tag v1.1.

After reaching this point, the next sensible thing to do would be to implement a loss function that is more appropriate for this type of task, and an activation function that is more suitable to produce outputs that can be interpreted as probabilities. We will do so in the next article of the series.

If you reached this far, you may also find interesting to experiment by yourself with different network architectures and see if you can come up with a configuration that performs as well as possibly, in a consistent manner. Remember that you can change the number of layers, their internal input and output sizes, the parameter of the LeakyReLU (we have been using the default value), and the learning rate of the network.

# The series

These are all the articles in this series:

I hope you learned something new! If you did, consider following the footsteps of the readers who bought me a slice of pizza 🍕. Your small contribution helps me produce this content for free and without spamming you with annoying ads.

Blog Comments powered by Disqus.


text:
# What is the electron configuration of nitrogen dioxide?

Dec 24, 2016

There are 17 valence electrons to distribute around 3 centres........

#### Explanation:

And the 17 valence electrons come from the $5 + 2 \times 6$ oxygen, and nitrogen valence electrons.

So a reasonable Lewis structure is $\left(O =\right) {N}^{+} - {O}^{-}$ with a LONE nitrogen-centred valence electron. These electrons can couple to form a $N - N$ bond in a dimer.

2(O=)N^(+)-O^(-)rightleftharpoons(""^(-)O)(O=)N^(+)-NO_2

There is necessarily formal charge separation in both the monomer and the dimer.

format: plain


text:
## more breaking sticks

Posted in Statistics with tags , , on July 19, 2021 by xi'an

A quick riddle from The Riddler that, when thinned to the actual maths problem, ends up asking for

$\mathbb P(\max(U_1,U_2,U_3)=U_3)+\mathbb P(\min(U_1,U_2,U_3)=U_3)$

which is equal to 2/3…. Anticlimactic.

## new order

Posted in Books, Kids, R, Statistics with tags , , , , on February 5, 2021 by xi'an

The latest riddle from The Riddler was both straightforward: given four iid Normal variates, X¹,X²,X³,X⁴, what is the probability that X¹+X²<X³+X⁴ given that X¹<X³ ? The answer is ¾ and it actually does not depend on the distribution of the variates. The bonus question is however much harder: what is this probability when there are 2N iid Normal variates?

I posted the question on math.stackexchange, then on X validated, but received no hint at a possible simplification of the probability. And then erased the questions. Given the shape of the domain where the bivariate Normal density is integrated, it sounds most likely there is no closed-form expression. (None was proposed by the Riddler.) The probability decreases roughly in N³ when computing this probability by simulation and fitting a regression.

> summary(lm(log(p)~log(r)))

Residuals:
Min        1Q    Median        3Q       Max
-0.013283 -0.010362 -0.000606  0.007835  0.039915

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.111235   0.008577  -12.97 4.11e-13 ***
log(r)      -0.311361   0.003212  -96.94  < 2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.01226 on 27 degrees of freedom
Multiple R-squared:  0.9971,	Adjusted R-squared:  0.997
F-statistic:  9397 on 1 and 27 DF,  p-value: < 2.2e-16

## where is .5?

Posted in Statistics with tags , , , , on September 10, 2020 by xi'an

A Riddler’s riddle on breaking the unit interval into 4 random bits (by which I understand picking 3 Uniform realisations and ordering them) and finding the length of the bit containing ½ (sparing you the chore of converting inches and feet into decimals). The result can be found by direct integration since the ordered Uniform variates are Beta’s, and so are their consecutive differences, leading to an average length of 15/32. Or by raw R simulation:

simz=t(apply(matrix(runif(3*1e5),ncol=3),1,sort))
mean((simz[,1]>.5)*simz[,1]+
(simz[,1]<.5)*(simz[,2]>.5)*(simz[,2]-simz[,1])+
(simz[,2]<.5)*(simz[,3]>.5)*(simz[,3]-simz[,2])+
(simz[,3]<.5)*(1-simz[,3]))

Which can be reproduced for other values than ½, showing that ½ is the value leading to the largest expected length. I wonder if there is a faster way to reach this nice 15/32.

## order, order!

Posted in Books, pictures, Statistics, University life with tags , , , , , , on June 9, 2020 by xi'an

A very standard (one-line) question on X validated, namely whether min(X,Y) could enjoy a finite mean when both X and Y had infinite means [the answer is yes, possibly!] brought a lot of traffic, including an incorrect answer and bringing it to be one of the “Hot Network Questions“, for no clear reason. Beside my half-Cauchy example, some answers pointed out the connection between mean and cdf, as integrated cdf on the negative half-line and integrated complement cdf on the positive half-line, and between mean and quantile function, as

$\mathbb E[T(X)]=\int_0^1 T(Q_X(u))\text{d}u$

since it nicely expands to

$\mathbb E[T(X_{(k)})]=\int_0^1 \frac{u^{k-1}(1-u)^{n-k-1}}{B(k,n-k)}T(Q_X(u))\text{d}u$

but I remain bemused by the excitement..! (Including the many answers and the lack of involvement of the OP.)

## sampling the mean

Posted in Kids, R, Statistics with tags , , , , , on December 12, 2019 by xi'an

A challenge found on the board of the coffee room at CEREMADE, Université Paris Dauphine:

When sampling with replacement three numbers in {0,1,…,N}, what is the probability that their average is (at least) one of the three?

With a (code-golfed!) brute force solution of

mean(!apply((a<-matrix(sample(0:n,3e6,rep=T),3)),2,mean)-apply(a,2,median))

producing a graph pretty close to 3N/2(N+1)² (which coincides with a back-of-the-envelope computation):


text:
# Proof that there are infinitely many positive rational numbers smaller than any given positive rational number.

I'm trying to prove this statement:- "Let $x$ be a positive rational number. There are infinitely many positive rational numbers less than $x$."

This is my attempt of proving it:-

Assume that $x=p/q$ is the smallest positive rational number.

Consider $p/q - 1$ $= (p-q)/q$

Case I: $p$ and $q$ are both positive

Then, $p-q<p$

And hence, $(p-q)/q < p/q$

Since $p$ and $q$ are integers, $(p-q)$ is also an integer. Thus, $(p-q)/q$ is a rational number smaller than $p/q$. Therefore, our assumption is wrong, and there always exists a rational number smaller than any given rational number $x$.

Case II: $p$ and $q$ are both negative

Then, let $p/q = -s/-t$, where $s$ and $t$ are both positive integers.

Then, $-s-(-t)>-s \implies (-s+t)/-t < -s/-t \implies (p-q)/q <p/q$

Since $p$ and $q$ are integers, $(p-q)$ is also an integer. Thus, $(p-q)/q$ is a rational number smaller than $p/q$. Therefore, our assumption is wrong, and there always exists a rational number smaller than any given rational number $x$.

Q.E.D

Is my proof correct? And there are a couple of questions that I've been pondering over:-

1) How do I justify the subtraction of $1$ from $p/q$? I mean, I assumed that $p/q$ is the smallest rational number, so how do I even know if this operation is valid?

2) I proved that there always exists a smaller rational number given any positive rational number. But how do I prove that there's always a smaller positive rational number?

3) Also, I don't seem to have proved that there are infinitely many smaller rational numbers than $x$. If I use a general integer $k$ instead of $1$, this would be taken care of, right? But then again, how do I justify this subtraction?

I'd be really grateful, if someone could help me with this! Thanks!

-
Up-voted for demonstrating substantial effort. –  dfeuer Jun 25 '13 at 0:19
I haven't looked at your proof, because it seems very long and there is a shorter way to do it. For a given positive rational $x$, take integer $N$ such that $\frac1N <x$ (possible by Archimedes theorem if you want to be totally rigorous) $x_n=x-\frac1n$ is always rational for integer $n$, and is always positive for $n\geq N$, so now you have infinitely many positive rationals smaller than $x$. –  Tom Oldfield Jun 25 '13 at 0:20
@TomOldfield: That's a slick proof there, thank you! I hadn't even thought of using the Archimedean property for this. –  Jobin Idiculla Jun 25 '13 at 0:33
Or another option take half of the smallest positive rational. –  Baby Dragon Jun 25 '13 at 5:24
@BabyDragon I'm not a maths expert, but when I saw the question I thought you could divide it by ten. Would that work too? –  11684 Jun 25 '13 at 14:10
show 1 more comment

First, you don't need Case II. If $x\in\mathbb Q_{>0}$, then you can assume, that $x=\frac{p}{q}$, where $p,q>0$.

Your general idea is good: Assume, that $x$ is smallest possible and find an even smaller one, which then is a contradiction. Now let's answer your questions:

2) You already noticed, that you only proved that there is a smaller rational number, not necissarily positive. Your proof is basically "If $x$ is the smallest, then $x-1$ is smaller, a contradiction."

1) Of course, this a valid operation, it actually disproved your assumption, that $x$ was the smallest rational number.

3) is right, too. With an arbitrary $k$, you get infintely many smaller rationals.

To prove the positive case, notice, that if $x\in\mathbb Q_{>0}$, then $0<\frac{x}{k}<x$ for all $k\in\mathbb Z$.

-
In 2), he says, that he only proved, that there is no smallest rational number. He asked if this is right - which it is. In 3) he asked, if he gets infintely many smaller rationals (not positive rationals) by subtracting an $k\in\mathbb Z$ - which he does. I stated above, that his whole proof is only about showing that there is no minimal rational number. –  Tomas Jun 25 '13 at 0:39
Apologies (and +1). I failed to separate the objective from the unuseful steps that were taken. Well answered. –  Cameron Buie Jun 25 '13 at 3:50

Your proof does not work. Indeed, subtracting $1$ from $\frac p q$ will give you a rational number, but it will be negative by assumption, so this doesn't help you (since it doesn't give you a contradiction).

A simpler approach: Explicitly state what the infinitely-many positive rationals less than $x$ are.

Hint: If $y$ is a positive rational, what can you say about $\frac{y}2$? About $\frac{y}4$? $\frac{y}8$? ...

-
Oh, now I see it's that simple, haha! Thank you! But again, how do I justify this division? How do I prove that it is actually possible? –  Jobin Idiculla Jun 25 '13 at 0:20
Well, if you write $y=\frac p q,$ with $p,q$ integers and $q\ne 0,$ then $$\frac{y}{2^n}=\frac{p}{2^nq}$$ for all positive integers $n$. Can you show that $2^nq$ is a non-zero integer (with the same sign as $q$) for all positive integers $n$? –  Cameron Buie Jun 25 '13 at 0:21
Ah, yes of course! I understand it now. Thank you for the answer! –  Jobin Idiculla Jun 25 '13 at 0:26
Incidentally, you can use this result to prove that there are infinitely many positive rationals less than any positive real number $x$. Use Archimedean property (or density of the rationals) to show that for any real $x$ there is a rational $0<r<x$. Then since there are infinitely many positive rationals less than $r$.... –  Cameron Buie Jun 25 '13 at 0:35

Before diving into a proof right away, it might help to think of some examples and generalizing a pattern you find. For example, suppose $x=1/3$. Can you think of a smaller positive rational number? Well, we could do a bunch of things to make a fraction smaller. We could try decreasing the numerator $-$ but as you discovered, things might not work out if the numerator is already very small. Instead, we can try increasing the denominator. Indeed, since the integers are unbounded above, this is always possible.

Proof. We proceed by contradiction. Suppose instead that there are only finitely many positive rational numbers less than $x$. Now let $y$ be the smallest of these positive rational numbers. Observe that $y=p/q$ where $p,q\in \mathbb{Z}$ and $p,q>0$. Now consider the number: $$z=\dfrac{p}{q+1}$$ Observe that since $q+1\in \mathbb{Z}$ and $q+1>1>0$, we know that $z$ is a positive rational number. But then we have $z<y$, contradicting the minimality of $y$. Hence, there are infinitely many positive rational numbers less than $x$, as desired.

-

There is no way to justify the subtraction of $1$: If $\frac{p}{q}\lt 1$, and $p$ and $q$ are positive, then indeed you showed correctly that $\frac{p-q}{q}\lt \frac{p}{q}$.

However, you did not show that $\frac{p-q}{q}$ is positive, and it will not be, for instance, if $p=3$ and $q=5$.

-

I would first prove that there is a rational number between any two (by taking an average $(p_{1}/q_{1} + p_{2}/q_{2})/2$) and then apply that to the number we claim to be the smallest and zero.

-

if $\frac{p}{q} > 0$.

(Consider $p,q >0$ or |p|,|q|)

You have:

$$0 < \frac{p}{q+1} < \frac{p}{q}$$

$$0 < \frac{p}{q+2} < \frac{p}{q}$$

......

$$0 < \frac{p}{q+n} < \frac{p}{q}$$

$$\forall n \in \mathbb{N} . \ 0 < \frac{p}{q+n} < \frac{p}{q}$$

-


text:
# What is the LCM of 8y, 18y^3 ?

It is $72 {y}^{3}$
You need ${y}^{3}$ and the factors of $8$ which is ${2}^{3}$ and of $18 = 2 \cdot {3}^{2}$ so: ${2}^{3} \cdot {3}^{2} \cdot {y}^{3} = 72 \cdot {y}^{3}$


text:
QUESTION

# HCP 220 CheckPoint Common Applications of Different Conversion Systems and Measurements of Time and Temperature

This document includes HCP 220 CheckPoint Common Applications of Different Conversion Systems and Measurements of Time and Temperature

• @
• 1 order completed
Tutor has posted answer for $14.29. See answer's preview$14.29


text:
<img src="https://d5nxst8fruw4z.cloudfront.net/atrk.gif?account=iA1Pi1a8Dy00ym" style="display:none" height="1" width="1" alt="" />

# 10.3: Area and Perimeter of Triangles

Difficulty Level: At Grade Created by: CK-12
Estimated8 minsto complete
%
Progress
Practice Area and Perimeter of Triangles

MEMORY METER
This indicates how strong in your memory this concept is
Progress
Estimated8 minsto complete
%
Estimated8 minsto complete
%
MEMORY METER
This indicates how strong in your memory this concept is

### Notes/Highlights Having trouble? Report an issue.

Color Highlighted Text Notes

### Vocabulary Language: English

Area

Area is the space within the perimeter of a two-dimensional figure.

Perimeter

Perimeter is the distance around a two-dimensional figure.

Perpendicular

Perpendicular lines are lines that intersect at a $90^{\circ}$ angle. The product of the slopes of two perpendicular lines is -1.

Right Angle

A right angle is an angle equal to 90 degrees.

Right Triangle

A right triangle is a triangle with one 90 degree angle.

Area of a Parallelogram

The area of a parallelogram is equal to the base multiplied by the height: A = bh. The height of a parallelogram is always perpendicular to the base (the sides are not the height).

Area of a Triangle

The area of a triangle is half the area of a parallelogram. Hence the formula: $A = \frac{1}{2}bh \text{ or } A = \frac{bh}{2}$.

Show Hide Details
Description
Difficulty Level:
Authors:
Tags:
Subjects:


text:
GMAT Question of the Day - Daily to your Mailbox; hard ones only

 It is currently 15 Oct 2019, 05:40

### GMAT Club Daily Prep

#### Thank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email.

Customized
for You

we will pick new questions that match your level based on your Timer History

Track

every week, we’ll send you an estimated GMAT score based on your performance

Practice
Pays

we will pick new questions that match your level based on your Timer History

# M15-09

Author Message
TAGS:

### Hide Tags

Math Expert
Joined: 02 Sep 2009
Posts: 58333

### Show Tags

16 Sep 2014, 00:55
00:00

Difficulty:

5% (low)

Question Stats:

92% (01:19) correct 8% (01:51) wrong based on 48 sessions

### HideShow timer Statistics

If the value of fraction $$\frac{A}{B}$$ ($$A \lt B$$) will not change if $$A$$ grows by 6 and $$B$$ grows by 15, which of the following is equal to $$\frac{B}{A}$$?

A. 2.0
B. 2.1
C. 2.5
D. 2.8
E. 3.0

_________________
Math Expert
Joined: 02 Sep 2009
Posts: 58333

### Show Tags

16 Sep 2014, 00:55
1
Official Solution:

If the value of fraction $$\frac{A}{B}$$ ($$A \lt B$$) will not change if $$A$$ grows by 6 and $$B$$ grows by 15, which of the following is equal to $$\frac{B}{A}$$?

A. 2.0
B. 2.1
C. 2.5
D. 2.8
E. 3.0

$$\frac{A}{B} = \frac{A + 6}{B + 15}$$. From here $$B(A + 6) = A(B + 15)$$ or $$6B = 15A$$ or $$\frac{B}{A} = \frac{15}{6} = 2.5$$.

_________________
Senior Manager
Joined: 08 Jun 2015
Posts: 420
Location: India
GMAT 1: 640 Q48 V29
GMAT 2: 700 Q48 V38
GPA: 3.33

### Show Tags

09 Jan 2017, 05:58
Given that A/B=(A+6)/(B+15), cross multiply to get the ratio between B and A. The answer comes out to be 2.5 i.e. option C
_________________
" The few , the fearless "
Manager
Joined: 30 Apr 2013
Posts: 76

### Show Tags

22 Nov 2017, 00:00
Can we back solve this question anyway?
Manager
Joined: 28 Jun 2018
Posts: 130
Location: Bouvet Island
GMAT 1: 490 Q39 V18
GMAT 2: 640 Q47 V30
GMAT 3: 670 Q50 V31
GMAT 4: 700 Q49 V36
GPA: 4

### Show Tags

05 Nov 2018, 10:37
santro789 wrote:
Can we back solve this question anyway?

Hey santro789

Sure u can! But it is just too time consuming.

When back solving always remember to start from the middle option so that you know wether u should test higher values or lower values.
Luckily in this question 2.5 is the middle value and we can arrive at the AC quick.
So since it is a fraction it wont matter if u take A/B as 2/5 or 200/500. Just make sure B/A is equal to 2.5 because we are testing for it.
You will see that by adding the A and B with 6 and 15 will always give us $$\frac{2}{5}$$.
Example - $$\frac{2}{5}$$ is $$\frac{2+6}{5 +15}$$ = $$\frac{8}{20}$$ = $$\frac{2}{5}$$.
Hence C is the option.

Hope it helps!
Intern
Joined: 02 Feb 2018
Posts: 31

### Show Tags

23 Nov 2018, 11:29
Bunuel How can we get from 6B=15A to B/A=15/6 without knowing that A is not 0? Thanks!
Intern
Joined: 15 Dec 2018
Posts: 6

### Show Tags

15 Jun 2019, 23:26
Hi Bunuel,

Is the below approach correct.

As mentioned in the question the ratio will not change if 6 is added to A and 15 is added to B.
Thus 6/15 will have the same ratio as A/B.
So to find B/A => just do 15/6 =2.5

Thanks
Re: M15-09   [#permalink] 15 Jun 2019, 23:26
Display posts from previous: Sort by

# M15-09

Moderators: chetan2u, Bunuel


text:
# Using implicit differentiation to solve a function and stuck at factoring out y'.

So here is the question:

$$\tan^{-1}\left(\frac{2x}{y}\right)=\frac{\pi x}{y^2}$$

When I solved it implicitly I got (with much pain in formatting it on this site :P):

$$y^2=\pi \left(\frac{y^2-2xy\cdot y'}{y^4}\right)\cdot \left ( \sec^2\left(\frac{2x}{y}\right)\cdot (2y-2xy') \right )$$

Now I know this sounds stupid but I don't know how to factor out y' because apparently I have derived correctly to the best of my knowledge and yet when I input (1,2) in my function and then check Wolphram Alpha, I get two different results (that shouldn't be the case)....

I'm at a loss as to what to do... Any help would be appreciated

• +1 for the courtesy of writing your equations all nice and purdy ;) – David H Oct 18 '13 at 20:21
• Did you start by rearranging to give $$\frac{2x}{y}=tan\left(\frac{\pi x}{y^2}\right)?$$ – George Tomlinson Oct 18 '13 at 20:34
• no, I changed tan^-1 into 1/tan... Now that you mentioned it, I'm gonna try doing that... Thanks – StrugglingCalcStudent Oct 18 '13 at 20:40
• So now my function after implicitly deriving it, is: $$\frac{2y-2x\cdot y'}{y^2}=sec^2(\frac{\pi x}{y^2})\cdot \pi (\frac{y^2-2xy\cdot y'}{y^4})$$ – StrugglingCalcStudent Oct 18 '13 at 20:43
• I did it! I got it thanks to that simple method of solving it! Thank you @bluesh34 – StrugglingCalcStudent Oct 18 '13 at 20:51


text:
# Definition:Convergent Product/Arbitrary Field/Arbitrary Sequence

Let $\struct {\mathbb K, \norm {\,\cdot\,} }$ be a valued field.
Let $\sequence {a_n}$ be a sequence of elements of $\mathbb K$.
The infinite product $\ds \prod_{n \mathop = 1}^\infty a_n$ is convergent if and only if:
there exists $n_0 \in \N$ such that the sequence of partial products of $\ds \prod_{n \mathop = n_0}^\infty a_n$ converges to some $b \in \mathbb K \setminus \set 0$.
The sequence of partial products of $\ds \prod_{n \mathop = 1}^\infty a_n$ is then convergent to some $a \in \mathbb K$.


text:
<img src="https://d5nxst8fruw4z.cloudfront.net/atrk.gif?account=iA1Pi1a8Dy00ym" style="display:none" height="1" width="1" alt="" />
Our Terms of Use (click here to view) and Privacy Policy (click here to view) have changed. By continuing to use this site, you are agreeing to our new Terms of Use and Privacy Policy.

2.10: Properties of Rectangles and Squares

Difficulty Level: At Grade Created by: CK-12

Learning Objectives

• Identify and classify a rectangle.
• Identify and classify a square.
• Identify the relationship between the diagonals in a rectangle.

Rectangles and Squares

Now that you have a much better understanding of parallelograms, you can begin to look more carefully into certain types of parallelograms. This lesson explores two very important types of parallelograms—rectangles and squares.

Rectangles

A rectangle is equiangular:

• Each angle in a rectangle has the same measure.
• Each angle in a rectangle measures 90\begin{align*}90^\circ\end{align*}
• In other words, a rectangle has four right angles.
• A square is a special kind of rectangle and shares all of the properties of rectangles.

Rectangles have four ___________________________ angles.

A square is a rectangle with ________________________________ sides.

Diagonals in a Rectangle

Remember that all of the rules that apply to parallelograms still apply to rectangles and squares.

There is one additional property that is specific to rectangles:

The diagonals of a rectangle are congruent.

Do you remember the properties of parallelograms?

These apply to all parallelograms, including rectangles and squares:

• opposite sides are parallel
• opposite sides are congruent
• opposite angles are congruent
• consecutive angles are supplementary
• diagonals bisect each other

The diagonals in a rectangle and a square are _______________________________.

In a parallelogram, opposite sides are ____________________ and ___________________.

Theorem for Rectangle Diagonals

The diagonals of a rectangle are congruent.

Reading Check:

1. True or False: All the angles in a rectangle are congruent.

2. True or False: The diagonals in a rectangle bisect each other.

3. True or False: The diagonals in a rectangle are congruent, but the diagonals in a square are not congruent.

Image Attributions

Show Hide Details
Description
Authors:
Tags:

Concept Nodes:

Grades:
8 , 9 , 10
Date Created:
Feb 23, 2012
Last Modified:
May 12, 2014
Save or share your relevant files like activites, homework and worksheet.
To add resources, you must be the owner of the section. Click Customize to make your own copy.
Reviews
Help us create better content by rating and reviewing this modality.
Loading reviews...
Please wait...
Please wait...
Image Detail
Sizes: Medium | Original


text:
# What does pandas describe() percentiles values tell about our data?

Let say this is my dataframe

x=[0.09, 0.95, 0.93, 0.93, 0.34, 0.29, 0.14, 0.23, 0.91, 0.31, 0.62,
0.29, 0.71, 0.26, 0.79, 0.3 , 0.1 , 0.73, 0.63, 0.61]

x=pd.DataFrame(x)

When we x.describe() this dataframe we get result as this

>>> x.describe()
0
count  20.000000
mean    0.50800
std     0.30277
min     0.09000
25%     0.28250
50%     0.47500
75%     0.74500
max     0.95000

What is meant by 25,50, and 75 percentile values? Is it saying 25% of values in x is less than 0.28250?

• I have updated my answer. I'll be glad if you take a look since I assume my previous illustration was misleading. – Fatemeh Asgarinejad May 27 '19 at 7:32

It describes the distribution of your data. 50 should be a value that describes „the middle“ of the data, also known as median. 25, 75 is the border of the upper/lower quarter of the data. You can get an idea of how skew your data is. Note that the mean is higher than the median, which means your data is right skewed.

Try:

import pandas as pd
x=[1,2,3,4,5]
x=pd.DataFrame(x)
x.describe()

First, seemingly, the describe table is not the description of your array x.

then, you need to sort your array (x), then calculate the location of your percentage ( which in .describe method p is 0.25, 0.5 and 0.75),

sorted_x = [0.09, 0.1 , 0.14, 0.23, 0.26, 0.29, 0.29, 0.3 , 0.31, 0.34, 0.61, 0.62, 0.63, 0.71, 0.73, 0.79, 0.91, 0.93, 0.93, 0.95]

and the element in the which is located in 25th percentage is achieved when we divide the list to 25 and 75 percent, the shown | is 25% here:
sorted_x = [0.09, 0.1 , 0.14, 0.23, 0.26,**|** 0.29, 0.29, 0.3 , 0.31, 0.34, 0.61, 0.62, 0.63, 0.71, 0.73, 0.79, 0.91, 0.93, 0.93, 0.95]

So the value is calculated as $$0.26 + (0.29-0.26)*\frac{3}{4}$$ which equals $$0.28250000000000003$$


text:
# Another trig substitution question

vande060

## Homework Statement

sorry wait a few moments for the details, i hit post on accident prematurely

∫ √(1 + x^2)/x dx

## The Attempt at a Solution

∫ √(1 + x^2)/x dx

x = tanϑ , dx sec^2ϑ dϑ -π/2 < ϑ < π/2

√(1 + x^2) = secϑ

∫ (secϑ * sec^2ϑ dϑ )/ tanϑ dϑ

after using trig identities

∫cscϑ dϑ + ∫ tanϑsecϑ dϑ

= -Ln I cscϑ + cotϑ I + secϑ + C

= -LnI [√(1 + x^2) +1]/xI + √(1 + x^2) + C

but the back of the book tells me

= LnI [√(1 + x^2) - 1]/xI + √(1 + x^2) + C

am i missing something here

Last edited:

Homework Helper
I'm not quite sure if you mean
$$\ln\left( i \sqrt{1 + x^2} + 1} / x \right)$$
or
$$\ln\left( i \sqrt{1 + x^2} + 1} \right) / x$$
or
$$\ln(i) \cdot \left( \sqrt{1 + x^2} + 1} / x \right)$$

But it might be possible that the answers are actually the same up to a constant.
You could try using the properties of logarithms to rewrite ln(i √(1 + x²) - 1) to ln(i √(1 + x²) - 1) + k
where k is a constant (which you can then absorb in C).

vande060
I'm not quite sure if you mean
$$\ln\left( i \sqrt{1 + x^2} + 1} / x \right)$$
or
$$\ln\left( i \sqrt{1 + x^2} + 1} \right) / x$$
or
$$\ln(i) \cdot \left( \sqrt{1 + x^2} + 1} / x \right)$$

But it might be possible that the answers are actually the same up to a constant.
You could try using the properties of logarithms to rewrite ln(i √(1 + x²) - 1) to ln(i √(1 + x²) - 1) + k
where k is a constant (which you can then absorb in C).

I am very sorry, there is no i. I is supposed to be the absolute value bar, I forgot the second one.

= -LnI [√(1 + x^2) +1]/xI + √(1 + x^2) + C

I have edited my first post to include the I properly in both my answer and the book's answer

Last edited:
Homework Helper
Ah, thanks for correcting that.
Just out of curiosity, don't you have a vertical bar (|) on your keyboard?

$$- \ln \left| \frac{\sqrt{1 + x^2} + 1}{x} \right|$$
$$\cdots = \ln \left| \frac{x}{\sqrt{1 + x^2} + 1} \right|$$
$$\cdots = \ln \left| \frac{x (\sqrt{1 + x^2} - 1)}{(\sqrt{1 + x^2} + 1)(\sqrt{1 + x^2} - 1)} \right|$$
$$\cdots = \ln \left| \frac{\sqrt{1 + x^2} - 1}{x} \right|$$

I intentionally skipped some steps and justifications (particularly about pulling operations inside the absolute value signs), I will leave those up to you.

vande060
Ah, thanks for correcting that.
Just out of curiosity, don't you have a vertical bar (|) on your keyboard?

$$- \ln \left| \frac{\sqrt{1 + x^2} + 1}{x} \right|$$
$$\cdots = \ln \left| \frac{x}{\sqrt{1 + x^2} + 1} \right|$$
$$\cdots = \ln \left| \frac{x (\sqrt{1 + x^2} - 1)}{(\sqrt{1 + x^2} + 1)(\sqrt{1 + x^2} - 1)} \right|$$
$$\cdots = \ln \left| \frac{\sqrt{1 + x^2} - 1}{x} \right|$$

I intentionally skipped some steps and justifications (particularly about pulling operations inside the absolute value signs), I will leave those up to you.

i dont see a vertical bar, sorry. I understand the transformation completely

i am sorry to bother with one more question, but why is the final transformation necessary? it does not seem any more simple.

Last edited:
Homework Helper
i dont see a vertical bar, sorry. I understand the transformation completely

i am sorry to bother with one more question, but why is the final transformation necessary? it does not seem any more simple.

No, of course not. What CompuChip is actually trying to show you is that, they are identically the same. Congratulations, you've come to the right result. :)


text:
# Cvx sdp problem with small valued matrices

I am trying to solve the following problem in CVX

cvx_begin sdp quiet
variable X(4Nr,4Nr) hermitian
minimize( trace(E0_TOTX))
subject to
trace(FF1
X)>=1;
trace(FF2*X)>=1;
X>=0;
cvx_end

matrices E0_TOT, FF1 and FF2 are all positive semi-definite matrices. Where

FF1=p1E1-E2;
FF2=p2
E3-E4;

E1 and E2 are matrices with small valued entries in the order of 1e-27 while E2 and E4 have entries in the order of 1e-14. Due to the selected values for the p1 and p2 there is no worries about the feasibility but it seems that CVX cannot solve the problem in enough steps and gives the “infeasible” message.
I tried to play with cvx_precision function but it only works when I set something like cvx_precision([0.65 0.65 0.9]) which gives a result for X which by far violates the constraints.
It would be highly appreciated if you kindly help me with this issue.

Thanks.

You’re going to have to re-scale your problem so that your values are on the order of unity.

Thank you for the comment. But, it makes no difference if I re-scale the problem (I just checked) because I have a 1 in the RHS of the constraints which will be scaled too and does not change the answer.

If you scale FF1, FF2, and E0_TOT by the same amount \alpha, the optimal X will be scaled by \alpha^{-1}. Just do that. Short of that, you’re stuck. None of the solvers can handle that wide dynamic range.

Thank you so much for your help. I did so and it worked.


text:
## Godel's incompleteness Theorems

Godel's incompleteness theorems are two celebrated theorems proved by Kurt Godel in 1930.

The first states:

In any consistent axiomatic system (formal system of mathematics) sufficiently strong to allow one to do basic arithmetic, one can construct a statement about natural numbers that can be neither proved nor disproved within that system.

An axiomatic system is one with a recursive set of axioms; equivalently, the theorems of the system can be generated by a Turing machine. The statement which cannot be proved nor disproved within the system is furthermore true in the sense that what it asserts about the natural numbers in fact holds. Because the system fails to prove a true statement, it is said to be incomplete. In other words, Godel's first incompleteness theorem says that any sufficiently strong formal system of mathematics is either inconsistent or incomplete.

Godel's second incompleteness theorem, which is proved by formalizing part of the proof of the first within the system itself, states:

Any sufficiently strong consistent system cannot prove its own consistency.

In essence, the proof of the first theorem consists of constructing the statement

p = "This statement cannot be proven"

within a formal axiomatic system. As such, it can be seen as a modern variant of the Liar paradox.

If the axiomatic system is consistent, Godel's proof shows that p (and its negation) cannot be proven in the system. Therefore p is true (p claims not to be provable, and it isn't) yet it cannot be formally proved in the system.

For the second theorem, let p stand for the undecidable sentence constructed above, and assume that the consistency of the system can be proven from within the system itself. We have seen above that if the system is consistent, then p is not provable. The proof of this implication can be formalized in the system itself, and therefore the statement "p is not provable", or "not P(p)" can be proven in the system.

But this last statement is equivalent to p itself (and this equivalence can be proven in the system), so p can be proven in the system. This contradiction shows that the system must be inconsistent.


text:
# Math Help - Points of tangency.

1. ## Points of tangency.

Two tangents to $y=x^2-2x-3$ pass through (5,3). Find the points of tangency.

2. Originally Posted by Hibijibi
Two tangents to $y=x^2-2x-3$ pass through (5,3). Find the points of tangency.
Let the tangent to the curve be at (a, b). Note that b = a^2 - 2a - 3.

The gradient m of the tangent is found by getting the value of the derivative at x = a:

dy/dx = 2x - 2 therefore m = 2a - 2.

So the equation of the tangent is

y - b = m(x - a)

=> y - a^2 + 2a + 3 = (2a - 2)(x - a)

=> y = (2a - 2)x - 2a^2 + 2a + a^2 - 2a - 3 = (2a - 2)x - a^2 - 3.

But the point (5, 3) lies on this tangent.

Therefore 3 = (2a - 2)(5) - a^2 - 3

=> 3 = 10a - 10 - a^2 - 3

=> a^2 - 10a + 16 = 0

=> (a - 2)(a - 8) = 0

=> a = 2, 8.

Substitute into b = a^2 - 2a - 3 to get the corresponding values of b.

3. Thanks! Really appreciate the time taken to help an uneducated sap such as myself.


text:
. . . =((.. . . . IP' . .

♥ 2
783

2

Similar images

D-Arts

more

ShaneFurry
♥0
17 January 2014 23:46
, TOR =)

Furry_Smith
♥0
18 January 2014 00:06
ShaneFurry, . . . . . . . . . . . . . . .

Furry_Smith
♥0
18 January 2014 00:23
Nom0relies, .

♥0
18 January 2014 13:27

Furry_Smith
♥0
18 January 2014 13:29

Furry_Smith
♥0
18 January 2014 14:38
Nom0relies, . XD. .))

Nom0relies
♥0
18 January 2014 15:03
Furry_Smith, . .

Nom0relies
♥0
18 January 2014 15:05
Furry_Smith, , , , - , , .


text:
# I got an interesting resut

1. Apr 28, 2007

### daniel_i_l

Is there any significance to all this or is it just silly number games?
Thanks.

2. Apr 28, 2007

### Werg22

I really can't see what you mean...

3. Apr 28, 2007

### daniel_i_l

The general idea is just to find triangles with sides of integer length where the sum of the sides is some number. The "number" is the number of links. So for the number three, the only triangle is (1,1,1) cause the only three integers whose sum is 3 is 1+1+1. For 9 you get the 3 results posted above... Is that what you where asking?

4. Apr 28, 2007

### LukeD

Oh wow, that's really interesting. I can't think of any use, but I'm sure that it has a lot of implications for discrete math in general.

5. Apr 29, 2007

### AKG

3 numbers x, y, z form a chain that can be made into a triangle of perimeter n iff x+y+z = n and max{x,y,z} < [n/2] where [.] is the "round down" function. The reason for the condition "x+y+z = n" is obvious. The second condition basically says that the triangle inequality is satisfied. So given an n, how many (x,y,z) satisfy this? To count this, condition on the size of the smallest side, which has length k anywhere between 1 and [n/3]. So the remaining two sides have to add up to n-k, and both must have length greater than or equal to k, and less than or equal to [n/2]. The next smallest side has length m, so we need [n/2] > m > k, [n/2] > n-(m+k) > m, since n-(m+k) will be the length of the largest side. So this means:

max{n-k-[n/2], k} < m < min{[n/2], [(n-k)/2]}

which is just

max{n-k-[n/2], k} < m < [(n-k)/2]

For each m satisfying the above, we get one and only one possibility, so we just have to count the number of m satisfying this, and that is exactly

[(n-k)/2] - max{n-k-[n/2], k}

So the total number of triangles of perimeter n and integer length sides is:

$$\sum _{k=1} ^{\lfloor n/3 \rfloor}\left \lfloor \frac{n-k}{2} \right \rfloor - \max \left (n-k-\left \lfloor \frac{n}{2} \right \rfloor ,\, k\right )$$

When is n-k-[n/2] > k? When k < [{n/2}/2], where {.} is the round up function. So the above sum is:

$$\sum _{k=1} ^{\lfloor \lceil (n/2) \rceil /2 \rfloor}\left \lfloor \frac{n-k}{2} \right \rfloor - \left (n-k-\left \lfloor \frac{n}{2} \right \rfloor \right ) + \sum _{k=\lfloor \lceil (n/2) \rceil /2 \rfloor + 1} ^{\lfloor n/3 \rfloor}\left \lfloor \frac{n-k}{2} \right \rfloor - k$$

$$= -\left \lfloor \frac{\lceil n/2 \rceil}{2} \right \rfloor \left \lceil \frac{n}{2} \right \rceil + \sum _{k=1} ^{\lfloor \lceil (n/2) \rceil /2 \rfloor}\left \lfloor \frac{n-k}{2} \right \rfloor + k + \sum _{k=\lfloor \lceil (n/2) \rceil /2 \rfloor + 1} ^{\lfloor n/3 \rfloor}\left \lfloor \frac{n-k}{2} \right \rfloor - k$$

$$= -\left \lfloor \frac{\lceil n/2 \rceil}{2} \right \rfloor \left \lceil \frac{n}{2} \right \rceil + \left \lfloor \frac{\lceil n/2 \rceil}{2}\right \rfloor ^ 2 + \left \lfloor \frac{\lceil n/2 \rceil}{2} \right \rfloor - \frac{1}{2} \left ( \left \lfloor \frac{n}{3}\right \rfloor ^ 2 + \left \lfloor \frac{n}{3} \right \rfloor \right ) + \sum _{k=1} ^{\lfloor n/3 \rfloor}\left \lfloor \frac{n-k}{2} \right \rfloor$$

Last edited: Apr 29, 2007
6. Apr 29, 2007

### AKG

Actually, figure out this number for the first, say, 8 n. You get 0, 0, 1, 0, 1, 1, 2, 1. Go to http://www.research.att.com/~njas/sequences/index.html [Broken], type in that sequence of numbers, and hit "Search". You'll see your sequence has already been discovered, it's called Alcuin's sequence, and a formula much better than mine is already given for it. It's actually 12 different formulas because it depends on the value of n (mod 12). From that site:

For n=0..11 (mod 12), a(n) is respectively
n^2/48
(n^2 + 6n - 7)/48
(n^2 - 4)/48
(n^2 + 6n + 21)/48
(n^2 - 16)/48
(n^2 + 6n - 7)/48
(n^2 + 12)/48
(n^2 + 6n + 5)/48
(n^2 - 16)/48
(n^2 + 6n + 9)/48
(n^2 - 4)/48
(n^2 + 6n + 5)/48

48 certainly does have some significance! By the way, something went wrong in the formula I derived, because when I plug in n=48 I get 52 as the result (unless I just computed wrong).

Last edited by a moderator: May 2, 2017


text: In this talk we will discuss recent results of M. Ostrovskii about embeddings of graphs into graphs of bounded degree and Lipschitz embeddings of expanders. Then we will show how we can adapt his construction to prove that there exists a family of expander graphs whose coarse Lipschitz embedding (a.k.a quasi-isometric embedding) into a Banach space forces the target space to have trivial cotype. One wants to mention that the proof does not require a metric cotype approach'' and uses only classical Banach space theory.


text:
# The typical output characteristics curve for a transistor working in the common-emitter configuration is shown in the figure.

Question:

The typical output characteristics curve for a transistor working in the common-emitter configuration is shown in the figure.

The estimated current gain from the figure is

Solution:

(200)

$\beta=\frac{\Delta \mathrm{I}_{\mathrm{C}}}{\Delta \mathrm{I}_{\mathrm{B}}}=\frac{2 \times 10^{-3}}{10 \times 10^{-6}}$

$\beta=\frac{1}{5} \times 10^{3}$

$\beta=2 \times 10^{2}$

$\beta=200$


text:
# Ideal of cusp forms for $\Gamma_0(4)$ is principal

Let $\Gamma_0(4)$ be a congruence subgroup of $SL(2,\mathbb{Z})$ defined as

$$\Gamma_0(4)=\{M=\begin{pmatrix} a &b\\ c& d \end{pmatrix}\in SL(2,\mathbb{Z})\mid c=0\bmod 4\}.$$
Dedekind eta-function is defined as
$$\eta(z)=q^{1/24}\prod_{n\geq1}(1-q^n).$$

How to prove that the ideal of cusp forms for $\Gamma_0(4)$ is principal and generated by

$$f(z)=\eta(2z)^{12}?$$

#### Solutions Collecting From Web of "Ideal of cusp forms for $\Gamma_0(4)$ is principal"

The form $f(z)$ generates the $\Gamma_0(4)$ cuspforms (as an ideal over the
graded ring of all modular forms for $\Gamma_0(4)$) for much the same
reason that $\Delta(z) = \eta(z)^{24}$ generates the cuspforms for
the full modular group $\Gamma(1) = {\rm SL}_2({\bf Z})$: this $f$ is
a cuspform with no zeros in the finite plane, and it vanishes at each cusp
only to the multiplicity needed to make it a cuspform. Hence if $\varphi$
is any other cuspform, say of weight $w$, then $\varphi_1 := \varphi/f$
is a modular form of weight $w-6$, and we have written $\varphi$ as
$f \varphi_1$ for some modular form $\varphi_1$ as desired.

The fact that there are no zeros in the finite plane is clear from
the product formula for $\eta(z)$. The vanishing order at the cusps
is easier to see if we change variables to $w := 2z$, because
then $f(z) = \eta(w)^{12}$ is a cuspform for the action of $\Gamma(2)$
on $w$, and the three cusps of $\Gamma(2)$ all have the same width
(namely $2$) because they’re transitively permuted by $\Gamma(1)$,
so $\eta(w)^{12}$ vanishes to order $1$ at each cusp.

Similar examples for other groups are $\eta(3z)^8$ for $\Gamma_0(9)$
(equivalently $\eta(z)^8$ for $\Gamma(3)$), and $(\eta(z)\eta(pz))^w$
for $\Gamma_0(p)$ with $p=2,3,5,11$ (i.e. the primes with $p+1\mid12$) and
$(p+1)w=24$. The last of these also works for $p=7$ and $p=23$
if we allow modular forms with quadratic character.


text:
# Number of nodes in an infinite binary tree

I know the number of nodes in an infinite binary tree is countably infinite, but I don't understand why.
There are $\aleph_0$ levels, and the number of nodes in a binary tree is $2^{\text{number of levels}}$, so there should be $2^{\aleph_0}$ nodes, which is uncountable. This is wrong, but I can't see why.

Bonus question cause I can't get it either : In an infinite tree where each node has an infinite number of children, what is the number of nodes ?
I guess it's the cardinality of the continuum but I'm not sure, and anyway I don't know how to prove it.

-
@wj32 : Math, always weird. –  Joris Valette Nov 4 '12 at 1:01

Let $T_n$ be the set of nodes on level $n$ of a complete binary tree of height $\omega$: $T_0$ is just the root, so it has $2^0=1$ node, $T_1$ has $2^1$ nodes, and in general $T_n$ has $2^n$ nodes. If the tree isn’t complete, the levels may be smaller, but the point is that they are all finite. Their union is the set of all nodes of the tree, and the union of countably many finite sets is countable.

Now suppose that each node has countably infinitely many children. Label the root of the tree with the empty sequence, $\langle\rangle$. Label the nodes on level $1$, the children of the root, with $1$-tuples of natural numbers: $\langle 0\rangle,\langle 1\rangle,\langle 2\rangle,\dots~$. Label their children with $2$-tuples; for instance, the first three children of $\langle1\rangle$ are $\langle 1,0\rangle,\langle1,1\rangle$, and $\langle1,2\rangle$. On level $4$ you’ll find nodes with labels like $\langle 3,0,5,3\rangle$: this node is the child of $\langle 3,0,5\rangle$, which is the child of $\langle 3,0\rangle$, the child of $\langle 3\rangle$, the child of $\langle\rangle$, the root. In this way you can assign every node in the tree a unique label that is a finite sequence of natural numbers, and every such finite sequence will be attached to a node of the tree. Thus, there are exactly as many nodes as there are labels.

There is only one empty label, and there are obviously $\aleph_0$ (countably infinitely many) labels on level $1$, one for each natural number. The labels on level $n$ are just the elements of the set $\Bbb N^n$, and it’s a basic fact of infinite cardinalities that $\Bbb N^n$ is countably infinite for each $n\in\Bbb Z^+$. Thus, each level of the tree has countably many nodes, and the union of countably many countable sets is still countable, so this tree also has only countably many nodes, not continuum-many.

-
Thanks I get it now. For some reason I thought level 2 of the tree would be $\mathbb{N}^{\mathbb{N}}$ when it's $\mathbb{N} \times \mathbb{N}$... –  Joris Valette Nov 4 '12 at 1:26
@Joris: Good. (And yes, that would throw you off pretty badly!) –  Brian M. Scott Nov 4 '12 at 1:27

It may help to note the following facts:

• There isn't an $\aleph_0$-th level.
• $\aleph_0$ is the least upper bound of $\{2^n \mid n \in \mathbb{N}\}$
-

There are $\omega$ levels, but: On the $n$-th level ($n < \omega$), there are $2^n$ nodes, so alltogether, we have $\sum_{n < \omega} 2^n = \aleph_0$ nodes. If we replace $2$ by some other cardinal $\kappa$, which may also be infinite, we have $\kappa^n$ nodes on the $n$-th level, that is alltogether $\sum_{n < \omega} \kappa^n = \max\{\aleph_0, \kappa\}$ nodes.

-
Ok, I have to learn the difference between $\aleph_0$ and $\omega$, the key might be here right ? –  Joris Valette Nov 4 '12 at 0:59
@Joris: No: $\aleph_0$ and $\omega_0=\omega$ are the same thing. People sometimes write $\aleph_0$ to emphasize that they’re talking about cardinality. –  Brian M. Scott Nov 4 '12 at 1:07