Jump to content

Wikipedia:Reference desk/Archives/Mathematics/2011 June 23

From Wikipedia, the free encyclopedia
Mathematics desk
< June 22 << May | June | Jul >> June 24 >
Welcome to the Wikipedia Mathematics Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


June 23

[edit]

FDS for an ODE

[edit]

Hey guys, I am trying to solve an BVP of the form -(a(x) u'(x))'=f(x) with u(0)=u(1)=0 where is a bounded differentiable function in [0,1], on an equally spaced grid on [0,1] using finite differences. Since I want approximation, I used central differences for both the first and the second derivative and got the relation:


with and since the ODE is linear, I can put this in a matrix vector form and get a tridiagonal matrix. I have two questions about this matrix. First of all, using Gerschgorin's theorem, I put a bound on the spectral radius of this matrix as 20M where M is the maximum of |a(x)| on the entire grid (I could use the max on [0,1] too which would be uniform for all grids). Is this correct and is this the best bound one can get? Second, what can I say about the condition number (let's say the 2-norm...using the ratio of the singular values)? How does the condition number depend on h? What happens as h goes to zero? Numerical experiments show that the condition number is blowing up but how would I show it analytically? Thanks!-Looking for Wisdom and Insight! (talk) 01:35, 23 June 2011 (UTC)[reply]

Gradient and conjugate gradient

[edit]

On a completely different topic, how does the conjugate gradient method converge so much faster than plain simple gradient descent? I am not asking for the math behind it. I am just trying to get some intuitive sense and would appreciate it if someone can explain it in words. I thought the gradient points in the direction of maximum increase so negative gradient points in the maximum decrease so if I want to minimize the quadratic function, why not just use the gradient? How can conjugate gradient be faster? Thanks!-Looking for Wisdom and Insight! (talk) 01:45, 23 June 2011 (UTC)[reply]

I believe the question relates to our articles Gradient descent and Conjugate gradient method. Dolphin (t) 01:59, 23 June 2011 (UTC)[reply]

I have already read both of the articles but I was looking more for some insight in words as to what's wrong with the gradient descent method and how does CG fixes it. - Looking for Wisdom and Insight! (talk) 03:42, 23 June 2011 (UTC)[reply]

For intuition, I think a key phrase from our CG article is "Suppose that {pk} is a sequence of n mutually conjugate directions. Then the pk form a basis of Rn, so we can expand the solution x* of Ax = b in this basis" -- Because the pk are orthogonal with respect to A, there is less potential for 'redundancy' in the iterates, and they won't tend to zig-zag as some of the examples given in the gradient decent article. Does that help? SemanticMantis (talk) 03:56, 23 June 2011 (UTC)[reply]

Striped triangle question

[edit]

Is it possible to create a triangle with three horizontal stripes, where each of the stripes has the same number of elements?

For example, it's easy to create such a triangle with two horizontal stripes:

  A
 A A
B B B

This has two stripes, each with three elements. This is (I think) the next smallest example, with two stripes containing 105 elements each:

                   A
                  A A
                 A A A
                A A A A
               A A A A A
              A A A A A A
             A A A A A A A
            A A A A A A A A
           A A A A A A A A A
          A A A A A A A A A A
         A A A A A A A A A A A
        A A A A A A A A A A A A
       A A A A A A A A A A A A A
      A A A A A A A A A A A A A A
     B B B B B B B B B B B B B B B
    B B B B B B B B B B B B B B B B
   B B B B B B B B B B B B B B B B B
  B B B B B B B B B B B B B B B B B B
 B B B B B B B B B B B B B B B B B B B
B B B B B B B B B B B B B B B B B B B B

But is it possible to extend this to three stripes? If so, what's the minimum number of elements in such a triangle? 28bytes (talk) 22:13, 23 June 2011 (UTC)[reply]

A quick python script shows that there are none with fewer than 100 million rows. So probably not, but I don't have a proof.--Antendren (talk) 23:20, 23 June 2011 (UTC)[reply]
Interesting. Thanks! 28bytes (talk) 23:21, 23 June 2011 (UTC)[reply]
The problem is equivalent to finding positive integer solutions of the system , . Picking the positive solution to each quadratic equation,
So it comes down to whether and can both be perfect squares. At this point, I tried reducing modulo some small primes to show that they both can't be quadratic residues mod p for some p, but I wasn't able to find such a prime. Anyway, a slightly different approach might work. Sławomir Biały (talk) 00:45, 24 June 2011 (UTC)[reply]
I also couldn't find a three stripe solution. I wrote a Fortran program, and found the following number of elements were solutions to the 2 stripe problem, but none of these had a third stripe:
           3
         105
        3570
      121278
     4119885
   139954815
  4754343828
161507735340
Interestingly, there seems to be an almost exact relationship between each adjacent pair listed above. That is, each is approximately 33.97 times the previous entry. StuRat (talk) 00:43, 24 June 2011 (UTC)[reply]
Looks like it converges to around 33.970562748477. Is that an algebraic number, I wonder? 28bytes (talk) 02:42, 24 June 2011 (UTC)[reply]
(sequence A053141 in the OEIS) and (sequence A061278 in the OEIS) are relevant. Sławomir Biały (talk) 00:47, 24 June 2011 (UTC)[reply]
(sequence A075528 in the OEIS) is the actual sequence given here. A generating function and citation appear. The value near 33.97 is actually the zero of .McKay (talk) 03:52, 24 June 2011 (UTC)[reply]
OK, using that first sequence as the number of lines in the first stripe (ignoring the zero), instead of my previous brute force approach, I was able to come up with an extended list of two stripe solutions, none of which has a third stripe. Here are the numbers of elements in each stripe:
                  3
                105
               3570
             121278
            4119885
          139954815
         4754343828
       161507735340
      5486508657735
    186379786627653
   6331426236682470
 215082112260576330
7306460390622912753
StuRat (talk) 02:28, 24 June 2011 (UTC)[reply]
Antendren showed that any solution must have at least 9 digits by directly checking the number of rows below that point to see which fit the two equations. By searching only the solutions of the first equation to see if they solve the second as well, there are no solutions with less than 100,000 digits. This calculation took about 30 seconds in PARI/GP:
isTriangular(n:int)={
	issquare(n<<3+1)
};
test(lim)={
  my(x,y,n,t);
  while(n<=lim,
    t=3*x+2*y+2;
    y=t+x+y+1;
    x=t;
    n=x*(x+1)/2;
    if(isTriangular(3*n),return(n))
  );
  print("No solutions")
};
test(1e100000)
(Actually, the listed code would be somewhat slower; I actually used an optimized and compiled version of the first function.)
CRGreathouse (t | c) 04:30, 24 June 2011 (UTC)[reply]