math Questions

7

Solved

I've been experimenting with the mathematical abilities of Python and I came upon some interesting behavior. It's related to the following expression: (4+4)+3/4/5*35-(3*(5+7))-6+434+5+5+5 >&gt...
Jacoby asked 17/2, 2012 at 20:2

2

Solved

I have a list of fractions that I need to transform. from fractions import Fraction fractions_list=[Fraction(3,14),Fraction(1,7),Fraction(9,14)] The output should be a list with the numerators fo...
Suspense asked 6/4, 2020 at 6:53

8

Solved

In my program, I have a statement like the following, inside a loop. y = (x >= 1)? 0:1; However, I want to avoid using any relational operator, because I want to use SIMD instructions, and am...
Inez asked 29/4, 2017 at 9:0

6

Solved

I need to write a program to input a number and output its factorial's prime factorization in the form: 4!=(2^3)*(3^1) 5!=(2^3)*(3^1)*(5^1) The problem is I still can't figure out how to get th...
Valentijn asked 17/1, 2014 at 22:5

3

In my demo, you can see that the player's camera catches up with the player's position with a slight delay. It follows him until the player finally stops, gradually reducing the distance. Unfortuna...

8

Solved

How to create a function, which on every call generates a random integer number? This number must be most random as possible (according to uniform distribution). It is only allowed to use one stati...
Levenson asked 17/6, 2010 at 14:48

4

Solved

I am trying to calculate the logarithm of a modified Bessel function of second type in MATLAB, i.e. something like that: log(besselk(nu, Z)) where e.g. nu = 750; Z = 1; I have a problem beca...
Plump asked 9/9, 2015 at 16:21

4

For a collision algorithm I am developing, I need to find out how to reflect a line over another. Line 1: y=ax+b Line 2: y=cx+d Line 3: (a result of reflecting line 1 over line 2) y=e...
Procto asked 30/6, 2013 at 23:42

4

Solved

I need an extremely compact UUID, the shorter the better. To that end, I wrote: public String getBase36UIID() { // More compact version of UUID String strUUID = UUID.randomUUID().toString().repl...
Applicable asked 17/8, 2020 at 19:44

3

Solved

I'm working on a small Python program for myself and I need an algorithm for fast multiplication of a huge array with prime powers (over 660 000 numbers, each is 7 digits). The result number is ove...
Constringe asked 15/7 at 23:55

13

Solved

OpenCV's remap() uses a real-valued index grid to sample a grid of values from an image using bilinear interpolation, and returns the grid of samples as a new image. To be precise, let: A = an im...
Holography asked 17/1, 2017 at 17:17

3

Solved

I need to generate all combinations of a matrix in Python. The input will be two integers n and m, and I need to generate all possible states of that matrix with 1 and 0 as possible values. For ex...
Hildie asked 28/2, 2019 at 10:50

7

Solved

I have a line segment defined by two pointFs, along with a 2D bounding rectangle. I want to extend the line segment as much as possible in both directions so that the segment is flush with the wall...
Nazarius asked 29/8, 2011 at 23:3

10

Solved

I'm trying to draw a gradient in a rectangle object, with a given angle (Theta), where the ends of the gradient are touching the perimeter of the rectangle. I thought that using tangent would wo...
Maud asked 31/10, 2010 at 2:28

4

Is there any way to get the step-by-step solution in SymPy? For example: x**2-5 = 4 step 1 x**2-5+5=4+5 step 2 : x**2=9 step 3 :x = 3 or x= -3
Debase asked 6/9, 2016 at 23:31

3

Solved

I know that I can just say: radians = degrees * Math.PI/180 However I expect there to be a built in framework method, as it is such a common requirement, however I cannot find one. Am I not look...
Retaliate asked 30/10, 2013 at 8:18

1

I am working with an assembly language that does not contain either multiply, divide, or bit-shift instructions. I am aware that a left bit-shift can be achieved by just adding the same number to i...

6

Solved

What would be the quickest way to find the power of 2, that a certain number (that is a power of two) used? I'm not very skilled at mathematics, so I'm not sure how best to describe it. But the f...
Camacho asked 29/1, 2014 at 17:45

7

Solved

I want to write a function which will allow me to "solve" an equation in js. what I want (not in a programming language): function f(x) { 1 + x * x } var z = 2 var y = f(z) //y will be 5 as a nu...
Blackington asked 8/5, 2013 at 19:34

2

Solved

I had searched on the internet and I could not find the method of the Math object that returns the ctg and arcctg of an angle. Is there such a method or should I just create my own function using t...
Cabrera asked 31/8, 2016 at 8:23

9

I'm trying to find the point of intersection between a sphere and a line but honestly, I don't have any idea of how to do so. Could anyone help me on this one ?
Cowardly asked 4/5, 2011 at 12:13

9

Solved

Is there a way to safety and simply deal with angle wrap with the minimum number of case statements. Angle wrap occurs when using a particular representation for angle (either 0-360 deg or -180 -...
Mime asked 16/7, 2012 at 4:38

4

Solved

I have encountered a game called Tower Breakers, which seems a variation of the nim game. There are two players, player 1 and player 2. Initially there are n towers, where each tower is of height...
Preachment asked 13/1, 2017 at 20:48

2

I recently came across a method in Pytorch when I try to implement AlexNet. I don't understand how it works. Please explain the idea behind it with some examples. And how it is different from Maxp...
Diphtheria asked 4/11, 2019 at 11:26

8

Solved

I wrote this code for generating Continued Fraction of a square root N. But it fails when N = 139. The output should be {11,1,3,1,3,7,1,1,2,11,2,1,1,7,3,1,3,1,22} Whilst my code gives me a sequence...
Sonority asked 29/8, 2012 at 16:43

© 2022 - 2024 — McMap. All rights reserved.