Samuel owns a shoe factory where there are N different machines operated for N different purposes. Each machine has its own motor. In order to avoid resonance, the rotation speed of any 2 machines should at least differ by 2 units. The rotation speed can only be in integer units and the maximum rotation speed of any motor is X units. Given minimum rotation speed of any motor to be 1 unit, you have to help Sam find out the number of different ways he can configure the speed of the motor. Input Specification: input1: N, denoting the number of machines. input 2X, denoting the maximum speed of the motor. Output Specification: Your function should return the total number of configuration modulus 10^4.
1
Expert's answer
2021-09-05T08:24:09-0400
n = int(input('the number of machines: '))
x = int(input('maximum speed of the motor: '))
k = 0
if (2*n-1) <= x:
k = x
for i in range(n-1):
k *= x//(2*(1+i))
print(f'configuration modulus: {k}')
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment