Free Essay

Euclid's Algorithm

In:

Submitted By sunil1204
Words 477
Pages 2
Assignment #2

A. Algorithm to calculate Easter day for the year 2013:
X = 2013 1. Divide X by 19 to obtain a quotient (which will be ignored) and a remainder A.
2013/19 = quotient 105 and remainder 18.
A = 18 2. Divide X by 100 to obtain a quotient B and a remainder C.
2013/100 = quotient 20 and remainder 13.
B =20; C = 13. 3. Divide B by 4 to obtain a quotient D and a remainder E
20/4 = quotient 5 and remainder 0.
D = 5; E = 0. 4. Divide (8*B + 13) by 25 to obtain a quotient G and remainder (which will be ignored).
(8*20 + 13)/25 = quotient 6 and remainder 23
G = 6. 5. Divide (19*A+B-D-G+15) by 30 to obtain a quotient which will be ignored and a remainder L.
(19*18+20-5–6+15)/30 = quotient 12 and remainder 6
H = 6. 6. Divide (A+11*H) by 310 to obtain a quotient M and a remainder (which will be ignored).
(18+11*6)/310 = quotient 0 and remainder 174.
M = 0 7. Divide C by 4 to obtain a quotient J and a remainder K.
13/4 => quotient 3; remainder 1
J = 3 and K = 1 8. Divide (2*E + 2*J - K – H + M + 32) by 7 to obtain a quotient (which will be ignored) and a remainder L.
(2*0 + 2*3 – 1 – 6 + 0 + 32)/7 = quotient 4 and remainder 3.
L = 3. 9. Divide (H - M + L + 90) by 25 to obtain a quotient N and a remainder (which will be ignored).
(6 – 0 + 3 + 90)/25 = quotient 3 and remainder 24.
N = 3. 10. Divide (H – M + L + N + 19)/32 to obtain a quotient (which will be ignored and a remainder P.
(6 – 0 +3+3+19)/32 = remainder 31 and quotient 0.
P = 31
Easter Sunday is on Pth day of the Nth month.
Easter Sunday is on March 31st 2013.

B. Using Euclid’s algorithm for determining GCD determine the following for inputs 60 and 16.
Step 1: Input larger value and smaller value (60 and 16).
Step 2: Divide larger by smaller and keep remainder. 60/16 = remainder 12.
Step 3a: If remainder is not 0, then reset larger to the value of smaller (16) and reset smaller to the remainder (12) and repeat step 2. 16/12 = remainder 4.
Step 3b: If remainder is not 0, then reset larger to value of smaller (12) and reset smaller to the remainder (4) and repeat step 2. 12/4 = remainder 0
If remainder is 0 then GCD is smaller (4)
Based on the above calculations the final findings are as below: 1. Step 2 was executed 3 times. 2. The final value of larger = 12. 3. The final value of smaller = 4. 4. GCD = 4

Similar Documents

Premium Essay

Walmart

...ACC 519 Case Note Target vs. WalMart Purpose: The purpose of this case is to illustrate a comprehensive financial statement analysis which applies the concepts of strategy analysis, ratio analysis and valuation in the context of two competing businesses. This case will demonstrate how corporate strategy is reflected in financial statements and ratios, and will require you to compare performance over time and against a competitor. In addition, this case will help you to see how different operating and financing strategies will affect ratios. Your primary sources of information in this case should be the most recent 10-K’s issued by the two companies (TGT, filed 3.15.2012; WMT, filed 3.27.12). Case Questions: 1. What is the generic strategy for each of the two companies? 2. What is each company’s source of competitive advantage, and what will be important to maintaining that advantage? 3. How do their business models differ? For purposes of this question you should consider the following: a. Composition of the business from a segment perspective b. Composition of sales - % of sales in various categories c. Financing of the assets used in the business 4. From an accounting analysis perspective, are there any major differences between the two companies? 5. Calculate the following ratios for both companies for the years ended January 2012 and 2011 (Please note that the two companies refer to their fiscal years in different ways): d. ROE...

Words: 370 - Pages: 2

Premium Essay

Value Publishing

...his case follows the performance-review and financial-statement-forecasting decisions of a Value Line analyst for the retail-building-supply industry in October 2002. The case contrasts the strong operating performance of Home Depot with the strong stock-market performance of Lowe's. Students examine a financial-ratio analysis for Home Depot that acts as a template for generating a comparable ratio analysis for Lowe's. The student ratio analysis is designed to build intuition with respect to interpreting individual ratios as well as ratio interrelationships (e.g., the DuPont framework). The historical-performance comparison suggests that investors are skeptical of the ability of Home Depot to maintain its performance trajectory, yet they project sustained improvements for Lowe's. Students are invited to scrutinize the analyst's five-year income-statement and asset-side balance-sheet forecast for Home Depot. The case expressly focuses on the asset side of the balance sheet as a preview for other cases using free-cash-flow forecasting. The Home Depot forecast exercise exposes students to the mechanics of financial-statement modeling and sensitivity analysis, which they can use in building their own forecast for Lowe's. Finally, the strong-growth assumptions for Home Depot relative to the modest-growth forecast for the industry suggest that the company can be expected to capture massive and perhaps unreasonable market share in the near term. The exercise provides a striking example...

Words: 328 - Pages: 2

Free Essay

Case Study of Bowden Brake Service

...Case Study of Bowden Brake Service HRM 505-OL Marygroove College By: Victoria Flanders Thursday September 25, 2014 Case Study #1 Bowden Brake Service Problem/Issue Statement Should local finance institutions lend the money to Jim to expand his business? The owner, Jim Bowden, has been denied by the local finance institutions for loan in order to expand his business. Executive Summary *Assumptions were made and are presented in Appendix A* The owner, Jim Bowden owns a brake service shop. His business specialized in fixing car brakes and possible other repairs. Jim is seeking to expand his business, the owner had fill out financial form in the local finance institutions. Jim appeared to be very furious at the local finance institutions. As it turns out, all the finance institutions turned down his request for loan. Since his requests were turned down, Jim is unable to expand his business. The local finance institutions had recommended for the owner to look into ratio analysis. The problem is, both the bookkeeper and accountant are on vacation during the time of need. Jim is clueless about ratio analysis and is frustrated. There is a Human Resource Manager who was hired several months ago. This HR Manager had some training in managerial finance. The HR Manager offered to help the owner figure out the finance. At first, the owner felt skeptical because he did not think HR would know anything about finance. When the HR Manger discovered Jim needed a ratio analysis...

Words: 1407 - Pages: 6

Premium Essay

Cases Basket

...Accounting for Managers Assignment 1 PSU heavyweight BHEL has approved the divestment of 5 per cent of government holding in the company. Using the attached financial data of BHEL surface the reason and impact of the divesture. Assignment 2 LNT Finance was one of the most awaited IPO of 2011 .Incorporated in 2008, L&T Finance Holdings is a financial holding company offering a diverse range of financial products and services across the corporate, retail and infrastructure finance sectors as well as mutual fund products and investment management services. Promoted by Larsen & Toubro Ltd, one of the leading companies in India, with interests in engineering, construction, electrical and electronics manufacturing and services, information technology and financial services, L&T Finance Holdings is registered with the RBI as a Systemically Important Non-Deposit Taking Non-Banking Financial Company and has applied for registration as a Core Investment Company. Company’s operations are arranged into four business groups – the Infrastructure Finance Group, the Retail Finance Group, the Corporate Finance Group and the Investment Management Group. LTF’s customer includes individual retail customers as well as large companies, banks, multinational companies and small- and medium-enterprises. Objects of the Issue: 1. Repayment of inter corporate deposit issued by Promoter to the Company; 2. To augment the capital base of L&T Finance and L&T Infra, to meet the capital adequacy...

Words: 2918 - Pages: 12

Free Essay

M&S Analysis

...Part 1 1. Introduction I chose topic 8 because analysis and interpretation of business and financial performance has interested me and I want to learn more about and it is the topic I feel most comfortable with having completed my ACCA studies. Writing reports and analysing business performance was covered in papers F7 and P3 and through this report I will have the opportunity to enforce practically the knowledge acquired. Moreover undertaking this research project will improve my performance at work and enhance my professional and communication skills. I work in accountancy practice and this project will be invaluable experience. I decide to write a research project on Marks & Spencer plc. and the reason being is that I had carried out an investigation on this company before and I have preliminary knowledge on its activities and the sector in which operates. Marks & Spencer is well known and reputable retailer which I personally favour as a customer. Marks and Spencer Group plc. is an international multi-channel retailer with headquarters in London, in the City of Westminster .It carries out the retailing of apparel, home products and food items. It was started as a Penny Bazar 1884 in Leeds selling only British made goods (Enc. Britannica,2004) As of 30 March 2013 the Company’s product were sold through 766 UK stores and 418 stores internationally (www.marksandspencer.com, 2013) 1.1.2 The reason for choosing the John Lewis Plc. as the comparator company John...

Words: 2277 - Pages: 10

Free Essay

Math Method

...Letter F FACTORIAL -the product of n integers from n to 1or 1 through n can be expressed by the symbol n! (read as n factorial). FACTORING -is it the process of finding the factor of a product. this is the inverse operation of special product. FACTORS -they are the numbers multiplied i.e, both the multiplicand and the multiplier. FINAL AMOUNT -it is the sum of the principal and the interest as computed. it is also called maturity value. FINITE SERIES -It is a series containing a fixed number of terms. FINITE SET -it is a set whose element can be counted or has a limited number of elements. FOOT -a measure of lenth. FOOT-POUND -it is a unit of work. it is the work done in raising 1 lb, a height of 1 ft., ot it is the pressure of 1 lb. xerted over a distance of 1 ft. in any direction. Face of a Polyhedron One of the flat surfaces making up a polyhedron. Note: The faces of a polyhedron are all polygons.   Factor of a Polynomial Factorization of a Polynomial A factor of polynomial P(x) is any polynomial which divides evenly into P(x). For example, x + 2 is a factor of the polynomial x2 – 4. The factorization of a polynomial is its representation as a product its factors. For example, the factorization of x2 – 4 is (x – 2)(x + 2). Factor Theorem The theorem that establishes the connection between the zeros and factors of apolynomial.   Factor Tree A structure used to find the prime factorization of a positive integer.   Factoring Rules Algebra formulas...

Words: 1653 - Pages: 7

Free Essay

Hippocrates

...Hippocrates of Chios was a Greek merchant turned mathematician who wrote the first textbook on geometry. Hippocrates, who was born on the island of Chios, has been called one of the greatest mathematicians of his time. Legend has it that Hippocrates was a thriving merchant until lost all of his fortune. He is said to have traveled to Athens to try to win his fortunes back in a court of law. Since he was required to stay in Athens for the trials, Hippocrates began to attend lectures on mathematics to pass the time. He eventually became proficient enough in mathematics to open his own school. Hippocrates is believed to have been influenced by the Pythagorean School of Mathematics. His book contained some of the first written accounts of Pythagorean mathematics since the Pythagoreans themselves did not believe in written texts. Hippocrates was one of the first “paid” mathematics teachers, although the Pythagoreans believed it was taboo to earn money from their knowledge. He may have been able to establish a school because of his financial troubles. Hippocrates wrote the first mathematical textbook, called the Elements of Geometry and even though the book is lost, it had a profound influence on the mathematicians who followed him. Euclid based some of his work on that of Hippocrates in his book, Elements that was written more than a century later. One of the most famous problems faced by ancient Greek mathematicians was doubling the cube, also called the Delian...

Words: 499 - Pages: 2

Free Essay

Hello

...` Regent CollegeCollette DivisionL3 BTEC National Business2013/14 | | Student Name | Abdullah Kadiri | UNIT: 2 | Business Resources | Unit Credit value | 10 | ABOUT THIS UNIT | The aim of this unit is to develop learner knowledge of the range of human, physical, technological andfinancial resources required in an organisation, and how the management of these resources can impact on business performance. | ASSESSOR(S) | FBE/MHU | ASSIGNMENT REF: | | START DATE: | 2/12/13 | END DATE: | 15/03/14 | Task 1:P1, P2 and M2 | ScenarioYou are a manager at a local business (your selected organisation) and you have been invited to give a series of two careers talks to Year 11 students about recruitment and selection within your organisation.Your presentation should include the following:P1 * A brief introduction to the business; * A summary of the types of employment within the business; * An explanation of the recruitment process with emphasis on the purpose and contents of job descriptions. This should be supported with annotated examples of job descriptions from the selected organisation; * An explanation of the purpose and content of employment contracts. This should be supported with an annotated example of an employment contract from the selected organisation. * For evidence produce written examples P2 * A description of one specific job within the organisation. This could relate to one of the...

Words: 1396 - Pages: 6

Premium Essay

Business

...Tootsie Roll Industries Inc. Loan Package ACC/561 - Accounting August 15, 2011 Tootsie Roll Industries Inc. Loan Package Since the company’s establishment in 1896, Tootsie Roll Industries Inc. has expanded to become one of the biggest candy companies in the United States. Tootsie Roll Industries Inc. is one of America’s most recognized candy companies through manufacturing and selling some of the most popular candies in the world. The company has an extensive amount of products sold in many venues including grocery stores, vending machines, and drugstores. Tootsie Roll Industries Inc. applies innovation consistently by developing new forms of presentation and creating more options for the consumer. In the first quarter of 2011 the company increased sales effectively through improved marketing processes but the increased costs of ingredients, freight, energy, and other factors lowered the net earnings to $8,000,000 compared to $9,204,000 in 2010. Tootsie Roll Industries Inc. is currently seeking beneficial opportunities to improve the net earnings and shareholder value of the organization. The company is completing a loan package by determining its current financial situation through ratio analysis of its financial statements. The goal is to secure a loan for the company to fund $2.5 million to improve the business. The company will explain how the proceeds from the loan will be used to enhance business operations and how the loan approval will affect the company...

Words: 297 - Pages: 2

Premium Essay

Accounting

...Accounting Group Presentation Outline I. Intro We are group B and our presentation is on the solvency of Lawson Software. To decide how solvent Lawson is on a scale of 1 to 10, with 10 being the highest, we chose to look at their Current Ratio, Quick Ratio, Interest Coverage, and Cash Flow Profile over the past 2 years. After looking over our data that was collected, we chose to give Lawson a rating of 6, due to their decent ratio numbers, even though some are in decline. II. Numbers A. Current Ratio (Current Assets/Current Liabilities): 2010:1.25 - (570,113,000/455,079,000) 2009:1.49 - (652,095,000/438,098,000) B. Quick Ratio: 2010:1.1 (375,917,000+117,976,000+4,664,000)/455,079,000) 2009:1.3 (414,815,000+152,666,000+4,242,000/438,098,000) C. Interest Coverage: 2010:5.20- ((40,636,000+27,612,000+16,238,000)/16,238,000) 2009:4.69- ((35,922,000+21,731,000+15,625,000)/15,625,000) III. Cash Flow Profile *I haven’t finished this part of the assignment yet* IV. Summary A. By looking at our data presented, as well as how Lawson has dropped their ratios closer and closer to that 1.0 line of being even, we stand behind them as a 6 ranking in solvency at this moment in time, with the belief that at this rate, within a couple of years that number will drop closer to...

Words: 258 - Pages: 2

Premium Essay

Accounting

...A1a. Horizontal Analysis - The candidate provides a logical evaluation, with sufficient support, of the company’s strengths and weaknesses based on the horizontal analysis results. Some things to consider are: 1. Identify what horizontal analysis is. 2. What does a horizontal analysis tell you about a company’s performance? 3. What does it tell you about the performance of Competition Bikes? Do not just restate the figures given, provide in-depth analysis. 4. Discuss key components of the financial statements that tell you about the overall performance of the company. Do not need to discuss every line item, just key components of the income statement and balance sheet. A1b. Vertical Analysis - The candidate provides a logical evaluation, with sufficient support, of the company’s strengths and weaknesses based on the vertical analysis results. Some things to consider are: 1. Consider the same items above in the horizontal analysis for the vertical analysis. A1c. Trend Analysis - The candidate provides a logical evaluation, with sufficient support, of the company’s strengths and weaknesses based on the trend analysis results. Some things to consider are: 1. What is trend analysis? 2. What information does a trend analysis provide, what does trend analysis tell you about Competition Bikes? Think about the company’s past performance and compare it to the forecasted performance. 3. What is the data telling you? Are there any concerns...

Words: 841 - Pages: 4

Free Essay

Case Study: Value Line Punlishing

...Case study: Value line publishing Zongchao Yang 701821448 According to the case, there are two major companies in the industry which are Home depot and Lowe’s. Home depot have a much larger market share than Lowe’s and the case has already presented the balance sheet and the ratio sheet of Home depot. So based on the Lowe’s balance sheet and the sheets of Home depot which are presented in the case. We can easily get all the ratios of Lowe’s. According to these ratios, we can find out that Lowe’s has done a good job because the sales and the NOPAT is increasing every year. So this tread and ratio may help us to forecast the performance of Lowe’s in the next five years. Ratio analysis for Lowe's | | | 1997 | 1998 | 1999 | 2000 | 2001 | | | | | | | Working capital | 673 | 920 | 1367 | 1288 | 1962 | Fixed assets | 3109 | 3759 | 5319 | 7201 | 8815 | Total capital | 3782 | 4679 | 6686 | 8489 | 10777 | Tax rate | 38.90% | 39.20% | 39% | 38.80% | 38.60% | NOPAT | 381 | 506 | 715 | 858 | 1103 | | | | | | | PROFITABILITY | | | | | | Return on capital | 10.1% | 10.8% | 10.7% | 10.1% | 10.2% | Return on equity | 13.7% | 15.4% | 14.3% | 7.1% | 7.5% | | | | | | | MARGINS | | | | | | Gross margin | 26.5% | 26.9% | 27.5% | 28.2% | 28.8% | cash operating expenses/sales | 18.0% | 17.9% | 18.0% | 18.5% | 18.3% | Depreciation/sales | 2.4% | 2.2% | 2.1% | 2.2% | 2.4% | Depreciation/P&E | 8.0% | 7.5% | 6.5% | 5.8% |...

Words: 433 - Pages: 2

Premium Essay

Ratio Analysis

...This assignment is to compute and a write a summary (max. 250 words) interpreting selected liquidity ratios. 1. Companies  Last name begins with the letters o A through M: CVS o N through Z: Eli Lilly You can work individually or in a group of not more than 3. If you work in a group, one group member must send the Academic Coach, Ms. Linda Anderson, a message stating who is in the group, AND the name of the member who would submit the assignment. THE SUBMISSION FROM THE DESIGNATED MEMBER ALONE WILL BE GRADED. If your last names fall in both categories (eg. Anderson and Surysekar), your message to Ms. Anderson should also include your choice of the company (CVS or Eli Lilly). If group work, both members will get the same score for this assignment. 2. Ratios to compute and interpret (only the following 4 liquidity ratios, defined in page 704 of the text):     Current ratio Current cash debt coverage ratio Inventory turnover Accounts receivable turnover 3. Time period: Years 2009, 2010, 2011 4. Source: Company Annual Report  CVS o o o Reinventing Pharmacy for Better Health CVS Annual Report Pharmacy Innovation In a Changing Health Care Environment  Eli Lilly o o o 2009 Annual Report 2011 Annual Report Getting There: The Lilly Promise 5. Requirements: a. Required ratios in the following table: Your name: ________________ Company name: CVS or Eli Lilly RATIO CURRENT RATIO CURRENT CASH DEBT COVERAGE RATIO ...

Words: 390 - Pages: 2

Free Essay

Fdsdfsdfssdcsc

...Euclid’s Algorithm The Greatest Common Divisor(GCD) of two integers is defined as follows: An integer c is called the GCD(a,b) (read as the greatest common divisor of integers a and b) if the following 2 conditions hold: 1) c | a ( c | b 2) For any common divisor d of a and b, d | c. Rule 2 ensures that the divisor c is the greatest of all the common divisors of a and b. One way we could find the GCD of two integers is by trial and error. Another way is that we could prime factorize each integer, and from the prime factorization, see which factors are common between the two integers. However, both of these become very time consuming as soon as the integers are relatively large. However, Euclid devised a fairly simple and efficient algorithm to determine the GCD of two integers. The algorithm basically makes use of the division algorithm repeatedly. Let’s say you are trying to find the GCD(a,b), where a and b are integers with a ( b > 0 Euclid’s algorithm says to write out the following: a = q1b + r1, where 0 < r < b b = q2r1 + r2, where 0 < r2 < r1 r1 = q3r2 + r3, where 0 < r3 < r2 . . ri = qi+2ri+1+ ri+2, where 0 < ri+2 < ri+1 . . rk-1 = qk+1rk Euclid’s algorithm says that the GCD(a,b) = rk This might make more sense if we look at an example: Consider computing GCD(125, 87) 125 = 1*87 + 38 87. = 2*38 + 11 38. = 3*11 + 5 11 = 2*5 + 1 5. = 5*1 Thus, we find that GCD(125,87) = 1. Let’s look at one more...

Words: 1201 - Pages: 5

Premium Essay

Pdf. Input Out Files

...something what we call System Analysis and Design programmers do to understand a problem. Many diagrams including "Work Break Down Structure", "Workflow Diagram" and "Class Diagrams" are some of the most common ones are used. Question 2. What is Pseaudocode? Pseudocode is an informal high-level description of the operating principle of a computer program or other algorithm. It uses the structural conventions of a programming language, but is intended for human reading rather than machine reading. Pseudocode typically omits details that are not essential for human understanding of the algorithm, such as variable declarations, system-specific code and some subroutines. The programming language is augmented with natural language description details, where convenient, or with compact mathematical notation. The purpose of using pseudocode is that it is easier for people to understand than conventional programming language code, and that it is an efficient and environment-independent description of the key principles of an algorithm. It is commonly used in textbooks and scientific publications that are documenting various algorithms, and also in planning of computer program development, for sketching out the structure of the program before the actual coding takes place. Question 3 computer programmers normally perform what 3 steps? 1. Input is received. 2. Some process is performed on the input. 3. Output is produced. Question 4 What does user friendly mean? 2. user friendly"...

Words: 330 - Pages: 2