Write a Prolog program that computes binomial coefficient
program.pl:
bc(N, 0, 1) :- N >= 0.% base case 1 binomial_coefficient is 1
for (N,0)
bc(N, N, 1) :- N > 0.% base case 2 binomial_coefficient is 1 for
(N,N)
bc(N,K,R):-
factorial(N,F1),% finds n!
factorial(K,F2),% finds k!
factorial(N-K,F3),% finds (n-k)!
R is F1/(F2*F3).
% we know that binomial coefficient formula binomial_coefficient (n
k) = n!/(k!(n-k)!
% program to find factorial of n
factorial(0,1).
factorial(N,F) :-
N>0,
N1 is N-1,
factorial(N1,F1),
F is N * F1.
Output:

C++: Write a program that computes and displays a full binomial expansion, such as (x+y)^n where only n is asked for by the user.
1. Write a Prolog program that returns the length of a list of numbers. For example: size([1, 2, 3, 4], len). then return len=4. 2. Write a Prolog program that reverses the given list. For example: reverse([a, b, c, d], X). then return X=[d, c, b, a].
Write a Prolog program to find the maximum, minimum, and range of values in a list of numbers. Please also provide the program with output.
1. Write a C++ program to compute the Binomial Coefficient to construct a 2D array using two input parameters: n and k Then once the table is constructed Display the entire table according to rows and columns. Give user a choice of computing the Binomial coefficient at various values of n and k using this table,i.e. prompt the user to enter a value of i and j (i <= n and j <= k), code first test if the input...
Write a program in prolog to perform the critical path scheduling algorithm given the durations and prerequiests for each task.
Write a program in prolog to reverse the elements of a list. Don't call the following library functions that already exist. reverse_list([], []). reverse_list([Head | Tail], Out) :- reverse_list(Tail, TailReversed), append(TailReversed, [Head], Out).
for future viewers please dont use this for spring 2020 Write a Prolog program to split a list into two lists of positive and negative numbers. For example: ?- split([20,-10,30,22,45,0,-15,0,12], L1, L2). L1 = [20,30,22,45,12] L2 = [-10,-15]
Write a Perl program that computes the circumference of a circle. Your program prompts for and accepts a radius from the person running the program. So, if the user enters 12.5 for the radius, she should get the answer about 78.5. Circumference is 2π times the radius (approximately 2 times 3.141592654).
For each of the following English statements write a prolog program. % Facts & Rules (1) jane is a woman. (2) john is a man. (3) john is healthy. (4) jane is healthy. (5) john is wealthy. (6) anyone is a traveler if he is healthy and wealthy. (7) anyone can travel if he is a traveler. % Goals (queries). (8) Who can travel? (9) Who is healthy and wealthy?
Write a Python program that computes the volume of a sphere with a radius of 5. The formula for a sphere is 4⁄3πr3. Write a function sphere_volume that returns the volume of a sphere when given radius r as a parameter. Then write a main program that calls sphere_volume by passing an argument after getting it as an input from the user.