Question

Functional Programming: F# Question: let list1 = [5; 10; 15; 20; 25; 30] let list2 =...

Functional Programming: F# Question:

let list1 = [5; 10; 15; 20; 25; 30]

let list2 = [50; 100; 150; 200; 250; 300]

1). Write a function that returns the maximum value in the list,

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Hi dear student,,

let list1 = [5; 10; 15; 20; 25; 30]
let list2 = [50; 100; 150; 200; 250; 300]
let list3 = list1 @ list2
let list4 = List.max list3
printfn "max: %A" list4

Output-

dear student you can find out maximum of only on list also

Just removes joining of two list method

Thank you ,

Hope you understand,,,if you have any doubt then comment

Like the answer

Add a comment
Know the answer?
Add Answer to:
Functional Programming: F# Question: let list1 = [5; 10; 15; 20; 25; 30] let list2 =...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • All of the problems must be done in Haskell. You may download a local IDE or...

    All of the problems must be done in Haskell. You may download a local IDE or use [this website.][https://repl.it/languages/haskell]. You are not allowed any functions that trivialize a problem! Here are some examples of lists you can test your solutions on: let list1 = [5, 10, 15, 20, 25, 30] let list2 = [50, 100, 150, 200, 250, 300] Write a function that returns the maximum value in a list. Write a function that returns the nth element in the...

  • IN python # Given these test lists to work with: salesDollars = [ 20, 30, 35,...

    IN python # Given these test lists to work with: salesDollars = [ 20, 30, 35, 15, 60, 100] personnelCosts = [ 15, 25, 30, 10, 55, 95] salesPersons =[ "jo", "mo", "ko", “curley”, “jack”,”gunnar”] A. Write a generic function that will take two numeric list parameters, of equal length, calculate the total of list1 – total of list 2 and return a triple of numbers, (totalOfList1, totalOfList2, difference of list1 and list2 totals. B. Test your function with salesDollars...

  • Let gfx)-ft) dt where f is the function whose graph is shown. 20 30 (a) Evaluate gx) for x0, 5, 1...

    Let gfx)-ft) dt where f is the function whose graph is shown. 20 30 (a) Evaluate gx) for x0, 5, 10, 15, 20, 25, and 30 g(0) = g(5) g(10)- g(15)- g(20)- g(25)- g(30)- (b) Estimate g(35). (Use the midpoint to get the most precise estimate.) (c) Where does g have a maximum and a minimum value? (d) Sketch a rough graph of g 25 25 35 35 35 35 x) Let gfx)-ft) dt where f is the function whose...

  • QUESTION 15 Figure 5-5 11 Price - Demand 5 10 15 20 25 30 35 40...

    QUESTION 15 Figure 5-5 11 Price - Demand 5 10 15 20 25 30 35 40 45 50 55 Quantity Refer to Figure 5-5. Using the midpoint method, demand is unit elastic between prices of O a. $20 and $40. b.$50 and $70 c. $40 and $60 d. $40 and $50.

  • QUESTION 6 Figure 10-20. 450- Social Cost 400 Supply Private Costs) 250- 200- 150 100 Demand...

    QUESTION 6 Figure 10-20. 450- Social Cost 400 Supply Private Costs) 250- 200- 150 100 Demand 50 100 150 200 250 300 350 400 460 500 Quantty k Save All Answers to save all answers Demand 100 50 50 100 150 200 250 300 350 400 450 500 Quantity Refer to Figure 10-20. Without government intervention O a there is no clear relationship between the equilibrium quantity and socially optimal quantity O b the equilibrium quantity equals the socially optimal...

  • QUESTION 9 Volts 107 5 10 15 20 25 30 35 40 45 50 (ms) -10...

    QUESTION 9 Volts 107 5 10 15 20 25 30 35 40 45 50 (ms) -10 -20% Given the above graph. Which general sinusoidal equation describes the voltage 20 sin (314.161) 40 sin (125.661) 20 sin (125.66t) 20 cos (314.16t)

  • 7. Consider the following vector: >> vec = [30 25 20 15 10 5 1] Write...

    7. Consider the following vector: >> vec = [30 25 20 15 10 5 1] Write a Matlab Statement using the colon operator to delete the elements 30, 20, 10, and 1 from vec and leaving the values 25, 15, 5. [You are using the same idea as in Q5 and Q6]

  • Make a sketch of f(x) for -15 s lessthanorequalto t<= lessthanorequalto when f(t) is given by...

    Make a sketch of f(x) for -15 s lessthanorequalto t<= lessthanorequalto when f(t) is given by the following expression: f(t)=(100+10t)u(t+10)-(50+10t)u(t+5)+(50-10t)u(t-5)-(150-10t)u(t-15)+(10t-250)u(t-25)-(10t-300)u(t-3).

  • Residual v. fitted Normal Q-Q Plot 30 30- 20 20- Residual value: y -ỹ (cm) 104...

    Residual v. fitted Normal Q-Q Plot 30 30- 20 20- Residual value: y -ỹ (cm) 104 Sample Quantiles 10- 0- 0 -104 -10- . 0 50 100 150 200 250 300 -4 -2 0 2 4 < Theoretical Quantiles C13. Do residual graphics indicate any major violations of the regression requirements?

  • Let 90-12 nt) at, where is the function whose graph is shown. S 20 30 (a)...

    Let 90-12 nt) at, where is the function whose graph is shown. S 20 30 (a) Evaluate g(x) for x = 0, 5, 10, 15, 20, 25, and 30. 9(0) - (5) - 9(10) - 9(15) - 9(20) - 9(25) - (30) - (b) Estimate g(35). (Use the midpoint to get the most precise estimate.) 9(35) - (c) Where does g have a maximum and a minimum value? minimum maximum X- (d) Sketch a rough graph of g. +25 -25...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT