Tutor profile: Ravi S.
Subject: Python Programming
Given a string in a variable 'a'. Write a single line python expression that returns a logical 'True' or 'False' depending on if 'a' is a palindrome or not, respectively. You are not supposed to import any library/module/sub-modules and use related functions.
As simple as it can be: a==a[::-1]
(1) Solve with a single line expression. For a given matrix/vector A, find all the negative numbers inside it and increment them with 1 while updating the matrix simultaneously. (2) Write four expressions/functions by which you can solve a system of linear equations Ax=b
== (1) == A(find(A<0)) = A(find(A<0))+1 == (2) == (a) A\b (b) mldivide(A,b) (c) linsolve(A,b) (d) pinv(A)*b It is to be noted that, the part (d) uses the concept of pseudo inverse (pinv). In general, when the matrices are non-square (which can be very well the case with system of linear equations), 'pinv' ensures the solution and 'inv' function which only calculates inverse for the square matrices can't be used.
Subject: Computer Science (General)
What is the fastest memory unit available in a computer system for programming.
Its registers! Some may argue that the answer is a cache memory, but, the CPU utilized cache for its memory management but can not be externally programmed in general. While registers are frequently utilized for programming, as we know specially in close vicinity with microprocessors.
needs and Ravi will reply soon.