-
-
Python - How to Write a function
How to Write a function kinda_format ( ) that take three arguments (each of which positive int ) - a,b,c- and tests whether the equality a^n +b^n=c^n holds for each n{2,3,...,10}. The function should return false if the equality does not hold for any value of n in the given range, and if there is a value of n for which the equality holds, the lowest such value (as in int)
-
How many trees are now left in Granada National Park?
Peter has a method for solving quadratic equations. For example, Peter solves 6x2
+ x – 2 = 0 as follows:
(a) Peter multiplies the leading coefficient (6) by the constant coefficient (2)
to get x2 + x – 12 = 0 to get (x+4)(x-3) = 0
(b) Peter then replaces each x by 6x (x times the leading coefficient) to get
(6x+4)(6x-3) = 0
(c) Peter then simplifies this equation to get (3x+2)(2x-1) = 0, which solves
the original equation.
Prove or disprove that Peter’s method always works.
">Two mathematicians were surveying the damage done to Granada National Park by Hurricane Ivan. “It could have been worse,” said one. “Less than one third of the trees were lost.” His friend replied, “Yes, in fact if you multiply by 10 the number formed by taking the last two digits of the number of trees there used to be, and add to this the number formed by removing the last two digits of the number of trees there used to be, then you obtain the number of trees there is now". Not to be outdone, the first mathematician said “And if you take the number of trees that were lost, and reverse the order of the last two digits, and then insert a zero in front of the last two digits, then you get the number of trees that there used to be plus the number of trees that there are now”.How many trees are now left in Granada National Park? Peter has a method for solving quadratic equations. For example, Peter solves 6x2+ x – 2 = 0 as follows:(a) Peter multiplies the leading coefficient (6) by the constant coefficient (2)to get x2 + x – 12 = 0 to get (x+4)(x-3) = 0(b) Peter then replaces each x by 6x (x times the leading coefficient) to get(6x+4)(6x-3) = 0(c) Peter then simplifies this equation to get (3x+2)(2x-1) = 0, which solvesthe original equation.Prove or disprove that Peter’s method always works.
-
Algorithm
Bring out the importance of Algorithms in the field of Computer Science?
-
Validation of an Algorithm
What is validation of an algorithm?
-
Algorithm Profiling
What is meant by algorithm profiling?
-
Time Complexity
How to find time complexity?
-
Cyclic Directed Graph
What is the complexity of a algorithm of finding the Cyclic Directed Graph?
-
Algorithm Profiling
What is meant by algorithm profiling?
-
Prime Integer
Suggest two different methods of knowing if a given integer is prime and analyse them.
-
Importance of Algorithm
What is the importance of algorithms in the field of computer science?
-
Algorithm Characteristics
List out the characteristics of an algorithm
-
Advantages of Circular Queue
Bring out the advantages of circular queue over linear queue
-
Quicksort Algorithm
Demonstrate the quicksort algorithm to sort a list of data elements
-
Traverse Binary Tree in Inorder
Design a conventional iterative algorithm to traverse a binary tree represented in linked lists in inorder.
-
Algorithm to Traverse Binary Tree
Design a conventional iterative algorithm to traverse a binary tree represented in linked lists in preorder.
-
Conventional Iterative Algorithm
Design a conventional iterative algorithm to traverse a binary tree represented in linked lists in postorder.
-
Importance of Algorithms
What is the importance of algorithms in the field of computer science?
-
Write an algorithm to read the date borrowed and present date.
A video club rents video for three days. Write an algorithm to read the date borrowed and the present date; calculate the number of days borrowed. If the number of days exceeds three days, compute the number of days overdue and overdue charge. Use a rate of $1.50 for everyday overdue or part overdue
-
Algorithm to input the price of a textbook
Write an algorithm to input the price of a textbook. Calculate the price and print the total cost of the book after 15% VAT is added
Algorithm Questions
Ans