Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Add two polynomials
Given two polynomials A and B, write a program that adds the given two polynomials A and B.
Input

The first line contains a single integer M. 
Next M lines contain two integers Pi, Ci separated with space, where Pi denotes power and Ci denotes co-efficient of Pi for polynomial A.
After that next line contains a single integer N.
Next N lines contain two integers Pj, Cj separated with space, where Pj denotes power and Cj denotes co-efficient of Pj for polynomial B.
Output

Explanation

If M = 4 and for polynomial A
For power 0, co-efficient is 5
For power 1, co-efficient is 0
For power 2, co-efficient is 10
For power 3, co-efficient is 6.

If N = 3 and for polynomial B
For power 0, co-efficient is 1
For power 1, co-efficient is 2
For power 2, co-efficient is 4.
Then polynomial A represents "6x^3 + 10x^2 + 5", the polynomial B represents "4x^2 + 2x + 1" and the addition of A and B is "6x^3 + 14x^2 + 2x + 6"

print 0 if degree of polynomial is 0


Question 9

print("Original array:")

Answer: 

print(x)

>>>array([ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20])

print(“Remove even numbers from the array x: “)

Answer:

print(x)

>>>array([12, 14, 16, 18, 200])

print(“Replace all odd numbers in array x with -10:”)

Answer:

print(x)

>>> array([ 12, -10, 14, -10, 16, -10, 18, -10, 20])


Question 10

print("Original array:")

Answer: 

>>> print(X)

[10 12 14 16 18 20 22 24 26 28 30]

>>> print(Z)

[10 12 14 16 18 20 22 24 26 28 30]

Answer: 

>>> print(X)

[0 2 4 6 18 20 22 24 26 28 30]

Answer: 

>>> print(Z)

[10,12,14,16,-18,-20,-22,-24,26,28,30]


Question 7

X = np.array([

[10,20,30], 

 [40,50,60], 

 [70,80,90]])

Answer: 


print(X)

array([20, 50, 50])


Question 8

Y = np.array([

 [3,6,9,12], 

 [15,18,21,24], 

 [27,30,33,36], 

 [39,42,45,48],

 [51,54,57,60]])

Answer: 


Question 8 Output

array([[ 3, 12],

    [27, 36],

    [51, 60]])

Given two dates D1 and D2, write a program to count the number of Saturday and sundays from D1 to D2 (including D1 and D2). The date in string format is like "8 Feb 2012"

Given a strong, write a program to print a secret message that replaces character with numbers 'a' with 1, 'b' with 2,...'z' with 26 where characters are separated by '-'

Problem statement:


Consider the given databases, in which Y attribute is linearly dependent on attribute X. Write down python code (without using library functions) for univariate linear regression to determine the relationship between the independent variable and dependent variable for following cases. For all the cases, plot the results.



a) In dataset 'test_a.csv', some of the Y values are missing, replace them with (a) mean, (b) median and perform regression analysis and comment.



b) In dataset 'test_b.csv', some of the Y values are negative, perform regression analysis and comment.



c) Perform the regression analysis on dataset 'test_c.csv', plot the results. Detect and remove the outliers, perform regression analysis and comment.



Election results


programm code please help me


B ¬A A∧B A∨B A⇒B A ⇔ B


T T Blank 21. Fill in the blank, read surrounding text.


Blank 22. Fill in the blank, read surrounding text.


Blank 23. Fill in the blank, read surrounding text.


Blank 24. Fill in the blank, read surrounding text.


Blank 25. Fill in the blank, read surrounding text.


T F Blank 26. Fill in the blank, read surrounding text.


Blank 27. Fill in the blank, read surrounding text.


Blank 28. Fill in the blank, read surrounding text.


Blank 29. Fill in the blank, read surrounding text.


Blank 30. Fill in the blank, read surrounding text.


F T Blank 31. Fill in the blank, read surrounding text.


Blank 32. Fill in the blank, read surrounding text.


Blank 33. Fill in the blank, read surrounding text.


Blank 34. Fill in the blank, read surrounding text.


Blank 35. Fill in the blank, read surrounding text.


F F

Match the terms with their correct symbol



A. ⊢



B. ¬



C. ⇒



D. ∨



E. ∧



F. ⊨



G. ⇔




select



1. Implication




select



2. Equivalence




select



3. Negation




select



4. Conjunction




select



5. Disjunction




select



6. Derived




select



7. Entailed

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS