Code Monkey home page Code Monkey logo

lukew3 / mathgenerator Goto Github PK

View Code? Open in Web Editor NEW
672.0 11.0 174.0 8.88 MB

A math problem generator, created for the purpose of giving self-studying students and teaching organizations the means to easily get access to high-quality, generated math problems to suit their needs.

Home Page: https://lukew3.github.io/mathgenerator

License: MIT License

Python 99.63% Makefile 0.29% Shell 0.08%
math generator contributions-welcome python python3 learning education mathematics maths

mathgenerator's Introduction

mathgenerator

A math problem generator, created for the purpose of giving teachers and students the means to easily get access to random math exercises to suit their needs.

To try out generators, go to https://mathgenerator-demo.netlify.app

See CONTRIBUTING.md for information about how to contribute.

Table of Contents

Installation

The project can be install via pip

pip install mathgenerator

Usage

Here is an example of how you would generate an addition problem:

import mathgenerator

#generate an addition problem
problem, solution = mathgenerator.addition()

#another way to generate an addition problem using genById()
problem, solution = mathgenerator.genById(0)

You may prefer to use import mathgenerator as mg and run functions like mg.addition() so that you don't have to type as much.

Problem/solution pairs are generated with either:

  • mathgenerator.<generator_name>() - generates a problem, solution set from the given generator name.
  • mathgenerator.genById(id) - generates a problem, solution set with generator id provided by the id parameter

You can also use getGenList() to return a list of all generators included in the library in the format:

[funcname, subjectname]

Documentation

Documentation can be found at https://lukew3.github.io/mathgenerator

mathgenerator's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mathgenerator's Issues

Midpoint of Two Points

Example Problem:
Find the midpoint between the points (-3,2) and (7,-12).
Eample Solution:
(2, -5)

Default range should be between -20 and 20 for x and y values.

Basic Algebra

Example Problem:
2x+4=8
Example Solution:
x=2

Variable should not have multiple degrees. Only 1 solution. Other generators can be made for more complex problems.

Find intersection of two lines

Example Problem:
Find the point of intersection of these two lines: y = (1/2)x + 6, y = 2x-2.
Example Solution:
((16/3),(26/3))

Given the form y = mx + b, m and b should be between -10 and 10.

Matrix Multiplication

Generate two random matrices A and B such that cols of A == rows of B, then compute the resultant matrix multiplication and display the output.

Evaluate Trig Functions

Example Problem:
What is the value of sin((2pi)/3)?
Example Solution:
sqrt(3)/2

Inside of trig function should be values found on unit circle. This includes pi/6, pi/4, pi/3, pi/2 and equivalents in other quadrants.

Compare Fractions

Example Problem:
Which symbol represents this relationship 3/2 O 5/6?
Example Solution:
>

I don't really like how this problem is formatted but I like the concept. If you have a better idea of what the problem/solution should look like please comment below.

Surds comparison

Example: cuberoot(25) and squareroot(37).
Solution: cuberoot(25) < squareroot(37).

Ranges: Values from 0 to 100
Roots: 2 to 10

Assign this to me if this is fine.

Power rule integration.

Just like the power rule differentiation function, add a power rule integration function.

Total Number of Combinations

I want to add the function that gives number of combinations for picking x objects at a time from y different objects.

Sample problem:- Number of combinations for picking 4 objects at a time from 6 objects.
Solutions:- There are 15 different combinations available.

Simple Interest Calculation

Sample problem

Given principle amount is Rs.1000, rate of interest 5% and time period is 5 years. Calculate the simple interest.

Solution

SI = (p * r * t)/100 = 250

Fix duplicate Id's

Correct class instances with the same id so that they have seperate id's, with the next being 1 greater than the last.

Quadratic equation

would be easy to build a generator to solve for ax^2+bx+c=0, maybe phrase it like some operation on its roots.

For adding permutations generator

I want to add the function that gives number of permutations for picking x objects at a time from y different objects.

Sample problem:- Number of permutations for picking 4 objects at a time from 6 objects.
Solutions:- There are 360 different permutations available.

Generation of docstrings

The idea is to generate docstrings for each and every function which can be returned by the generator class using help {generatorName} by adding a doc to Generator class. This will assist those who use this library.

Adding a function to find factorial of a number

Problem

Find the factorial of an integer i.

Solution

Creating a recursive function fact(int i) that returns factorial of.

Advantage

Function fact(int i) can also used for creating function for permutation and combination

Distance Between Two Points

Example Problem:
Find the distance between the points (1,2) and (4,-6).
Eample Solution:
sqrt(73)

Default range should be between -20 and 20 for x and y values.

Trigonometric Values of Standard Angles.

I want to add the function that gives Sine,Cosine,Tangent of only the standard Angles which includes 0,30,45,60 & 90 degrees.

Sample problem:- What is the Sin(30)?
Solutions:- 1/2

Just a basic idea of the function.Can add the remaining functions too if required.

Add getById function

Add a function that gets the output of a function when you input an Id. A function that gives you the title of a function when you input an Id would also be useful.

Squaring

Example Problem:
5^2=
Example Solution:
25

Simplify Complex Radicals

Example Problem:
Simplify the radical expression sqrt(72).
Example Solution:
6sqrt(2)

At least one perfect square should be able to be removed from the radical.

Project Restructure

This project has grown a lot and it seems like it is time for a new structure, better suited to the size of this project. I'm currently looking for ideas on how to better restructure this project. This comment will be edited as new ideas are proposed.
Current Ideas are:

  • Place each generator into a seperate file. Organize files by type of problem.
  • Group generators into class-level like Algebra, Calculus, or Geometry. Multiple generators are still stored in the same file.

Non-exclusive ideas:

  • Make a module for common functions that might be used in multiple generators. Could be called utils.py.
  • Consider adding docstrings to generator class so that users can understand what the generator does. See #77.

Multiply 2x2 Matrice by Integer

Example Problem:
3*[[5,0],[1,3]]=
Example Solution:
[[15,0],[3,9]]

The matrice [[5,0],[1,3]] looks like this:
| 5 , 0 |
| 1 , 3 |

Add Decimal To Binary Converter

@lukew3 the project lacks decimal to binary conversion questions, I was just wondering if I can make a function that does that?
For example:
Binary of 61 = 111101

Factoring

Example Problem:
x^2+x-6
Example Solution:
(x-2)(x+3)

System of Equations (two variables)

Example problem:
Find the solution to the following system of equations: x-7y = -11, 5x+2y=-18.
Example solution:
(-4, 1)

Problem should be generated backwards so that the solution is a set of integers, not fractions or decimals.

Find the HCF of two numbers

Problem - Two numbers are given ,example 36 and 23 and we have to find their highest common factor.

Solution - The HCF of 36 and 24 is 12

Cube root

Generate random number a and calculate cube root (cbrt) with two arguments: minNo and maxNo like in sqrt function.

Fix useless parameters

Some functions have parameters that don't do what they are supposed to. These need to be fixed before next release.

Pythagoras theorem

Example Problem:
Find the the length of the hypotenuse given the other two sides, 7 and 9.

Example Solution:
sqrt(130)

The range could be 1:20.

I can submit a pull request for this if the idea works!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.