You are on page 1of 5

General Instructions:

1. Faster is better. The judges are very impatient, one of them cannot sit in a place for too long. So
programs running longer than they should, will be marked negatively. If two competing teams
programs give correct results, the one which runs faster will get higher marks.
2. Transparency is very important. You should write comments. It will help us to understand your
code even if it does not work in some cases.

1. What is the Resistance Now?


Let us imagine a single port electrical network has a variable resistance ( )somewhere inside it. This
network has only linear resistances (no voltage or current source), but their configuration and valuesare
unknown. The equivalent resistance (
) seen from the port for four different values of
are given.
The problem is to find out
for any value of the variable resistance . Write a MATLAB function that
will be able to do so, given these nine values ( four known
for four known values of ,and one
for
which we want to know
).

Test Case

2/3

27/23

10

52/43

15

11/9

20

102/83

The table Test Case gives equivalent resistance at the port for five different values of the variable
resistance . Suppose, your MATLAB function is named Eqv_Res. If it is called like,
Req=Eqv_Res( [0 5 10 15] , [ 2/3 27/23 52/43 11/9] , 20);
Then Req will be 102/83.

2. Series of Blocks.

There are three single port linear electrical networks named for = 1,2,3. Each of these networks have
two terminals and . For example, Network 2,
has two terminals
and . When any two of those
networks are connected, their terminals with the same name are shorted respectively. As shown in the
figure, to connect
and ,
and
are shorted and so are and . The current from
to
are
defined as . Voltage between and terminals are denoted as
. Given
,
,
and
,
,
find out the current if the three blocks are connected in series (
with ,
with and
with
).

Test Case
3/2
2/3
17/10
4
64/3
24/5
23/14
If the name of your MATLAB function is Sers_Cur, then if it is called like,
I_s=Sers_Cur(

);

Then it should return 23/14 in the variable I_s.

3. Power Rides Power Riding Power.


Given , , , and

find the remainder of

if divided by
0< , , ,

< 10

Your MATLAB function should be defined as Calc_Remainder(x, y, z, m). If it is called like,


Rem=Calc_Remainder(2,2,2,3);
then Rem should be equal to 1.

4. Find the Line.


Alice has many places ( 3000 ) to travel in her two dimensional world. All the places she wants to go
have integer coordinates. But poor Alice can only travel in one direction on a line. So she cannot go to all
the places at once and she knows that. Now she wants to maximize the number of visited desired points.
Given the coordinates of the places, help her to visit the most number of desired places by finding the line
she should travel.
If your MATLAB function is named Alices_Line, then it should be called like,
[a,b,c]=Alices_Line(x,y);
x is the array containing the x-coordinates of the desired places. y is the array containing the ycoordinates of the desired places. The number of elements in x and y are same. The returned values a,b,c
denotes the line
+
= which Alice should travel.
1.5

0.5

0
-1.5

-1

-0.5

0.5

1.5

-0.5

-1

-1.5

If we call the function as [a,b,c]=Alices_Line([-1 0 1 1],[-1 0 1 -1]);


Then the values should be,

1
1
1 or 1
0
0

5. Can You Find the Function?


Bob went to a very wise guru in Himalaya to learn about mathematics. The guru said to him, I have a
function ( ) in mind and can be complex. I can tell you that the highest power
present in ( ).
You can only vary on the unit radius circle on complex plane ( =
).

Bob replied, Then I want the value of ( )for all values of

where

The guru replied, That my son, is not going to happen. The best I can do is to tell you the value of ( )
at equally spaced points in the complex unit circle. To say it in another way, I can give you ( ) for all
=

, where

= 0,1,2, ,

1 and

After thinking a while Bob replied, Thatll do.

Can you do the same? Given the value of a function ( ) at equally spaced points in the complex unit
circle, can you uniquely determine what the function is? 100000.

If your MATLAB function is called Answer_The_Guru, then it should be called like


[C]=Answer_The_Guru(F,N);
Where N is the order of the function, F is the array containing the value of
= 0,1,2, ,
in ( ).

for

, where

1 . C is an array (of length N) which should contain the coefficients of the polynomials

6. Brilliant Kanto
Kanto has recently graduated and got his first job. Quite the happy and excited Kanto soon finds his
excitement to vanish like a leaked balloon as soon as he gets his first assignment from his boss, a techy
dilettante. His company is planning to buy a new instrument and have collected samples from several
competing suppliers. Kanto has to test all the samples and prepare a comprehensive report. The
performance of the machine is measured by the current it draws. His boss has asked him to monitor the
current drawn for a complete task period (which is a long time actually) of each machine. But Kanto is
too smart for that he analyzed the circuit of the machine and figured out that the current drawn is a
function of time and has Nth order dependence on time. Then he made a schedule to monitor the currents
at only a few number of times at regular intervals and wrote a function in MATLAB[F]=I_was_not_here_the_whole_time ( IWAS , N, IWASNT)
It took the current readings that Kanto did took(IWAS), the order of dependence on time(N) and the time
instants (not monitored) at which he wanted to know the current readings(IWASNT) and the function
returned the correct readings(F). Can you write the same function that Kanto wrote?

7. Locating target
In an indoor positioning system, every target being tracked has an onboard transceiver that can
approximately determine its distance from the transmitters located at fixed points over the area. Ideally, if
the measured distances were free from errors, distances from two transmitters would be enough to give
the exact location of the target. However, the measured distances have considerable errors. Therefore, the

system utilizes measured distances from more than two transmitters to reduce the error and get the best
approximation of the location of the target.
Assume the system is employed on a xy-plane. Write a function[x_target , y_target] = locate_target(x_trans, y_trans, r_trans )
x_trans and y_trans are the vectors that contain the x and y co-ordinates of the transmitters placed at fixed
positions (N, number of transmitters, can be no less than 3) and r_trans is the vector containing the
measured distances of the target from the transmitters. The function returns the x & y co-ordinate
(x_target, y_target) of the target.
Test case:
[x_target , y_target] = locate_target( [0, 1, 0], [0, 0, 1], [1.41, 1, 1.01] );
Then x_target=1 and y_target=1(approximately). Since this will always return an approximate value, an
answer with small margin of error will be accepted as correct.

8. Find the power matrix


Consider you have a single row matrix of length N. Using this row you can form a new matrix,
where each row is the right rotated version of the previous row. Say the row r=[ 1 2 3 4], then you can
1 2 3 4
form the matrix, = 4 1 2 3 . For a given row r of length N (>1000) you have to find the matrix
3 4 1 2
2 3 4 1
where, m is an integer and m > 200.
The problem looks pretty straight forward and you may do it by brute force easily. Definitely, it will take
much time to compute because a large size of matrix multiplication is involved. But, what we want you to
do is that you should find an innovative approach to compute
.
Your MATLAB function will be, Power_Mtx=Calc_Power_Mtx(r,m); where r is the row matrix of size
1 , m is an integer greater than 200 and returned Power_Mtx has a size of .
Test case:
For simplification, let us consider r=[1, 2] and m=5.
Power_Mtx=Calc_Power_Mtx(r,m);
Power_Mtx=

121
122

122
121

You might also like