Skip to main content

Posts

characteristic of Pythagorean

The sum of two numbers is a square. The sum of their squares is also a square. Find a method to get all such numbers. Answer let a + b = x^2 and a^2 + b^2 = y^2. the second equation is the characteristic Pythagorean triplet. so we can write a and b as p^2-1 and 2p where p is a positive integer > 1 . therefore, (p^2-1) + (2p) has to be a square number. [which is not true except for p=1/2] thus there is no base Pythagorean triplet which satisfies this relation, but multiples of them may easily do so. like: 3,4,5. 3+4 = 7 not a square. but for 21,28,35. 21 + 28 =7^2. thus (p^2+2p-1)(p^2-1) and (p^2+2p-1)(2p) or better still, q^2*(p^2+2p-1)(p^2-1) and q^2*(p^2+2p-1)(2p) satisfy the given condition, where p,q are both positive integers.

Properties of Irrational numbers

Properties of Irrational numbers If x be an irrational number then there are infinitely many relatively prime integers p and q such that | p/q - x | < 1/q^2 If x is a rational number then there are finitely many solutions to the above equation. This Theorem was first discovered by Dirichlet Further let {y} be the fractional part of y. x is an irrational number then the sequence {nx} n = 1,2,3, ... is not periodic. If x is a rational then this sequence is periodic. A rational number can be represented only by a a finite continued fraction where as an irrational number can be represented by an infinite continued fraction. Each convergent of the continued fraction representation of a irrational number is a better rational approximation of the given irrational number, than any previous convergent. Eg: The continued fraction representation of Pi is [3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, 1, 14, 2, 1, 1, 2, 2, 2, 2, ..] hence the successive rational approximation of Pi are 3, 2

fibonacci numbers in pascal's triangle

Fibonacci numbers in pascal's triangle? The Proof follows from the following identity: Let F(r) be the r-Th Fibonacci number, C(n,r) be the number of combination of n things taken are at a time and [x] be the greatest integer function then Summation C(n-k, k) = F(n+1) where k goes form k=0 to k = [n/2] Now use induction on the variable n.

Improve your reasoning power and Solve the Mathematics equation problem

Improve your reasoning power Question - When a no. is divided by 2, rem. is 1 when divided by 3, rem. is 2. and so on...till it is divided by 10, remainder is 9.What's the number? Answer- if the no. be n, (n+1) is divisible by all of {2,3,4,..,10}. hence (n+1) is divisible by 2520. [ 2 |(n+1) & 3 |(n+1) => 6 |(n+1) & 4 | (n+1) => 12 |(n+1) (12=l.c.m(6,4)) & 5 |(n+1) => 60 |(n+1). continuing in this way 2520 |(n+1)] therefore any no. of the form n=(2520p-1) will suffice where p is a natural no. of course the smallest such natural no. is 2519. Mathematics equation problem X^3-Y^2=2 FIND ALL INTEGRAL SOLUTION OF X,Y Answer: case 1 x-3=y-5 y=x+2 original eq gives x^3-x^2-4x-2=0 no integral solution for this. case 2 x-3=y+5 y=x-8 original eq gives x^3-x^2+16x-66=0 (x-3)(x^2+2x+22)=0 x=3 y=-5 as eq invoves y^2 hence y as wellas -y both satisfies the pairs are (3,5) and (3,-5)

Find the remainder

Find the remainder when the digits 1 to 99 written side by side is divided by 11 i.e: (123456789101112...99)mod 11=? 123456789101112.....979899 counting from right, sum of digits at odd place = 9(9+8+...+1+0)+(9+7+5+3+1) sum of digits at even place = 10(9+8+...+1)+(8+6+4+2) sum of odd - sum of even = -40 = 4 (mod 11)

Code to send email using PLSQL

Code to send email using PLSQL You can use UTL_SMTP and UTL_TCP to send email attachment from Oracle Version 8i onwards. Sample Code: DECLARE v_From VARCHAR2(80) := 'oracle@mycompany.com'; v_Recipient VARCHAR2(80) := 'test@mycompany.com'; v_Subject VARCHAR2(80) := 'test subject'; v_Mail_Host VARCHAR2(30) := 'mail.mycompany.com'; v_Mail_Conn utl_smtp.Connection; crlf VARCHAR2(2) := chr(13)||chr(10); BEGIN v_Mail_Conn := utl_smtp.Open_Connection(v_Mail_Host, 25); utl_smtp.Helo(v_Mail_Conn, v_Mail_Host); utl_smtp.Mail(v_Mail_Conn, v_From); utl_smtp.Rcpt(v_Mail_Conn, v_Recipient); utl_smtp.Data(v_Mail_Conn, 'Date: ' || to_char(sysdate, 'Dy, DD Mon YYYY hh24:mi:ss') || crlf || 'From: ' || v_From || crlf || 'Subject: '|| v_Subject || crlf || 'To: ' || v_Recipient || crlf || 'MIME-Version: 1.0'|| crlf || -- Use MIME mail standard 'Content-Type: multi

Code to Get all table size in sql database server, code to get table size, get sql tables size, show table size in sql server

SET NOCOUNT ON DBCC UPDATEUSAGE(0) -- Database size. Following code you can write in stored procedure or you can directly run on query browser to get all table size in selected database. EXEC sp_spaceused-- Table row counts and sizes. CREATE TABLE #test ( [name] NVARCHAR(128), [rows] CHAR(11), reserved VARCHAR(18), data VARCHAR(18), index_size VARCHAR(18), unused VARCHAR(18)) INSERT #t EXEC sp_msForEachTable 'EXEC sp_spaceused ''?''' SELECT *FROM #test-- # of rows. SELECT SUM(CAST([rows] AS int)) AS [rows]FROM #test DROP TABLE #test I hope this code will help you a lot on database administration.