Maths 162: Computational Mathematics

SpringBoot+Vue+MySQL 高校学科竞赛平台 完整可运行版(源码+文档) 本项目基于SpringBoot+Vue+MySQL构建高校学科竞赛管理平台,覆盖学生、教师、领队教师、管理员四大角色,实现竞赛发布、报名、刷题、评分、公示等全流程闭环管理。系统架构清晰,技术主流,配套完整源码、数据库脚本、万字论文、开题报告、答辩PPT及部署文档,支持一键运行,适用于毕业设计、课程设计及院系二次开发,真正实现“开箱即用”。 阅读详情

Maths 162: Computational Mathematics

Assignment 2, due 7:00pm on September 27th 2024

This assignment is to be submitted online through canvas as a single PDF file, containing answers for all questions, your workings, any figures, and code in a sensible order.

Do not use your phone to take a photo of your computer screen. Photographs of computer screens will not be marked. When handing in code, either copy paste your code into your docu-ment (perhaps with a special coding font), or take a printscreen of your matlab window.

Note that questions are not ordered by difficulty. If question 1 seems hard, don’t assume that the other questions will be harder, they will just be different.

For each question, work through as far as you can - even if you cannot get a complete/perfect answer, write what you can. As the main idea is to demonstrate your understanding of the ideas, methods and programming, do include all your working and your MATLAB code along with the answers that you get from your MATLAB code.

Full marks: 35 marks.

Getting help:

• No cheating. You are allowed to discuss with others how to go about a question, but you must produce your own computations and write your answers by yourself. Copying answers, either from other students, the internet or ’online tutors’ is considered plagiarism.

• Course material: The course book, your notes from lectures, and the tutorials all provide helpful information for answering the assignment questions. There is also the Coder’s guide to programming and the Spider’s guide to Cobwebs.

• Help files in MATLAB: One way to find information about a particular MATLAB function is to type help in the MATLAB Command Window followed by the name of the function. For example, to get help with using sqrt , the square root function, type help sqrt . This gives basic information. For more information, you can click on the link to the Help browser (i.e., the question mark at the top of the MATLAB window.)

• Office Hours: Alastair’s office hours are currently 1:30-3:30 on Thursday. Additional office hours will be available during assignment weeks (These will be announced on Canvas)

1 Diffie-Hellman and Modular inverses (11 marks)

What this question is checking? Modular arithmetic, inverses and key exchange are central to modern cryptography and our ability to communicate securely on the internet. In this question you will test your understanding of Diffie-Hellman key exchange.

The question will mainly focus on methods you have seen in class (all be it, computationally difficult ones).

Now to the question...

(a) You decide to send a message to your friend using the Diffie-Hellman key exchange. You pick p = 78401, g = 26869, and a = 1620. What A must you transmit to your partner? Show all working; if you use any sneaky shortcuts, please explain what you have done. (Shortcuts are useful, not required)

(b) Let’s check the security of our Diffie-Hellman Algorithm. Modify the brute force algorithm form. class (or build your own), and see if you can use it to deduce a, for the A you calculated in the previous question. Hand in your code, along with your calculated value for a.

(c) Get Matlab to print out the first 50 powers of g (that is, print g 1 , g2 , g3 ...g50). What do you notice? Is this what you expect? Do you believe this will make the Diffie-Hellman key exchange more or less secure than usual? Give two or three sentences explaining your reasoning.

(d) You and your partner decide to select new g and p values. You select p = 98143. After receiving B from your partner, you calculate S = 9815. Use Euclid’s extended algorithm to calculate S −1 mod 98143 by hand. Show all working.

Hint: The algebra here is finicky and it is easy to make a mistake. If you are unsure of your final answer, you can check it by multiplying S × S−1 mod p.

2 Quickfire Questions (8 marks)

What this question is checking?

For each of the question below, I have described the properties of a dice we would like to build.

In each case, either explain why such a dice can not possibly exist, OR determine what numbers we should write on each side of my dice.

(Note: For many of the questions below there may be multiple valid dice. You only need to find one valid dice, or, if the problem is impossible, explain what goes wrong in two or three sentences.)

a) Design a dice with var(X) = 0.

b) Design a dice where every possible value of X is greater that E(X)

c) Design a dice such that P(X = 8|X > 5) = 1/3 and E(X) = 3.

d) Design a dice with P(X < 5) = 1/2 and P(X > 3) = 1/3.

e) Design a dice such that P(X is odd| X is square) = 1/4, and P(X is square| X is odd ) = 1/3. (X is a square numbers if X = k 2 for some whole number k).

f) Design a dice which has var(X) = 1 = E(X2 ), and E(X) = 0 = var(X2).

3 A Novel Cipher (8 marks)

For this question we will consider a novel cipher, the pyramid cipher, as described below.

What is this question checking? Your goal in this question it to take the familiar ideas of cryptography and modular arithmetic learned in class, and apply them to a novel circumstance.

a) By hand, use the Pyramid cipher to encrypt the word ‘NILE’.

b) Write a function Pyramid which takes plaintext as input, and gives the Pyramid ciphertext as output. (If you need a reminder of how functions are built in Matlab, flick forward to Q4)

c) Use your code to encrypt the word ‘HIEROGLYPH’.

d) Suppose you are given the ciphertext ‘SZHYRR’. Is it possible to decrypt and find the original text? If it is possible, what was my plaintext? If it is not possible, what goes wrong?

(Hint: It may be best NOT to solve for P1 first. Instead, is there any combination of Ck which will tell you P3? Can you work forward from there?)

e) Suppose you are given the ciphertext ‘COQBP’. Is it possible to decrypt and find the original text? If it is possible, what was my plaintext? If it is not possible, what goes wrong?

(Hint: It may be best NOT to solve for P1 first. Instead it may be easier to find P3 and work from there.)

f) Do you believe the Pyramid cipher is a good cipher? Is it secure? Does it successfully transmit information?

g) Challenge question (zero marks): Which of the following messages is it possible to decrypt: ‘A’, ‘AB’, ‘ABC’, ‘ABCD’, ‘ABCDE’,... ‘ABCDEFGHIJ’ etc.

Based on this, can you determine when the Pyramid cipher is a valid cipher? What is it about our message which makes the Pyramid cypher succeed or fail? Can you explain WHY this occurs?

4 Continuous Random Variables (8 marks)

Suppose I want to create a function which will give me a point (x, y) in the region 0 < y < x2 < 1: Below you will find three possible scripts for implementing this. (You can also find them on the canvas page for the assignment).

What this question is question checking?

Throughout this question we will use the three scripts given to explore how different ways of generating random numbers can lead to different results.

a) Use each of the above functions to create N = 4000 samples. (You don’t need to hand anything in for this question)

b) For each dataset, what is the probability that X < 0.3. (We might call these probabilities P(Xa < 0.3), P(Xb < 0.3), P(Xc < 0.3)).

c) What is the expected value of Y for each data set? (We might call this E(Ya), E(Yb), E(Yc)).

d) For each of the scripts given, give one or two sentences explaining what the script. is doing. In particular, highlight how the three scripts are similar and/or different to one another.

e) Use the scatter command to draw an image representing each of your sample sets. Hand in your three figures, Remember to label your figures ParabowlA,ParabowlB,ParabowlC.

f) Give one or two sentences on what you notice in your three figures. Do your figures match your understanding based on the code?

Tlsr8258开发-程序烧写 开源一小步,进步一大步 阅读详情

相关推荐

3 种 VLA 模型动作表示方案对比:RT-2 离散化 vs π0 流匹配 vs HybridVLA 混合架构

本文深入对比了三种VLA模型动作表示方案:RT-2离散化、π0流匹配和HybridVLA混合架构。分析了各自的技术原理、优势与局限性,并提供了应用场景选择指南,帮助研究者在具身智能领域做出更优的技术选型决策。

weixin_29031161的博客 322

Maths 162: Computational Mathematics 2R

−1。

ishytynt的博客 863

L298N电机驱动模块的接线使用与代码实现

#include "iostm8s208mb.h" #define u8 uint8_t #define u16 uint16_t #define u32 uint32_t typedef unsigned char uint8_t; typedef unsigned short uint16_t; typedef unsigned long uint32_t; // 关于LED灯的宏定义 #define LED2 PI_ODR_ODR2 //输出量 #define LE

Clichong 13万+

InnoDB 内存结构总览:Change Buffer、AHI 与 Log Buffer

本文系统梳理InnoDB内存结构中的ChangeBuffer、Adaptive Hash Index(AHI)与LogBuffer。ChangeBuffer缓存二级索引页不在内存时的变更,减少随机IO,仅在页加载时合并;聚簇索引修改立即执行,因数据本身不可延后。AHI基于高频等值查询自动构建哈希索引,加速定位,仅支持等值操作。LogBuffer为redo log内存缓冲,配合磁盘日志实现崩溃恢复。三者均服务于性能优化,其中ChangeBuffer与AHI共享BufferPool空间,而LogBuffer独立

bksczm的博客 310

FPGA_adc采样并通过以太网发送到上位机

本项目使用FPGA-ZYNQ-7020采集8通道ADC数据,通过以太网上传到上位机显示波形PL部分包括数据的获取与处理,数据从PL传递到PSPS部分包括以太网的发送,由PL到PS的中断触发本文章不详细讲解背后原理 但保证每一步足够详细,跟着就能实现。本人FPGA平台 大磊FPGA7020开发板 vivado2020.2 vitis2020.2 匿名上位机公开版

weixin_42304868的博客 5628

基于单片机控制双向可控硅灯光强度设计

*单片机设计介绍,基于单片机控制双向可控硅灯光强度设计。

QQ2193276455的博客 2458

信创环境下PageOffice文档控件适配与实践

信创适配做到文档控件这一层,拼的已经不是"有没有国产版本",而是同一个功能在两类终端上是否真的等价。等价的标准很具体:同一次点击能得到同样的结果,同一份公文能得到同样的版式,同一个项目不需要维护两套代码。这背后是三件并不轻松的工作:服务端用一套接口同时支撑两类终端,客户端把两种系统与四种芯片的安装包分发清楚,文档内核层由产品侧跟着 WPS 的版本走。浏览器这一层的压力,则被收进了产品自己的窗口里——升级节奏由产品掌握,不再交给运气。

zi_wu_xian的专栏 336

H3C BGP联盟实验

bgp,bgp联盟,bgp公认团体属性,

一只懒羊羊 971

第三篇 第 6 课

前置:第三篇第 1 课(stdx 引入),第二篇第 1 课(std.regex)。环境:仓颉 SDK 1.2.0。本文所有代码与输出均逐行实测。

weixin_41618057的博客 557

【C++/嵌入式梳理】bootloader

【C++/嵌入式笔试面试八股】bootloader

Hi 1212

《网络安全自学教程》- OSI七层模型分层及作用,数据封装与解封过程,数据传输过程。

OSI分哪七层,每层的作用是什么,解释数据在七层模型中是怎样传输的,封包和解封过程,数据包在每一层是怎么封装和解封的。

wangyuxiang946的博客 1万+

【从零理解 Spring AI · 12】MCP 的两种角色:做客户端还是做服务端

上一篇讲了 MCP 的概念:标准协议、三大角色、M+N 替代 M×N。

nice_lcj520的博客 616

复合材料仿真PAM-COMPOSITE 全工艺案例实操参数模板

复合材料仿真PAM-COMPOSITE 全工艺案例实操参数模板

源代码杀手的博客 284

pcl2启动器下载(Minecraft PCL2 启动器 最新版 安装与使用说明)

摘要:PCL2(Plain Craft Launcher 2)是一款面向 Minecraft 的第三方启动器,支持正式版与快照版本管理、模组与整合包安装、Java 运行时自动匹配,绿色免安装、双击即可运行。适合在 Windows 上玩单机整合包、需要多版本共存或离线启动的用户使用

2611_96675819的博客 226

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

Probability and Statistics - 4th edition

Probability and Statistics - 4th edition

spring boot 4集成SQLLite,及其SQLLite的建库

spring boot 4集成SQLLite,及其SQLLite的建库

weixin_41463944的博客 239

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

Java 集合容器高频面试题全解:HashMap 树化阈值、1.7 死循环与 ConcurrentHashMap 演进(2026 招聘 JD 真题复盘)

HashMap 树化阈值 8 的泊松分布依据、退化阈值 6 的防抖设计、JDK 1.7 头插成环死循环的排查与修复、1.8 尾插后为何仍线程不安全、ConcurrentHashMap 放弃分段锁的原因与 ForwardingNode 协作扩容、computeIfAbsent 死锁陷阱、大集合找重复的场景题选型,附三层追问链自测。题目来源为 38 期公开招聘 JD 样本与字节、拼多多、建行、美团、快手公开面经。

蒙眼过河 427

复分析 阿尔福斯(Ahlfors) 第三版答案 英文

答案分为十章,有部分习题没有答案,全英文复分析阿尔福斯(Ahlfors) 第三版答案

spdlog 同步日志库使用详解

spdlog是一个轻量级 C++ 日志库,支持同步日志、异步日志、多线程日志、日志文件轮转和自定义日志格式。对于嵌入式 Linux 应用开发,我建议先使用。它可以帮我们完成:日志级别过滤。时间戳和线程 ID 输出。日志格式化。终端和文件输出。多线程安全写入。日志文件按大小或时间轮转。我们不需要自己实现互斥锁、文件写入、日志格式化和轮转等底层功能。

zengjiajun2006的博客 1124

JavaSE通关手册:数据类型与变量

代码无需额外处理,编译时编译器自动完成转换。

xys_678的博客 236

IDEA 简介:从零认识 IntelliJ IDEA

IDEA 全称,是由 JetBrains 公司开发的一款主流 Java 集成开发环境(IDE)。它集代码编辑、编译、调试、测试、版本控制、构建管理等功能于一体,被大量 Java 开发者视为日常开发的首选工具。所谓 IDE(Integrated Development Environment,集成开发环境),就是把写代码所需的各类工具整合到同一个界面中。相比只用文本编辑器加命令行编译,IDE 能显著减少重复操作,让开发者把精力集中在业务逻辑上。

ztI10的博客 187

Docker部署linkding:HTTPS与数据备份

部署私人书签库,除了让页面能够打开,还需要考虑几个实际问题:重建容器后数据是否保留、登录和保存是否正常、升级前怎样备份,以及出现 502 或 CSRF 错误时从哪里检查。本文使用 Docker Compose 部署 linkding,采用默认 SQLite 数据库,通过 Caddy 提供 HTTPS,并完成账户创建、数据持久化验证和备份。如果重建后账户或书签消失,应先检查是否换了项目目录、改了挂载路径,或者启动了另一套实例,不要急着重新初始化。遇到权限问题,应根据日志确认具体目录和运行用户,再调整权限。

tedcloud123的博客 194

动态代理两大流派:JDK 代理与子类代理

业务类想加日志,最直白的写法是侵入式修改: 问题很明显:每个方法都要改一遍,改一个业务要动十处。代理模式的解法是:调用方不直接依赖 ,而是依赖一个代理对象。代理对象长得跟目标一模一样,调用它 → 代理先执行增强逻辑 → 再转调真实对象。 关键在于:代理对象的类型是哪来的?这就是"动态"二字的含义:代理类在运行时才诞生。两个角色: 承载增强逻辑, 负责生成代理类。 组装代理并调用: 输出: 业务代码 一行没动,增强逻辑全在 里。这就是 AOP 的味道。 内部四步: 第 2 步 内部:先查 (同一个接口

Android的专栏 662

C++20协程怎么运行?原理与三大核心组件深度剖析

C++20协程是轻量级的无栈状态机,通过co_await、co_yield、co_return实现挂起与恢复,由Promise、协程句柄和Awaitable三大组件协同工作。协程与线程互补,适用于高效管理大量并发I/O任务,显著降低上下文切换开销。其核心在于编译器生成的状态机机制,需配合库(如cppcoro)使用。掌握Promise控制逻辑、句柄生命周期管理及Awaitable语义,是构建高性能异步程序的基础。

Lucis__的博客 336

c++ explicit关键字详解

explicit。

拒绝AI文,努力在AI时代写出感动人心的好文章 170

TRingBuffer两端都能增删(快递站版)

TRingBuffer 是一个支持两端增删、下标访问且容量动态增长的环形双端队列。它通过无符号索引的永不归零设计,利用减法自动模运算实现空满判断与元素计数,避免了传统环形缓冲浪费格子的问题。内部以票号(索引)标记首尾,扩容时重排元素为连续存储,保证 O(1) 操作与高缓存效率。虽不线程安全,但其高效性使其成为游戏开发中事件队列、命令缓冲等场景的理想选择。

u013768914的博客 315

Teamcenter Java SOA 开发:连接、查询与保存

本文介绍如何通过 Java 调用 Teamcenter SOA 接口实现外部系统对接,涵盖连接登录、查询保存等核心操作。以最小闭环示例展示 Connection、Service、ModelObject 等关键组件的使用,强调错误处理与事务管理要点。梳理了 DataManagement、Query、File Management 等 API 模块分工,并结合“工作移交WebService”案例,说明幂等性设计与流程状态返回的重要性。适用于 Web 门户、ERP 集成等场景,建议批量操作用 bulk 接口优化性

软件工程师文艺 277

Java 项目实战:交友项目后台系统——网关统一鉴权与 B 端管理后台

本次改造通过引入SpringCloud Gateway实现网关统一鉴权与路由,新建mf-admin管理端复用C端域服务(Dubbo调用),实现管理员登录与用户管理四件查询。核心套路:网关白名单+双体系JWT(同工具不同payload)、管理端零直连业务库、分页形态区分(MySQL自动count/Mongo手动count)、浏览器端独立聚合。踩坑12条,附自检清单与后续改造方向,可复用于多角色后台系统。

Wang的专栏 71
上一篇: Retail Geography
下一篇: FNCE30003 International Finance
WX_codehelp
博客等级 码龄2年 700粉丝 87原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值