Processing math: 100%
Google
 
Web unafbapune.blogspot.com

Friday, November 30, 2012

 

Ex 1.8 Ideal

The notion of an ideal of Z is a non-empty set of integers that is closed under addition, and closed under multiplication by an arbitrary integer. Let I be a non-empty set of integers that is closed under addition (i.e., a+bI for all a,bI ). Show that I is an ideal if and only if aI for all aI.





== Attempt ==

If I is an ideal, clearly aI, as a(1)I, picking -1 as an arbitrary integer.
Given I is closed under addition, for all aI,a+a=2aI,2a+a=3aI, etc. Clearly, if aI,aZI. In other words, if aI,I becomes closed under multiplication by an arbitrary integer.

Thursday, November 29, 2012

 

Ex 1.7 a=bq+r

Division with remainder property:

Let a,bZ with b>0. Then there exist unique q,rZ such that a=bq+r and 0r<b.

Generalized division with remainder property:

Let a,bZ with b>0, and let xR. Then there exist unique q,rZ such that a=bq+r and r[x, x+b).

Show that the generalized division with remainder property also holds for the interval (x, x+b]. Does it hold in general for the intervals [x, x+b] or (x, x+b) ?





== Attempt ==

Consider the interval (x, x+b], which contains exactly b integers, namely x+1, ...,x+b. Applying the division with remainder property with a(x+1) in place of a:
  a(x+1)=bq+ra=bq+r+x+1
Let r=r+x+1. Given r[0, b),
  r{0, ..., b1}r{x+1, ...,x+1+b1}={x+1, ...,x+b}r(x, x+b]
In other words, the generalized division with remainder property holds for the interval (x, x+b].

Consider the interval [x, x+b], which contains integers:
  {x, ...,x+b1,x+b}
In particular, when x is an integer, this set will contain exactly b+1 integers, and therefore the interval [x, x+b] does not hold in general. (It would hold, however, in the special case when x is not an integer, since then the set would contain exactly b integers. Do you see why ?)

Similarly, consider the interval (x, x+b), which contains integers:
  {x+1, ...,x+b1,x+b1}
In particular, when x is an integer, this set will contain exactly b1 integers, and therefore the interval (x, x+b) does not hold in general. (It would hold, however, in the special case when x is not an integer, since then the set would contain exactly b integers. Do you see why ?)


 

Ex 1.6 a mod b with b<0

Given (a mod b) is defined to be abab. Let a,bZ with b<0. Show that (a mod b) (b,0].





== Attempt ==

First, ab is a unique integer m such that mab<m+1. Equivalently, ab=m+ϵ for some ϵ[0,1).
  a mod b=abab=abm=b(m+ϵ)bm=bϵ
Knowing that
  0ϵ<1, and given b<00bϵ>b0(a mod b)>b


Tuesday, November 27, 2012

 

Ex 1.3 xm

Let m be a positive integer. Show that for every real number x1, the number of multiples of m in the interval [1,x] is xm; in particular, for every integer n1, the number of multiples of m among 1,...,n is nm.





== Attempt ==

First, every real number x can be formulated as the sum of an integer and an ϵR where 0ϵ<1. Using the "division with remainder property" (which says for every a,bZ with b>0, there exist unique q,rZ such that a=bq+r and 0r<b), there exist q,rZ such that:
  x=qm+r+ϵ
where q0 and 0r<m

Obviously, q is the number of multiples of m in the interval [1,x]. To find q, we can start with dividing both sides by m:
  xm=q+r+ϵmxm=q+r+ϵm
Observe 0r+ϵ<m, so
  xm=q
Since every integer n is also a real number, the second statement is obviously true by substituting x by n in the first statement.


Sunday, November 25, 2012

 

Ex 1.2 pn12

Let n be a composite integer. Show that there exists a prime p dividing n, with pn12





== Attempt ==

Given n is composite, there exists a,bN such that:
  ab=n
Let's suppose a<=b.

If a = b, a=b=n. So the prime p clearly exists.

If a < b,
  a=nbn
Given abn, observe thatn<b, or else a>n>b, which contradicts the assumption that a < b. This means a<n. So such prime p would also exist.


 

Prove (nn+1)21 as n

This is equivalent to show that:
  (ϵ>0)(nN)(mn)[ | (nn+1)21 |<ϵ ]
Given ϵ,2>0, by the Archimedean property (which says that if x,yR and x,y>0,there is an nN such that nx>y), there is an nN such that:
  (n+1)ϵ>2ϵ>2n+1
Consider for all mn:
  |m2(m+1)21|=1m2(m+1)2=2m+1(m+1)22n+1(n+1)2=2(n+1)1(n+1)2<2n+1<ϵ


Wednesday, November 21, 2012

 

Linear plot with intercept and slope in R

# http://stat.ethz.ch/R-manual/R-devel/library/graphics/html/abline.html
# http://stat.ethz.ch/R-manual/R-devel/library/graphics/html/plot.html

# Set up coordinate system
plot(c(-2,3), c(-1,5), type="n", xlab="x", ylab="y", main="y = 2x + 1")
# Set up the x- and y-axis
abline(h=0, v=0, col="gray60")
# Set up a grid
abline(h = -1:5, v = -2:3, col = "lightgray", lty=3)
# Draw a line with slope=2 and y-intercept=1
abline(b=2, a=1, col="red")

Saturday, November 10, 2012

 

Drawing Function in Octave

# Some references
# http://octave.sourceforge.net/octave/function/text.html
# http://en.wikibooks.org/wiki/Octave_Programming_Tutorial/Plotting
# http://math-blog.com/2011/04/25/plotting-and-graphics-in-octave/
x = [1:0.5:3]
y=x.^2*3
plot(x,y,'-@')
title("y=x^2*3")
xlabel("x")
ylabel("y")
text(1.4,8,"(1.5,6.75)")
text(1.9,13,"(2,12)")
text(2.25,19,"(2.5,18.75)")
print -dpng "foo.png"

Tuesday, November 06, 2012

 

Why rationals are incomplete

Let A = {rQ | r>0r2>3}. Show that A has a lower bound in Q but no greatest lower bound in Q. Give all details of the proof.









== Attempt ==

To show that A has a lower bound in Q is trivial. Clearly, zero is a lower bound of A in Q, as 0 < r for all r in A, and 0 is rational.

Let's assume A has a greatest lower bound x in Q. There are then only three possibilities:
  Case 1: x2=3Case 2: x2>3Case 3: x2<3

Case 1: x2=3

The first case is obviously not possible, since 3 is irrational. See proof here.

Case 2: x2>3

For the second case, suppose
  x=pq where p,qN and x2>3
So
  p2>3q2
Let's consider the rational number
  n22n+1 where nN
which increases without bound as n increases. In particular, we can always pick a large enough n so that
  n22n+1>3q2p23q2n2p23n2q2>6q2n+3q2n2p2>3q2(n+2n+1)n2p2>3q2(n+1)2n2(n+1)2p2q2>3
Let
  y=n(n+1)pq
Since n<n+1,
  p2q2>n2(n+1)2p2q2>3x2>y2>3
This means y is an element of A but less than x, which contradicts the assumption that x is a lower bound of A in Q ! So the supposition that x2>3 must be false.

Case 3: x2<3

For the third case, suppose
  x=pq where p,qN and x2<3
So
  p2<3q2
Let's consider the rational number
  n22n+1 where nN
which increases without bound as n increases. In particular, we can always pick a large enough n so that
  n22n+1>p23q2p23n2q2n2p2>2p2n+p23n2q2>p2(n+2n+1)3n2q2>p2(n+1)23>p2q2(n+1)2n2
Let
  y=pq(n+1)n
Since n<n+1,
  3>p2q2(n+1)2n2>p2q23>y2>x2
This means y is a lower bound of A in Q but greater than x, which contradicts the assumption that x is the greatest lower bound of A in Q ! So the supposition that x2<3 must be false.

As shown in all cases above, it is not possible for A to have a greatest lower bound in Q. This completes the proof.


Sunday, November 04, 2012

 

Running QSTK from TextMate/Sublime Text 2 in OSX

Assuming QSTK has been installed

Sublime Text 2

Edit the Sublime's Python build file at:

  ~/Library/Application Support/Sublime Text 2/Packages/Python/Python.sublime-build
adding the QSTK environment variables. The file would then end up containing something like:
{
    "cmd": ["python", "-u", "$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python",

    "env":
    {
        "PATH": "/opt/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/upune/QSTK/Bin",
        "PYTHONPATH": ":/Users/upune/QSTK:/Users/upune/QSTK/Bin",
        "QS": "/Users/upune/QSTK",
        "QSDATA": "/Users/upune/QSTK/QSData",
        "HOSTNAME": "5855pns93223.nag.nznmba.com",
        "QSDATAPROCESSED": "/Users/upune/QSTK/QSData/Processed",
        "QSDATATMP": "/Users/upune/QSTK/QSData/Tmp",
        "QSBIN": "/Users/upune/QSTK/Bin",
        "QSSCRATCH": "/Users/upune/QSTK/QSData/Scratch",
        "CACHESTALLTIME": "12"
    }
}
The environment variables that need to be defined can be found in the file:
    ~/QSTK/local.sh 
Now one can execute those Python scripts under
    ~/QSTK/Exampls/Basic/
with the usual Command-B shortcut key in Sublime Text 2.

TextMate

In TextMate, however, these environment variables would need to be added at

    TextMate > Preferences > Shell Variables
The Python scripts can then be executed with the usual Command-R shortcut key in TextMate.

This page is powered by Blogger. Isn't yours?