The government of a small but important country has decided that the alphabet needs to be streamlined and reordered. Uppercase letters will be eliminated. They will issue a royal decree in the form of a String of B and A characters. The first character in the decree specifies whether a must come ( B )Before b in the new alphabet or ( A )After b . The second character determines the relative placement of b and c , etc. So, for example, "BAA" means that a must come Before b , b must come After c , and c must come After d .
Any letters beyond these requirements are to be excluded, so if the decree specifies k comparisons then the new alphabet will contain the first k+1 lowercase letters of the current alphabet.
Create a class Alphabet that contains the method choices that takes the decree as input and returns the number of possible new alphabets that conform to the decree. If more than 1,000,000,000 are possible, return -1.
Definition
A one-dimensional calibration object consists of three or more collinear points with known relative positions.
It is generally believed that a camera can be calibrated only when a 1D calibration object is in planar motion or rotates
around a ¯ xed point. In this paper, it is proved that when a multi-camera is observing a 1D object undergoing general
rigid motions synchronously, the camera set can be linearly calibrated. A linear algorithm for the camera set calibration
is proposed,and then the linear estimation is further re¯ ned using the maximum likelihood criteria. The simulated and
real image experiments show that the proposed algorithm is valid and robust.
We have a group of N items (represented by integers from 1 to N), and we know that there is some total order defined for these items. You may assume that no two elements will be equal (for all a, b: a<b or b<a). However, it is expensive to compare two items. Your task is to make a number of comparisons, and then output the sorted order. The cost of determining if a < b is given by the bth integer of element a of costs (space delimited), which is the same as the ath integer of element b. Naturally, you will be judged on the total cost of the comparisons you make before outputting the sorted order. If your order is incorrect, you will receive a 0. Otherwise, your score will be opt/cost, where opt is the best cost anyone has achieved and cost is the total cost of the comparisons you make (so your score for a test case will be between 0 and 1). Your score for the problem will simply be the sum of your scores for the individual test cases.
1) Write a function reverse(A) which takes a matrix A of arbitrary dimensions as input and returns a matrix B consisting of the columns of A in reverse order. Thus for example, if
A = 1 2 3 then B = 3 2 1
4 5 6 6 5 4
7 8 9 9 8 7
Write a main program to call reverse(A) for the matrix A = magic(5). Print to the screen both A and reverse(A).
2) Write a program which accepts an input k from the keyboard, and which prints out the smallest fibonacci number that is at least as large as k. The program should also print out its position in the fibonacci sequence. Here is a sample of input and output:
Enter k>0: 100
144 is the smallest fibonacci number greater than or equal to 100.
It is the 12th fibonacci number.
Visual tracking is one of the key components for robots
to accomplish a given task in a dynamic environment,
especially when independently moving objects are included.
This paper proposes an extension of Adaptive
Visual Servoing (hereafter, AVS) for unknown moving
object tracking. The method utilizes binocular stereo
vision, but does not need the knowledge of camera parameters.
Only one assumption is that the system
need stationary references in the both images by which
the system can predict the motion of unknown moving
objects. The basic ideas how we extended the AVS
method such that it can track unknown moving objects
are given and formalized into a new AVS system. The
experimental results with proposed control architecture
are shown and a discussion is given.