Subjects
PRICING
COURSES
Start Free Trial
Rounak M.
Visiting Scholar at Griffith University, Australia
Tutor Satisfaction Guarantee
Wolfram Mathematica
TutorMe
Question:

Implement quantum teleportation protocol in Mathematica.

Rounak M.

C++ Programming
TutorMe
Question:

Suppose we are given n integers $$b_1,b_2 ..... b_n$$. Find the number of pairs of indexes i,j (i < j) that $$b_i + b_j$$ is a power of 2 ( i.e. there exist a integer x such that $$b_i + b_j = 2^x$$).

Rounak M.

We need to use map data structure to solve this problem. Basically we use map cnt to store how many times every integer appears in the given array. Then we iterate through all those given numbers with variable i. Let the current number be $$b_i$$. For this number we need to iterate all possible powers of 2 ( powers up to 31 i.e. $$2^{31}$$). Let the current power is equal to cur. Then we need to make cnt[$$b_i$$] –  and add the value cnt[$$b_i$$ - cur] to the asnwer.

C Programming
TutorMe
Question:

Suppose we are given n points on a plane. No three points are on the same line. Find the number of parallelograms with the vertices at the given points.

Rounak M.

It is known that the diagonals of a parallelograms split each other in the middle. We will simple iterate over all pairs of points a, b and consider the middle segment c = (a+b)/2. Let's say the value is x for each middle. x is the number of segments a,b with the middle c. It's easy to see that our answer will be $$\sum_{c}x*(x-1)/2$$.

Send a message explaining your
needs and Rounak will reply soon.
Contact Rounak