# Tutor profile: Rounak M.

## Questions

### Subject: Wolfram Mathematica

Implement quantum teleportation protocol in Mathematica.

Download the quantum teleportation code in mathematica from the following link. https://goo.gl/Y2Wkj4

### Subject: C++ Programming

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$$).

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.

### Subject: C Programming

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.

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$$.

## Contact tutor

needs and Rounak will reply soon.