Question

Q.4 (10 pointsi Consider the following fitness function fitness Sa +2bc+ d where a-e are all Boolean-valued parameters. e g b

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

1ans:

flowchart:

start listim,n false for i-0 to m true false for j-0 to n true read a,b,c,d,e values end compute function fitness 5a+2bc+d-e

2 ans:

source code in python:

list=[[1,1,0,1,1],[1,0,1,0,1],[1,0,0,0,0],[1,0,1,1,1],[1,0,0,1,0],[1,1,1,1,1]]
print("a\tb\tc\td\te\tfitness\n")
for i in range(len(list)):
   a=list[i][0]
   b=list[i][1]
   c=list[i][2]
   d=list[i][3]
   e=list[i][4]
   fitness=(5*a)+(2*b*c)+d-e
   print(str(a)+"\t"+str(b)+"\t"+str(c)+"\t"+str(d)+"\t"+str(e)+"\t"+str(fitness)+"\n")

#output:

CCommand Prompt C:\Users\vishnu\Desktop>python tree.py b d C e fitness 1 1 1 1 5 1 1 1 4 1 5 1 1 1 1 5 1 1 6 1 1 1 1 1 7 C:\U

#if you have any doubt comment below....

Add a comment
Know the answer?
Add Answer to:
Q.4 (10 pointsi Consider the following fitness function fitness Sa +2bc+ d where a-e are all...
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
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
ADVERTISEMENT