Note: Answer the following problems. Solutions are due Sunday Oct 11th at 9 pm.
Note 2: I will open up a Zoom room during class period for questions about problem 1 or problem 2.
Use the following "encoding" program to develop a decoding program and decode the following message:
Message = "r³cË\x96Ç)pº\xa0Òr}gÀ£}\x8d²²f§¨É\x85\x9cÆ)tÌ\x8cÔs£\x8e'\x82¸m\x96Ä\x9fÄ\x84ZÔ~RÈu\x8a´q\x9d\x7f\x80\xadÏ~j»®Àªº\x95Ö&lµ»ªÍ?[Ä\x86±¾{¶µº¹]§\x8d¼Â\xad¹\x94\x8e(\x85¾²Ð\x91¹UÆw\x88³¶Ë\x96Å)vÊ\x8bÎ\x80§Ër\x81»Êh\x7f\x84±Ë\x94¼\x9aÇ)\x87Æ\x9d\x81\x81\x95Æ*\x85È\x94Ë\x86´r\x9eÅu\x97Ði|sr«Ñ\x82©Î\x88£}\x8e´\xado©½\x97Ä\x84\x9aÌ.\x88Çs~ªÀ¨\x83MÂx\x87y\x99Á\x7fÄ´½IÓ{¢~Y±¹¨Õq\x8a·²|\x8c¶^©\x83¯¬Ä¯Ø2¯Î3«Ô\x86±Â\x87êÇUÃv\x80o±Í\x9c\x80a¥Õ}\x85È\x98Ö\x81Hp£Ë>Á¬Är\xa0Ï*\x84Ç\x89|\x81ó¼\x81À\x9eÕo;¬¿£\x82J\x89º»Ä©Ï\x95É\x9bÑt7\xadÁ\xad\x7f\x86£Ä2\x8eÎw£Çl=¤±¿\x8bªÇUÑm;\x8e³¸ªÊn\x88\x8c7\x9c¬Æ,xÏ\x85\x96Ïh}ºprÎ\x81"
def Encode_msg(string,initial_point,start_sequence,parameter):
def log_func(x,r):
return r*x*(1-x)
R = 3.9+parameter/100000
r0=R
X_0=initial_point/10000
Steps=start_sequence+2*len(string)
X_old=X_0
Points=[]
for t in range(0,Steps):
Points.append(X_old)
X_new=log_func(X_old,r0)
X_old=X_new
Points=np.array(Points)*100
Points = Points.round(0)
Msg=[]
for c in string:
Msg.append(ord(c))
Coded_Msg = Msg + Points[start_sequence:start_sequence+len(Msg)]
Coded_Msg_string=''
for x in Coded_Msg:
Coded_Msg_string += chr(int(round(x,1)))
return Coded_Msg_string
Use the game scores of the Chiefs first 3 games as "keys", ie "initial_point,start_sequence,parameter"
You can resubmit or turn in late any assigned homework up to Sunday Oct 11th. If you have answered 4 out of 5 homeworks you will recieve the points for this problem on this exam.