April 29, 2017 | Author: Ashish Chaudhary | Category: N/A
it is a calculator and illustrator based on Vedic Mathematics....
Computer Science Project
Vedic Mathematics Teacher (With illustration) Please review this project.
[email protected]
By- Ashish Chaudhary XII A Computer Science Army Public School, Meerut Cantt. Board Roll No. 5716336
Contents: 1.)
Acknowledgement
2.)
System Requirements
3.)
Introduction To Vedic
Mathematics
9.)
Advantages of Vedic Mathematics Use of Vedic Mathematics in the field of Computers Vedic Mathematics in schools and colleges Researches on Vedic Mathematics The Vedic Mathematics - Sutras Basics of Vedic Mathematics
10.)
Concepts of C++ used
11.)
The Code
12.)
References
4.) 5.)
6.) 7.) 8.)
Acknowledgement
I would like to express my special thanks of gratitude to my teacher Mr. Sachin Chahal as well as my school Army Public School, Meerut Cantt. who gave me the golden opportunity to do this project on the topic Vedic Mathematics Teacher With illustration , which also helped me a lot in remodeling the way I calculate and also I came to know about so many new things. I am really thankful to them. Secondly i would also like to thank my parents and friends who helped me a lot in finishing this project within the limited time.
THANKS AGAIN TO ALL WHO HELPED ME.
Certificate This is to certify that Ashish Chaudhary (Board Roll No. 5716336) of class XII A, Army School Meerut Cantonment has successfully completed his project work on the topic
“Veda Mathematics Teacher ( With Illustration).”
Mr. Sachin Chahal
System Requirements: Minimum System Requirements for running the program: • Intel Pentium II/300 MHz or better • Microsoft Windows Server 2003 (SP1)Microsoft Windows XP Professional (SP2)Windows 2000 Professional (SP4)Windows 2000 Server (SP4) • 128 MB RAM or better • CD-ROM or DVD-ROM drive • SVGA or higher-resolution monitor (XGA recommended)
The following C++ program has been constructed via a free software Turbo C++ for windows 7 and has been compiled on Windows 8 Professional 32-bit (6.1, Build 7601) Service Pack 1. The program has been successfully compiled with the following specifications of the machine used: -----------------System Information -----------------Time of this report: 1/11/2013, 18:36:32 Machine name: GAMING-PC Operating System: Windows 8 Professional 32-bit (6.1, Build 7601) Service Pack 1 (7601.win8sp1_rtm.101119-1850) Language: English (Regional Setting: English)
System Manufacturer: INTEL_ System Model: DG41RQ__ BIOS: BIOS Date: 02/08/08 17:50:03 Ver: 08.00.10 Processor: Intel(R) Core(TM)2 Quad CPU
E7500 @ 2.93GHz (4 CPUs), ~2.9GHz
Memory: 6144MB RAM Available OS Memory: 6144MB RAM Page File: 1287MB used, 2800MB available Windows Dir: C:\Windows DirectX Version: DirectX 11 DX Setup Parameters: Not found User DPI Setting: Using System DPI System DPI Setting: 96 DPI (100 percent) DWM DPI Scaling: Enabled DxDiag Version: 6.01.7601.17514 32bit Unicode
--------------Display Devices --------------Card name: AMD Radeon HD 6990 Manufacturer: Advanced Micro Devices, Inc. Chip type: ATI display adapter (0x954F) DAC type: Internal DAC(400MHz) Device Key: Enum\PCI\VEN_1002&DEV_954F&SUBSYS_03541043&REV_00 Display Memory: 2803 MB
Dedicated Memory: 2038 MB Shared Memory: 765 MB Current Mode: 1980 x 1080 (32 bit) (120Hz) Monitor Name: Generic PnP Monitor Monitor Model: W2043 Monitor Id: GSM4E9E Native Mode: 1980 x 1080(p) (120.000Hz) Output Type: DVI Driver Name: aticfx32.dll,aticfx32.dll,atiumdag.dll,atidxx32.dll,atiumdva.cap Driver File Version: 8.17.0010.1129 (English) Driver Version: 8.970.100.3000 DDI Version: 10.1 Driver Model: WDDM 1.1 Driver Attributes: Final Retail Driver Date/Size: 7/4/2012 11:57:08, 918528 bytes WHQL Logo'd: No WHQL Date Stamp: None Device Identifier: {D7B71EE2-D60F-11CF-9A77-5E23BEC2C535} Vendor ID: 0x1002 Device ID: 0x954F SubSys ID: 0x03541043 Revision ID: 0x0000 Driver Strong Name: oem5.inf:ATI.Mfg.NTx86.6.1:ati2mtag_R7X:8.970.100.3000:pci\ven_1002&dev_954f
Rank Of Driver: 00E62001
------------Sound Devices ------------Description: Speakers (Realtek High Definition Audio) Default Sound Playback: Yes Default Voice Playback: Yes Hardware ID: HDAUDIO\FUNC_01&VEN_10EC&DEV_0662&SUBSYS_8086D613&REV_1001 Manufacturer ID: 1 Product ID: 100 Type: WDM Driver Name: RTKVHDA.sys Driver Version: 6.00.0001.6662 (English) Driver Attributes: Final Retail WHQL Logo'd: Yes Date and Size: 6/19/2012 16:54:20, 3240400 bytes Other Files: Driver Provider: Realtek Semiconductor Corp. HW Accel Level: Basic Cap Flags: 0xF1F Min/Max Sample Rate: 100, 200000
Introduction To Vedic Mathematics About a hundred years ago the scholars in the west discovered the Indian Vedas: ancient texts in their millions containing some of the most profound knowledge. In fact the Sanskrit word ‘Veda’ means ‘knowledge’. They found Vedic texts on medicine, architecture, astronomy, ethics etc and according to the Indian tradition all knowledge is contained in these Vedas. The age of these Vedic texts is disputed, tradition telling us that oginally the Vedas were carried on by word of mouth, by pandits who recited the texts exactly and passed them on to their children. However certain writings that were entitled Ganita Sutras, which means mathematics, were not found to contain any mathematics and the scholars rejected them saying they were nonsense. Now a brilliant eastern scholar, Sri Bharata Krsna Tirthaji (1884-1960), heard what was being said about the Ganita texts and determined to uncover the mathematics in them. Between 1911 and 1918 he studied the texts and eventually was able to reconstruct the system that had been lost long ago. He discovered that all of mathematics is governed by just sixteen sutras or word-formula (and some sub-Sutras), and he showed some really amazing examples of their power and versatility. He wrote sixteen books (one on each sutra) but these have been lost. In 1958 when the loss was confirmed he wrote an introductory book, which is currently available (Reference 1). Recent attempts to reconstruct the system from this book have led to an upsurge of interest and the Vedic system which being taken up by researchers, teachers and others all over the world.
Advantages of Vedic Mathematics: We are living in the age of tredemdous amount of competitions and Vedic Mathematics methods come to us as a boon for all the competitions. Present maths,a scary subject requires higher amount of effort in learning. Maths can be learnt and mastered with miminum efforts in a very short span of time and can be translated into a playful and a blissful subject with the help of Vedic Maths. The several advantages of Vedic Maths are: It reduces the burden of remembering large amount of stuff because it requires you to learn tables upto 9 only. • It enables faster calculations when compared to the conventional method. Thus, the time that gets saved in the process can be used to answer more questions • It acts as a tool for reducing finger counting and scratch work. • It plays an important role in increasing concentration as well as improving confidence. • It is very simple, direct, totally unconventional, original and straight forward. • It encourages mental calculations. • It enriches our understanding of maths and enables us to see links and continuity between different branches of maths. • Vedic Maths system also gives us a set of checking procedures for independent crosschecking of whatever we do. • It keeps the mind alert and lively because of th element of choice and flexibility at each. • Holistic development of the human brain takes place through Vedic Mathematics along with multidimensional thinking. • Vedic Mathematics system to quite an extent also helps us in developing our spiritual part of personality. •
It can introduce creativity in intelligent and smart students, while helping the slow-learners grasp the basic concepts of mathematics. More and more use of Vedic math can without any doubts generate interest in a subject that is generally dreaded by children. Thus, Vedic maths is considered to be more than the blessing of the Veda for the entire humanity. •
A large number of people in the field of education, especially maths professors consider Vedic Maths to be a new and a better approach in studying and understanding Maths. Even students studying at the Indian Institute of Technology are said to be making use of this technique for quicker calculations. Several other institutes are also emphasizing the significance of Vedic Maths.
Use of Vedic Mathematics in the field of Computers: Vedic mathematics is used by several researchers in the field of Digital signal processing, Chip designing, Discrete Fourier Transform , High speed low power VLSI arithmetic and algorithm, RSA encryption system . Most of the researchers have used the vedic mathematics method such as multiplication, division, squares and cubes in above mention fields. VLSI Implementation of RSA encryption H. Thapliyal implementated RSA encryption or decryption algorithm using the algorithm of ancient Indian vedic mathematics which is being modified to improve the performance .The most significant aspect is the development of divisor architecture based on straight division algorithm of Vedic mathematics and embedding it in RSA encryption or decryption circuitry for improved efficiency .They proved that RSA circuitry implemented using vedic division and multiplication is efficient in terms of area and speed compared
to its implementation using conventional multiplication and division architecture. Multiplier and square architecture Time, area and power efficient multiplier and square architecture based on ancient Indian vedic mathematics is developed by H. Thapliyal. Developed algorithm was for low power and high speed applications. It is based on generating partial product and their sums in one step. The design implemented is described at both gate and high level using verilog Hardware Description Language. The design code is tested using “Veriwelsimulator. Their work relates to the field of mathematical coprocessor in computers and more specifically to improve speed and power over the conventional co-processor. The Vedic multiplier and square architecture developed by them were faster than array multiplier and booth multiplier in FPGA implementation.
Digital Signal Processing Digital Signal processing is a technology that is present in almost every engineering discipline. It is also the fastest growing technology of the century and hence it posses tremendous challenges to the engineering community. Faster addition and multiplication are of extreme importance in DSP for Convolution, DFT and Digital filters .The core computing process is always a multiplication routine and hence DSP engineers are constantly looking for new algorithms and hardware to implement them. The methods in Vedic Mathematics are complementary directly and easy. Mr. Mangesh Karad and Mr. Chidgupkar highlight the use of multiplication process based on vedic algorithms and implemented on 8085 and 8086 microprocessors . Use of Vedic algorithms shows appreciable saving of processing time.
supplementing the main coprocessor which is designed to work on specific types of functions like numeric computations, signal processing, graphics etc. The speed of ALU depends on the multipliers. In algorithm and structure levels, numerous multiplication techniques have been developed to enhance the efficiency of multiplier which concentrates on reducing the partial product and their additions. But in this case principle behind the multiplication remains same. Use of Vedic mathematics for multiplication strikes difference in actual process. M. Ramalatha used Urdhva tiryakbhyam Sutra of Vedic mathematics to build a high speed power efficient multiplier in the coprocessor. Using Vedic techniques various arithmetic modules can be designed and integrated into a Vedic ALU, which is compatible for co-processor. The advantages of Vedic multipliers are increase in speed, decrease in delay, decrease in power consumption and decrease in area occupancy. This Vedic coprocessor is more efficient than the conventional one.
ALU Design The ever increasing demands in enhancing the ability of processors to handle the complex and challenging processes has resulted in the integration of number of processor cores into one chip still the load on processor is not less. This load is reduced by
Performance Analyses of Vedic Algorithms Various parameters are recommended by researchers to evaluate the performance of Vedic Maths algorithm. Researchers suggested many parameters few of them are:
Time, Delay, Power and Number of slices. The following table shows the comparison of Delay (ns) factor for multiplication implemented in different algorithms between Conventional and Vedic way. Conclusion
Vedic mathematics can be used in implementation of fast algorithms in various fields of engineering. The performance analysis of Vedic algorithms is done on the basis of delay. This shows efficiency of Vedic multiplier interms of high speed and less complexity.
VEDIC MATHS IN SCHOOLS AND COLLEGES: A few years ago several schools began to teach the Vedic system. The response received was so huge that this remarkable system is today in many schools and institutions in India as well as abroad. It is not only taught in schools but also to a lot of MBA and Economic students. There are obviously many benefits of making use of a flexible, distinguished and proficient mental system like Vedic math. Pupils can come out of the imprisonment of the ‘only one correct’ way, and make their own distinct methods under the Vedic system. Ever since the year 1999, a forum which has been initiated in Delhi called International Research Foundation for Vedic Mathematics and Indian Heritage, has arranged several lectures on Vedic maths in various schools and colleges in Delhi.
RESEARCHES ON VEDIC MATHS: People like Aryabhatta, who laid the foundation of Algebra, Baudhayan, the great geometer and the saint duo, Medhatithi and Madhyatithi, who formulated the basic structure for numerals, have conducted large number of researches. Several research programmes have currently been undertaken in many areas. These researches have been initiated in order to try and find the effects of learning Vedic maths on children, to develop more commanding and simple applications of the Vedic sutras in different fields such as geometry, calculus, and computing.
THE VEDIC MATHEMATICS – SUTRAS Sutras: The Natural Formula In Sanskrit, the ancient language of India, the word Sutra means "Thread of Knowledge". In English we have the word Suture from Sutra and Suture is the thread used for stitching wounds together. So each rule is a thread of knowledge and the whole subject is based on these sutras. The system is based on 16 Vedic Main-Sutras together with 13 Sub-Sutras which are actually word formulae describing natural ways of solving a whole range of mathematical problems. These are 16 one-line formulae originally written in Sanskrit, which can be easily memorized, enable one to solve long mathematical problems quickly. • The Sutras (aphorisms) apply to and cover each and every part of each and every chapter of each and every branch of mathematics (including Arithmetic, Algebra, Geometry – plane and solid, Trigonometry – plane and spherical, Conics – geometrical and analytical, Astronomy, Calculus – differential and integral etc.) In fact, there is no part of mathematics, pure or applied, that is beyond their jurisdiction. • The Sutras are easy to understand, easy to apply and easy to remember, and the whole work can be truthfully summarized in one word ‘Mental’!
Basics Of Vedic Mathematics: 1
GIVE AND TAKE A Addition and subtraction always seem to come together. For example, if you take some money out of your pocket it is now in your hand but is no longer in your pocket.So it is no surprise that there is a Vedic Sutra for this: By Addition and By Subtraction We naturally use this when, say, we add 55 and 19. Most people will add 20 and take 1 away, so 55 + 19 = 74. Similarly for 198 + 64 we could add 200 to 64 and take off 2 after. So 198 + 64 = 262. In the same way we can subtract easily: For 44 – 19 we take 20 from 44 and add 1 back on. So 44 – 19 = 25. And for 333 – 198 we can take 200 from 333 and add 2 back. We get 333 – 198 = 135. This is what many people would naturally do. B For this we use the Sutra: All from 9 and the Last from 10 To take 357 from 1000 for example, we apply All from 9 and the Last from 10 to the figures of 357. So 1000 – 357 = 643. We take the 3 from 9 to get 6, take the 5 from 9 to get 4, and take the 7 from 10 to get 3. Similarly 10,000 – 7621 = 2379, we take 7, 6 and 2 from 9 and the 1 from 10. If the number of figures in the number being subtracted is less than the number of zeros in the base number, we just add as many zeros as needed to make them the same: For example in 10,000 – 643 there are four zeros and only three figures in 643. So we write 10,000 – 0643 so that 0643 has four figures. Then 10,000 – 0643 = 9357. (We take 0, 6, 4 from 9 and 3 from 10) Similarly, 10,000 – 77 = 10,000 – 0077 = 9923.
Now suppose with don’t have a base number, but a multiple of it: like 200, 3000 etc. Suppose you had 3000 – 444. We get 3000 – 444 = 2556. The 444 will come off one of the three thousands, so the initial 3 becomes 2. Then applying “All from 9 and the Last from 10” to the 444 we put down 556. Similarly 700 – 52 = 648. The 7 reduces to 6, and applying the sutra to 52 gives 48. There is one thing to be careful of though. Suppose you had 7000 – 430. When you apply the Sutra to 430 you just apply it to the 43, not to 430. So you get 7000 – 430 = 6570. (7 becomes 6, the Sutra converts 43 to 57 and the zero is carried over).
C Amazingly, this simple method can handle all subtractions! Suppose we had: 444 – 286. Subtracting in each column we get 4 – 2 = 2, 4 – 8 = –4, 4 – 6 = –2. Since these negative answers can be written like this : 2 (42) and 2 (42) is easily converted into 158 because this is just the kind of sum you have just done: 2 (42) means 200 – 42 = 158. Similarly 6767-1908= 5(2)6(1) Here to convert 5(2)6(1) we split it into 5(2) / 6(1) and 5(2)=48 (because 50-2) also 6(1)=59 (because 60-1=59).
2
MIGHTY MULTIPLICATIONS In the Vedic system there are general methods that always work (see Chapter 3 for general multiplication) and there are special methods which can be applied in special cases. Here we look at a very powerful special method that works when the numbers are near a base number (like 10, 100, 1000 etc.) or a multiple of a base number. A Numbers below a base number. 88 × 97 = 8536 We notice here that both numbers being multiplied are close to 100: 88 is 12 below 100, and 97 is 3 below it. So we write 88 = 88(3) or 97= 97(12) which is equal to 88-3=85 or 97-12=85 (whichever you like). Then we multiply the deficiencies ie 12 and 3 to get 12 × 3= 36. So the answer (in two parts) becomes 85 / 36 = 8536. Similarly, 93 × 96 = 8928 Deficiencies are 7 and 4 so 93 =93(4) and 96= 96(7) Which equals 93-4=89 or 96-7=89. Then 7 × 4= 28. Therefore the answer is 89 / 28 =8928. 89 × 89= 7921 Here the first part is 89(11)=89-11=78 and multiplying the deficiencies gives 121. So we write 21 out of the 121 and carry 1 to 78 to become 79. This gives the answer is 79 / 21 =7921. 876 × 998 = 874 / 248 Same rule here, but the base number is 1000 so the deficiencies are 1000-876= 124 by All from 9 and the Last from 10 sutra and 1000-998=2. So the first part is 876-2=998-124=874 and the second part is 124×2=248.
So the answer is 874 / 248 = 874248. D But this is not all: if the numbers are above the base number the method still works: 103 × 104 = 10712 Here the excess is 103-100=3 and 104-100=4. So the first part in this case becomes 103+4=104+3=107 and the second part becomes 4×3=12. This gives the answer 10712.
E But suppose one number is above the base and the other number is below it. Can the method still be used? The answer is yes, most certainly. 124 × 98 = 122(48)= 12152 Here the base number is 100 and the deficiency is 100-98=2 also the efficiency is 124-100=24. Therefore the first part is 124-2 or 98+24= 122 (whichever you like), the second part is 24×minus 2 =(48). So the answer is 122(48)= 12200-48. Now applying All from 9 and the Last from 10 sutra 122 becomes 121 and 48 gives 52 therefore the answer becomes 12152.
F Let’s look at one more extension of this method: where the numbers are not near a base number, but are near a multiple of a base number, like 30, 200, 6000. In fact we use a sub-sutra called Proportionately. 213 × 203 = 2 × 216/39 = 43239 Here excess is 213-200=13 and 203-200=3. We observe here that the numbers are not near any of bases used before: 10, 100, 1000 etc. But they are close to 200, and are 13 and 3 above 200. The usual procedure gives us 216/39 (213+3=216, 13×3=39). Now since our base is 200 which is 100×2 we multiply only the left-hand
part of the answer by 2 to get 43239.
29 × 28 = 3×27/2 = 812 Deficiency is 30-29=1 and 30-28=2. So 29-2=28-1= 27 and 3 × 27=81 and 2 × 1 =2, therefore the answer becomes 812.
3 VERTICAL AND CROSSWISE PATTERNS
_____________________________________________________ The Vedic Sutra Vertically and Crosswise enables us to multiply any two numbers together in one line (from left to right or from right to left) no matter how big the numbers are. A Let us start with multiplying 2-figure numbers. 21 × 23 = 483 we put the numbers one below the other and multiply: A. vertically on the right, B. then crosswise and add, C. and then vertically on the left. C. multiply vertically in the right-hand column: 1 × 3 = 3, so 3 is the last figure of the answer. D. multiply crosswise and add: 2 × 3 = 6, 1 × 2 = 2, 6 + 2 = 8, so 8 is the middle figure of the answer. E. multiply vertically in the left-hand column: 2 × 2 = 4, 4 is the first figure of the answer. So the answer is 483. The previous examples involved no carry figures, so let us consider this next. 23×41=943 The 3 steps give us: 3×1 = 3, 2×1 + 3×4 = 14, so we carry 1 to the left as shown. 2×4 = 8, and 8 + the carried 1 = 9. So 23 × 41 = 943.
Concepts of C++ used:
a. Switch case: switch ( expression ) case constant-expression : statement [default : statement] If a matching expression is found, control is not impeded by subsequent case or default labels. The break statement is used to stop execution and transfer control to the statement after the switch statement. Without a break statement, every statement from the matched case label to the end of the switch, including the default, is executed. For example: // switch_statement1.cpp #include int main() { char *buffer = "Any character stream"; int capa, lettera, nota; char c; capa = lettera = nota = 0; while ( c = *buffer++ ) // Walks buffer until NULL { switch ( c ) { case 'A': capa++; break; case 'a': lettera++; break; default: nota++; } } printf_s( "\nUppercase a: %d\nLowercase a: %d\nTotal: %d\n", capa, lettera, (capa + lettera + nota) ); } In the above example, capa is incremented if c is an uppercase A. The break statement after capa++ terminates execution of the switch statement body and control passes to the while loop. Without
the break statement, lettera and nota would also be incremented. A similar purpose is served by the break statement for case 'a'. If c is a lowercase a, lettera is incremented and the break statement terminates the switch statement body. If c is not an a or A, the default statement is executed. A switch statement can be nested. In such cases, case or default labels associate with the closest switch statement that encloses them. ////////////////////////////////////////////////////////////////////////
b. Classes: A class is an expanded concept of a data structure: instead of holding only data, it can hold both data and functions. An object is an instantiation of a class. In terms of variables, a class would be the type, and an object would be the variable. Classes are generally declared using the keyword class, with the following format: class class_name { access_specifier_1: member1; access_specifier_2: member2; ... } object_names; Where class_name is a valid identifier for the class, object_names is an optional list of names for objects of this class. The body of the declaration can contain members, that can be either data or function declarations, and optionally access specifiers. All is very similar to the declaration on data structures, except that we can now include also functions and members, but also this new thing called access specifier. An access specifier is one of the following three keywords:private, public or protected. These specifiers modify the access rights that the members following them acquire:
•
private members of a class are accessible only from within other members of the same class or from theirfriends.
• •
protected members are accessible from members of their same class and from their friends, but also from members of their derived classes. Finally, public members are accessible from anywhere where the object is visible.
By default, all members of a class declared with the class keyword have private access for all its members. Therefore, any member that is declared before one other class specifier automatically has private access. For example:
class CRectangle { int x, y; public: void set_values (int,int); int area (void); } rect; Declares a class (i.e., a type) called CRectangle and an object (i.e., a variable) of this class called rect. This class contains four members: two data members of type int (member x and member y) with private access (because private is the default access level) and two member functions with public access: set_values() and area(), of which for now we have only included their declaration, not their definition. ////////////////////////////////////////////////////////////////////
c. Scope Resolution: ‘::’ is known as Scope Resolution Operator. C++ is a block structured language. Different program modules are written in various blocks. Same variable name can be used in different blocks. Scope of a variable extends from the point of declaration to the end of the block. A variable declared inside a block is ‘local’ variable. Blocks in C++ are often nested. e.g. …. …. { int x = 10; …. ….
{ int x = 20; ….. …. } …. } The declaration of the inner block hides the declaration of same variable in outer block. This means, within the inner block, the variable x will refer to the data object declared therein. To access the global version of the variable, C++ provides scope resolution operator. In the above example, x has a value of 20 but ::x has value 10. Similarly, this operator is used when a member function is defined outside the class e.g. Class MyClass { int n1, n2; public: { void func1(); ---------Function Declaration } }; public void MyClass::func1() ---Use of Scope Resolution Operator to write function definition outside class definition { // Function Code } //////////////////////////////////////////////////////////////////////////////
d. Inheritance: Inheritance is a mechanism of reusing and extending existing classes without modifying them, thus producing hierarchical relationships between them. Inheritance is almost like embedding an object into a class. Suppose that you declare an object x of class A in the class definition of B. As a result, class B will have access to all the public data members and member functions of class A. However, in class B, you have to access the data members and member functions of class A through objectx. The following example demonstrates this: #include using namespace std;
class A { int data; public: void f(int arg) { data = arg; } int g() { return data; } };
class B { public: A x; };
int main() { B obj; obj.x.f(20); cout