# Tutor profile: Jon K.

## Questions

### Subject: SAT

Suppose x and y are positive integers and 1568 = (x^(1/2) * y^(1/5))^10. If z^(-2/3) = 9, what could be the value of yz^(-1)? (A) 14 (B) 42 (C) 54 (D) 189 (E) 378

The key to this problem is understanding your exponent rules. This problem is much easier if done on paper. since you can not easily type the square root symbol on the computer. First we can solve for z. z^(-2/3) = 9 raise both sides to the -1/2 to get rid of the -2 on the z side (z^(-2/3))^(-1/2) = 9^(-1/2) z^(1/3) = 1/3 raise both sides to the 3 to solve for z (z^(1/3))^3 = (1/3)^3 z = 1/27 Now if we look at what could be the value of yz^(-1), we see that z^(-1) = 27. So, y * 27 must be a multiple of 27. This eliminates all answers except C and D. Sometimes you can short cut to the correct answer, but not this time. We need to eliminate one more. We have not yet used the first part of the problem 1568 = (x^(1/2) * y^(1/5))^10 If we simplify we get 1568 = x^5 * y^2. Lets try to plug in C first and see if it works. if y * 27 = 54, then y = 2 Now we can solve for x by dividing both sides by 2^2 or 4 x^5 = 392 x must be an integer so lets try 392^(1/5) on the calculator x = 3.301 so this answer is not valid, We now know the answer must be D. If this was a real test I would take note of this question and come back to double check my answer if I had more time at the end. y * 27 = 189 y = 7 1568 = x^5 * 7^2 32 = x^5 x = 2 this answer checks out.

### Subject: Javascript Programming

Write a function named 'mult' which will produce the following outputs when invoked: console.log(mult(2)(3)(4)); // output : 24 console.log(mult(4)(3)(4)); // output : 48

To solve this problem you must realize that you have to return a reference to to a function in order to keep passing in your input values. In the first example it can be broken down like this mult(2) must return a function so the input becomes func2(3)(4) func2 must return a function to the input becomes func3(4) at this point func3 can do your multiplcation and return your answer. function mult (x) { return function (y) { // anonymous function return function (z) { // anonymous function return x * y * z; }; }; }

### Subject: C Sharp Programming

Find the original (unscrambled) words, which were randomly taken from a wordlist(C:\wordlist.txt) return a comma separated list of the original words, in the same order as in the list below. List of scrambled words: dbgfcea mryeom ciohdr dleezp adnmoyr artleb berles wtyihne nhlcelag aloigzdl

The trick to this problem is trying to reduce the number of string compares that must be done to unscramble the words. Take the first scrambled word "dbgfcea", for example. There are 7 letters so there are 7! or 5040 ways to reorder these letters. (7 * 6 * 5 * 4 * 3 * 2 * 1 = 5040) Say our dictionary has 2000 words. That means you have over 10 million string compares if you want to compare every combination. (5040 * 2000 = 10,080,000) We can see that this brute force approach can get out of hand very quickly. The approach I took to solving this problem was to sort the characters of each word in the dictionary alphabetically. For example "apple" would become "aelpp". I then store these values in C# dictionary for fast lookup. For example, my key is "aelpp" and the value is "apple" I then can apply the same sorting on the scrambled words so "dbgfcea" becomes "abcdefg". When I look up "abcdefg" in my dictionary I see that the unscrambled value happens to be the same thing. static void Main(string[] args) { //load worldlist var lines = File.ReadAllLines(@"C:\wordlist.txt"); //create dict var dict = new Dictionary<string, string>(); foreach(var line in lines) { dict[String.Concat(line.OrderBy(c => c))] = line; } Console.Write("edit scramwords.txt"); var test = Console.ReadLine(); //read scarmwords var words = File.ReadAllLines(@"C:\scramwords.txt"); var output = ""; foreach(var word in words) { var sorted = String.Concat(word.OrderBy(c => c)); output += dict[sorted] + ","; } Console.Write(output); }

## Contact tutor

needs and Jon will reply soon.